aboutsummaryrefslogtreecommitdiff
path: root/gdb/valprint.c
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1991-07-14 07:48:06 +0000
committerJohn Gilmore <gnu@cygnus>1991-07-14 07:48:06 +0000
commit36b9d39cf464e3511c08399cbce1da7e098fde69 (patch)
tree81a828cb99995b744be558d385040734173ea9f3 /gdb/valprint.c
parent116a34785af00cec25f3db9427b5abb84e8e408e (diff)
downloadfsf-binutils-gdb-36b9d39cf464e3511c08399cbce1da7e098fde69.zip
fsf-binutils-gdb-36b9d39cf464e3511c08399cbce1da7e098fde69.tar.gz
fsf-binutils-gdb-36b9d39cf464e3511c08399cbce1da7e098fde69.tar.bz2
* findvar.c (find_var_value): Handle &function better.
* TODO: Document work needed on &fn and &array. * printcmd.c (print_address_symbolic): New arg is the prefix to print if a name is printed. (print_address_demangle): Honor "set print address" now. Use new arg above to improve spacing of output. * valprint.c (val_print): When printing function pointers, print symbolic form too. * breakpoint.c (breakpoint_1): Use new print_address_symbolic.
Diffstat (limited to 'gdb/valprint.c')
-rw-r--r--gdb/valprint.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/gdb/valprint.c b/gdb/valprint.c
index d91bada..ed2d7b6 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -3,19 +3,19 @@
This file is part of GDB.
-GDB is free software; you can redistribute it and/or modify
+This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
-any later version.
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
-GDB is distributed in the hope that it will be useful,
+This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GDB; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <stdio.h>
#include <string.h>
@@ -1087,11 +1087,13 @@ val_print (type, valaddr, address, stream, format,
print_scalar_formatted (valaddr, type, format, 0, stream);
break;
}
+ /* FIXME, we should consider, at least for ANSI C language, eliminating
+ the distinction made between FUNCs and POINTERs to FUNCs. */
fprintf_filtered (stream, "{");
type_print (type, "", stream, -1);
fprintf_filtered (stream, "} ");
- if (addressprint)
- fprintf_filtered (stream, "0x%x", address);
+ /* Try to print what function it points to, and its address. */
+ print_address_demangle (address, stream, demangle);
break;
case TYPE_CODE_INT:
@@ -1884,9 +1886,14 @@ _initialize_valprint ()
add_prefix_cmd ("print", no_class, set_print,
"Generic command for setting how things print.",
&setprintlist, "set print ", 0, &setlist);
+ add_alias_cmd ("p", "print", no_class, 1, &setlist);
+ add_alias_cmd ("pr", "print", no_class, 1, &setlist); /* prefer set print
+ to set prompt */
add_prefix_cmd ("print", no_class, show_print,
"Generic command for showing print settings.",
&showprintlist, "show print ", 0, &showlist);
+ add_alias_cmd ("p", "print", no_class, 1, &showlist);
+ add_alias_cmd ("pr", "print", no_class, 1, &showlist);
add_show_from_set
(add_set_cmd ("elements", no_class, var_uinteger, (char *)&print_max,