Error loading breakpoint

I previously saved a list of breakpoints using

save breakpoints blist

now after compiling the program, when I try to reload the same breakpoints with the load command

load blist

I get this error

You can't do that when your target is `exec'

How to resolve this?

+5
source share
2 answers

load blist

Give it a try source blist.

From "help save breakpoints":

Save current breakpoint definitions as a script.

The way to read a script is a command source. Team loadmeans something completely different.

+12
source

I have breakpoints saved in a file, say gdb.br , the contents of the file are as follows:

br /project/src/file.c : 100
commands
silent
printf "\nbacktrace:\n"
bt
cont
end

. , :

br /project/src/file.c : 100
br className::methodName

- gdb copy-past. load . gdb , :

gdb -p 1523 -x gdb.br

1523 - pid, . -x  intedent, , , . , .

0

All Articles