diff options
author | Tom Tromey <tromey@redhat.com> | 2009-11-04 23:06:50 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2009-11-04 23:06:50 +0000 |
commit | 8c2963fbcf62669f67a72fd06c48792f6c83c85f (patch) | |
tree | 63bd7469a5992db498f954c886b6bb29eebb7344 /gdb/symfile.c | |
parent | d90834c7df3d01558fadb8523435caa1d63b8512 (diff) | |
download | fsf-binutils-gdb-8c2963fbcf62669f67a72fd06c48792f6c83c85f.zip fsf-binutils-gdb-8c2963fbcf62669f67a72fd06c48792f6c83c85f.tar.gz fsf-binutils-gdb-8c2963fbcf62669f67a72fd06c48792f6c83c85f.tar.bz2 |
* symfile.c (add_psymbol_to_bcache): Don't copy name. Make
'psymbol' non-static.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r-- | gdb/symfile.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c index 1e57c69..c55cb03 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -3106,19 +3106,9 @@ add_psymbol_to_bcache (char *name, int namelength, domain_enum domain, enum language language, struct objfile *objfile, int *added) { - char *buf = name; - /* psymbol is static so that there will be no uninitialized gaps in the - structure which might contain random data, causing cache misses in - bcache. */ - static struct partial_symbol psymbol; - - if (name[namelength] != '\0') - { - buf = alloca (namelength + 1); - /* Create local copy of the partial symbol */ - memcpy (buf, name, namelength); - buf[namelength] = '\0'; - } + struct partial_symbol psymbol; + + memset (&psymbol, 0, sizeof (struct partial_symbol)); /* val and coreaddr are mutually exclusive, one of them *will* be zero */ if (val != 0) { @@ -3133,7 +3123,7 @@ add_psymbol_to_bcache (char *name, int namelength, domain_enum domain, PSYMBOL_DOMAIN (&psymbol) = domain; PSYMBOL_CLASS (&psymbol) = class; - SYMBOL_SET_NAMES (&psymbol, buf, namelength, objfile); + SYMBOL_SET_NAMES (&psymbol, name, namelength, objfile); /* Stash the partial symbol away in the cache */ return bcache_full (&psymbol, sizeof (struct partial_symbol), |