This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] Fix ARM valid PC check
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb-patches at sourceware dot org
- Date: Fri, 2 May 2008 13:26:43 -0400
- Subject: [commit] Fix ARM valid PC check
Comparing get_frame_func to lowest_pc (usually 0x200, 0x8000, or
thereabouts) means that we were never backtracing past a function
without symbols because an invalid function is represented as
zero. Generally this does not matter as we will not know how anyway,
but I have a heuristic patch that does OK and this broke it.
Tested extensively on arm-symbianelf, checked in.
--
Daniel Jacobowitz
CodeSourcery
2008-05-02 Daniel Jacobowitz <dan@codesourcery.com>
* arm-tdep.c (arm_prologue_this_id): Compare pc, not func, to
lowest_pc.
Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.262
diff -u -p -r1.262 arm-tdep.c
--- arm-tdep.c 2 May 2008 16:00:35 -0000 1.262
+++ arm-tdep.c 2 May 2008 17:23:14 -0000
@@ -981,23 +981,22 @@ arm_prologue_this_id (struct frame_info
{
struct arm_prologue_cache *cache;
struct frame_id id;
- CORE_ADDR func;
+ CORE_ADDR pc, func;
if (*this_cache == NULL)
*this_cache = arm_make_prologue_cache (this_frame);
cache = *this_cache;
- func = get_frame_func (this_frame);
-
- /* This is meant to halt the backtrace at "_start". Make sure we
- don't halt it at a generic dummy frame. */
- if (func <= gdbarch_tdep (get_frame_arch (this_frame))->lowest_pc)
+ /* This is meant to halt the backtrace at "_start". */
+ pc = get_frame_pc (this_frame);
+ if (pc <= gdbarch_tdep (get_frame_arch (this_frame))->lowest_pc)
return;
/* If we've hit a wall, stop. */
if (cache->prev_sp == 0)
return;
+ func = get_frame_func (this_frame);
id = frame_id_build (cache->prev_sp, func);
*this_id = id;
}