gdb doesn't work very well with dynamic linked binaries

H . J . Lu hjl@lucon.org
Mon Sep 4 23:32:00 GMT 2000


On Tue, Sep 05, 2000 at 01:48:56AM -0400, Eli Zaretskii wrote:
> > 
> > Date: Mon, 4 Sep 2000 16:44:58 -0700
> > From: "H . J . Lu" <hjl@lucon.org>
> > 
> > 1. Delete hardware watchpoints to free hardware debug registers. Set 4
> > hardware watchpoints. Then delete/disable one hardware watchpoint. Set
> > another hardware watchpoint. Can gdb free a hardware debug register
> > when I delete/disable the hardware watchpoint which uses it?
> > 2. Watch for different values on a viariable with one hardware debug
> > register. That is do
> > 
> > (gdb) watch foobar == 1
> > (gdb) watch foobar == 2
> > (gdb) watch foobar == 3
> > (gdb) watch foobar == 4
> > (gdb) watch foobar == 5
> > 
> > only using one hardware debug register.
> > 
> > I have reported them long before 5.0 was released. But at least #1
> > still doesn't work right in 5.0 under Linux/ia32.
> 
> These are not GDB/ia32 issues per se: the above features are all
> implemented in the DJGPP port of GDB and work in v5.0.  Every
> x86-based target should be able to lift the relevant parts of
> go32-nat.c and use them almost verbatim.  You get debug register
> sharing through reference counts, and the ability to watch large
> regions (up to 16 bytes) using multiple registers.  (The required
> infrastructure in high-level GDB application code, mostly in
> breakpoint.c, is also working since v5.0.)
> 
> What is missing is something that we discussed here some time ago: a
> unified handling for debug registers common for ALL ia32 targets.  If
> you want to get this done before 5.1 is out, I'm for it.  I said in
> the past that I'm willing to volunteer to pull the code out of
> go32-nat.c and generalize it as appropriate, as the first step towards
> this goal.  Provided that it's decided to do that for 5.1, of course
> (otherwise, I have too many other important things to do ;-).
> 

If you can generalize it for ia32, I will implement it for Linux/ia32.
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. It is just one of
those things which makes me to roll my own stuff. Hardware watchpoints
have been known to be broken on Linux/ia32 for a long time and nothing
has been done to it.


H.J.


More information about the Gdb mailing list