This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
gdb-1990525 : FRAME_NUM_ARGS fixes.
- To: gdb-patches@sourceware.cygnus.com (gdb-patches@sourceware.cygnus.com)
- Subject: gdb-1990525 : FRAME_NUM_ARGS fixes.
- From: "Philippe De Muyter" <phdm@macqel.be>
- Date: Tue, 1 Jun 1999 13:40:36 +0200 (CEST)
Tue Jun 1 13:36:31 1999 Philippe De Muyter <phdm@macqel.be>
* config/m68k/tm-delta68.h (FRAME_NUM_ARGS): Macro prototype fixed.
* config/m68k/tm-news.h, config/ns32k/tm-merlin.h: Ditto.
* config/ns32k/tm-umax.h (FRAME_NUM_ARGS): Old macro definition
removed; new macro prototype fixed.
--- ./gdb/config/m68k/tm-delta68.h Tue Jun 1 13:29:56 1999
+++ ./gdb/config/m68k/tm-delta68.h Tue Jun 1 12:47:10 1999
@@ -76,7 +76,7 @@
Can return -1, meaning no way to tell. */
extern int delta68_frame_num_args PARAMS ((struct frame_info *fi));
-#define FRAME_NUM_ARGS (delta68_frame_num_args ((fi)))
+#define FRAME_NUM_ARGS(fi) (delta68_frame_num_args ((fi)))
/* On M68040 versions of sysV68 R3V7.1, ptrace(PT_WRITE_I) does not clear
the processor's instruction cache as it should. */
--- ./gdb/config/m68k/tm-news.h Tue Jun 1 13:29:56 1999
+++ ./gdb/config/m68k/tm-news.h Tue Jun 1 12:49:24 1999
@@ -60,6 +60,6 @@
Can return -1, meaning no way to tell. */
extern int news_frame_num_args PARAMS ((struct frame_info *fi));
-#define FRAME_NUM_ARGS (news_frame_num_args ((fi)))
+#define FRAME_NUM_ARGS(fi) (news_frame_num_args ((fi)))
#include "m68k/tm-m68k.h"
--- ./gdb/config/ns32k/tm-merlin.h Tue Jun 1 13:29:57 1999
+++ ./gdb/config/ns32k/tm-merlin.h Tue Jun 1 12:49:51 1999
@@ -193,7 +193,7 @@
Can return -1, meaning no way to tell. */
extern int merlin_frame_num_args PARAMS ((struct frame_info *fi));
-#define FRAME_NUM_ARGS (merlin_frame_num_args ((fi)))
+#define FRAME_NUM_ARGS(fi) (merlin_frame_num_args ((fi)))
/* Return number of bytes at start of arglist that are not really args. */
--- ./gdb/config/ns32k/tm-umax.h Tue Jun 1 13:29:57 1999
+++ ./gdb/config/ns32k/tm-umax.h Tue Jun 1 13:29:13 1999
@@ -221,46 +221,6 @@
extern CORE_ADDR ns32k_get_enter_addr ();
-/* Return number of args passed to a frame.
- Can return -1, meaning no way to tell.
- Encore's C compiler often reuses same area on stack for args,
- so this will often not work properly. If the arg names
- are known, it's likely most of them will be printed. */
-
-#define FRAME_NUM_ARGS(numargs, fi) \
-{ CORE_ADDR pc; \
- CORE_ADDR enter_addr; \
- unsigned int insn; \
- unsigned int addr_mode; \
- int width; \
- \
- numargs = -1; \
- enter_addr = ns32k_get_enter_addr ((fi)->pc); \
- if (enter_addr > 0) \
- { \
- pc = (enter_addr == 1) ? \
- SAVED_PC_AFTER_CALL (fi) : \
- FRAME_SAVED_PC (fi); \
- insn = read_memory_integer (pc,2); \
- addr_mode = (insn >> 11) & 0x1f; \
- insn = insn & 0x7ff; \
- if ((insn & 0x7fc) == 0x57c && \
- addr_mode == 0x14) /* immediate */ \
- { \
- if (insn == 0x57c) /* adjspb */ \
- width = 1; \
- else if (insn == 0x57d) /* adjspw */ \
- width = 2; \
- else if (insn == 0x57f) /* adjspd */ \
- width = 4; \
- numargs = read_memory_integer (pc+2,width); \
- if (width > 1) \
- flip_bytes (&numargs, width); \
- numargs = - sign_extend (numargs, width*8) / 4;\
- } \
- } \
-}
-
/* Return number of bytes at start of arglist that are not really args. */
#define FRAME_ARGS_SKIP 8
@@ -272,7 +232,7 @@
the address we return for it IS the sp for the next frame. */
extern int umax_frame_num_args PARAMS ((struct frame_info *fi));
-#define FRAME_NUM_ARGS (umax_frame_num_args ((fi)))
+#define FRAME_NUM_ARGS(fi) (umax_frame_num_args ((fi)))
/* Things needed for making the inferior call functions. */
--- ./ns32k-tdep.c Tue Jun 1 13:29:58 1999
+++ ./ns32k-tdep.c Tue Jun 1 13:29:43 1999
@@ -100,6 +100,12 @@ merlin_frame_num_args (fi)
return numargs;
}
+
+/* Return number of args passed to a frame.
+ Can return -1, meaning no way to tell.
+ Encore's C compiler often reuses same area on stack for args,
+ so this will often not work properly. If the arg names
+ are known, it's likely most of them will be printed. */
int
umax_frame_num_args (fi)
struct frame_info *fi;