This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFC/TileGX 4/6]use skip_prologue_using_sal for skipping prologue
- From: Jiong Wang <jiwang at tilera dot com>
- To: <gdb-patches at sourceware dot org>
- Cc: Walter Lee <walt at tilera dot com>
- Date: Fri, 18 Jan 2013 17:29:03 +0800
- Subject: [RFC/TileGX 4/6]use skip_prologue_using_sal for skipping prologue
use skip_prologue_using_sal, instead of old find_pc_line, for skip prologue
gdb/ChangeLog:
* tilegx-tdep.c (tilegx_skip_prologue): Use skip_prologue_using_sal.
please review.
---
Regards,
Jiong
Tilera Corporation.
---
gdb/tilegx-tdep.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/gdb/tilegx-tdep.c b/gdb/tilegx-tdep.c
index 638be6c..7f36bed 100644
--- a/gdb/tilegx-tdep.c
+++ b/gdb/tilegx-tdep.c
@@ -731,28 +731,28 @@ tilegx_analyze_prologue (struct gdbarch* gdbarch,
/* This is the implementation of gdbarch method skip_prologue. */
static CORE_ADDR
-tilegx_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
+tilegx_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
{
- struct symtab_and_line sal;
- CORE_ADDR func_start, func_end;
+ CORE_ADDR func_start;
/* This is the preferred method, find the end of the prologue by
using the debugging information. */
- if (find_pc_partial_function (pc, NULL, &func_start, &func_end))
+ if (find_pc_partial_function (start_pc, NULL, &func_start, NULL))
{
- sal = find_pc_line (func_start, 0);
-
- if (sal.end < func_end && pc <= sal.end)
- return sal.end;
+ CORE_ADDR post_prologue_pc
+ = skip_prologue_using_sal (gdbarch, func_start);
+ if (post_prologue_pc != 0)
+ return max (start_pc, post_prologue_pc);
}
/* for plt stub, just return the start pc */
- if (in_plt_section (pc, NULL))
- return pc;
+ if (in_plt_section (start_pc, NULL))
+ return start_pc;
/* Otherwise, try to skip prologue the hard way. */
return tilegx_analyze_prologue (gdbarch,
- pc, pc + 8 * TILEGX_BUNDLE_SIZE_IN_BYTES,
+ start_pc,
+ start_pc + 8 * TILEGX_BUNDLE_SIZE_IN_BYTES,
NULL, NULL);
}
--
1.7.10.3