From: John Gilmore Date: Tue, 2 Feb 1993 08:21:50 +0000 (+0000) Subject: * printcmd.c (print_frame_args, print_frame_nameless_args): X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7dc15bb7501f4b3d2d77176447c4ef53b334053e;p=binutils-gdb.git * printcmd.c (print_frame_args, print_frame_nameless_args): Let print_frame_nameless_args decide whether there are any, laying groundwork for possibly later printing 29K args for functions where we have tag words but no symbols. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6de2a1fa8b8..1aac2776dc5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +Tue Feb 2 00:19:08 1993 John Gilmore (gnu@cygnus.com) + + * printcmd.c (print_frame_args, print_frame_nameless_args): + Let print_frame_nameless_args decide whether there are any, + laying groundwork for possibly later printing 29K args for + functions where we have tag words but no symbols. + Mon Feb 1 18:09:58 1993 Roland H. Pesch (pesch@fowanton.cygnus.com) * Makefile.in: fix GDB doc targets for new doc subdir structure diff --git a/gdb/printcmd.c b/gdb/printcmd.c index d8bc20f7f33..3e878a68885 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -305,6 +305,7 @@ print_formatted (val, format, size) default: if (format == 0 || TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_ARRAY + || TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_STRING || TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_STRUCT || TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_UNION || VALUE_REPEATED (val)) @@ -703,6 +704,11 @@ validate_format (fmt, cmdname) fmt.format, cmdname); } +/* Evaluate string EXP as an expression in the current language and + print the resulting value. EXP may contain a format specifier as the + first argument ("/x myvar" for example, to print myvar in hex). + */ + static void print_command_1 (exp, inspect, voidprint) char *exp; @@ -1526,48 +1532,59 @@ print_frame_args (func, fi, num, stream) if (num != -1) { long start; - CORE_ADDR addr; if (highest_offset == -1) start = FRAME_ARGS_SKIP; else start = highest_offset; - addr = FRAME_ARGS_ADDRESS (fi); - if (addr) - print_frame_nameless_args (addr, start, num - args_printed, - first, stream); + print_frame_nameless_args (fi, start, num - args_printed, + first, stream); } } /* Print nameless args on STREAM. - ARGSADDR is the address of the arglist, START is the offset + FI is the frameinfo for this frame, START is the offset of the first nameless arg, and NUM is the number of nameless args to print. FIRST is nonzero if this is the first argument (not just the first nameless arg). */ static void -print_frame_nameless_args (argsaddr, start, num, first, stream) - CORE_ADDR argsaddr; +print_frame_nameless_args (fi, start, num, first, stream) + struct frame_info *fi; long start; int num; int first; FILE *stream; { int i; + CORE_ADDR argsaddr; + long arg_value; + for (i = 0; i < num; i++) { QUIT; +#ifdef NAMELESS_ARG_VALUE + NAMELESS_ARG_VALUE (fi, start, &arg_value); +#else + argsaddr = FRAME_ARGS_ADDRESS (fi); + if (!argsaddr) + return; + + arg_value = read_memory_integer (argsaddr + start, sizeof (int)); +#endif + if (!first) fprintf_filtered (stream, ", "); -#ifndef PRINT_TYPELESS_INTEGER - fprintf_filtered (stream, "%d", - read_memory_integer (argsaddr + start, sizeof (int))); + +#ifdef PRINT_NAMELESS_INTEGER + PRINT_NAMELESS_INTEGER (stream, arg_value); #else - PRINT_TYPELESS_INTEGER (stream, builtin_type_int, - (LONGEST) - read_memory_integer (argsaddr + start, - sizeof (int))); -#endif +#ifdef PRINT_TYPELESS_INTEGER + PRINT_TYPELESS_INTEGER (stream, builtin_type_int, (LONGEST) arg_value); +#else + fprintf_filtered (stream, "%d", arg_value); +#endif /* PRINT_TYPELESS_INTEGER */ +#endif /* PRINT_NAMELESS_INTEGER */ first = 0; start += sizeof (int); }