This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] fallback unwinder for hppa


+ int pcoqt = (regnum == PCOQ_TAIL_REGNUM);
+ struct gdbarch *gdbarch = get_frame_arch (next_frame);
+ int regsize = register_size (gdbarch, PCOQ_HEAD_REGNUM);
+
+ if (pcoqt)
+ regnum = PCOQ_HEAD_REGNUM;
+
+ trad_frame_prev_register (next_frame, saved_regs, regnum,
+ optimizedp, lvalp, addrp, realnump, valuep);
+
+ if (pcoqt)
+ store_unsigned_integer (valuep, regsize, + extract_unsigned_integer (valuep, regsize) + 4);
+}

It should be possible to encode this information directly in the saved_regs array. For instance, near the end, round:


+  cache->base = frame_unwind_register_unsigned (next_frame, HPPA_SP_REGNUM);
+
+  if (trad_frame_addr_p (cache->saved_regs, RP_REGNUM))
+    {
+      cache->saved_regs[RP_REGNUM].addr += cache->base;
+      cache->saved_regs[PCOQ_HEAD_REGNUM] = cache->saved_regs[RP_REGNUM];
+    }
   else
     {
-      trad_frame_prev_register (next_frame, info->saved_regs, regnum,
-				optimizedp, lvalp, addrp, realnump, valuep);
+      ULONGEST rp = frame_unwind_register_unsigned (next_frame, RP_REGNUM);
+      trad_frame_set_value (cache->saved_regs, PCOQ_HEAD_REGNUM, rp);
     }
+

have:


saved_regs[PCOQ_TAIL_REGNUM] = saved_regs[PCOQ_HEAD_REGNUM]

andrew




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]