This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] remote: Avoid unwanted shlib internal BPs When debugging Linux kernel or u-boot with Abatron BDI emulator an error occurs:


On 06/01/2012 02:36 PM, Joakim Tjernlund wrote:

> ..
> (gdb) tar remote bdi:2001
> Remote debugging using bdi:2001
> 0xeff80050 in ?? ()
> (gdb) mon reset
> (gdb) cont
> Continuing.
> Warning:
> Cannot insert breakpoint -1.
> Error accessing memory address 0xc0000000: Unknown error 4294967295.
> 
> (gdb) maintenance info breakpoints
> Num     Type           Disp Enb Address    What
> -1      shlib events   keep y   0xc0000000 <_stext> inf 1
> 
> gdb mistakenly inserts a special shared library BP even though
> there area no such libs in either linux or u-boot.


GDB has no special knowledge of the Linux kernel, nor of u-boot.
A GNU/Linux targeted GDB (*-*-linux-gnu) recognizes, and knows how to
debug user space applications.  If the kernel binary or the u-boot binary
look very much like GNU/Linux user space programs, the *-*-linux-gnu targeted
GDB will assume that's what they are.  If you used a bare metal elf/eabi
targeted GDB, which is really what those programs are, you'd not see this.

> Fix this by explicitly informing remote_add_inferior() that
> the remote is attached.


NAK.  This is not a "fix", it's papering over the problem, and
regresses GDB.  It makes GDB always detach on quit, instead of asking
the remote end whether it is "attached" or whether it has "spawned"
the inferior.

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]