aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2009-11-10 10:35:57 +0000
committerTristan Gingold <gingold@adacore.com>2009-11-10 10:35:57 +0000
commit8c201e543a54f7bc01841a0cbd7ca19000a34de1 (patch)
treebd124b3436f7fdb482eaa7e2d723a2d83c10c398
parent1bd0bb725f88c288a32999aceebdcef5d838d0e5 (diff)
downloadgdb-8c201e543a54f7bc01841a0cbd7ca19000a34de1.zip
gdb-8c201e543a54f7bc01841a0cbd7ca19000a34de1.tar.gz
gdb-8c201e543a54f7bc01841a0cbd7ca19000a34de1.tar.bz2
2009-11-10 Tristan Gingold <gingold@adacore.com>
* avr-tdep.c (avr_skip_prologue): First try to skip prologue using skip_prologue_using_sal.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/avr-tdep.c45
2 files changed, 27 insertions, 23 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 66c26d7..f51bbf9 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2009-11-10 Tristan Gingold <gingold@adacore.com>
+ * avr-tdep.c (avr_skip_prologue): First try to skip prologue
+ using skip_prologue_using_sal.
+
+2009-11-10 Tristan Gingold <gingold@adacore.com>
+
* avr-tdep.c (avr_extract_return_value): Remove.
(avr_return_value): Mostly rewritten. Fix handling for structures.
(avr_push_dummy_call): Handle struct_return.
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index 56c3f63..68244fc 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -789,40 +789,39 @@ static CORE_ADDR
avr_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
{
CORE_ADDR func_addr, func_end;
- CORE_ADDR prologue_end = pc;
+ CORE_ADDR post_prologue_pc;
/* See what the symbol table says */
- if (find_pc_partial_function (pc, NULL, &func_addr, &func_end))
- {
- struct symtab_and_line sal;
- struct avr_unwind_cache info = {0};
- struct trad_frame_saved_reg saved_regs[AVR_NUM_REGS];
-
- info.saved_regs = saved_regs;
-
- /* Need to run the prologue scanner to figure out if the function has a
- prologue and possibly skip over moving arguments passed via registers
- to other registers. */
+ if (!find_pc_partial_function (pc, NULL, &func_addr, &func_end))
+ return pc;
- prologue_end = avr_scan_prologue (gdbarch, func_addr, func_end, &info);
+ post_prologue_pc = skip_prologue_using_sal (gdbarch, func_addr);
+ if (post_prologue_pc != 0)
+ return max (pc, post_prologue_pc);
- if (info.prologue_type == AVR_PROLOGUE_NONE)
- return pc;
- else
- {
- sal = find_pc_line (func_addr, 0);
+ {
+ CORE_ADDR prologue_end = pc;
+ struct avr_unwind_cache info = {0};
+ struct trad_frame_saved_reg saved_regs[AVR_NUM_REGS];
- if (sal.line != 0 && sal.end < func_end)
- return sal.end;
- }
- }
+ info.saved_regs = saved_regs;
+
+ /* Need to run the prologue scanner to figure out if the function has a
+ prologue and possibly skip over moving arguments passed via registers
+ to other registers. */
+
+ prologue_end = avr_scan_prologue (gdbarch, func_addr, func_end, &info);
+
+ if (info.prologue_type != AVR_PROLOGUE_NONE)
+ return prologue_end;
+ }
/* Either we didn't find the start of this function (nothing we can do),
or there's no line info, or the line after the prologue is after
the end of the function (there probably isn't a prologue). */
- return prologue_end;
+ return pc;
}
/* Not all avr devices support the BREAK insn. Those that don't should treat