* gdb basic questions
@ 2009-11-15 17:30 ranjith kumar
2009-11-15 18:46 ` Jan Kratochvil
0 siblings, 1 reply; 3+ messages in thread
From: ranjith kumar @ 2009-11-15 17:30 UTC (permalink / raw)
To: gdb
hi,
I am new to gdb. I have 3 questions.
Suppose that we want to keep a breakpoint at a function say
'myfunction', we will a gdb command
(gdb) b myfunction
at gdb command prompt.
What I want is keep breakpoints at, say, 1000 functions.
But I cant type 1000 times '(gdb) b functionname'.
1) Is there any way to keep breakpoints at 1000 functions, without
typing ?( Assume I have saved all 1000 funcion names in a file)
2) Generally, is it possible to ask gdb to go and read 'gdb commands'
from a file?
3) Another question. Sometimes gdb diplays a message like below and
waits for user to type 'y or n'.
"Make breakpoint pending on future shared library load? (y or [n]) "
How to tell gdb to not to wait for input from user and assume that
user has typed 'y' always ?
Thanks in advance.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: gdb basic questions
2009-11-15 17:30 gdb basic questions ranjith kumar
@ 2009-11-15 18:46 ` Jan Kratochvil
0 siblings, 0 replies; 3+ messages in thread
From: Jan Kratochvil @ 2009-11-15 18:46 UTC (permalink / raw)
To: ranjith kumar; +Cc: gdb
On Sun, 15 Nov 2009 12:41:18 +0100, ranjith kumar wrote:
> 1) Is there any way to keep breakpoints at 1000 functions, without
> typing ?( Assume I have saved all 1000 funcion names in a file)
+
> 2) Generally, is it possible to ask gdb to go and read 'gdb commands'
> from a file?
(gdb) help source
Read commands from a file named FILE.
Optional -v switch (before the filename) causes each command in
FILE to be echoed as it is executed.
Note that the file ".gdbinit" is read automatically in this way
when GDB is started.
Optional -p switch (before the filename) causes FILE to be evaluated
as Python code.
> 3) Another question. Sometimes gdb diplays a message like below and
> waits for user to type 'y or n'.
> "Make breakpoint pending on future shared library load? (y or [n]) "
> How to tell gdb to not to wait for input from user and assume that
> user has typed 'y' always ?
(gdb) set breakpoint pending on
(gdb) help set breakpoint pending
Set debugger's behavior regarding pending breakpoints.
If on, an unrecognized breakpoint location will cause gdb to create a
pending breakpoint. If off, an unrecognized breakpoint location results in
an error. If auto, an unrecognized breakpoint location results in a
user-query to see if a pending breakpoint should be created.
In some other cases one needs:
(gdb) set confirm off
(gdb) help set confirm
Set whether to confirm potentially dangerous operations.
Regards,
Jan
^ permalink raw reply [flat|nested] 3+ messages in thread
* gdb basic questions
@ 2009-11-16 10:23 nagaraju.m
0 siblings, 0 replies; 3+ messages in thread
From: nagaraju.m @ 2009-11-16 10:23 UTC (permalink / raw)
To: gdb; +Cc: ranjith kumar
Hi Ranjith,
You can use -x option and link a command file which will take
commands from the input file
open a new file:
Then type the commands you want to give input to gdb
tar simulator
load
b main
r
info reg
c
q
then call gdb -x option
[nagaraju@nagaraju nagaraju]$ gdb a.out -x gdb.cmd
Good luck,
Nagaraju M
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-11-16 6:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-15 17:30 gdb basic questions ranjith kumar
2009-11-15 18:46 ` Jan Kratochvil
2009-11-16 10:23 nagaraju.m
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox