File: attach_gdb.dox

package info (click to toggle)
libcwd 1.0.4-1.1
  • links: PTS
  • area: non-free
  • in suites: jessie, jessie-kfreebsd
  • size: 8,136 kB
  • ctags: 10,313
  • sloc: cpp: 23,354; sh: 9,798; ansic: 1,172; makefile: 852; exp: 234; awk: 11
file content (31 lines) | stat: -rw-r--r-- 823 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*!
\defgroup chapter_attach_gdb Starting A gdb Session From A Running Program
\ingroup book_attach_gdb
*/
/*!
\page page_attach_gdb
\ingroup chapter_attach_gdb

A running program can initiate a gdb session by calling the function <code>attach_gdb()</code>.

For example,

\code
  Debug(
    if (counter == 31523 && ptr == (void*)0x40013fa0)	// When to start debugging?
      attach_gdb();
  );

  ptr->foobar++;	// The debugging will start at this line.
\endcode

The function <code>attach_gdb()</code> opens an xterm (or whatever is configured in the rcfile)
and starts the gdb session inside it.

After exiting gdb the application will continue running.

In order for <code>attach_gdb()</code> to work, you will need to call
<code>\link chapter_rcfile read_rcfile() \endlink</code>
at the start of your application.

*/