I am now using linux developing c++ program. the workbench is windows connecting linux workstation console through putty. I set lot of breakpoint in the program, using gdb to debug program is very powerful:) But I do not no how to save breakpoint, so the next time when "gdb ./MyProg" the breakpoint information is lost,“info breakpoint” show no breakpoint, It puzzled me lot of day. Can anybody give some advice? Thanks first.
Asked
Active
Viewed 2,546 times
2
-
1Seems to be a duplicate of [Getting gdb to save a list of breakpoints?](http://stackoverflow.com/q/501486/2509). – dmckee --- ex-moderator kitten Oct 23 '10 at 03:35
-
yew, I have found it, thanks the same. noisy's answer inthe link up works well:) – parsifal Oct 28 '10 at 07:03
-
Possible duplicate of [Getting gdb to save a list of breakpoints?](http://stackoverflow.com/questions/501486/getting-gdb-to-save-a-list-of-breakpoints) – Ciro Santilli OurBigBook.com Apr 19 '17 at 08:31
2 Answers
4
According to the GDB Manual, you can use the command:
save breakpoints <file>
To save them to , and then:
source <file>
To load them.
If the break points are not yet loaded, you may want to tell gdb to allow loading those breakpoints later.
set breakpoint pending on

Community
- 1
- 1

Dr. Snoopy
- 55,122
- 7
- 121
- 140
-
but when I set the breakpoints and save breakpoints, system echoed with " warning: save-tracepoints: no tracepoints to save" why even I have set and hit the breakpoints? and what is the tracepoint means? thans for your help first! – parsifal Oct 25 '10 at 06:16
-
sounds like first entering "set logging on" then can use " source
" to load the breakpoints – parsifal Oct 28 '10 at 07:00
1
On similar lines,
you can log all gdb inputs into a file and can see.
You can enable log using 'set logging on [filename]'. If file name is not mentioned, then default filename - gdb.txt is taken.
Debug Log might be useful when you want to share gdb trace details
If you do not want to log, disable log using 'set logging off'
--Cheers

Koteswara sarma
- 434
- 3
- 7