[RFA] Ignore breakpoints when reading memory.

Jim Blandy jimb@codesourcery.com
Tue Dec 4 19:12:00 GMT 2007

Mark Kettenis <mark.kettenis at xs4all.nl> writes:
>> From: Vladimir Prus <vladimir@codesourcery.com>
>> Date: Sat, 1 Dec 2007 14:19:45 +0300
>> This commit prepares us for always-inserted-breakpoints mode.
>> If breakpoints are always inserted, then reading the code memory
>> will read the breakpoint instructions, not the original content.
>> This patch makes us try to restore the original comments using
>> the breakpoints table. OK?
> So now reading from target memory will need to traverse the complete
> list of inserted breakpoints.  Did you do any benchmarking to see what
> the impact of this change is, especially when running on a somewhat
> slow machine?

Without taking a position on whether this is a significant problem:

If we used some ordered data structure (we've got splay trees handy)
to hold the breakpoint locations sorted by address, then that would
permit better algorithms in some of the always-inserted breakpoint
code as well.  The comparison between the old and new breakpoint
location lists could be linear instead of quadratic.

More information about the Gdb-patches mailing list