This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: [PATCH]: Fix stack offset correction for 68hc11


Stephane Carrez wrote:
> 
> Hi!
> 
> For 68hc11, a stack offset correction of +1 must be applied on the stack
> register before using it to read/write the memory.  No correction is required
> for 68hc12. The stack offset correction was already applied (inlined) at
> several places but it was only correct for 68hc11.
> 
> I've committed the following patch to fix the problem.

FYI,

> + /* Stack pointer correction value.  For 68hc11, the stack pointer points
> +    to the next push location.  An offset of 1 must be applied to obtain
> +    the address where the last value is saved.  For 68hc12, the stack
> +    pointer points to the last value pushed.  No offset is necessary.  */
> + static int stack_correction = 1;

Can I encourage you to create ``struct gdbarch_tdep'' object and put
this value in there.  Eventually gdb is going to have more than one
active GDB architecture and when that happens static variables just
won't work :-(

	enjoy,
		Andrew

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