diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1994-01-16 20:09:59 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1994-01-16 20:09:59 +0000 |
commit | 91cc45daccbefd06041f8bbf3b75fa2622e0004f (patch) | |
tree | d40a49ee6bac76db6159bd3e443e73b37fc1ca27 /gdb/xcoffread.c | |
parent | 5bac80223246f762f09075ffc5d614ca34808ea0 (diff) | |
download | gdb-91cc45daccbefd06041f8bbf3b75fa2622e0004f.zip gdb-91cc45daccbefd06041f8bbf3b75fa2622e0004f.tar.gz gdb-91cc45daccbefd06041f8bbf3b75fa2622e0004f.tar.bz2 |
* xcoffread.c (process_xcoff_symbol): Only change 'V' to 'S' if not
within_function.
Diffstat (limited to 'gdb/xcoffread.c')
-rw-r--r-- | gdb/xcoffread.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 6e61e80..8b70625 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); |