This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Problem after hitting breakpoint on Windows (with GDBserver)


On 03/13/2012 01:39 AM, Joel Brobecker wrote:

> +  if (val == 0)
> +    memcpy (bp_tgt->shadow_contents, readbuf, bp_tgt->placed_size);
>  
>    /* Write the breakpoint.  */
>    if (val == 0)


Merge?

> +   As a limitation, MYADDR must not be the shadow_contents buffer of one

I wouldn't call it a limitation; it's more a design choice thing, like
memcpy doesn't handle overlapping buffers.

Otherwise this is fine with me.  An assertion in breakpoint_xfer_memory
to catch that READBUF or WRITEBUF doesn't overlap bp->target_info.shadow_contents
would be nice.  We could even avoid the new comments in target.h that way, as
there's be no way to write a new hook that doesn't trip on it instantly.

As we discussed yesterday on IRC, the current code always reinserts locations,
which means that gdb > 7.4 now does an extra read off of inferior memory to
fill the shadow on breakpoint re-sets.  That'd be possible to avoid (and avoiding
this whole problem along the way), though I think Joel's patch is a good one
even knowing that.

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]