aboutsummaryrefslogtreecommitdiff
path: root/gdb/buildsym.c
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>1992-04-09 07:57:10 +0000
committerPer Bothner <per@bothner.com>1992-04-09 07:57:10 +0000
commit095db7ce4528842c75f8e015a329eca2181db3f3 (patch)
treea4cf78eea70129aa77bef5a4b5825328719a14ba /gdb/buildsym.c
parentcf9838aff0cbd72970fc630afecd7200fde487fe (diff)
downloadgdb-095db7ce4528842c75f8e015a329eca2181db3f3.zip
gdb-095db7ce4528842c75f8e015a329eca2181db3f3.tar.gz
gdb-095db7ce4528842c75f8e015a329eca2181db3f3.tar.bz2
Changes from metin@ibmpa.awdpa.ibm.com (Metin G. Ozisik).
* buildsym.c (#ifdef RS6000_TARGET): Don't create unnecessary symbols for nameless types. And, handle `R' (register parameter type) for AIX. (an extension to existing stabstring grammar). * rs6000-xdep.c: Fix typo (= should have been ==).
Diffstat (limited to 'gdb/buildsym.c')
-rw-r--r--gdb/buildsym.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 5f160be..c10edc6 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -1082,6 +1082,15 @@ define_symbol (valu, string, desc, type, objfile)
register int i;
struct type *temptype;
+#ifdef IBM6000_TARGET
+ /* We would like to eliminate nameless symbols, but keep their types.
+ E.g. stab entry ":t10=*2" should produce a type 10, which is a pointer
+ to type 2, but, should not creat a symbol to address that type. Since
+ the symbol will be nameless, there is no way any user can refer to it. */
+
+ int nameless;
+#endif
+
/* Ignore syms with empty names. */
if (string[0] == 0)
return 0;
@@ -1090,6 +1099,12 @@ define_symbol (valu, string, desc, type, objfile)
if (p == 0)
return 0;
+#ifdef IBM6000_TARGET
+ /* If a nameless stab entry, all we need is the type, not the symbol.
+ e.g. ":t10=*2" */
+ nameless = (p == string);
+#endif
+
sym = (struct symbol *)obstack_alloc (&objfile -> symbol_obstack, sizeof (struct symbol));
if (processing_gcc_compilation) {
@@ -1148,7 +1163,16 @@ define_symbol (valu, string, desc, type, objfile)
Handle Sun-style local fortran array types 'ar...' .
(gnu@cygnus.com) -- this strchr() handles them properly?
(tiemann@cygnus.com) -- 'C' is for catch. */
+
+#ifdef IBM6000_TARGET
+
+ /* 'R' is for register parameters. */
+
+ if (!strchr ("cfFGpPrStTvVXCR", *p))
+#else
+
if (!strchr ("cfFGpPrStTvVXC", *p))
+#endif
deftype = 'l';
else
deftype = *p++;
@@ -1226,6 +1250,12 @@ define_symbol (valu, string, desc, type, objfile)
SYMBOL_TYPE (sym)
= lookup_pointer_type (lookup_function_type (read_type (&p, objfile)));
}
+
+#ifdef IBM6000_TARGET
+ else if (deftype == 'R')
+ SYMBOL_TYPE (sym) = read_type (&p);
+#endif
+
else
{
struct type *type_read;
@@ -1408,6 +1438,9 @@ define_symbol (valu, string, desc, type, objfile)
add_symbol_to_list (sym, &local_symbols);
break;
+#ifdef IBM6000_TARGET
+ case 'R':
+#endif
case 'r':
/* Register variable (either global or local). */
SYMBOL_CLASS (sym) = LOC_REGISTER;
@@ -1433,6 +1466,12 @@ define_symbol (valu, string, desc, type, objfile)
break;
case 't':
+#ifdef IBM6000_TARGET
+ /* For a nameless type, we don't want a create a symbol, thus we
+ did not use `sym'. Return without further processing. */
+
+ if (nameless) return NULL;
+#endif
SYMBOL_CLASS (sym) = LOC_TYPEDEF;
SYMBOL_VALUE (sym) = valu;
SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;