This is the mail archive of the gdb-patches@sourceware.org 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]

[hppa, commited] frame debug improvement


Add some printfs to show how we are determining the pc of a frame.

committed
randolph
2005-11-19  Randolph Chung  <tausq@debian.org>

	* hppa-tdep.c (hppa_frame_cache): Reformat code and enhance 
	debugging.

Index: hppa-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-tdep.c,v
retrieving revision 1.212
diff -u -p -r1.212 hppa-tdep.c
--- hppa-tdep.c	3 Oct 2005 20:53:00 -0000	1.212
+++ hppa-tdep.c	19 Nov 2005 12:30:24 -0000
@@ -1984,7 +2046,7 @@ hppa_frame_cache (struct frame_info *nex
  	cache->base = fp;
  
  	if (hppa_debug)
-	  fprintf_unfiltered (gdb_stdlog, " (base=0x%s) [frame pointer] }",
+	  fprintf_unfiltered (gdb_stdlog, " (base=0x%s) [frame pointer]",
  	    paddr_nz (cache->base));
       }
      else if (u->Save_SP 
@@ -1996,7 +2058,7 @@ hppa_frame_cache (struct frame_info *nex
             cache->base = read_memory_integer (this_sp, TARGET_PTR_BIT / 8);
 
 	    if (hppa_debug)
-	      fprintf_unfiltered (gdb_stdlog, " (base=0x%s) [saved] }",
+	      fprintf_unfiltered (gdb_stdlog, " (base=0x%s) [saved]",
 			          paddr_nz (cache->base));
       }
     else
@@ -2005,7 +2067,7 @@ hppa_frame_cache (struct frame_info *nex
 	   the SP back.  */
         cache->base = this_sp - frame_size;
 	if (hppa_debug)
-	  fprintf_unfiltered (gdb_stdlog, " (base=0x%s) [unwind adjust] } ",
+	  fprintf_unfiltered (gdb_stdlog, " (base=0x%s) [unwind adjust]",
 			      paddr_nz (cache->base));
 
       }
@@ -2017,21 +2079,34 @@ hppa_frame_cache (struct frame_info *nex
   if (u->Millicode)
     {
       if (trad_frame_addr_p (cache->saved_regs, 31))
-        cache->saved_regs[HPPA_PCOQ_HEAD_REGNUM] = cache->saved_regs[31];
+        {
+          cache->saved_regs[HPPA_PCOQ_HEAD_REGNUM] = cache->saved_regs[31];
+	  if (hppa_debug)
+	    fprintf_unfiltered (gdb_stdlog, " (pc=r31) [stack] } ");
+        }
       else
 	{
 	  ULONGEST r31 = frame_unwind_register_unsigned (next_frame, 31);
 	  trad_frame_set_value (cache->saved_regs, HPPA_PCOQ_HEAD_REGNUM, r31);
+	  if (hppa_debug)
+	    fprintf_unfiltered (gdb_stdlog, " (pc=r31) [frame] } ");
         }
     }
   else
     {
       if (trad_frame_addr_p (cache->saved_regs, HPPA_RP_REGNUM))
-        cache->saved_regs[HPPA_PCOQ_HEAD_REGNUM] = cache->saved_regs[HPPA_RP_REGNUM];
+        {
+          cache->saved_regs[HPPA_PCOQ_HEAD_REGNUM] = 
+	    cache->saved_regs[HPPA_RP_REGNUM];
+	  if (hppa_debug)
+	    fprintf_unfiltered (gdb_stdlog, " (pc=rp) [stack] } ");
+        }
       else
 	{
 	  ULONGEST rp = frame_unwind_register_unsigned (next_frame, HPPA_RP_REGNUM);
 	  trad_frame_set_value (cache->saved_regs, HPPA_PCOQ_HEAD_REGNUM, rp);
+	  if (hppa_debug)
+	    fprintf_unfiltered (gdb_stdlog, " (pc=rp) [frame] } ");
 	}
     }
 

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