From 3de61d8c53f4cd0aa568067130b7909c68f79272 Mon Sep 17 00:00:00 2001 From: John Gilmore Date: Fri, 11 Sep 1992 09:11:11 +0000 Subject: [PATCH] * xm-mips.h (KERNEL_U_ADDR): Get from . (REGISTER_U_ADDR): Fix up for Ultrix 4.2. * tm-tahoe.h, xm-tahoe.h (KERNEL_U_ADDR): Move macro to xm-tahoe.h. * stack.c (_initialize_stack): "dow" should be a valid abbreviation for "down". Suggested by Richard Stallman. --- gdb/ChangeLog | 13 +++++++++++++ gdb/stack.c | 7 ++++--- gdb/tm-tahoe.h | 7 +------ gdb/xm-mips.h | 24 ++++++++++++++++++++---- gdb/xm-tahoe.h | 7 ++++++- 5 files changed, 44 insertions(+), 14 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 553cff14966..86c5a8bbc69 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,16 @@ +Fri Sep 11 01:34:25 1992 John Gilmore (gnu@sphagnum.cygnus.com) + + * mips-xdep.c (REGISTER_PTRACE_ADDR, fetch_inferior_registers, + store_inferior_registers): Replace unexplained numbers + with manifest constants from a DECstation header file. + * xm-mips.h (KERNEL_U_ADDR): Get from . + (REGISTER_U_ADDR): Fix up for Ultrix 4.2. + + * tm-tahoe.h, xm-tahoe.h (KERNEL_U_ADDR): Move macro to xm-tahoe.h. + + * stack.c (_initialize_stack): "dow" should be a valid abbreviation + for "down". Suggested by Richard Stallman. + Thu Sep 10 15:26:07 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) * remote-vx.c: Rename realloc for inclusion of rpc/rpc.h, to avoid diff --git a/gdb/stack.c b/gdb/stack.c index 4aeb7c40f92..a8037c4551d 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -624,7 +624,7 @@ backtrace_command (count_exp, from_tty) fi = get_frame_info (frame); ps = find_pc_psymtab (fi->pc); if (ps) - (void) PSYMTAB_TO_SYMTAB (ps); /* Force syms to come in */ + PSYMTAB_TO_SYMTAB (ps); /* Force syms to come in */ } } @@ -779,7 +779,7 @@ print_frame_label_vars (frame, this_level_only, stream) bl = blockvector_for_pc (BLOCK_END (block) - 4, &index); blocks_printed = (char *) alloca (BLOCKVECTOR_NBLOCKS (bl) * sizeof (char)); - (void) memset (blocks_printed, 0, BLOCKVECTOR_NBLOCKS (bl) * sizeof (char)); + memset (blocks_printed, 0, BLOCKVECTOR_NBLOCKS (bl) * sizeof (char)); while (block != 0) { @@ -1144,7 +1144,7 @@ return_command (retval_exp, from_tty) if (retval_exp) { return_value = parse_and_eval (retval_exp); - (void) (VALUE_CONTENTS (return_value)); + VALUE_CONTENTS (return_value); } /* If interactive, require confirmation. */ @@ -1239,6 +1239,7 @@ This is useful in command scripts."); "Select and print stack frame called by this one.\n\ An argument says how many frames down to go."); add_com_alias ("do", "down", class_stack, 1); + add_com_alias ("dow", "down", class_stack, 1); add_com ("down-silently", class_support, down_silently_command, "Same as the `down' command, but does not print anything.\n\ This is useful in command scripts."); diff --git a/gdb/tm-tahoe.h b/gdb/tm-tahoe.h index 4640b9512ae..748316a9e87 100644 --- a/gdb/tm-tahoe.h +++ b/gdb/tm-tahoe.h @@ -1,5 +1,5 @@ /* Definitions to make GDB target for a tahoe running 4.3-Reno. - Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc. + Copyright 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc. This file is part of GDB. @@ -71,11 +71,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define TARGET_UPAGES UPAGES #define TARGET_NBPG NBPG -/* This is the amount to subtract from u.u_ar0 - to get the offset in the core file of the register values. */ - -#define KERNEL_U_ADDR (0xc0000000 - (TARGET_UPAGES * TARGET_NBPG)) - /* Address of end of stack space. */ #define STACK_END_ADDR (0xc0000000 - (TARGET_UPAGES * TARGET_NBPG)) diff --git a/gdb/xm-mips.h b/gdb/xm-mips.h index 1318bba60b4..6a8a5bbccd6 100644 --- a/gdb/xm-mips.h +++ b/gdb/xm-mips.h @@ -27,7 +27,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define SET_STACK_LIMIT_HUGE -#define KERNEL_U_ADDR 0 /* Not needed. */ +#ifdef ultrix +/* Needed for DECstation core files. */ +#include +#define KERNEL_U_ADDR UADDR +#endif #ifdef ultrix extern char *strdup(); @@ -39,11 +43,23 @@ extern void *memcpy(); extern void *memset(); #define MEM_FNS_DECLARED -/* Only used for core files on DECstations. */ +#if !defined (offsetof) +# define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER) +#endif + +/* Only used for core files on DECstations. + First four registers at u.u_ar0 are saved arguments, and + there is no r0 saved. Float registers are saved + in u_pcb.pcb_fpregs, not relative to u.u_ar0. */ #define REGISTER_U_ADDR(addr, blockend, regno) \ - if (regno < 38) addr = (NBPG*UPAGES) + (regno - 38)*sizeof(int);\ - else addr = 0; /* ..somewhere in the pcb */ + { \ + if (regno < FP0_REGNUM) \ + addr = blockend + sizeof(int) * (4 + regno - 1); \ + else \ + addr = offsetof (struct user, u_pcb.pcb_fpregs[0]) + \ + sizeof (int) * (regno - FP0_REGNUM); \ + } /* Override copies of {fetch,store}_inferior_registers in infptrace.c. */ #define FETCH_INFERIOR_REGISTERS diff --git a/gdb/xm-tahoe.h b/gdb/xm-tahoe.h index a28d69a9173..57a3b19615b 100644 --- a/gdb/xm-tahoe.h +++ b/gdb/xm-tahoe.h @@ -1,5 +1,5 @@ /* Definitions to make GDB hosted on a tahoe running 4.3-Reno - Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc. + Copyright 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc. Contributed by the State University of New York at Buffalo, by the Distributed Computer Systems Lab, Department of Computer Science, 1991. @@ -32,6 +32,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define SET_STACK_LIMIT_HUGE +/* This is the amount to subtract from u.u_ar0 + to get the offset in the core file of the register values. */ + +#define KERNEL_U_ADDR (0xc0000000 - (TARGET_UPAGES * TARGET_NBPG)) + #define REGISTER_U_ADDR(addr, blockend, regno) \ { addr = blockend - 100 + regno * 4; \ if (regno == PC_REGNUM) addr = blockend - 8; \ -- 2.30.2