- cache->func_addr = frame_func_unwind (next_frame);
- if (cache->func_addr == 0
- && frame_relative_level (next_frame) > 0
- && get_frame_type (next_frame) != SIGTRAMP_FRAME)
- return NULL;
-
- /* Get a libunwind cursor to the previous frame. We do this by initializing
- a cursor. Libunwind treats a new cursor as the top of stack and will get
- the current register set via the libunwind register accessor. Now, we
- provide the platform-specific accessors and we set up the register accessor to use
- the frame register unwinding interfaces so that we properly get the registers for
- the current frame rather than the top. We then use the unw_step function to
- move the libunwind cursor back one frame. We can later use this cursor to find previous
- registers via the unw_get_reg interface which will invoke libunwind's special logic. */
- descr = libunwind_descr (get_frame_arch (next_frame));
+ cache->func_addr = get_frame_func (this_frame);
+ if (cache->func_addr == 0)
+ /* This can happen when the frame corresponds to a function for which
+ there is no debugging information nor any entry in the symbol table.
+ This is probably a static function for which an entry in the symbol
+ table was not created when the objfile got linked (observed in
+ libpthread.so on ia64-hpux).
+
+ The best we can do, in that case, is use the frame PC as the function
+ address. We don't need to give up since we still have the unwind
+ record to help us perform the unwinding. There is also another
+ compelling to continue, because abandonning now means stopping
+ the backtrace, which can never be helpful for the user. */
+ cache->func_addr = get_frame_pc (this_frame);
+
+ /* Get a libunwind cursor to the previous frame.
+
+ We do this by initializing a cursor. Libunwind treats a new cursor
+ as the top of stack and will get the current register set via the
+ libunwind register accessor. Now, we provide the platform-specific
+ accessors and we set up the register accessor to use the frame
+ register unwinding interfaces so that we properly get the registers
+ for the current frame rather than the top. We then use the unw_step
+ function to move the libunwind cursor back one frame. We can later
+ use this cursor to find previous registers via the unw_get_reg
+ interface which will invoke libunwind's special logic. */
+ descr = libunwind_descr (gdbarch);