diff options
author | Mark Kettenis <kettenis@gnu.org> | 2003-08-17 23:16:44 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2003-08-17 23:16:44 +0000 |
commit | 99ab4326f1095f50d2991b6f633337e7d92e1134 (patch) | |
tree | 48985198141d7cff0a8324b397a9e76e7589e805 /gdb/i386-tdep.c | |
parent | c8d5f0d664dcaafa5226142035a11cd80e665a0b (diff) | |
download | gdb-99ab4326f1095f50d2991b6f633337e7d92e1134.zip gdb-99ab4326f1095f50d2991b6f633337e7d92e1134.tar.gz gdb-99ab4326f1095f50d2991b6f633337e7d92e1134.tar.bz2 |
* i386-tdep.c (i386_analyze_register_saves): Handle register saves
at the start of a frameless function. This probably fixes PR
backtrace/1338.
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r-- | gdb/i386-tdep.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 2c7afca..9aa20d6 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -571,23 +571,22 @@ static CORE_ADDR i386_analyze_register_saves (CORE_ADDR pc, CORE_ADDR current_pc, struct i386_frame_cache *cache) { - if (cache->locals >= 0) - { - CORE_ADDR offset; - unsigned char op; - int i; + CORE_ADDR offset = 0; + unsigned char op; + int i; - offset = - 4 - cache->locals; - for (i = 0; i < 8 && pc < current_pc; i++) - { - op = read_memory_unsigned_integer (pc, 1); - if (op < 0x50 || op > 0x57) - break; + if (cache->locals > 0) + offset -= cache->locals; + for (i = 0; i < 8 && pc < current_pc; i++) + { + op = read_memory_unsigned_integer (pc, 1); + if (op < 0x50 || op > 0x57) + break; - cache->saved_regs[op - 0x50] = offset; - offset -= 4; - pc++; - } + offset -= 4; + cache->saved_regs[op - 0x50] = offset; + cache->sp_offset += 4; + pc++; } return pc; |