From 91cc45daccbefd06041f8bbf3b75fa2622e0004f Mon Sep 17 00:00:00 2001 From: Jim Kingdon Date: Sun, 16 Jan 1994 20:09:59 +0000 Subject: [PATCH] * xcoffread.c (process_xcoff_symbol): Only change 'V' to 'S' if not within_function. --- gdb/ChangeLog | 3 +++ gdb/xcoffread.c | 37 +++++++++++++++++++------------------ 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d9958587d8a..39f97482c97 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,8 @@ Sun Jan 16 12:46:01 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + * xcoffread.c (process_xcoff_symbol): Only change 'V' to 'S' if not + within_function. + * Makefile.in: Add mostlyclean target. Sat Jan 15 10:20:13 1994 Jim Kingdon (kingdon@lioth.cygnus.com) diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 6e61e80df5e..8b70625f9b4 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -1629,24 +1629,25 @@ process_xcoff_symbol (cs, objfile) case C_STSYM: - /* If we are going to use Sun dbx's define_symbol(), we need to - massage our stab string a little. Change 'V' type to 'S' to be - comparible with Sun. */ - /* FIXME: Is this to avoid a Sun-specific hack somewhere? - Needs more investigation. */ - - if (*name == ':' || (pp = (char *) strchr(name, ':')) == NULL) - return NULL; - - ++pp; - if (*pp == 'V') *pp = 'S'; - sym = define_symbol (cs->c_value, cs->c_name, 0, 0, objfile); - if (sym != NULL) - { - SYMBOL_VALUE (sym) += static_block_base; - SYMBOL_SECTION (sym) = static_block_section; - } - return sym; + /* For xlc (not GCC), the 'V' symbol descriptor is used for all + statics and we need to distinguish file-scope versus function-scope + using within_function. We do this by changing the string we pass + to define_symbol to use 'S' where we need to, which is not necessarily + super-clean, but seems workable enough. */ + + if (*name == ':' || (pp = (char *) strchr(name, ':')) == NULL) + return NULL; + + ++pp; + if (*pp == 'V' && !within_function) + *pp = 'S'; + sym = define_symbol (cs->c_value, cs->c_name, 0, 0, objfile); + if (sym != NULL) + { + SYMBOL_VALUE (sym) += static_block_base; + SYMBOL_SECTION (sym) = static_block_section; + } + return sym; case C_LSYM: sym = define_symbol (cs->c_value, cs->c_name, 0, N_LSYM, objfile); -- 2.30.2