+ /* When unwinding a normal frame, the stack structure is determined
+ by analyzing the frame's function's code (be it using brute force
+ prologue analysis, or the dwarf2 CFI). In the case of a dummy
+ frame, that simply isn't possible. The PC is either the program
+ entry point, or some random address on the stack. Trying to use
+ that PC to apply standard frame ID unwind techniques is just
+ asking for trouble. */
+
+ /* Don't bother unless there is at least one dummy frame. */
+ if (dummy_frame_stack != NULL)
+ {
+ struct dummy_frame *dummyframe;
+ /* Use an architecture specific method to extract this frame's
+ dummy ID, assuming it is a dummy frame. */
+ struct frame_id this_id
+ = gdbarch_dummy_id (get_frame_arch (this_frame), this_frame);
+ struct dummy_frame_id dummy_id = { this_id, inferior_thread () };
+
+ /* Use that ID to find the corresponding cache entry. */
+ for (dummyframe = dummy_frame_stack;
+ dummyframe != NULL;
+ dummyframe = dummyframe->next)
+ {
+ if (dummy_frame_id_eq (&dummyframe->id, &dummy_id))
+ {
+ struct dummy_frame_cache *cache;
+
+ cache = FRAME_OBSTACK_ZALLOC (struct dummy_frame_cache);
+ cache->prev_regcache = get_infcall_suspend_state_regcache
+ (dummyframe->caller_state);
+ cache->this_id = this_id;
+ (*this_prologue_cache) = cache;
+ return 1;
+ }
+ }
+ }
+ return 0;