* gdb script
@ 2009-07-22 13:07 nagaraju.m
2009-07-22 21:30 ` Joel Brobecker
0 siblings, 1 reply; 7+ messages in thread
From: nagaraju.m @ 2009-07-22 13:07 UTC (permalink / raw)
To: gdb
Hi ALL,
I have a problem in gdb-6.8 target execution, GDB is not giving
control back to my script whenever it hits a breakpoint.
ex:
if suppose my gdb script contains
file name:*gdb.cmd*
* tar simulator
load
b <some location> (ex: b main)
run
info reg
q
*
if i use this script like
* gdb -x gdb.cmd*
After hitting breakpoint it not giving control back to script and it
is not executing remaining part
*info reg
q
*can any one please help me out why gdb is not giving control back
to script
Thanks in advance,
Nagaraju
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: gdb script
2009-07-22 13:07 gdb script nagaraju.m
@ 2009-07-22 21:30 ` Joel Brobecker
2009-07-23 0:34 ` Paul Pluzhnikov
0 siblings, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2009-07-22 21:30 UTC (permalink / raw)
To: nagaraju.m; +Cc: gdb
> *can any one please help me out why gdb is not giving control back to
> script
That's actually the documented behavior. I'm sorry I don't have more
time to explain more or point you to the right place in the
documentation, but I thought I'd point this out.
--
Joel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: gdb script
2009-07-22 21:30 ` Joel Brobecker
@ 2009-07-23 0:34 ` Paul Pluzhnikov
2009-07-23 1:53 ` Joel Brobecker
0 siblings, 1 reply; 7+ messages in thread
From: Paul Pluzhnikov @ 2009-07-23 0:34 UTC (permalink / raw)
To: Joel Brobecker; +Cc: nagaraju.m, gdb
On Wed, Jul 22, 2009 at 2:30 PM, Joel Brobecker<brobecker@adacore.com> wrote:
>> *can any one please help me out why gdb is not giving control back to
>> script
>
> That's actually the documented behavior.
Really? I thought script execution stopped only on errors:
Node: Command Files
An error in any command terminates execution of the command
file and control is returned to the console.
Anyway, this seems to work for me:
cat t.c
int main() { return 0; }
gcc -g t.c
cat gdb.cmd
break main
run
info reg
quit
gdb -q -nx -x gdb.cmd ./a.out
Breakpoint 1 at 0x40044c: file t.c, line 1.
Breakpoint 1, main () at t.c:1
1 int main() { return 0; }
rax 0x7ffff7ddca60 140737351895648
rbx 0x7ffff7ffdc00 140737354128384
rcx 0x400470 4195440
rdx 0x7fffffffdb88 140737488345992
rsi 0x7fffffffdb78 140737488345976
rdi 0x1 1
rbp 0x7fffffffda90 0x7fffffffda90
rsp 0x7fffffffda90 0x7fffffffda90
r8 0x7ffff7ddb2e0 140737351889632
r9 0x7ffff7dee580 140737351968128
r10 0x0 0
r11 0x7ffff7a9c0d0 140737348485328
r12 0x0 0
r13 0x7fffffffdb70 140737488345968
r14 0x0 0
r15 0x0 0
rip 0x40044c 0x40044c <main+4>
eflags 0x246 [ PF ZF IF ]
cs 0x33 51
ss 0x2b 43
ds 0x0 0
es 0x0 0
fs 0x0 0
gs 0x0 0
fctrl 0x37f 895
fstat 0x0 0
ftag 0xffff 65535
fiseg 0x0 0
fioff 0x0 0
foseg 0x0 0
fooff 0x0 0
fop 0x0 0
mxcsr 0x1f80 [ IM DM ZM OM UM PM ]
The program is running. Exit anyway? (y or n) [answered Y; input not
from terminal]
--
Paul Pluzhnikov
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: gdb script
2009-07-23 0:34 ` Paul Pluzhnikov
@ 2009-07-23 1:53 ` Joel Brobecker
2009-07-24 6:18 ` nagaraju.m
0 siblings, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2009-07-23 1:53 UTC (permalink / raw)
To: Paul Pluzhnikov; +Cc: nagaraju.m, gdb
> > That's actually the documented behavior.
>
> Really? I thought script execution stopped only on errors:
Oops, I thought that the command not executed was part of a breakpoint
command. Sorry about the confusion.
--
Joel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: gdb script
2009-07-23 1:53 ` Joel Brobecker
@ 2009-07-24 6:18 ` nagaraju.m
2009-07-24 6:39 ` Paul Pluzhnikov
0 siblings, 1 reply; 7+ messages in thread
From: nagaraju.m @ 2009-07-24 6:18 UTC (permalink / raw)
To: Paul Pluzhnikov; +Cc: Joel Brobecker, gdb
Hi Paul,
I have tried with the options you suggested
gdb -q -nx -x gdb.cmd ./a.out
but it is also ended with same issue.
Paul, I have raised "SIGINT" signal in my target for hitting the breakpoint is this signal causing the issue.
Thanks,
Nagaraju M
Joel Brobecker wrote:
>>> That's actually the documented behavior.
>>>
>> Really? I thought script execution stopped only on errors:
>>
>
> Oops, I thought that the command not executed was part of a breakpoint
> command. Sorry about the confusion.
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: gdb script
2009-07-24 6:18 ` nagaraju.m
@ 2009-07-24 6:39 ` Paul Pluzhnikov
2009-07-24 9:50 ` nagaraju.m
0 siblings, 1 reply; 7+ messages in thread
From: Paul Pluzhnikov @ 2009-07-24 6:39 UTC (permalink / raw)
To: nagaraju.m; +Cc: Joel Brobecker, gdb
On Thu, Jul 23, 2009 at 11:15 PM,
nagaraju.m<nagaraju.m@redpinesignals.com> wrote:
> Paul, I have raised "SIGINT" signal in my target for hitting the breakpoint
> is this signal causing the issue.
I have very little experience with embedded targets, and have
absolutely no clue on how to interpret your statement above.
But I think that yes, SIGINT may have something to do with the
problem, as GDB is probably expecting SIGTRAP, not SIGINT.
--
Paul Pluzhnikov
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: gdb script
2009-07-24 6:39 ` Paul Pluzhnikov
@ 2009-07-24 9:50 ` nagaraju.m
0 siblings, 0 replies; 7+ messages in thread
From: nagaraju.m @ 2009-07-24 9:50 UTC (permalink / raw)
To: Paul Pluzhnikov; +Cc: gdb
Paul,
I have given SIGTRAP signal but gdb is not giving control to
user, so I have changed to SIGINT and it is working.
Paul Pluzhnikov wrote:
> On Thu, Jul 23, 2009 at 11:15 PM,
> nagaraju.m<nagaraju.m@redpinesignals.com> wrote:
>
>
>> Paul, I have raised "SIGINT" signal in my target for hitting the breakpoint
>> is this signal causing the issue.
>>
>
> I have very little experience with embedded targets, and have
> absolutely no clue on how to interpret your statement above.
>
> But I think that yes, SIGINT may have something to do with the
> problem, as GDB is probably expecting SIGTRAP, not SIGINT.
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-07-24 9:50 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-22 13:07 gdb script nagaraju.m
2009-07-22 21:30 ` Joel Brobecker
2009-07-23 0:34 ` Paul Pluzhnikov
2009-07-23 1:53 ` Joel Brobecker
2009-07-24 6:18 ` nagaraju.m
2009-07-24 6:39 ` Paul Pluzhnikov
2009-07-24 9:50 ` nagaraju.m
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox