* Cannot insert breakpoint -1.
@ 2009-07-24 21:12 Anmol P. Paralkar
2009-07-24 21:19 ` Daniel Jacobowitz
0 siblings, 1 reply; 6+ messages in thread
From: Anmol P. Paralkar @ 2009-07-24 21:12 UTC (permalink / raw)
To: gdb
Hello,
Is there a reason why GDB will try to set a breakpoint (breakpoint number: -1) at
the entry point address on a 'c', after a 'target remote'? (I am using a GDB stub
at the remote end that resides in a hypervisor upon which guest OS'es run).
I am using gdb-6.8.50.20090717; but, I suppose that this is general GDB behaviour.
--------------------------------------------------------------------------------
(gdb) target remote :12007
Remote debugging using :12007
warning: Loadable segment "cpu0_heap_stack" outside of ELF segments
warning: Loadable segment "cpu1_heap_stack" outside of ELF segments
warning: Loadable segment "cpu2_heap_stack" outside of ELF segments
warning: Loadable segment "cpu3_heap_stack" outside of ELF segments
warning: Loadable segment "cpu4_heap_stack" outside of ELF segments
warning: Loadable segment "cpu5_heap_stack" outside of ELF segments
warning: Loadable segment "cpu6_heap_stack" outside of ELF segments
warning: Loadable segment ".stats_heap" outside of ELF segments
warning: Loadable segment ".dpa_mem" outside of ELF segments
0x0013c880 in ?? ()
(gdb) p $pc
$1 = (void (*)()) 0x13c880
(gdb) c
Continuing.
Warning:
Cannot insert breakpoint -1.
Error accessing memory address 0x110000: Unknown error 18446744073709551615.
--------------------------------------------------------------------------------
(The entry point is likely not mapped into the TLB at that stage and so it is
really a visible problem, else it just does this silently without it getting
any attention).
I tried to work around the issue by using set remote-<name>-packet, where <name>
equalled software-breakpoint - but that does not work (it did not send a Z0, but
sent an X packet instead (verified with an earlier GDB compiled with tracing on)):
--------------------------------------------------------------------------------
(gdb) c
Continuing.
^C
Program received signal SIGTRAP, Trace/breakpoint trap.
0x0013c888 in ?? ()
(gdb) c
Continuing.
Warning:
Cannot insert breakpoint -1.
Error accessing memory address 0x110000: Input/output error.
--------------------------------------------------------------------------------
I then also re-tried with <name> equal to binary-download - but that does not work
(it did not send the X, but sent an M packet instead):
--------------------------------------------------------------------------------
(gdb) c
Continuing.
^C
Program received signal SIGTRAP, Trace/breakpoint trap.
Cannot remove breakpoints because program is no longer writable.
Further execution is probably impossible.
0x0013c880 in ?? ()
(gdb)
--------------------------------------------------------------------------------
Please could someone kindly shed light on this GDB behaviour?
Thank you.
Anmol.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cannot insert breakpoint -1.
2009-07-24 21:12 Cannot insert breakpoint -1 Anmol P. Paralkar
@ 2009-07-24 21:19 ` Daniel Jacobowitz
2009-07-24 22:01 ` Anmol P. Paralkar
0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2009-07-24 21:19 UTC (permalink / raw)
To: Anmol P. Paralkar; +Cc: gdb
On Fri, Jul 24, 2009 at 04:12:08PM -0500, Anmol P. Paralkar wrote:
> Hello,
>
> Is there a reason why GDB will try to set a breakpoint (breakpoint number: -1) at
> the entry point address on a 'c', after a 'target remote'? (I am using a GDB stub
> at the remote end that resides in a hypervisor upon which guest OS'es run).
>
> I am using gdb-6.8.50.20090717; but, I suppose that this is general GDB behaviour.
What target is it configured for?
"maint info break" will give you some more information. This is
probably a shared library event breakpoint.
> (The entry point is likely not mapped into the TLB at that stage and so it is
> really a visible problem, else it just does this silently without it getting
> any attention).
IMO it's a bug in your stub if you can't set breakpoints when not
mapped into the TLB...
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cannot insert breakpoint -1.
2009-07-24 21:19 ` Daniel Jacobowitz
@ 2009-07-24 22:01 ` Anmol P. Paralkar
2009-07-25 2:25 ` Daniel Jacobowitz
0 siblings, 1 reply; 6+ messages in thread
From: Anmol P. Paralkar @ 2009-07-24 22:01 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb
On Fri, 24 Jul 2009, Daniel Jacobowitz wrote:
> On Fri, Jul 24, 2009 at 04:12:08PM -0500, Anmol P. Paralkar wrote:
>> Hello,
>>
>> Is there a reason why GDB will try to set a breakpoint (breakpoint number: -1) at
>> the entry point address on a 'c', after a 'target remote'? (I am using a GDB stub
>> at the remote end that resides in a hypervisor upon which guest OS'es run).
>>
>> I am using gdb-6.8.50.20090717; but, I suppose that this is general GDB behaviour.
>
> What target is it configured for?
The target is: powerpc-linux-gnu
The application is not a linux application, but a "guest" OS that runs on top of the
hypervisor.
>
> "maint info break" will give you some more information. This is
> probably a shared library event breakpoint.
Yes, I see:
(gdb) maintenance info breakpoints
Num Type Disp Enb Address What
-1 shlib events keep y 0x00110000 <_start>
How do I delete it/prevent it from being set? Is this a configure time setting?
I tried:
(gdb) delete -1
negative value
--
Thanks a lot!
Anmol.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cannot insert breakpoint -1.
2009-07-24 22:01 ` Anmol P. Paralkar
@ 2009-07-25 2:25 ` Daniel Jacobowitz
2009-07-27 17:35 ` Anmol P. Paralkar
0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2009-07-25 2:25 UTC (permalink / raw)
To: Anmol P. Paralkar; +Cc: gdb
On Fri, Jul 24, 2009 at 05:00:45PM -0500, Anmol P. Paralkar wrote:
> Yes, I see:
>
> (gdb) maintenance info breakpoints Num Type Disp Enb
> Address What
> -1 shlib events keep y 0x00110000 <_start>
>
> How do I delete it/prevent it from being set? Is this a configure time setting?
It may help to use a powerpc-elf debugger instead.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cannot insert breakpoint -1.
2009-07-25 2:25 ` Daniel Jacobowitz
@ 2009-07-27 17:35 ` Anmol P. Paralkar
2009-07-27 17:55 ` Michael Snyder
0 siblings, 1 reply; 6+ messages in thread
From: Anmol P. Paralkar @ 2009-07-27 17:35 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb
On Fri, 24 Jul 2009, Daniel Jacobowitz wrote:
> On Fri, Jul 24, 2009 at 05:00:45PM -0500, Anmol P. Paralkar wrote:
>> Yes, I see:
>>
>> (gdb) maintenance info breakpoints Num Type Disp Enb
>> Address What
>> -1 shlib events keep y 0x00110000 <_start>
>>
>> How do I delete it/prevent it from being set? Is this a configure
> time setting?
>
> It may help to use a powerpc-elf debugger instead.
I tried powerpc-elf GDB, and it'll work (I see that I cannot set a
breakpoint in the application - but that seems to be a problem with
the application itself).
--
I do have one question about powerpc-linux-gnu GDB; I see that the breakpoint
is inserted inspite of:
(gdb) show stop-on-solib-events
Stopping for shared library events is 0.
--
From breakpoint.h:
/* Some dynamic linkers (HP, maybe Solaris) can arrange for special
code in the inferior to run when significant events occur in the
dynamic linker (for example a library is loaded or unloaded).
By placing a breakpoint in this magic code GDB will get control
when these significant events occur. GDB can then re-examine
the dynamic linker's data structures to discover any newly loaded
dynamic libraries. */
bp_shlib_event,
--
I would assume that if stop-on-solib-events is 0, then it ought not to set
the -1 breakpoint. Please could you help understanding this part.
Thank you,
Anmol.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cannot insert breakpoint -1.
2009-07-27 17:35 ` Anmol P. Paralkar
@ 2009-07-27 17:55 ` Michael Snyder
0 siblings, 0 replies; 6+ messages in thread
From: Michael Snyder @ 2009-07-27 17:55 UTC (permalink / raw)
To: Anmol P. Paralkar; +Cc: Daniel Jacobowitz, gdb
Anmol P. Paralkar wrote:
> On Fri, 24 Jul 2009, Daniel Jacobowitz wrote:
>
>> On Fri, Jul 24, 2009 at 05:00:45PM -0500, Anmol P. Paralkar wrote:
>>> Yes, I see:
>>>
>>> (gdb) maintenance info breakpoints Num Type Disp Enb
>>> Address What
>>> -1 shlib events keep y 0x00110000 <_start>
>>>
>>> How do I delete it/prevent it from being set? Is this a configure
>> time setting?
>>
>> It may help to use a powerpc-elf debugger instead.
>
> I tried powerpc-elf GDB, and it'll work (I see that I cannot set a
> breakpoint in the application - but that seems to be a problem with
> the application itself).
>
> --
>
> I do have one question about powerpc-linux-gnu GDB; I see that the breakpoint
> is inserted inspite of:
>
> (gdb) show stop-on-solib-events
> Stopping for shared library events is 0.
>
> --
>
> From breakpoint.h:
>
> /* Some dynamic linkers (HP, maybe Solaris) can arrange for special
> code in the inferior to run when significant events occur in the
> dynamic linker (for example a library is loaded or unloaded).
>
> By placing a breakpoint in this magic code GDB will get control
> when these significant events occur. GDB can then re-examine
> the dynamic linker's data structures to discover any newly loaded
> dynamic libraries. */
> bp_shlib_event,
>
> --
>
> I would assume that if stop-on-solib-events is 0, then it ought not to set
> the -1 breakpoint. Please could you help understanding this part.
Anmol,
"stop-on-solib-events" means 'stop' as in "show the user a gdb prompt".
If it's unset, we still insert the breakpoints so that we can
handle the shared library events (read symbol files), we just
don't go to the interactive prompt.
I think it's really unusual for someone to want to actually
go to the prompt when a shared lib event occurs, but normally
we want symbols to be loaded. Don't know if there's any way
to actually disable that...
Michael
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-07-27 17:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-24 21:12 Cannot insert breakpoint -1 Anmol P. Paralkar
2009-07-24 21:19 ` Daniel Jacobowitz
2009-07-24 22:01 ` Anmol P. Paralkar
2009-07-25 2:25 ` Daniel Jacobowitz
2009-07-27 17:35 ` Anmol P. Paralkar
2009-07-27 17:55 ` Michael Snyder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox