diff options
author | Daniel Jacobowitz <drow@false.org> | 2006-07-19 02:17:23 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2006-07-19 02:17:23 +0000 |
commit | 29e8a84408168aa7787f892c00c9458841c7feba (patch) | |
tree | 1ac751d14cf3695c0a45aba91469e167b9a3472b /gdb/blockframe.c | |
parent | 5061a8853b6f8fb5af87b8ff4a0f7a2460ad333b (diff) | |
download | gdb-29e8a84408168aa7787f892c00c9458841c7feba.zip gdb-29e8a84408168aa7787f892c00c9458841c7feba.tar.gz gdb-29e8a84408168aa7787f892c00c9458841c7feba.tar.bz2 |
* blockframe.c (find_pc_partial_function): Use the minimal symbol
size to control the cache entry, if available.
* minsyms.c (lookup_minimal_symbol_by_pc_section): Handle minimal
symbols with zero and non-zero sizes differently.
* gdb.arch/i386-size.c, gdb.arch/i386-size.exp: New files.
Diffstat (limited to 'gdb/blockframe.c')
-rw-r--r-- | gdb/blockframe.c | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/gdb/blockframe.c b/gdb/blockframe.c index dbb1b43..ba298c3 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -280,27 +280,34 @@ find_pc_partial_function (CORE_ADDR pc, char **name, CORE_ADDR *address, cache_pc_function_name = DEPRECATED_SYMBOL_NAME (msymbol); cache_pc_function_section = section; - /* Use the lesser of the next minimal symbol in the same section, or - the end of the section, as the end of the function. */ + /* If the minimal symbol has a size, use it for the cache. + Otherwise use the lesser of the next minimal symbol in the same + section, or the end of the section, as the end of the + function. */ - /* Step over other symbols at this same address, and symbols in - other sections, to find the next symbol in this section with - a different address. */ - - for (i = 1; DEPRECATED_SYMBOL_NAME (msymbol + i) != NULL; i++) + if (MSYMBOL_SIZE (msymbol) != 0) + cache_pc_function_high = cache_pc_function_low + MSYMBOL_SIZE (msymbol); + else { - if (SYMBOL_VALUE_ADDRESS (msymbol + i) != SYMBOL_VALUE_ADDRESS (msymbol) - && SYMBOL_BFD_SECTION (msymbol + i) == SYMBOL_BFD_SECTION (msymbol)) - break; - } + /* Step over other symbols at this same address, and symbols in + other sections, to find the next symbol in this section with + a different address. */ - if (DEPRECATED_SYMBOL_NAME (msymbol + i) != NULL - && SYMBOL_VALUE_ADDRESS (msymbol + i) < osect->endaddr) - cache_pc_function_high = SYMBOL_VALUE_ADDRESS (msymbol + i); - else - /* We got the start address from the last msymbol in the objfile. - So the end address is the end of the section. */ - cache_pc_function_high = osect->endaddr; + for (i = 1; DEPRECATED_SYMBOL_NAME (msymbol + i) != NULL; i++) + { + if (SYMBOL_VALUE_ADDRESS (msymbol + i) != SYMBOL_VALUE_ADDRESS (msymbol) + && SYMBOL_BFD_SECTION (msymbol + i) == SYMBOL_BFD_SECTION (msymbol)) + break; + } + + if (DEPRECATED_SYMBOL_NAME (msymbol + i) != NULL + && SYMBOL_VALUE_ADDRESS (msymbol + i) < osect->endaddr) + cache_pc_function_high = SYMBOL_VALUE_ADDRESS (msymbol + i); + else + /* We got the start address from the last msymbol in the objfile. + So the end address is the end of the section. */ + cache_pc_function_high = osect->endaddr; + } return_cached_value: |