From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Ingham To: Andrew Cagney Cc: "Insight (GDB GUI)" Subject: Re: RFA: gdbtk-cmds.c: use paddr_nz() to convert addr to string Date: Mon, 11 Oct 1999 10:24:00 -0000 Message-id: <14338.7606.707625.233882@leda.cygnus.com> References: <38013863.B1DA0196@cygnus.com> X-SW-Source: 1999-q4/msg00006.html 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 > > * 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,