[RFC/TileGX 2/6] simplify the handling of skip prologue for plt stub

Jiong Wang
2013-01-18T09:25:58Z

[-- Attachment #1: Type: text/plain, Size: 290 bytes --]

for tilegx, when skip prologue, if the start_pc is a plt stub address, then
stop to go further, just return the start_pc.

gdb/ChangeLog:

* tilegx-tdep.c (tilegx_skip_prologue): simplify the handling for
plt stub.

please review.

---
Regards,
Jiong
Tilera Corporation.

[-- Attachment #2: 0003-fix-plt-stub-issue.patch --]
[-- Type: text/x-patch, Size: 575 bytes --]

---
gdb/tilegx-tdep.c | 4 ++++
1 files changed, 4 insertions(+)

diff --git a/gdb/tilegx-tdep.c b/gdb/tilegx-tdep.c
index 2f1d824..6432edb 100644
--- a/gdb/tilegx-tdep.c
+++ b/gdb/tilegx-tdep.c
@@ -746,6 +746,10 @@ tilegx_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
return sal.end;
}

+ /* for plt stub, just return the start pc */
+ if (in_plt_section (pc, NULL))
+ return pc;
+
/* Otherwise, try to skip prologue the hard way. */
return tilegx_analyze_prologue (gdbarch,
pc, pc + 8 * TILEGX_BUNDLE_SIZE_IN_BYTES,
--
1.7.10.3