aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJiong Wang <jiwang@sourceware.org>2013-03-02 01:34:40 +0000
committerJiong Wang <jiwang@sourceware.org>2013-03-02 01:34:40 +0000
commitd79e58d83cf2ba86afe15683d7fc68149d12e30f (patch)
tree88666468cc2500d20f0c0f61b7625ca6b658fb85 /gdb
parent0f4bfba480461cc249b951d268ecf9af5b96ca45 (diff)
downloadgdb-d79e58d83cf2ba86afe15683d7fc68149d12e30f.zip
gdb-d79e58d83cf2ba86afe15683d7fc68149d12e30f.tar.gz
gdb-d79e58d83cf2ba86afe15683d7fc68149d12e30f.tar.bz2
gdb/
* tilegx-tdep.c (tilegx_analyze_prologue): Limit bundle reading to END_ADDR. (tilegx_skip_prologue): Limit prologue analysis to section end
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/tilegx-tdep.c13
2 files changed, 18 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 48df60d..a2ca687 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2013-03-01 Jiong Wang <jiwang@tilera.com>
+ Pedro Alves <palves@redhat.com>
+
+ * tilegx-tdep.c (tilegx_analyze_prologue): Limit bundle reading
+ to END_ADDR.
+ (tilegx_skip_prologue): Limit prologue analysis to section end.
+
2013-03-01 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf2loc.c (call_site_find_chain_1): New variable save_callee_pc,
diff --git a/gdb/tilegx-tdep.c b/gdb/tilegx-tdep.c
index f45c20f..a476053 100644
--- a/gdb/tilegx-tdep.c
+++ b/gdb/tilegx-tdep.c
@@ -433,6 +433,8 @@ tilegx_analyze_prologue (struct gdbarch* gdbarch,
if (instbuf_size > size_on_same_page)
instbuf_size = size_on_same_page;
+
+ instbuf_size = min (instbuf_size, (end_addr - next_addr));
instbuf_start = next_addr;
status = safe_frame_unwind_memory (next_frame, instbuf_start,
@@ -745,7 +747,8 @@ tilegx_analyze_prologue (struct gdbarch* gdbarch,
static CORE_ADDR
tilegx_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
{
- CORE_ADDR func_start;
+ CORE_ADDR func_start, end_pc;
+ struct obj_section *s;
/* This is the preferred method, find the end of the prologue by
using the debugging information. */
@@ -758,10 +761,16 @@ tilegx_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
return max (start_pc, post_prologue_pc);
}
+ /* Don't straddle a section boundary. */
+ s = find_pc_section (start_pc);
+ end_pc = start_pc + 8 * TILEGX_BUNDLE_SIZE_IN_BYTES;
+ if (s != NULL)
+ end_pc = min (end_pc, obj_section_endaddr (s));
+
/* Otherwise, try to skip prologue the hard way. */
return tilegx_analyze_prologue (gdbarch,
start_pc,
- start_pc + 8 * TILEGX_BUNDLE_SIZE_IN_BYTES,
+ end_pc,
NULL, NULL);
}