gdb doesn't work very well with dynamic linked binaries

Eli Zaretskii
Tue Sep 5 03:36:00 GMT 2000

>   Date: Mon, 4 Sep 2000 23:32:22 -0700
>   From: "H . J . Lu" <>
>   If you can generalize it for ia32, I will implement it for Linux/ia32.

The code on go32-nat.c manipulates an array which represents the ia32
debug registers, including the status and control registers.  It
leaves it to resume() and its subroutines on the target end to
actually insert the watchpoints when the inferior is resumed and
remove them when the inferior stops and control is passed to GDB.

If this model suits most or all ia32 targets, pulling the code from
go32-nat.c into a separate module (probably, as part of i386-nat.c)
would be very easy for me.  If not, I'd ask the relevant maintainers
to tell what provisions should I make for other platforms to fit in.

>   If it won't be fixed in 5.1, I will follow your hints and implement a
>   Linux only solution when it happens to me again.

I can do this Very Soon (tm) provided that I hear a GO from The Powers
That Be.  Andrew?  Stan?  What say you?

>   Hardware watchpoints
>   have been known to be broken on Linux/ia32 for a long time and nothing
>   has been done to it.

That's not 100% true: a few important patches related to watchpoints
went into mainstream sources (mainly in breakpoint.c) in preparation
for v5.0.  This is the infrastructure I was talking about in my
previous message; without those patches the watchpoint support in
go32-nat.c could not work reliably.  (IIRC, a major part of these
patches were resubmitted by me and approved by Michael Snyder as a
result of a discussion in which you participated.)

More information about the Gdb mailing list