aboutsummaryrefslogtreecommitdiff
path: root/gdb/stack.c
diff options
context:
space:
mode:
authorgdb-3.4 <gdb@fsf.org>1989-11-05 21:02:37 +0000
committerPedro Alves <palves@redhat.com>2012-06-03 15:36:32 +0100
commit1c997a4ae86938343edb715efc3fc742c5f668fe (patch)
tree9e3c70728a3987732436b7fa4b4cfef433a0669a /gdb/stack.c
parent4187119d59afd156703cfcbc6be287c5085f1867 (diff)
downloadfsf-binutils-gdb-1c997a4ae86938343edb715efc3fc742c5f668fe.zip
fsf-binutils-gdb-1c997a4ae86938343edb715efc3fc742c5f668fe.tar.gz
fsf-binutils-gdb-1c997a4ae86938343edb715efc3fc742c5f668fe.tar.bz2
gdb-3.4
Diffstat (limited to 'gdb/stack.c')
-rw-r--r--gdb/stack.c48
1 files changed, 34 insertions, 14 deletions
diff --git a/gdb/stack.c b/gdb/stack.c
index 981348a..3762f7d 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -301,6 +301,16 @@ parse_frame_specification (frame_exp)
/* NOTREACHED */
}
+/* FRAME_ARGS_ADDRESS_CORRECT is just like FRAME_ARGS_ADDRESS except
+ that if it is unsure about the answer, it returns Frame_unknown
+ instead of guessing (this happens on the VAX, for example).
+
+ On most machines, we never have to guess about the args address,
+ so FRAME_ARGS_ADDRESS{,_CORRECT} are the same. */
+#if !defined (FRAME_ARGS_ADDRESS_CORRECT)
+#define FRAME_ARGS_ADDRESS_CORRECT FRAME_ARGS_ADDRESS
+#endif
+
/* Print verbosely the selected frame or the frame at address ADDR.
This means absolutely all information in the frame is printed. */
@@ -316,7 +326,6 @@ frame_info (addr_exp)
FRAME calling_frame;
int i, count;
char *funname = 0;
- int numargs;
if (!(have_inferior_p () || have_core_file_p ()))
error ("No inferior or core file.");
@@ -359,20 +368,31 @@ frame_info (addr_exp)
printf (" caller of frame at 0x%x", fi->next_frame);
if (fi->next_frame || calling_frame)
printf ("\n");
- printf (" Arglist at 0x%x,", FRAME_ARGS_ADDRESS (fi));
- FRAME_NUM_ARGS (i, fi);
- if (i < 0)
- printf (" args: ");
- else if (i == 0)
- printf (" no args.");
- else if (i == 1)
- printf (" 1 arg: ");
- else
- printf (" %d args: ", i);
- FRAME_NUM_ARGS (numargs, fi);
- print_frame_args (func, fi, numargs, stdout);
- printf ("\n");
+ {
+ /* Address of the argument list for this frame, or Frame_unknown. */
+ CORE_ADDR arg_list = FRAME_ARGS_ADDRESS_CORRECT (fi);
+ /* Number of args for this frame, or -1 if unknown. */
+ int numargs;
+
+ if (arg_list != Frame_unknown)
+ {
+ printf (" Arglist at 0x%x,", arg_list);
+
+ FRAME_NUM_ARGS (numargs, fi);
+ if (numargs < 0)
+ printf (" args: ");
+ else if (numargs == 0)
+ printf (" no args.");
+ else if (numargs == 1)
+ printf (" 1 arg: ");
+ else
+ printf (" %d args: ", numargs);
+ print_frame_args (func, fi, numargs, stdout);
+ printf ("\n");
+ }
+ }
+
/* The sp is special; what's returned isn't the save address, but
actually the value of the previous frame's sp. */
printf (" Previous frame's sp is 0x%x\n", fsr.regs[SP_REGNUM]);