⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 yolinux tutorial - gnu gdb debugger command cheat sheet.mht

📁 linux下c++编程的好文章
💻 MHT
📖 第 1 页 / 共 5 页
字号:
          to.</TD></TR></TBODY></TABLE></DD></DL>
      <P>
      <HR>

      <TABLE cellSpacing=3D0 cellPadding=3D2 width=3D"100%" border=3D0>
        <TBODY>
        <TR bgColor=3D#ffcc33>
          <TD><B><BIG>GDB Commands: </BIG></B></TD></TR></TBODY></TABLE>
      <P>Commands used within GDB:=20
      <P>
      <DL>
        <DD>
        <TABLE border=3D1>
          <TBODY>
          <TR bgColor=3D#c0c0c0>
            <TH>Command</TH>
            <TH>Description</TH></TR>
          <TR>
            <TD vAlign=3Dtop>help</TD>
            <TD vAlign=3Dtop>List gdb command topics.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>help <I>topic-classes</I></TD>
            <TD vAlign=3Dtop>List gdb command within class.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>help <I>command</I></TD>
            <TD vAlign=3Dtop>Command description.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>apropos <I>search-word</I></TD>
            <TD vAlign=3Dtop>Search for commands and command topics =
containing=20
              <I>search-word</I>.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>info args<BR>i args</TD>
            <TD vAlign=3Dtop>List program command line =
arguments</TD></TR>
          <TR>
            <TD vAlign=3Dtop>info breakpoints</TD>
            <TD vAlign=3Dtop>List breakpoints</TD></TR>
          <TR>
            <TD vAlign=3Dtop>info break</TD>
            <TD vAlign=3Dtop>List breakpoint numbers.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>info break <I>breakpoint-number</I></TD>
            <TD vAlign=3Dtop>List info about specific =
breakpoint.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>info watchpoints</TD>
            <TD vAlign=3Dtop>List breakpoints</TD></TR>
          <TR>
            <TD vAlign=3Dtop>info registers</TD>
            <TD vAlign=3Dtop>List registers in use</TD></TR>
          <TR>
            <TD vAlign=3Dtop>info threads</TD>
            <TD vAlign=3Dtop>List threads in use</TD></TR>
          <TR>
            <TD vAlign=3Dtop>info set</TD>
            <TD vAlign=3Dtop>List set-able option</TD></TR>
          <TR bgColor=3D#c0c0c0>
            <TH>Break and Watch </TH>
            <TH><BR></TH></TR>
          <TR>
            <TD vAlign=3Dtop>break <I>funtion-name</I><BR>break=20
              <I>line-number</I></TD>
            <TD vAlign=3Dtop>Suspend program at specified function of =
line=20
              number.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>break +<I>offset</I><BR>break =
-<I>offset</I></TD>
            <TD vAlign=3Dtop>Set a breakpoint specified number of lines =
forward=20
              or back from the position at which execution =
stopped.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>break <I>filename:function</I></TD>
            <TD vAlign=3Dtop>Don't specify path, just the file name and =
function=20
              name.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>break *<I>address</I></TD>
            <TD vAlign=3Dtop>Suspend processing at an instruction =
address. Used=20
              when you do not have source.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>break <I>line-number</I> if =
<I>condition</I></TD>
            <TD vAlign=3Dtop>Where condition is an expression. i.e. =
<TT>x &gt;=20
              5</TT><BR>Suspend when boolean expression is =
true.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>break <I>line</I> thread =
<I>thread-number</I></TD>
            <TD vAlign=3Dtop>Break in thread at specified line number. =
Use=20
              <TT>info threads</TT> to display thread numbers.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>tbreak</TD>
            <TD vAlign=3Dtop>Temporary break. Break once only. Break is =
then=20
              removed. See "break" above for options.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>watch <I>condition</I></TD>
            <TD vAlign=3Dtop>Suspend processing when condition is met. =
i.e.=20
              <TT>x &gt; 5</TT></TD></TR>
          <TR>
            <TD vAlign=3Dtop>clear<BR>clear <I>function</I><BR>clear=20
              <I>line-number</I></TD>
            <TD vAlign=3Dtop>Delete breakpoints as identified by command =

            option.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>delete<BR>d</TD>
            <TD vAlign=3Dtop>Delete all breakpoints, watchpoints, or=20
            catchpoints.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>delete <I>breakpoint-number</I><BR>delete=20
              <I>range</I></TD>
            <TD vAlign=3Dtop>Delete the breakpoints, watchpoints, or =
catchpoints=20
              of the breakpoint ranges specified as arguments.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>disable =
<I>breakpoint-number-or-range</I><BR>enable=20
              <I>breakpoint-number-or-range</I></TD>
            <TD vAlign=3Dtop>Does not delete breakpoints. Just =
enables/disables=20
              them.<BR>Example:<BR>Show breakpoints: <TT>info=20
              break</TT><BR>Disable: <TT>disable 2-9</TT></TD></TR>
          <TR>
            <TD vAlign=3Dtop>enable <I>breakpoint-number</I> once</TD>
            <TD vAlign=3Dtop>Enables once</TD></TR>
          <TR>
            <TD vAlign=3Dtop>continue<BR>c</TD>
            <TD vAlign=3Dtop>Continue executing until next break=20
              point/watchpoint.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>continue <I>number</I></TD>
            <TD vAlign=3Dtop>Continue but ignore current breakpoint=20
              <I>number</I> times. Usefull for breakpoints within a =
loop.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>finish</TD>
            <TD vAlign=3Dtop>Continue to end of function.</TD></TR>
          <TR bgColor=3D#c0c0c0>
            <TH>Line Execution </TH>
            <TH><BR></TH></TR>
          <TR>
            <TD vAlign=3Dtop>step<BR>s<BR>step=20
            <I>number-of-steps-to-perform</I></TD>
            <TD vAlign=3Dtop>Step to next line of code. Will step into a =

              function.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>next<BR>n<BR>next <I>number</I></TD>
            <TD vAlign=3Dtop>Execute next line of code. Will not enter=20
              functions. </TD></TR>
          <TR>
            <TD vAlign=3Dtop>until<BR>until <I>line-number</I></TD>
            <TD vAlign=3Dtop>Continue processing until you reacha =
aspecified=20
              line number. Also: function name, address, =
filename:function or=20
              filename:line-number.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>stepi<BR>si<BR>nexti<BR>ni</TD>
            <TD vAlign=3Dtop>step/next assembly/processor =
instruction.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>info signals<BR>info handle<BR>handle=20
              <I>SIGNAL-NAME</I> <I>option</I></TD>
            <TD vAlign=3Dtop>Perform the following option when signal =
recieved:=20
              nostop, stop, print, noprint, pass/noignore or =
nopass/ignore</TD></TR>
          <TR>
            <TD vAlign=3Dtop>where</TD>
            <TD vAlign=3Dtop>Shows current line number and which =
function you=20
              are in.</TD></TR>
          <TR bgColor=3D#c0c0c0>
            <TH>Stack </TH>
            <TH><BR></TH></TR>
          <TR>
            <TD vAlign=3Dtop>backtrace<BR>bt<BR>bt=20
              <I>inner-function-nesting-depth</I><BR>bt=20
              -<I>outer-function-nesting-depth</I></TD>
            <TD vAlign=3Dtop>Show trace of where you are currently. =
Which=20
              functions you are in. Prints stack backtrace.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>backtrace full</TD>
            <TD vAlign=3Dtop>Print values of local variables.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>frame <I>number</I><BR>f <I>number</I></TD>
            <TD vAlign=3Dtop>Select frame number.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>up <I>number</I><BR>down <I>number</I></TD>
            <TD vAlign=3Dtop>Move up/down the specified number of frames =
in the=20
              stack.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>info frame</TD>
            <TD vAlign=3Dtop>List address, language, address of =
arguments/local=20
              variables and which registers were saved in =
frame.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>info args<BR>info locals<BR>info catch</TD>
            <TD vAlign=3Dtop>Info arguments of selected frame, local =
variables=20
              and exception handlers.</TD></TR>
          <TR bgColor=3D#c0c0c0>
            <TH>Source Code </TH>
            <TH><BR></TH></TR>
          <TR>
            <TD vAlign=3Dtop>list<BR>list <I>line-number</I><BR>list=20
              <I>function</I><BR>list -<BR>list =
<I>start#,end#</I><BR>list=20
              <I>filename:function</I></TD>
            <TD vAlign=3Dtop>List source code.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>set listsize <I>count</I><BR>show =
listsize</TD>
            <TD vAlign=3Dtop>Number of lines listed when <TT>list</I> =
command=20
              given.</TT></TD></TR>
          <TR>
            <TD vAlign=3Dtop>directory <I>directory-name</I><BR>dir=20
              <I>directory-name</I><BR>show directories</TD>
            <TD vAlign=3Dtop>Add specified directory to front of source =
code=20
              path.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>directory</TD>
            <TD vAlign=3Dtop>Clear sourcepath when nothing =
specified.</TD></TR>
          <TR bgColor=3D#c0c0c0>
            <TH>Examine Variables </TH>
            <TH><BR></TH></TR>
          <TR>
            <TD vAlign=3Dtop>print <I>variable-name</I><BR>p=20
              <I>variable-name</I><BR>p =
<I>file-name::variable-name</I><BR>p=20
              '<I>file-name</I>'::<I>variable-name</I></TD>
            <TD vAlign=3Dtop>Print value stored in variable.</TD></TR>
          <TR>
            <TD vAlign=3Dtop>p *<I>array-variable</I>@<I>length</I></TD>
            <TD vAlign=3Dtop>Print first # values of array specified by=20
              <I>length</I>. Good for pointers to dynamicaly allocated=20
          memory.</TD></TR>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -