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: PING: [RFA/i386] 2 more patterns in i386_analyze_stack_align


> Date: Sun, 31 Dec 2006 10:08:44 +0400
> From: Joel Brobecker <brobecker@adacore.com>
> 
> Ping?
> 
> No rush. I just read a message from Mark saying that he was losing
> messages, so I'm resending this message, JIC.

Probably a good idea ;).

> > Index: i386-tdep.c
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/i386-tdep.c,v
> > retrieving revision 1.225
> > diff -u -p -r1.225 i386-tdep.c
> > --- i386-tdep.c	8 Aug 2006 21:36:46 -0000	1.225
> > +++ i386-tdep.c	20 Dec 2006 10:21:58 -0000
> > @@ -497,15 +497,27 @@ static CORE_ADDR
> >  i386_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc,
> >  			  struct i386_frame_cache *cache)
> >  {
> > -  static const gdb_byte insns[10] = { 
> > +  static const gdb_byte insns_ecx[10] = { 
> >      0x8d, 0x4c, 0x24, 0x04,	/* leal  4(%esp), %ecx */
> >      0x83, 0xe4, 0xf0,		/* andl  $-16, %esp */
> >      0xff, 0x71, 0xfc		/* pushl -4(%ecx) */
> >    };
> > +  static const gdb_byte insns_edx[10] = { 
> > +    0x8d, 0x54, 0x24, 0x04,	/* leal  4(%esp), %edx */
> > +    0x83, 0xe4, 0xf0,		/* andl  $-16, %esp */
> > +    0xff, 0x72, 0xfc		/* pushl -4(%edx) */
> > +  };
> > +  static const gdb_byte insns_eax[10] = { 
> > +    0x8d, 0x44, 0x24, 0x04,	/* leal  4(%esp), %eax */
> > +    0x83, 0xe4, 0xf0,		/* andl  $-16, %esp */
> > +    0xff, 0x70, 0xfc		/* pushl -4(%eax) */
> > +  };
> >    gdb_byte buf[10];

Hmm, you're missing the %ebx case here.  Now on ELF systems, you'll
probably never see it since %ebx is used for GOT access, but on other
object formats I don't think there is any reason why GCC wouldn't
choose to use %ebx as well.

This looks reasonable otherwise, except that I would sort the patterns
in a more logical order.

Mark


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