i386 debugging registers
Mark Kettenis
kettenis@wins.uva.nl
Sun Jun 11 16:22:00 GMT 2000
Hi,
While trying to build a generic layer for implementing hardware
watchpoint for the various i386 native ports, I found myself starting
to implement some sort of register cache for the debugging registers.
Instead actually doing so, I wondered whether it would be a good idea
to add the debug registers to the standard register cache.
Pros:
* It makes my life easier :-)
* They are, you know, erh... registers.
* Some people might actually want to fiddle with them, especially
with the control register which has some bits that control the
instruction pipeline.
Cons:
* It might confuse our users. Fiddling with the debug registers
might interfere with the hardware watchpoint support. For example,
Assigning to one of the address registers will probably make GDB
forget about some hardware watchpoints and produce some weird
warnings. It will also likely cause some spurious SIGTRAPS.
* The exact effect of modifying the debugging registers is somewhat
dependent on the underlying OS. To make sure GDB's hardware
watchpoints work as expected, some additional frobbing of the
debugging might be necessary in the code that actually fetches
and/or stores the registers. The user will see those frobbed
registers instead of the real ones.
Comments?
Mark
More information about the Gdb
mailing list