Created
May 6, 2015 02:11
-
-
Save projectgus/9d7d31a69b716061ab7e to your computer and use it in GitHub Desktop.
gdb call0 patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From b08ec678a9e4cd3cb8d41979c4049315004a94dd Mon Sep 17 00:00:00 2001 | |
From: Angus Gratton <[email protected]> | |
Date: Wed, 6 May 2015 11:19:42 +1000 | |
Subject: [PATCH] XTensa call0 ABI: Reference register cache from a0 when | |
unwinding | |
Fixes bug where wrong Frame Pointer value was read during backtrace, | |
leading to corrupt stack traces. | |
--- | |
gdb/xtensa-tdep.c | 7 ++++--- | |
1 file changed, 4 insertions(+), 3 deletions(-) | |
diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c | |
index a66d00a..eacd656 100644 | |
--- a/gdb/xtensa-tdep.c | |
+++ b/gdb/xtensa-tdep.c | |
@@ -1505,10 +1505,11 @@ xtensa_frame_prev_register (struct frame_info *this_frame, | |
} | |
else /* Call0 ABI. */ | |
{ | |
- int reg = (regnum >= gdbarch_tdep (gdbarch)->ar_base | |
- && regnum <= (gdbarch_tdep (gdbarch)->ar_base | |
+ int reg = (regnum >= gdbarch_tdep (gdbarch)->a0_base | |
+ && regnum <= (gdbarch_tdep (gdbarch)->a0_base | |
+ C0_NREGS)) | |
- ? regnum - gdbarch_tdep (gdbarch)->ar_base : regnum; | |
+ ? regnum - gdbarch_tdep (gdbarch)->a0_base : regnum; | |
+ | |
if (reg < C0_NREGS) | |
{ | |
-- | |
2.1.4 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment