GDB commands

Didn't realize that GDB had an option called 'commands' to execute extra commands after hitting a break point. That is pretty cool. For example, I can now do some thing like



(gdb) b <function name> if ($data)

(gdb) commands <breakpoint-number>
Type commands for when breakpoint 7 is hit, one per line.
End with a line saying just "end".

commands

silent

print $data

cont

end

 Af course, if you are using DBX on Solaris/OpenSolaris,you would do some thing like when { shell statements } .. Hope this helps some one..

Comments:

Post a Comment:
Comments are closed for this entry.
About

Sharing what little I know

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
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
   
       
Today