This is the mail archive of the insight@sourceware.cygnus.com mailing list for the Insight project.


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

Re: RFA: gdbtk-cmds.c: use paddr_nz() to convert addr to string


Andrew,

Groovy.

Jim

 > Hello,
 > 
 > The attached patch uses paddr_nz() (and asprintf()) instead of the host
 > dependant "%lx" to convert an address into a string.
 > 
 > Ok?
 > 
 > 	AndrewMon Oct 11 10:19:04 1999  Andrew Cagney  <cagney@b1.cygnus.com>
 > 
 > 	* gdbtk-cmds.c (gdb_get_tracepoint_info): Use paddr_nz to convert
 >  	the address into a string.
 > 
 > Index: gdbtk-cmds.c
 > ===================================================================
 > RCS file: /cvs/cvsfiles/devo/gdb/gdbtk-cmds.c,v
 > retrieving revision 2.60
 > diff -p -r2.60 gdbtk-cmds.c
 > *** gdbtk-cmds.c	1999/10/05 18:18:12	2.60
 > --- gdbtk-cmds.c	1999/10/11 00:51:10
 > *************** gdb_get_tracepoint_info (clientData, int
 > *** 2121,2127 ****
 >     struct action_line *al;
 >     Tcl_Obj *action_list;
 >     char *filename, *funcname, *fname;
 > -   char tmp[19];
 >   
 >     if (objc != 2)
 >       {
 > --- 2121,2126 ----
 > *************** gdb_get_tracepoint_info (clientData, int
 > *** 2161,2169 ****
 >   
 >     Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
 >   			    Tcl_NewIntObj (sal.line));
 > !   sprintf (tmp, "0x%lx", tp->address);
 > !   Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
 > ! 			    Tcl_NewStringObj (tmp, -1));
 >     Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
 >   			    Tcl_NewIntObj (tp->enabled));
 >     Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
 > --- 2160,2172 ----
 >   
 >     Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
 >   			    Tcl_NewIntObj (sal.line));
 > !   {
 > !     char *tmp;
 > !     asprintf (&tmp, "0x%s", paddr_nz (tp->address));
 > !     Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
 > ! 			      Tcl_NewStringObj (tmp, -1));
 > !     free (tmp);
 > !   }
 >     Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,
 >   			    Tcl_NewIntObj (tp->enabled));
 >     Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr,

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