From 095db7ce4528842c75f8e015a329eca2181db3f3 Mon Sep 17 00:00:00 2001 From: Per Bothner Date: Thu, 9 Apr 1992 07:57:10 +0000 Subject: [PATCH] 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 ==). --- gdb/buildsym.c | 39 +++++++++++++++++++++++++++++++++++++++ gdb/rs6000-xdep.c | 2 +- 2 files changed, 40 insertions(+), 1 deletion(-) 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; diff --git a/gdb/rs6000-xdep.c b/gdb/rs6000-xdep.c index 6fb8469..2c491d4 100644 --- a/gdb/rs6000-xdep.c +++ b/gdb/rs6000-xdep.c @@ -258,7 +258,7 @@ frame_get_cache_fsr (fi, fdatap) if (fi->cache_fsr) return; - if (fdatap = NULL) { + if (fdatap == NULL) { fdatap = &work_fdata; function_frame_info (get_pc_function_start (fi->pc), fdatap); } -- 2.7.4