* remote debugging: "call" just leads to "Cannot insert breakpoint 0"
@ 2010-09-20 14:41 Steffen Dettmer
2010-09-20 14:59 ` Pedro Alves
0 siblings, 1 reply; 2+ messages in thread
From: Steffen Dettmer @ 2010-09-20 14:41 UTC (permalink / raw)
To: gdb
Hi,
using gdb-arm-elf (non-linux) running on x86 linux I think remote
functions can be invoked (such as "(gdb) print strlen(str)"), but
I just get "Cannot insert breakpoint 0".
Why is gdb trying to break at 0?
Any ideas what could cause this?
Do I do something wrong?
Do I need to setup anything special?
This issue was reported for a wide range of gdb versions (6.4,
6.8, 7.1/7.2), actually never worked for us, but I think it
should work, shouldn't it?
The trace shows that when you type the "call" command, GDB sets
up the registers, sets a breakpoint (to be reached at the end of
the function execution, I believe), and resumes the execution.
The problem is that the breakpoint is always set at address 0, on
4 bytes:
"Sending packet: $Z0,0,4#46...Ack"
-> It makes no sense to set such a breakpoint at address 0, and
BTW this breakpoint is never reached. It fails immediately
because it is impossible to set this breakpoint.
p &toto
p &toto
$1 = (int ()) 0xc0000248 <toto>
set debug remote 1
set debug remote 1
call toto()
call toto()
Sending packet: $Pe=00000000#72...Ack
Packet received: OK
Packet P (set-register) is supported
Sending packet: $Pd=980702c0#be...Ack
Packet received: OK
Sending packet: $Pf=480200c0#b4...Ack
Packet received: OK
Sending packet: $Z0,0,4#46...Ack
Packet received: E00
Sending packet: $Pd=a00702c0#de...Ack
Packet received: OK
Sending packet: $Pe=100200c0#a8...Ack
Packet received: OK
Sending packet: $Pf=520200c0#af...Ack
Packet received: OK
Warning:
Cannot insert breakpoint 0.
Error accessing memory address 0x0: Unknown error 4294967295.
Any hints appreciated.
oki,
Steffen
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: remote debugging: "call" just leads to "Cannot insert breakpoint 0"
2010-09-20 14:41 remote debugging: "call" just leads to "Cannot insert breakpoint 0" Steffen Dettmer
@ 2010-09-20 14:59 ` Pedro Alves
0 siblings, 0 replies; 2+ messages in thread
From: Pedro Alves @ 2010-09-20 14:59 UTC (permalink / raw)
To: gdb; +Cc: Steffen Dettmer
On Monday 20 September 2010 15:41:45, Steffen Dettmer wrote:
> Hi,
>
> using gdb-arm-elf (non-linux) running on x86 linux I think remote
> functions can be invoked (such as "(gdb) print strlen(str)"), but
> I just get "Cannot insert breakpoint 0".
>
> Why is gdb trying to break at 0?
>
> Any ideas what could cause this?
GDB defaults to place the call dummy breakpoint at the entry point.
Your binary probably has entry point == 0.
>
> Do I do something wrong?
> Do I need to setup anything special?
>
> This issue was reported for a wide range of gdb versions (6.4,
> 6.8, 7.1/7.2), actually never worked for us, but I think it
> should work, shouldn't it?
>
> The trace shows that when you type the "call" command, GDB sets
> up the registers, sets a breakpoint (to be reached at the end of
> the function execution, I believe), and resumes the execution.
> The problem is that the breakpoint is always set at address 0, on
> 4 bytes:
>
> "Sending packet: $Z0,0,4#46...Ack"
> -> It makes no sense to set such a breakpoint at address 0, and
> BTW this breakpoint is never reached. It fails immediately
> because it is impossible to set this breakpoint.
>
> p &toto
> p &toto
> $1 = (int ()) 0xc0000248 <toto>
> set debug remote 1
> set debug remote 1
> call toto()
> call toto()
> Sending packet: $Pe=00000000#72...Ack
> Packet received: OK
> Packet P (set-register) is supported
> Sending packet: $Pd=980702c0#be...Ack
> Packet received: OK
> Sending packet: $Pf=480200c0#b4...Ack
> Packet received: OK
> Sending packet: $Z0,0,4#46...Ack
> Packet received: E00
> Sending packet: $Pd=a00702c0#de...Ack
> Packet received: OK
> Sending packet: $Pe=100200c0#a8...Ack
> Packet received: OK
> Sending packet: $Pf=520200c0#af...Ack
> Packet received: OK
> Warning:
> Cannot insert breakpoint 0.
> Error accessing memory address 0x0: Unknown error 4294967295.
>
>
> Any hints appreciated.
>
> oki,
>
> Steffen
>
--
Pedro Alves
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-09-20 14:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-20 14:41 remote debugging: "call" just leads to "Cannot insert breakpoint 0" Steffen Dettmer
2010-09-20 14:59 ` Pedro Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox