This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Save the length of inserted breakpoints
On Mon, Apr 17, 2006 at 03:08:52PM +0200, Mark Kettenis wrote:
> But this means that actually we should try to make the interface
> stricter, instead of looser. And the fact that the shadow contents
> are needed makes it impossible to use an opaque struct. That in
> combination with the possibility that BREAKPOINT_FROM_PC adjusts the
> breakpoint address means that besides the length we also need to pass
> back the address. At that point indeed passing a struct is perhaps a
> better option. And we should remove the usage of BREAKPOINT_FROM_PC
> from deprecated_read_memory_nobpt() altogether.
Yes, absolutely - that's how I plan to fix it.
> I still think we should maintain a strict seperation between the
> high-level breakpoint code and the low-level target code. So I'd
> really appreciate it if you'd be willing to change your patch such
> that instead of struct bp_location, you used a different struct, which
> for now would have three members: the saved contents, the length and
> the address. It's perfectly ok with me to make that new struct part
> of struct bp_location to avoid all memory allocation problems.
Sounds perfect! While the argument was a little wearing, I am entirely
happy with this result. I'll post a patch for this shortly.
I've been thinking about having target methods which don't need the
shadow contents (there are definitely several) record the "length" of
the breakpoint as zero; then deprecated_read_memory_nobpt can do the
right thing. Does this sound reasonable? The alternative is to do an
unnecessary read from the target.
--
Daniel Jacobowitz
CodeSourcery