Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA]: Patch for ia64-tdep.c to cross-compile
@ 2004-02-10  0:15 Jeff Johnston
  2004-02-10  2:55 ` Daniel Jacobowitz
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Johnston @ 2004-02-10  0:15 UTC (permalink / raw)
  To: gdb-patches; +Cc: Kevin Buettner

[-- Attachment #1: Type: text/plain, Size: 681 bytes --]

The attached patch fixes the tracing printfs to use paddr() functions so 
cross-compiling will work on ia64-tdep.c.

Ok to commit?

2004-02-09  Jeff Johnston  <jjohnstn@redhat.com>

         * ia64-tdep.c (ia64_frame_this_id): Fix tracing print statement
         to use paddr functions to format ia64 addresses and long values..
         (ia64_frame_prev_register, ia64_sigtramp_frame_this_id): Ditto.
         (ia64_sigtramp_frame_prev_register, ia64_access_reg): Ditto.
         (get_kernel_table, ia64_find_proc_info_x): Ditto.
         (ia64_get_dyn_info_list, ia64_libunwind_this_frame_id): Ditto.
         (ia64_libunwind_frame_prev_register, ia64_unwind_dummy_id): Ditto.


[-- Attachment #2: paddr.patch --]
[-- Type: text/plain, Size: 7424 bytes --]

Index: ia64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ia64-tdep.c,v
retrieving revision 1.111
diff -u -p -r1.111 ia64-tdep.c
--- ia64-tdep.c	3 Feb 2004 22:21:36 -0000	1.111
+++ ia64-tdep.c	9 Feb 2004 23:53:06 -0000
@@ -1551,8 +1551,10 @@ ia64_frame_this_id (struct frame_info *n
   (*this_id) = frame_id_build_special (cache->base, cache->pc, cache->bsp);
   if (gdbarch_debug >= 1)
     fprintf_unfiltered (gdb_stdlog,
-			"regular frame id: code %lx, stack %lx, special %lx, next_frame %p\n",
-			this_id->code_addr, this_id->stack_addr, cache->bsp, next_frame);
+			"regular frame id: code 0x%s, stack 0x%s, special 0x%s, next_frame %p\n",
+			paddr_nz (this_id->code_addr), 
+			paddr_nz (this_id->stack_addr), 
+			paddr_nz (cache->bsp), next_frame);
 }
 
 static void
@@ -1847,9 +1849,10 @@ ia64_frame_prev_register (struct frame_i
 
   if (gdbarch_debug >= 1)
     fprintf_unfiltered (gdb_stdlog,
-			"regular prev register <%d> <%s> is %lx\n", regnum, 
+			"regular prev register <%d> <%s> is 0x%s\n", regnum, 
 			(((unsigned) regnum <= IA64_NAT127_REGNUM)
-			 ? ia64_register_names[regnum] : "r??"), extract_unsigned_integer (valuep, 8));
+			 ? ia64_register_names[regnum] : "r??"), 
+			paddr_nz (extract_unsigned_integer (valuep, 8)));
 }
  
 static const struct frame_unwind ia64_frame_unwind =
@@ -1947,8 +1950,10 @@ ia64_sigtramp_frame_this_id (struct fram
   (*this_id) = frame_id_build_special (cache->base, frame_pc_unwind (next_frame), cache->bsp);
   if (gdbarch_debug >= 1)
     fprintf_unfiltered (gdb_stdlog,
-			"sigtramp frame id: code %lx, stack %lx, special %lx, next_frame %p\n",
-			this_id->code_addr, this_id->stack_addr, cache->bsp, next_frame);
+			"sigtramp frame id: code 0x%s, stack 0x%s, special 0x%s, next_frame %p\n",
+			paddr_nz (this_id->code_addr), 
+			paddr_nz (this_id->stack_addr), 
+			paddr_nz (cache->bsp), next_frame);
 }
 
 static void
@@ -2024,9 +2029,10 @@ ia64_sigtramp_frame_prev_register (struc
 
   if (gdbarch_debug >= 1)
     fprintf_unfiltered (gdb_stdlog,
-			"sigtramp prev register <%s> is %lx\n",
+			"sigtramp prev register <%s> is 0x%s\n",
 			(((unsigned) regnum <= IA64_NAT127_REGNUM)
-			 ? ia64_register_names[regnum] : "r??"), extract_unsigned_integer (valuep, 8));
+			 ? ia64_register_names[regnum] : "r??"), 
+			paddr_nz (extract_unsigned_integer (valuep, 8)));
 }
 
 static const struct frame_unwind ia64_sigtramp_frame_unwind =
@@ -2225,9 +2231,10 @@ ia64_access_reg (unw_addr_space_t as, un
 	}
       if (gdbarch_debug >= 1)
 	fprintf_unfiltered (gdb_stdlog, 
-			    "  access_reg: to cache: %4s=%016lx\n",
+			    "  access_reg: to cache: %4s=0x%s\n",
 			    (((unsigned) regnum <= IA64_NAT127_REGNUM)
-			     ? ia64_register_names[regnum] : "r??"), *val);
+			     ? ia64_register_names[regnum] : "r??"), 
+			    paddr_nz (*val));
     }
   else
     {
@@ -2271,9 +2278,10 @@ ia64_access_reg (unw_addr_space_t as, un
       
       if (gdbarch_debug >= 1)
 	fprintf_unfiltered (gdb_stdlog, 
-			    "  access_reg: from cache: %4s=%016lx\n",
+			    "  access_reg: from cache: %4s=0x%s\n",
 			    (((unsigned) regnum <= IA64_NAT127_REGNUM)
-			     ? ia64_register_names[regnum] : "r??"), *val);
+			     ? ia64_register_names[regnum] : "r??"), 
+			    paddr_nz (*val));
     }
   return 0;
 }
@@ -2357,9 +2365,11 @@ get_kernel_table (unw_word_t ip, unw_dyn
   
   if (gdbarch_debug >= 1)
     fprintf_unfiltered (gdb_stdlog, "get_kernel_table: found table `%s': "
-			"segbase=%lx, length=%lu, gp=%lx\n",
-			(char *) di->u.ti.name_ptr, di->u.ti.segbase, 
-			di->u.ti.table_len, di->gp);
+			"segbase=0x%s, length=%s, gp=0x%s\n",
+			(char *) di->u.ti.name_ptr, 
+			paddr_nz (di->u.ti.segbase), 
+			paddr_u (di->u.ti.table_len), 
+			paddr_nz (di->gp));
   return 0;
 }
 
@@ -2441,12 +2451,15 @@ ia64_find_proc_info_x (unw_addr_space_t 
 	return -UNW_ENOINFO;
 
       if (gdbarch_debug >= 1)
-	fprintf_unfiltered (gdb_stdlog, "ia64_find_proc_info_x: %lx -> "
-			    "(name=`%s',segbase=%lx,start=%lx,end=%lx,gp=%lx,"
-			    "length=%lu,data=%p)\n",
-			    ip, (char *)di.u.ti.name_ptr,
-			    di.u.ti.segbase, di.start_ip, di.end_ip,
-			    di.gp, di.u.ti.table_len, di.u.ti.table_data);
+	fprintf_unfiltered (gdb_stdlog, "ia64_find_proc_info_x: 0x%s -> "
+			    "(name=`%s',segbase=0x%s,start=0x%s,end=0x%s,gp=0x%s,"
+			    "length=%s,data=0x%s)\n",
+			    paddr_nz (ip), (char *)di.u.ti.name_ptr,
+			    paddr_nz (di.u.ti.segbase), 
+			    paddr_nz (di.start_ip), paddr_nz (di.end_ip),
+			    paddr_nz (di.gp), 
+			    paddr_u (di.u.ti.table_len), 
+			    paddr_nz ((CORE_ADDR)di.u.ti.table_data));
     }
   else
     {
@@ -2455,12 +2468,15 @@ ia64_find_proc_info_x (unw_addr_space_t 
 	return ret;
 
       if (gdbarch_debug >= 1)
-	fprintf_unfiltered (gdb_stdlog, "ia64_find_proc_info_x: %lx -> "
-			    "(name=`%s',segbase=%lx,start=%lx,end=%lx,gp=%lx,"
-			    "length=%lu,data=%lx)\n",
-			    ip, (char *)di.u.rti.name_ptr,
-			    di.u.rti.segbase, di.start_ip, di.end_ip,
-			    di.gp, di.u.rti.table_len, di.u.rti.table_data);
+	fprintf_unfiltered (gdb_stdlog, "ia64_find_proc_info_x: 0x%s -> "
+			    "(name=`%s',segbase=0x%s,start=0x%s,end=0x%s,gp=0x%s,"
+			    "length=%s,data=0x%s)\n",
+			    paddr_nz (ip), (char *)di.u.rti.name_ptr,
+			    paddr_nz (di.u.rti.segbase), 
+			    paddr_nz (di.start_ip), paddr_nz (di.end_ip),
+			    paddr_nz (di.gp), 
+			    paddr_u (di.u.rti.table_len), 
+			    paddr_nz (di.u.rti.table_data));
     }
 
   ret = libunwind_search_unwind_table (&as, ip, &di, pi, need_unwind_info,
@@ -2513,9 +2529,9 @@ ia64_get_dyn_info_list (unw_addr_space_t
 	      if (gdbarch_debug >= 1)
 		fprintf_unfiltered (gdb_stdlog,
 				    "dynamic unwind table in objfile %s "
-				    "at %lx (gp=%lx)\n",
+				    "at 0x%s (gp=0x%s)\n",
 				    bfd_get_filename (objfile->obfd),
-				    addr, di.gp);
+				    paddr_nz (addr), paddr_nz (di.gp));
 	      *dilap = addr;
 	      return 0;
 	    }
@@ -2545,8 +2561,9 @@ ia64_libunwind_frame_this_id (struct fra
 
   if (gdbarch_debug >= 1)
     fprintf_unfiltered (gdb_stdlog,
-			"libunwind frame id: code %lx, stack %lx, special %lx, next_frame %p\n",
-			id.code_addr, id.stack_addr, bsp, next_frame);
+			"libunwind frame id: code 0x%s, stack 0x%s, special 0x%s, next_frame %p\n",
+			paddr_nz (id.code_addr), paddr_nz (id.stack_addr), 
+			paddr_nz (bsp), next_frame);
 }
 
 static void
@@ -2625,9 +2642,10 @@ ia64_libunwind_frame_prev_register (stru
 
   if (gdbarch_debug >= 1)
     fprintf_unfiltered (gdb_stdlog,
-			"libunwind prev register <%s> is %lx\n",
+			"libunwind prev register <%s> is 0x%s\n",
 			(((unsigned) regnum <= IA64_NAT127_REGNUM)
-			 ? ia64_register_names[regnum] : "r??"), extract_unsigned_integer (valuep, 8));
+			 ? ia64_register_names[regnum] : "r??"), 
+			paddr_nz (extract_unsigned_integer (valuep, 8)));
 }
 
 static const struct frame_unwind ia64_libunwind_frame_unwind =
@@ -3172,8 +3190,9 @@ ia64_unwind_dummy_id (struct gdbarch *gd
 
   if (gdbarch_debug >= 1)
     fprintf_unfiltered (gdb_stdlog,
-			"dummy frame id: code %lx, stack %lx, special %lx\n",
-			frame_pc_unwind (next_frame), sp, bsp);
+			"dummy frame id: code 0x%s, stack 0x%s, special 0x%s\n",
+			paddr_nz (frame_pc_unwind (next_frame)), 
+			paddr_nz (sp), paddr_nz (bsp));
 
   return frame_id_build_special (sp, frame_pc_unwind (next_frame), bsp);
 }

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFA]: Patch for ia64-tdep.c to cross-compile
  2004-02-10  0:15 [RFA]: Patch for ia64-tdep.c to cross-compile Jeff Johnston
@ 2004-02-10  2:55 ` Daniel Jacobowitz
  2004-02-10  6:23   ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2004-02-10  2:55 UTC (permalink / raw)
  To: gdb-patches

On Mon, Feb 09, 2004 at 07:14:59PM -0500, Jeff Johnston wrote:
> The attached patch fixes the tracing printfs to use paddr() functions so 
> cross-compiling will work on ia64-tdep.c.
> 
> Ok to commit?
> 
> 2004-02-09  Jeff Johnston  <jjohnstn@redhat.com>
> 
>         * ia64-tdep.c (ia64_frame_this_id): Fix tracing print statement
>         to use paddr functions to format ia64 addresses and long values..
>         (ia64_frame_prev_register, ia64_sigtramp_frame_this_id): Ditto.
>         (ia64_sigtramp_frame_prev_register, ia64_access_reg): Ditto.
>         (get_kernel_table, ia64_find_proc_info_x): Ditto.
>         (ia64_get_dyn_info_list, ia64_libunwind_this_frame_id): Ditto.
>         (ia64_libunwind_frame_prev_register, ia64_unwind_dummy_id): Ditto.
> 

I think this patch is "obvious"; please go ahead.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFA]: Patch for ia64-tdep.c to cross-compile
  2004-02-10  2:55 ` Daniel Jacobowitz
@ 2004-02-10  6:23   ` Eli Zaretskii
  2004-02-10 18:30     ` Jeff Johnston
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2004-02-10  6:23 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

> Date: Mon, 9 Feb 2004 21:55:27 -0500
> From: Daniel Jacobowitz <drow@mvista.com>
> > 
> > 2004-02-09  Jeff Johnston  <jjohnstn@redhat.com>
> > 
> >         * ia64-tdep.c (ia64_frame_this_id): Fix tracing print statement
> >         to use paddr functions to format ia64 addresses and long values..
> >         (ia64_frame_prev_register, ia64_sigtramp_frame_this_id): Ditto.
> >         (ia64_sigtramp_frame_prev_register, ia64_access_reg): Ditto.
> >         (get_kernel_table, ia64_find_proc_info_x): Ditto.
> >         (ia64_get_dyn_info_list, ia64_libunwind_this_frame_id): Ditto.
> >         (ia64_libunwind_frame_prev_register, ia64_unwind_dummy_id): Ditto.
> > 
> 
> I think this patch is "obvious"

If this is an obvious patch, shouldn't we have some coding rule
somewhere to cover it?  It certainly isn't obvious out of the GDB
context, i.e. not a standard coding practice.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFA]: Patch for ia64-tdep.c to cross-compile
  2004-02-10  6:23   ` Eli Zaretskii
@ 2004-02-10 18:30     ` Jeff Johnston
  2004-02-10 19:09       ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Johnston @ 2004-02-10 18:30 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Daniel Jacobowitz, gdb-patches

Eli Zaretskii wrote:
>>Date: Mon, 9 Feb 2004 21:55:27 -0500
>>From: Daniel Jacobowitz <drow@mvista.com>
>>
>>>2004-02-09  Jeff Johnston  <jjohnstn@redhat.com>
>>>
>>>        * ia64-tdep.c (ia64_frame_this_id): Fix tracing print statement
>>>        to use paddr functions to format ia64 addresses and long values..
>>>        (ia64_frame_prev_register, ia64_sigtramp_frame_this_id): Ditto.
>>>        (ia64_sigtramp_frame_prev_register, ia64_access_reg): Ditto.
>>>        (get_kernel_table, ia64_find_proc_info_x): Ditto.
>>>        (ia64_get_dyn_info_list, ia64_libunwind_this_frame_id): Ditto.
>>>        (ia64_libunwind_frame_prev_register, ia64_unwind_dummy_id): Ditto.
>>>
>>
>>I think this patch is "obvious"
> 
> 
> If this is an obvious patch, shouldn't we have some coding rule
> somewhere to cover it?  It certainly isn't obvious out of the GDB
> context, i.e. not a standard coding practice.
> 
>

Eli,

   Do you want me to hold off on checking this in or do you just wish to discuss 
whether such a patch should be marked as obvious in the future?

-- Jeff J.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFA]: Patch for ia64-tdep.c to cross-compile
  2004-02-10 18:30     ` Jeff Johnston
@ 2004-02-10 19:09       ` Eli Zaretskii
  2004-02-10 19:37         ` Jeff Johnston
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2004-02-10 19:09 UTC (permalink / raw)
  To: Jeff Johnston; +Cc: drow, gdb-patches

> Date: Tue, 10 Feb 2004 13:30:15 -0500
> From: Jeff Johnston <jjohnstn@redhat.com>
> > 
> > If this is an obvious patch, shouldn't we have some coding rule
> > somewhere to cover it?  It certainly isn't obvious out of the GDB
> > context, i.e. not a standard coding practice.
> 
> Eli,
> 
>    Do you want me to hold off on checking this in or do you just wish to discuss 
> whether such a patch should be marked as obvious in the future?

I don't think you need to hold off; sorry that I wasn't more clear.

What I wanted to discuss is whether we need to put some text somewhere
that includes the use of paddr* functions in the GDB coding standards.
Then it would be clear that fixing any deviation from that falls under
the obvious fix rule.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFA]: Patch for ia64-tdep.c to cross-compile
  2004-02-10 19:09       ` Eli Zaretskii
@ 2004-02-10 19:37         ` Jeff Johnston
  0 siblings, 0 replies; 6+ messages in thread
From: Jeff Johnston @ 2004-02-10 19:37 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: drow, gdb-patches

Eli Zaretskii wrote:
>>Date: Tue, 10 Feb 2004 13:30:15 -0500
>>From: Jeff Johnston <jjohnstn@redhat.com>
>>
>>>If this is an obvious patch, shouldn't we have some coding rule
>>>somewhere to cover it?  It certainly isn't obvious out of the GDB
>>>context, i.e. not a standard coding practice.
>>
>>Eli,
>>
>>   Do you want me to hold off on checking this in or do you just wish to discuss 
>>whether such a patch should be marked as obvious in the future?
> 
> 
> I don't think you need to hold off; sorry that I wasn't more clear.
> 

Thanks.  I just wanted to be sure before checking it in.  The patch has been 
checked in.

> What I wanted to discuss is whether we need to put some text somewhere
> that includes the use of paddr* functions in the GDB coding standards.
> Then it would be clear that fixing any deviation from that falls under
> the obvious fix rule.
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-02-10 19:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-10  0:15 [RFA]: Patch for ia64-tdep.c to cross-compile Jeff Johnston
2004-02-10  2:55 ` Daniel Jacobowitz
2004-02-10  6:23   ` Eli Zaretskii
2004-02-10 18:30     ` Jeff Johnston
2004-02-10 19:09       ` Eli Zaretskii
2004-02-10 19:37         ` Jeff Johnston

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox