aboutsummaryrefslogtreecommitdiff
path: root/gdb/stabsread.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1993-11-11 23:27:21 +0000
committerJeff Law <law@redhat.com>1993-11-11 23:27:21 +0000
commit91f87016039cec17692114935282d7296223ec24 (patch)
tree09d2e4526f9705d30d638e62df5fa8ebc1065a2f /gdb/stabsread.c
parent3e80841e27fd46016d2529eac7eb4f9f7cf1fc05 (diff)
downloadgdb-91f87016039cec17692114935282d7296223ec24.zip
gdb-91f87016039cec17692114935282d7296223ec24.tar.gz
gdb-91f87016039cec17692114935282d7296223ec24.tar.bz2
* printcmd.c (address_info): Use fprintf_symbol_filtered
to print the symbol name. * stabsread.c (define_symbol): Handle cfront lossage for struct/union/enums and typedefs. * partial-stab.h (case N_BINCL): Update psymtab_language as appropriate when changing subfiles. (case N_SOL): Update psymtab_language as appropriate when changing subfiles. Add typedef for structs, unions, and enums when processing C++ files.
Diffstat (limited to 'gdb/stabsread.c')
-rw-r--r--gdb/stabsread.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index 93800b4..2ebaa6c 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -1035,6 +1035,17 @@ define_symbol (valu, string, desc, type, objfile)
strlen (SYMBOL_NAME (sym)),
&objfile -> symbol_obstack);
}
+ /* The semantics of C++ state that "struct foo { ... }" also defines
+ a typedef for "foo". Unfortunately, cfront never makes the typedef
+ when translating C++ into C. We make the typedef here so that
+ "ptype foo" works as expected for cfront translated code. */
+ else if (current_subfile->language == language_cplus)
+ {
+ synonym = 1;
+ type_synonym_name = obsavestring (SYMBOL_NAME (sym),
+ strlen (SYMBOL_NAME (sym)),
+ &objfile -> symbol_obstack);
+ }
SYMBOL_TYPE (sym) = read_type (&p, objfile);