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] i386-tdep.c, check target_read_memory for error.


On Tuesday 08 March 2011 19:25:20, Mark Kettenis wrote:
> > From: Pedro Alves <pedro@codesourcery.com>
> > Date: Tue, 8 Mar 2011 18:58:43 +0000
> > 
> > On Tuesday 08 March 2011 18:37:55, Michael Snyder wrote:
> > > @@ -1221,7 +1231,8 @@ i386_skip_noop (CORE_ADDR pc)
> > >        if (op == 0x90) 
> > >         {
> > >           pc += 1;
> > > -         target_read_memory (pc, &op, 1);
> > > +         if (target_read_memory (pc, &op, 1))
> > > +           return pc;
> > 
> > I think you're meant to return PC as it was at function
> > start.  Note the pc += 1 above.  There are other instances
> > in the patch.
> 
> Those are actually fine.  Skipping nop instructions is harmless, even
> if we get stuck somewhere in the middle.

You're right, missed that.

BTW, I noticed a bunch of read_memory_unsigned_integer/read_memory_integer
calls in these skippers/sniffers.  These functions call read_memory, which
throws.

-- 
Pedro Alves


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