This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: PATCH: update i386 port to use FRAME_INIT_SAVED_REGS()
- To: jtc at redback dot com, Jim Blandy <jimb at cygnus dot com>
- Subject: Re: PATCH: update i386 port to use FRAME_INIT_SAVED_REGS()
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Wed, 09 Feb 2000 14:01:35 +1100
- CC: gdb-patches at sourceware dot cygnus dot com
- Organization: Cygnus Solutions
- References: <5mbt5vrxxp.fsf@jtc.redbacknetworks.com>
J.T.,
What testing did this one get - it's going to affect all the x86 targets
(including GNU/Linux which is hot topic at present).
Jim,
See any problems from your end?
Architecturally I've no problems with this patch.
Andrew
"J.T. Conklin" wrote:
>
> Moving the master GDB repository to sourceware provided the motivation
> for me to sync up to the most recent snapshots, compare my repository,
> and try to minimize the divergence. Easier than finishing the memory
> region attribute code...
>
> Most of these are patches that have been submitted before but were not
> rejected.
>
> >From the original submission: "I made this change a while ago, back
> when Andrew was making similar changes to other targets. It's been in
> my sources for some time, I found it again when I was checking the
> differences between my repository and the last snapshot."
>
> The enclosed ChangeLog is from the original message. The patch is
> relative to the 20000204 snapshot.
>
> --jtc
>
> 1999-08-13 J.T. Conklin <jtc@redback.com>
>
> * config/i386/tm-i386.h (FRAME_INIT_SAVED_REGS): Replace
> FRAME_FIND_SAVED_REGS.
> (i386_frame_init_saved_regs): Replace i386_frame_find_saved_regs.
> * i386-tdep.c (i386_frame_init_saved_regs, i386_pop_frame):
> Update.
>
> Index: i386-tdep.c
> ===================================================================
> RCS file: /home/jtc/CVSROOT/gdb/gdb/i386-tdep.c,v
> retrieving revision 1.1.1.10
> retrieving revision 1.7
> diff -c -r1.1.1.10 -r1.7
> *** i386-tdep.c 1999/10/19 17:16:44 1.1.1.10
> --- i386-tdep.c 1999/10/19 17:48:19 1.7
> ***************
> *** 475,483 ****
> */
>
> void
> ! i386_frame_find_saved_regs (fip, fsrp)
> struct frame_info *fip;
> - struct frame_saved_regs *fsrp;
> {
> long locals = -1;
> unsigned char op;
> --- 475,482 ----
> */
>
> void
> ! i386_frame_init_saved_regs (fip)
> struct frame_info *fip;
> {
> long locals = -1;
> unsigned char op;
> ***************
> *** 486,492 ****
> CORE_ADDR pc;
> int i;
>
> ! memset (fsrp, 0, sizeof *fsrp);
>
> /* if frame is the end of a dummy, compute where the
> * beginning would be
> --- 485,494 ----
> CORE_ADDR pc;
> int i;
>
> ! if (fip->saved_regs)
> ! return;
> !
> ! frame_saved_regs_zalloc (fip);
>
> /* if frame is the end of a dummy, compute where the
> * beginning would be
> ***************
> *** 501,507 ****
> for (i = 0; i < NUM_REGS; i++)
> {
> adr -= REGISTER_RAW_SIZE (i);
> ! fsrp->regs[i] = adr;
> }
> return;
> }
> --- 503,509 ----
> for (i = 0; i < NUM_REGS; i++)
> {
> adr -= REGISTER_RAW_SIZE (i);
> ! fip->saved_regs[i] = adr;
> }
> return;
> }
> ***************
> *** 520,535 ****
> break;
> #ifdef I386_REGNO_TO_SYMMETRY
> /* Dynix uses different internal numbering. Ick. */
> ! fsrp->regs[I386_REGNO_TO_SYMMETRY (op - 0x50)] = adr;
> #else
> ! fsrp->regs[op - 0x50] = adr;
> #endif
> adr -= 4;
> }
> }
>
> ! fsrp->regs[PC_REGNUM] = fip->frame + 4;
> ! fsrp->regs[FP_REGNUM] = fip->frame;
> }
>
> /* return pc of first real instruction */
> --- 522,537 ----
> break;
> #ifdef I386_REGNO_TO_SYMMETRY
> /* Dynix uses different internal numbering. Ick. */
> ! fip->saved_regs[I386_REGNO_TO_SYMMETRY (op - 0x50)] = adr;
> #else
> ! fip->saved_regs[op - 0x50] = adr;
> #endif
> adr -= 4;
> }
> }
>
> ! fip->saved_regs[PC_REGNUM] = fip->frame + 4;
> ! fip->saved_regs[FP_REGNUM] = fip->frame;
> }
>
> /* return pc of first real instruction */
> ***************
> *** 640,654 ****
> struct frame_info *frame = get_current_frame ();
> CORE_ADDR fp;
> int regnum;
> - struct frame_saved_regs fsr;
> char regbuf[MAX_REGISTER_RAW_SIZE];
>
> fp = FRAME_FP (frame);
> ! get_frame_saved_regs (frame, &fsr);
> for (regnum = 0; regnum < NUM_REGS; regnum++)
> {
> CORE_ADDR adr;
> ! adr = fsr.regs[regnum];
> if (adr)
> {
> read_memory (adr, regbuf, REGISTER_RAW_SIZE (regnum));
> --- 642,656 ----
> struct frame_info *frame = get_current_frame ();
> CORE_ADDR fp;
> int regnum;
> char regbuf[MAX_REGISTER_RAW_SIZE];
>
> fp = FRAME_FP (frame);
> ! i386_frame_init_saved_regs (frame);
> !
> for (regnum = 0; regnum < NUM_REGS; regnum++)
> {
> CORE_ADDR adr;
> ! adr = frame->saved_regs[regnum];
> if (adr)
> {
> read_memory (adr, regbuf, REGISTER_RAW_SIZE (regnum));
> Index: config/i386/tm-i386.h
> ===================================================================
> RCS file: /home/jtc/CVSROOT/gdb/gdb/config/i386/tm-i386.h,v
> retrieving revision 1.1.1.9
> retrieving revision 1.8
> diff -c -r1.1.1.9 -r1.8
> *** tm-i386.h 2000/02/03 20:37:19 1.1.1.9
> --- tm-i386.h 2000/02/03 21:38:36 1.8
> ***************
> *** 357,367 ****
> ways in the stack frame. sp is even more special:
> the address we return for it IS the sp for the next frame. */
>
> ! #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
> ! { i386_frame_find_saved_regs ((frame_info), &(frame_saved_regs)); }
>
> - extern void i386_frame_find_saved_regs PARAMS ((struct frame_info *,
> - struct frame_saved_regs *));
>
>
> /* Things needed for making the inferior call functions. */
> --- 357,365 ----
> ways in the stack frame. sp is even more special:
> the address we return for it IS the sp for the next frame. */
>
> ! extern void i386_frame_init_saved_regs PARAMS ((struct frame_info *));
> ! #define FRAME_INIT_SAVED_REGS(FI) i386_frame_init_saved_regs (FI)
>
>
>
> /* Things needed for making the inferior call functions. */
>
> --
> J.T. Conklin
> RedBack Networks