Source string Read only

(itstool) path: sect3/para
309/3090
Context English State
In this case, the program was called <filename><replaceable>progname</replaceable></filename>, so the core file is called <filename><replaceable>progname</replaceable>.core</filename>. We can see that the program crashed due to trying to access an area in memory that was not available to it in a function called <function>bazz</function>.
Sometimes it is useful to be able to see how a function was called, as the problem could have occurred a long way up the call stack in a complex program. <command>bt</command> causes <command>gdb</command> to print out a back-trace of the call stack:
(gdb) <userinput>bt</userinput>
#0 0x164a in bazz (anint=0x5) at temp.c:17
#1 0xefbfd888 in end ()
#2 0x162c in main () at temp.c:11
(gdb)
The <function>end()</function> function is called when a program crashes; in this case, the <function>bazz()</function> function was called from <function>main()</function>.
Attaching to a Running Program with gdb
One of the neatest features about <command>gdb</command> is that it can attach to a program that is already running. Of course, that requires sufficient permissions to do so. A common problem is stepping through a program that forks and wanting to trace the child, but the debugger will only trace the parent.
To do that, start up another <command>gdb</command>, use <command>ps</command> to find the process ID for the child, and do
(gdb) <userinput>attach <replaceable>pid</replaceable></userinput>
in <command>gdb</command>, and then debug as usual.
Now all that is needed is to attach to the child, set <symbol>PauseMode</symbol> to <literal>0</literal>, and wait for the <function>sleep()</function> call to return!
Using Emacs as a Development Environment

Loading…

None

New source string

FreeBSD Doc / books_developers-handbookEnglish

New source string 2 weeks ago
Browse all component changes

Things to check

Multiple failing checks

The translations in several languages have failing checks

Reset

Glossary

English English
No related strings found in the glossary.

Source information

Source string comment
(itstool) path: sect3/para
Labels
No labels currently set.
Flags
read-only
Source string location
book.translate.xml:2252
Source string age
2 weeks ago
Translation file
, string 397