* valops.c (call_function_by_hand, push_word), defs.h (push_word),
authorJim Kingdon <jkingdon@engr.sgi.com>
Sun, 26 Dec 1993 18:10:22 +0000 (18:10 +0000)
committerJim Kingdon <jkingdon@engr.sgi.com>
Sun, 26 Dec 1993 18:10:22 +0000 (18:10 +0000)
convex-xdep.c, m88k-nat.c, i386m3-nat.c, mips-tdep.c, mipsm3-nat.c,
ns32km3-nat.c, remote-bug.c, m88k-tdep.c, remote-hms.c, remote-mips.c,
config/gould/tm-np1.h, hppa-tdep.c (hppa_fix_call_dummy), remote-vx.c:
Use REGISTER_SIZE, unsigned LONGEST, and
{store,extract}_unsigned_integer, instead of sizeof
(REGISTER_TYPE) and REGISTER_TYPE.
* All tm.h files: Change REGISTER_TYPE to REGISTER_SIZE.
* hppa-tdep.c (pa_print_fp_reg): Remove unused variable val.

* Makefile.in (ALLDEPFILES): Remove i386ly-nat.c and m68kly-nat.c.
Add lynx-nat.c.

31 files changed:
gdb/ChangeLog
gdb/Makefile.in
gdb/config/a29k/tm-a29k.h
gdb/config/h8300/tm-h8300.h
gdb/config/h8500/tm-h8500.h
gdb/config/i386/tm-i386v.h
gdb/config/i386/tm-sun386.h
gdb/config/i960/tm-i960.h
gdb/config/m68k/tm-m68k.h
gdb/config/m68k/tm-vx68.h
gdb/config/m88k/tm-m88k.h
gdb/config/mips/tm-mips.h
gdb/config/ns32k/tm-merlin.h
gdb/config/ns32k/tm-umax.h
gdb/config/pa/tm-hppa.h
gdb/config/sh/tm-sh.h
gdb/config/sparc/tm-sparc.h
gdb/config/vax/tm-vax.h
gdb/config/z8k/tm-z8k.h
gdb/convex-xdep.c
gdb/defs.h
gdb/hppa-tdep.c
gdb/i386m3-nat.c
gdb/m88k-nat.c
gdb/m88k-tdep.c
gdb/mipsm3-nat.c
gdb/ns32km3-nat.c
gdb/remote-bug.c
gdb/remote-hms.c
gdb/remote-mips.c
gdb/remote-vx.c

index 435623302b2c2913e58ada27e907319cd4f8a566..8c3cd8688e3d099eef7c988ed33fbb1df4f0deb3 100644 (file)
@@ -1,3 +1,18 @@
+Sun Dec 26 09:18:10 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
+
+       * valops.c (call_function_by_hand, push_word), defs.h (push_word),
+       convex-xdep.c, m88k-nat.c, i386m3-nat.c, mips-tdep.c, mipsm3-nat.c,
+       ns32km3-nat.c, remote-bug.c, m88k-tdep.c, remote-hms.c, remote-mips.c,
+       config/gould/tm-np1.h, hppa-tdep.c (hppa_fix_call_dummy), remote-vx.c:
+       Use REGISTER_SIZE, unsigned LONGEST, and
+       {store,extract}_unsigned_integer, instead of sizeof
+       (REGISTER_TYPE) and REGISTER_TYPE.
+       * All tm.h files: Change REGISTER_TYPE to REGISTER_SIZE.
+       * hppa-tdep.c (pa_print_fp_reg): Remove unused variable val.
+
+       * Makefile.in (ALLDEPFILES): Remove i386ly-nat.c and m68kly-nat.c.
+       Add lynx-nat.c.
+
 Sat Dec 25 20:05:41 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
 
     * hppa-tdep.c (init_extra_frame_info): Correctly adjust the base
index ac3ee3f4d4e6e12a6e448d17f872b6640132cfe7..e47de42988e083611b9dd6b38cc64c9dcd0639ab 100644 (file)
@@ -310,7 +310,7 @@ SFILES = blockframe.c breakpoint.c buildsym.c c-exp.y c-lang.c \
        mem-break.c minsyms.c mipsread.c nlmread.c objfiles.c parse.c \
        printcmd.c remote.c source.c stabsread.c stack.c symfile.c symmisc.c \
        symtab.c target.c thread.c typeprint.c utils.c valarith.c valops.c \
-       valprint.c values.c serial.c ser-unix.c
+       valprint.c values.c serial.c ser-unix.c mdebugread.c
 
 # Files that are not source code, but need to go into
 # gdb-$(VERSION).tar.Z.
@@ -375,10 +375,10 @@ defs_h =  defs.h xm.h tm.h nm.h config.status
 
 inferior_h =   inferior.h $(breakpoint_h)
 
-# Header files that are not named in config/*/* Makefile fragments go
-# into HFILES.
+# Header files that need to have srcdir added.
 
-HFILES = buildsym.h call-cmds.h coff-solib.h defs.h environ.h $(gdbcmd_h) \
+HFILES_NO_SRCDIR = buildsym.h call-cmds.h coff-solib.h defs.h environ.h \
+       $(gdbcmd_h) \
        $(gdbcore_h) gdb-stabs.h $(inferior_h) language.h minimon.h monitor.h \
        objfiles.h parser-defs.h partial-stab.h serial.h signals.h solib.h \
        symfile.h stabsread.h target.h terminal.h typeprint.h xcoffsolib.h \
@@ -386,7 +386,7 @@ HFILES = buildsym.h call-cmds.h coff-solib.h defs.h environ.h $(gdbcmd_h) \
        config/m68k/tm-m68k.h config/pa/tm-hppa.h config/i960/tm-i960.h \
        config/sparc/tm-sparc.h config/tm-sunos.h config/tm-sysv4.h \
        config/m68k/xm-m68k.h config/sparc/xm-sparc.h config/xm-sysv4.h \
-       config/vax/xm-vax.h config/nm-m3.h config/nm-trash.h $(udiheaders) \
+       config/vax/xm-vax.h config/nm-m3.h config/nm-trash.h \
        29k-share/udi/udiids.h 29k-share/udi_soc nindy-share/b.out.h \
        nindy-share/block_io.h nindy-share/coff.h \
        nindy-share/env.h nindy-share/stop.h \
@@ -395,6 +395,11 @@ HFILES = buildsym.h call-cmds.h coff-solib.h defs.h environ.h $(gdbcmd_h) \
        vx-share/xdr_ptrace.h vx-share/xdr_rdb.h thread.h \
        $(remote_utils_h)
 
+# Header files that already have srcdir in them.
+
+HFILES_WITH_SRCDIR = $(udiheaders)
+
+
 # GDB "info" files, which should be included in their entirety
 INFOFILES = gdb.info*
 
@@ -417,9 +422,12 @@ DEPFILES = $(TDEPFILES) $(XDEPFILES) $(SER_HARDWIRE) $(NATDEPFILES) $(REMOTE_O)
 SOURCES = $(SFILES) $(ALLDEPFILES) $(YYFILES)
 # Don't include YYFILES (*.tab.c) because we already include *.y in SFILES,
 # and it's more useful to see it in the .y file.
-TAGFILES = $(SFILES) $(HFILES) $(ALLDEPFILES) $(ALLPARAM) $(POSSLIBS) 
+TAGFILES_NO_SRCDIR = $(SFILES) $(HFILES_NO_SRCDIR) $(ALLDEPFILES) \
+       $(ALLPARAM) $(POSSLIBS)
+TAGFILES_WITH_SRCDIR = $(HFILES_WITH_SRCDIR)
 
-TARFILES = $(SFILES) $(HFILES) $(NONSRC) $(ALLDEPFILES) $(ALLCONFIG) \
+TARFILES = $(SFILES) $(HFILES_NO_SRCDIR) $(HFILES_WITH_SRCDIR) \
+       $(NONSRC) $(ALLDEPFILES) $(ALLCONFIG) \
        $(ALLPARAM) $(INFOFILES) $(POSSLIBS) $(REMOTE_EXAMPLES)
 
 
@@ -432,7 +440,7 @@ OBS =       version.o main.o blockframe.o breakpoint.o findvar.o stack.o thread.o \
        dwarfread.o mipsread.o stabsread.o core.o c-lang.o ch-lang.o m2-lang.o \
        complaints.o typeprint.o c-typeprint.o ch-typeprint.o m2-typeprint.o \
        c-valprint.o cp-valprint.o ch-valprint.o m2-valprint.o nlmread.o \
-       serial.o
+       serial.o mdebugread.o
 
 RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES)
 
@@ -459,8 +467,16 @@ all: gdb
        @$(MAKE) $(FLAGS_TO_PASS) DO=all "DODIRS=`echo $(SUBDIRS) | sed 's/testsuite//'`" subdir_do
 
 installcheck:
+
+# The check target can not use subdir_do, because subdir_do does not
+# use TARGET_FLAGS_TO_PASS.
 check: force
-       @rootme=`pwd`; export rootme; $(MAKE) $(TARGET_FLAGS_TO_PASS) DO=check DODIRS=testsuite subdir_do
+       @if [ -f testsuite/Makefile ]; then \
+         rootme=`pwd`; export rootme; \
+         cd testsuite; \
+         $(MAKE) $(TARGET_FLAGS_TO_PASS) check; \
+       else true; fi
+
 info dvi install-info clean-info: force
        @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
 
@@ -601,14 +617,21 @@ kdb:      $(NTSSTART) $(OBS) $(NTSOBS) $(ADD_DEPS) $(CDEPS)
          -lc $(CLIBS)
 
 # Put the proper machine-specific files first, so M-. on a machine
-# specific routine gets the one for the correct machine.
-TAGS:  
+# specific routine gets the one for the correct machine.  (FIXME: those
+# files go in twice; we should be removing them from the main list).
+
+# TAGS depends on all the files that go into it so you can rebuild TAGS
+# with `make TAGS' and not have to say `rm TAGS' first.
+
+TAGS: $(TAGFILES_NO_SRCDIR) $(TAGFILES_WITH_SRCDIR)
        etags `find $(srcdir)/config \( -name $(TM_FILE) \
                -o -name $(XM_FILE) \
                -o -name $(NAT_FILE) \) -print` \
-       `(for i in $(DEPFILES) $(TAGFILES); do \
+       `(for i in $(DEPFILES) $(TAGFILES_NO_SRCDIR); do \
                echo $(srcdir)/$$i ; \
-       done) | sed -e 's/\.o$$/\.c/'` \
+       done ; for i in $(TAGFILES_WITH_SRCDIR); do \
+               echo $$i ; \
+       done) | sed -e 's/\.o$$/\.c/'`
 
 tags: TAGS
 
@@ -851,11 +874,12 @@ ALLDEPFILES = 29k-share/udi/udip2soc.c 29k-share/udi/udr.c \
        go32-xdep.c gould-pinsn.c gould-xdep.c h8300-tdep.c h8500-tdep.c \
        hp300ux-nat.c hppa-pinsn.c hppa-tdep.c hppab-nat.c hppah-nat.c \
        i386-pinsn.c i386-tdep.c i386b-nat.c i386mach-nat.c i386v-nat.c \
-       i386aix-nat.c i386m3-nat.c i386v4-nat.c i386ly-nat.c i386ly-tdep.c \
+       i386aix-nat.c i386m3-nat.c i386v4-nat.c i386ly-tdep.c \
        i387-tdep.c \
        i960-pinsn.c i960-tdep.c \
-       infptrace.c inftarg.c irix4-nat.c isi-xdep.c m3-nat.c \
-       m68k-pinsn.c m68k-tdep.c m68kly-nat.c \
+       infptrace.c inftarg.c irix4-nat.c isi-xdep.c \
+       lynx-nat.c m3-nat.c \
+       m68k-pinsn.c m68k-tdep.c \
        m88k-nat.c m88k-pinsn.c m88k-tdep.c mips-nat.c mips-pinsn.c \
        mips-tdep.c mipsm3-nat.c news-xdep.c \
        nindy-share/Onindy.c nindy-share/nindy.c \
@@ -1223,6 +1247,10 @@ main.o: main.c $(bfd_h) $(getopt_h) $(readline_headers) call-cmds.h \
 maint.o: maint.c $(defs_h) $(gdbcmd_h) $(gdbtypes_h) $(symtab_h) language.h \
        $(expression_h)
 
+mdebugread.o: mdebugread.c buildsym.h complaints.h $(bfd_h) $(defs_h) \
+       $(expression_h) gdb-stabs.h $(gdbcore_h) $(gdbtypes_h) language.h \
+       objfiles.h partial-stab.h stabsread.h symfile.h $(symtab_h)
+
 mem-break.o: mem-break.c $(defs_h) 
 
 minsyms.o: minsyms.c $(bfd_h) $(defs_h) objfiles.h symfile.h \
index 7d240444cfe2e6a2061e9f341df690b13121ca1e..cf5fbcab3bfd8678a916f06a14c7c7a046655c3f 100644 (file)
@@ -100,9 +100,11 @@ CORE_ADDR skip_prologue ();
 
 #define INVALID_FLOAT(p, len) 0   /* Just a first guess; not checked */
 
-/* Say how long (ordinary) registers are.  */
+/* Say how long (ordinary) registers are.  This is a piece of bogosity
+   used in push_word and a few other places; REGISTER_RAW_SIZE is the
+   real way to know how big a register is.  */
 
-#define REGISTER_TYPE long
+#define REGISTER_SIZE 4
 
 /* Allow the register declarations here to be overridden for remote
    kernel debugging.  */
index e3de3d56bc7184746b9b679c1209cb41a2d812d6..a0f60c4aa8a351a95c224b3e118bc68320b3ecce 100644 (file)
@@ -93,9 +93,11 @@ extern CORE_ADDR h8300_skip_prologue ();
 
 #define INVALID_FLOAT(p, len) 0   /* Just a first guess; not checked */
 
-/* Say how long registers are.  */
+/* Say how long (ordinary) registers are.  This is a piece of bogosity
+   used in push_word and a few other places; REGISTER_RAW_SIZE is the
+   real way to know how big a register is.  */
 
-#define REGISTER_TYPE  unsigned short
+#define REGISTER_SIZE 2
 
 #define NUM_REGS 13  
 
index 14d476fa133acb008c8342cde36d1c8806c239ab..0e4494b32e94f57ef25c2ad3f6281907bcf1351d 100644 (file)
@@ -75,9 +75,11 @@ extern CORE_ADDR h8500_skip_prologue ();
 
 #define INVALID_FLOAT(p, len) 0   /* Just a first guess; not checked */
 
-/* Say how long registers are.  */
+/* Say how long (ordinary) registers are.  This is a piece of bogosity
+   used in push_word and a few other places; REGISTER_RAW_SIZE is the
+   real way to know how big a register is.  */
 
-#define REGISTER_TYPE  unsigned long
+#define REGISTER_SIZE 4
 
 /* Say how much memory is needed to store a copy of the register set */
 
index 89c1c61666537f66ae0cb0b69ebe9e806e0b0e54..3f7d650e7cd3876488f167064fb40121f51323fd 100644 (file)
@@ -84,9 +84,11 @@ i386_skip_prologue PARAMS ((int));
 
 #define INVALID_FLOAT(p, len) (0)
 
-/* Say how long (ordinary) registers are.  */
+/* Say how long (ordinary) registers are.  This is a piece of bogosity
+   used in push_word and a few other places; REGISTER_RAW_SIZE is the
+   real way to know how big a register is.  */
 
-#define REGISTER_TYPE long
+#define REGISTER_SIZE 4
 
 /* Number of machine registers */
 
index 9c1f6a88626852e72a3e4075ce4d04ad6099676a..29a1201fe99311e562653f67495ebda9ec72d8fa 100644 (file)
@@ -92,9 +92,11 @@ i386_skip_prologue PARAMS ((int));
 /* Name of the builtin type for the LONGEST type above. */
 #define BUILTIN_TYPE_LONGEST builtin_type_long
 
-/* Say how long (ordinary) registers are.  */
+/* Say how long (ordinary) registers are.  This is a piece of bogosity
+   used in push_word and a few other places; REGISTER_RAW_SIZE is the
+   real way to know how big a register is.  */
 
-#define REGISTER_TYPE long
+#define REGISTER_SIZE 4
 
 /* Number of machine registers */
 
index 12f844e383a79ed932d7b484ec6dbdb5fab2ebcc..d1513f7da2376d246c19ef71d3494d25a82a5206 100644 (file)
@@ -73,9 +73,11 @@ extern CORE_ADDR saved_pc_after_call ();
 
 #define INVALID_FLOAT(p, len) (0)
 
-/* How long (ordinary) registers are */
+/* Say how long (ordinary) registers are.  This is a piece of bogosity
+   used in push_word and a few other places; REGISTER_RAW_SIZE is the
+   real way to know how big a register is.  */
 
-#define REGISTER_TYPE long
+#define REGISTER_SIZE 4
 
 /* Number of machine registers */
 #define NUM_REGS 40
index 14b71cff79c1b6706d6b06330fd20f872007c677..c7f64e0415d97fa13158c4f2626b971b6bf68f33 100644 (file)
@@ -95,9 +95,11 @@ extern CORE_ADDR m68k_saved_pc_after_call PARAMS ((struct frame_info *));
 
 #define INVALID_FLOAT(p, len) 0   /* Just a first guess; not checked */
 
-/* Say how long registers are.  */
+/* Say how long (ordinary) registers are.  This is a piece of bogosity
+   used in push_word and a few other places; REGISTER_RAW_SIZE is the
+   real way to know how big a register is.  */
 
-#define REGISTER_TYPE long
+#define REGISTER_SIZE 4
 
 #define REGISTER_BYTES_FP (16*4 + 8 + 8*12 + 3*4)
 #define REGISTER_BYTES_NOFP (16*4 + 8)
index 092045e31bf72c51b13030f5c76026bdaf36e84e..23ace234c13fda8c97e4c021346602d0a7e51e83 100644 (file)
@@ -88,4 +88,4 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 /* Number of registers in a ptrace_getfpregs call. */
 
 #define VX_SIZE_FPREGS (8 * REGISTER_RAW_SIZE (FP0_REGNUM) \
-                       + (3 * sizeof (REGISTER_TYPE)))
+                       + (3 * REGISTER_SIZE))
index 77b902badaa220408cc26a79070abd64d433f941..9b50dcf74cb7979576968ce7bba47754ae9590f8 100644 (file)
@@ -102,9 +102,11 @@ extern CORE_ADDR skip_prologue ();
 
 #define INVALID_FLOAT(p,len) 0
 
-/* Say how long (ordinary) registers are.  */
+/* Say how long (ordinary) registers are.  This is a piece of bogosity
+   used in push_word and a few other places; REGISTER_RAW_SIZE is the
+   real way to know how big a register is.  */
 
-#define REGISTER_TYPE long
+#define REGISTER_SIZE 4
 
 /* Number of machine registers */
 
index 916dba33994598a5e97200c137df548a5cd2a72e..5bc947f882739fe1349606fb072315cf757eb1fb 100644 (file)
@@ -83,9 +83,11 @@ extern int in_sigtramp PARAMS ((CORE_ADDR, char *));
 
 #define INVALID_FLOAT(p,l) 0
 
-/* Say how long (all) registers are.  */
+/* Say how long (ordinary) registers are.  This is a piece of bogosity
+   used in push_word and a few other places; REGISTER_RAW_SIZE is the
+   real way to know how big a register is.  */
 
-#define REGISTER_TYPE long
+#define REGISTER_SIZE 4
 
 /* Number of machine registers */
 
index b6d29c17d8d5a6d7c9bc883cdff9ed38470d5b06..ec3505cec580ee09e8bb69034bc65137fce8debd 100644 (file)
@@ -75,9 +75,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #define NS32K_SVC_IMMED_OPERANDS
 
-/* Say how long (ordinary) registers are.  */
+/* Say how long (ordinary) registers are.  This is a piece of bogosity
+   used in push_word and a few other places; REGISTER_RAW_SIZE is the
+   real way to know how big a register is.  */
 
-#define REGISTER_TYPE long
+#define REGISTER_SIZE 4
 
 /* Number of machine registers */
 
index 3e33d25e1885ef03afea884a963207d853a7b900..7847041d1a8133764b3e4d99ae2052e4b1f41955 100644 (file)
@@ -87,9 +87,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
                NaD (*(double *) p))
 #endif /* INVALID_FLOAT */
 
-/* Say how long (ordinary) registers are.  */
+/* Say how long (ordinary) registers are.  This is a piece of bogosity
+   used in push_word and a few other places; REGISTER_RAW_SIZE is the
+   real way to know how big a register is.  */
 
-#define REGISTER_TYPE long
+#define REGISTER_SIZE 4
 
 /* Number of machine registers */
 
index 3dd646dd7fe8739e43c9aaa0538fddabdfbb11d0..23d9fe5a9b45b826285f6a6acb39cf9221f7785d 100644 (file)
@@ -120,9 +120,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 /* Name of the builtin type for the LONGEST type above. */
 #define BUILTIN_TYPE_LONGEST builtin_type_long
 
-/* Say how long (ordinary) registers are.  */
+/* Say how long (ordinary) registers are.  This is a piece of bogosity
+   used in push_word and a few other places; REGISTER_RAW_SIZE is the
+   real way to know how big a register is.  */
 
-#define REGISTER_TYPE long
+#define REGISTER_SIZE 4
 
 /* Number of machine registers */
 
@@ -217,23 +219,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #define MAX_REGISTER_VIRTUAL_SIZE 8
 
-/* Nonzero if register N requires conversion
-   from raw format to virtual format.  */
-
-#define REGISTER_CONVERTIBLE(N) 0
-
-/* Convert data from raw format for register REGNUM
-   to virtual format for register REGNUM.  */
-
-#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM, FROM, TO) \
-{ memcpy ((TO), (FROM), (REGNUM) < FP4_REGNUM ? 4 : 8); }
-
-/* Convert data from virtual format for register REGNUM
-   to raw format for register REGNUM.  */
-
-#define REGISTER_CONVERT_TO_RAW(REGNUM, FROM, TO) \
-{ memcpy ((TO), (FROM), (REGNUM) < FP4_REGNUM ? 4 : 8); }
-
 /* Return the GDB type object for the "standard" data type
    of data in register N.  */
 
@@ -257,8 +242,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
    of type TYPE, given in virtual format.  */
 
 #define STORE_RETURN_VALUE(TYPE,VALBUF) \
-  write_register_bytes (TYPE_LENGTH(TYPE) > 4 ? FP4_REGNUM :28,                \
-                       VALBUF, TYPE_LENGTH (TYPE))
+  write_register_bytes ((TYPE_LENGTH(TYPE) > 4 \
+                        ? REGISTER_BYTE (FP4_REGNUM) \
+                        : REGISTER_BYTE (28)),         \
+                       (VALBUF), TYPE_LENGTH (TYPE))
 
 /* Extract from an array REGBUF containing the (raw) register state
    the address in which a function should return its structure value,
@@ -565,5 +552,8 @@ struct obj_unwind_info {
 
 #define OBJ_UNWIND_INFO(obj) ((struct obj_unwind_info *)obj->obj_private)
 
+extern CORE_ADDR target_read_pc PARAMS ((void));
+extern void target_write_pc PARAMS ((CORE_ADDR));
+
 #define TARGET_READ_PC() target_read_pc ()
 #define TARGET_WRITE_PC(v) target_write_pc (v)
index 21d7a4a17ec8d0f1cd216efaad145865fdd66168..b5987e1b1b69016df860de3c65fcc81776f85c8d 100644 (file)
@@ -72,8 +72,11 @@ extern CORE_ADDR sh_skip_prologue ();
 
 #define INVALID_FLOAT(p, len) 0   /* Just a first guess; not checked */
 
-/* Say how long registers are.  */
-#define REGISTER_TYPE  long
+/* Say how long (ordinary) registers are.  This is a piece of bogosity
+   used in push_word and a few other places; REGISTER_RAW_SIZE is the
+   real way to know how big a register is.  */
+
+#define REGISTER_SIZE 4
 
 /* Say how much memory is needed to store a copy of the register set */
 #define REGISTER_BYTES    (NUM_REGS*4) 
index 960ab7524085b4b03a303f84d74d20eaa2dc603f..b71f7f2b5942ff274463d90c8b35b40c6eff0410 100644 (file)
@@ -126,9 +126,11 @@ extern CORE_ADDR sparc_pc_adjust();
 
 #define INVALID_FLOAT(p, len) 0   /* Just a first guess; not checked */
 
-/* Say how long (ordinary) registers are.  */
+/* Say how long (ordinary) registers are.  This is a piece of bogosity
+   used in push_word and a few other places; REGISTER_RAW_SIZE is the
+   real way to know how big a register is.  */
 
-#define REGISTER_TYPE long
+#define REGISTER_SIZE 4
 
 /* Number of machine registers */
 
index 6d39f752e53ef2cf7d41264883206eaae1a62294..16718707ad6774305e026aaf37d5dd6757cf3fc8 100644 (file)
@@ -89,9 +89,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #define INVALID_FLOAT(p, len) ((*(short *) p & 0xff80) == 0x8000)
 
-/* Say how long (ordinary) registers are.  */
+/* Say how long (ordinary) registers are.  This is a piece of bogosity
+   used in push_word and a few other places; REGISTER_RAW_SIZE is the
+   real way to know how big a register is.  */
 
-#define REGISTER_TYPE long
+#define REGISTER_SIZE 4
 
 /* Number of machine registers */
 
index b735973cfbafd366994ead401521814eea9660a6..722c1afb6fd9ff703b07e2ff48f8c39ae290cce0 100644 (file)
@@ -69,9 +69,11 @@ extern CORE_ADDR mz8k_skip_prologue PARAMS ((CORE_ADDR ip));
 
 #define INVALID_FLOAT(p, len) 0   /* Just a first guess; not checked */
 
-/* Say how long registers are.  */
+/* Say how long (ordinary) registers are.  This is a piece of bogosity
+   used in push_word and a few other places; REGISTER_RAW_SIZE is the
+   real way to know how big a register is.  */
 
-#define REGISTER_TYPE unsigned int
+#define REGISTER_SIZE 4
 
 #define NUM_REGS       23   /* 16 registers + 1 ccr + 1 pc + 3 debug
                                regs + fake fp + fake sp*/
index 794a934c7400cb20fea31c2c2d3aabf7a5acbe83..7dbac6fa4a70173008ec7e93cbb62ed9e9788be9 100644 (file)
@@ -193,7 +193,7 @@ static struct type *vector_type ();
 static long *read_vector_register ();
 static long *read_vector_register_1 ();
 static void write_vector_register ();
-static REGISTER_TYPE read_comm_register ();
+static unsigned LONGEST read_comm_register ();
 static void write_comm_register ();
 static void convex_cont_command ();
 static void thread_continue ();
@@ -442,7 +442,7 @@ read_vector_register_1 (reg)
 static void
 write_vector_register (reg, element, val)
     int reg, element;
-    REGISTER_TYPE val;
+    unsigned LONGEST val;
 {
   if (have_inferior_p ())
     {
@@ -481,7 +481,7 @@ write_vector_register (reg, element, val)
 
 /* Return the contents of communication register NUM.  */ 
 
-static REGISTER_TYPE 
+static unsigned LONGEST 
 read_comm_register (num)
      int num;
 {
@@ -503,7 +503,7 @@ read_comm_register (num)
 static void
 write_comm_register (num, val)
      int num;
-     REGISTER_TYPE val;
+     unsigned LONGEST val;
 {
   if (have_inferior_p ())
     {
index 8508f271a26138894233ae2b61fb38120f61a38c..15060a64cea75a7685f7a5542b7a1db02dfe4df0 100644 (file)
@@ -893,13 +893,8 @@ void store_floating PARAMS ((void *, int, double));
 extern CORE_ADDR
 push_bytes PARAMS ((CORE_ADDR, char *, int));
 
-/* In some modules, we don't have a definition of REGISTER_TYPE yet, so we
-   must avoid prototyping this function for now.  FIXME.  Should be:
 extern CORE_ADDR
-push_word PARAMS ((CORE_ADDR, REGISTER_TYPE));
- */
-extern CORE_ADDR
-push_word ();
+push_word PARAMS ((CORE_ADDR, unsigned LONGEST));
 
 /* Some parts of gdb might be considered optional, in the sense that they
    are not essential for being able to build a working, usable debugger
index e8ee10da4734ba50474f70945a8b2a36fb7a8c43..93509b6323d587af681e8a4e238106b203635738 100644 (file)
@@ -961,7 +961,7 @@ hppa_push_arguments (nargs, args, sp, struct_return, struct_addr)
 
 CORE_ADDR
 hppa_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
-     REGISTER_TYPE *dummy;
+     char *dummy;
      CORE_ADDR pc;
      CORE_ADDR fun;
      int nargs;
@@ -985,10 +985,30 @@ hppa_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p)
 
   sr4export_addr = SYMBOL_VALUE_ADDRESS (msymbol);
 
-  dummy[9] = deposit_21 (fun >> 11, dummy[9]);
-  dummy[10] = deposit_14 (fun & MASK_11, dummy[10]);
-  dummy[12] = deposit_21 (sr4export_addr >> 11, dummy[12]);
-  dummy[13] = deposit_14 (sr4export_addr & MASK_11, dummy[13]);
+  store_unsigned_integer
+    (&dummy[9*REGISTER_SIZE],
+     REGISTER_SIZE,
+     deposit_21 (fun >> 11,
+                extract_unsigned_integer (&dummy[9*REGISTER_SIZE],
+                                          REGISTER_SIZE)));
+  store_unsigned_integer
+    (&dummy[10*REGISTER_SIZE],
+     REGISTER_SIZE,
+     deposit_14 (fun & MASK_11,
+                extract_unsigned_integer (&dummy[10*REGISTER_SIZE],
+                                          REGISTER_SIZE)));
+  store_unsigned_integer
+    (&dummy[12*REGISTER_SIZE],
+     REGISTER_SIZE,
+     deposit_21 (sr4export_addr >> 11,
+                extract_unsigned_integer (&dummy[12*REGISTER_SIZE],
+                                          REGISTER_SIZE)));
+  store_unsigned_integer
+    (&dummy[13*REGISTER_SIZE],
+     REGISTER_SIZE,
+     deposit_14 (sr4export_addr & MASK_11,
+                extract_unsigned_integer (&dummy[13*REGISTER_SIZE],
+                                          REGISTER_SIZE)));
 
   write_register (22, pc);
 
@@ -1115,7 +1135,6 @@ pa_print_fp_reg (i)
 {
   unsigned char raw_buffer[MAX_REGISTER_RAW_SIZE];
   unsigned char virtual_buffer[MAX_REGISTER_VIRTUAL_SIZE];
-  REGISTER_TYPE val;
 
   /* Get the data in raw format.  */
   read_relative_register_raw_bytes (i, raw_buffer);
index 2ab37c50b2c3da7e8b0f2d8e1a7397c5c310c0bd..7f1d47b159386174ad9e764c5f5db72448ed3c95 100644 (file)
@@ -87,13 +87,13 @@ static int reg_offset[] =
 #define FETCH_REGS(state, regnum, count) \
   memcpy (&registers[REGISTER_BYTE (regnum)], \
          REG_ADDRESS (state, regnum), \
-         count*sizeof (REGISTER_TYPE))
+         count*REGISTER_SIZE)
 
 /* Store COUNT contiguous registers to thread STATE starting from REGNUM */
 #define STORE_REGS(state, regnum, count) \
   memcpy (REG_ADDRESS (state, regnum), \
          &registers[REGISTER_BYTE (regnum)], \
-         count*sizeof (REGISTER_TYPE))
+         count*REGISTER_SIZE)
 \f
 /*
  * Fetch inferiors registers for gdb.
index b574651ef49a7335698dd67bee77dccbb3102e1d..b16c52313de4977a885fa225f0df55c4716910bf 100644 (file)
@@ -211,7 +211,8 @@ m88k_register_u_addr (blockend, regnum)
     case 28:
     case 29:
     case 30:
-    case 31:          return (ustart + ((int) &u.pt_r0 - (int) &u) + sizeof(REGISTER_TYPE) * regnum);
+    case 31:
+      return (ustart + ((int) &u.pt_r0 - (int) &u) + REGISTER_SIZE * regnum);
     case PSR_REGNUM:  return (ustart + ((int) &u.pt_psr - (int) &u));
     case FPSR_REGNUM: return (ustart + ((int) &u.pt_fpsr - (int) &u));
     case FPCR_REGNUM: return (ustart + ((int) &u.pt_fpcr - (int) &u));
@@ -224,7 +225,7 @@ m88k_register_u_addr (blockend, regnum)
               give it zero */
            return (ustart + ((int) &u.pt_r0 - (int) &u));
        else
-           return (blockend + sizeof (REGISTER_TYPE) * regnum);
+           return (blockend + REGISTER_SIZE * regnum);
     }
 }
 
index 0ef524c8ac42ee291cd6309135a52adbe109c9bb..a932e4c6aeb39afa0e3f40c4c7b46acdc065faf9 100644 (file)
@@ -768,9 +768,9 @@ collect_returned_value (rval, value_type, struct_return, nargs, args)
 static void
 write_word (sp, word)
      CORE_ADDR sp;
-     REGISTER_TYPE word;
+     unsigned LONGEST word;
 {
-  register int len = sizeof (REGISTER_TYPE);
+  register int len = REGISTER_SIZE;
   char buffer[MAX_REGISTER_RAW_SIZE];
 
   store_unsigned_integer (buffer, len, word);
index 34434a6de2d8cdc9ac63c0f70084a71f67cdbce7..04f8139a8130e03592f5a5733ba12046dbddb901 100644 (file)
@@ -122,13 +122,13 @@ static int reg_offset[] =
 #define FETCH_REGS(state, regnum, count) \
   memcpy (&registers[REGISTER_BYTE (regnum)], \
          (char *)state+reg_offset[ regnum ], \
-         count*sizeof (REGISTER_TYPE))
+         count*REGISTER_SIZE)
 
 /* Store COUNT contiguous registers to thread STATE starting from REGNUM */
 #define STORE_REGS(state, regnum, count) \
   memcpy ((char *)state+reg_offset[ regnum ], \
          &registers[REGISTER_BYTE (regnum)], \
-         count*sizeof (REGISTER_TYPE))
+         count*REGISTER_SIZE)
 
 #define REGS_ALL    -1
 #define REGS_NORMAL  1
index 4002e45a02dd286c08bbe11be35deed7616337d8..e652402819c29f0f3da2b842d0108946b7aeb863 100644 (file)
@@ -60,13 +60,13 @@ static int reg_offset[] =
 #define FETCH_REGS(state, regnum, count) \
   memcpy (&registers[REGISTER_BYTE (regnum)], \
          (char *)state+reg_offset[ regnum ], \
-         count*sizeof (REGISTER_TYPE))
+         count*REGISTER_SIZE)
 
 /* Store COUNT contiguous registers to thread STATE starting from REGNUM */
 #define STORE_REGS(state, regnum, count) \
   memcpy ((char *)state+reg_offset[ regnum ], \
          &registers[REGISTER_BYTE (regnum)], \
-         count*sizeof (REGISTER_TYPE))
+         count*REGISTER_SIZE)
 \f
 /* 4.4 bfd support function */
 /* jtv@hut.fi: UNIMPLEMENTED!!!!! */
index e1f36036bbd4559f53e19e2ada4f633f062c946a..a1806fc8b519bf7291b989dcb5463003f60fd3c9 100644 (file)
@@ -425,8 +425,6 @@ static void
 bug_fetch_register(regno)
      int regno;
 {
-  REGISTER_TYPE regval;
-
   sr_check_open();
 
   if (regno == -1)
@@ -444,12 +442,15 @@ bug_fetch_register(regno)
     }
   else if (regno < XFP_REGNUM)
     {
-      sr_write("rs ", 3);
-      sr_write_cr(get_reg_name(regno));
-      sr_expect("=");
-      regval = sr_get_hex_word();
-      gr_expect_prompt();
-      supply_register(regno, (char *) &regval);
+      char buffer[MAX_REGISTER_RAW_SIZE];
+
+      sr_write ("rs ", 3);
+      sr_write_cr (get_reg_name(regno));
+      sr_expect ("=");
+      store_unsigned_integer (buffer, REGISTER_RAW_SIZE (regno),
+                             sr_get_hex_word());
+      gr_expect_prompt ();
+      supply_register (regno, buffer);
     }
   else
     {
index 27611044fff950c165dbfc2f3124db7d10113c49..4a76d3d7cc83e71c640d332cab3f32684a642914 100644 (file)
@@ -868,7 +868,7 @@ hms_fetch_register (dummy)
   int s;
   int gottok;
 
-  REGISTER_TYPE reg[NUM_REGS];
+  unsigned LONGEST reg[NUM_REGS];
   int foo[8];
 
   check_open ();
index 5322e765a0dff1069b1c7571b9dc4a62cb1ff173..7425eafec474a1a434fdd99109f0279e0f01a41a 100644 (file)
@@ -1045,7 +1045,7 @@ static void
 mips_fetch_registers (regno)
      int regno;
 {
-  REGISTER_TYPE val;
+  unsigned LONGEST val;
   int err;
 
   if (regno == -1)
index e49d0eda1fb3e63e6b96b34b0b43a7c74f901c85..a45f24fe9c7ad307381a1dd2efc0932bfef07276 100644 (file)
@@ -459,7 +459,7 @@ vx_write_register (regno)
 
   in_data.bytes = registers;
 
-  in_data.len = VX_NUM_REGS * sizeof (REGISTER_TYPE);
+  in_data.len = VX_NUM_REGS * REGISTER_SIZE;
 
   /* XXX change second param to be a proc number */
   status = net_ptrace_clnt_call (PTRACE_SETREGS, &ptrace_in, &ptrace_out);
This page took 0.043324 seconds and 4 git commands to generate.