This is the mail archive of the
insight@sourceware.cygnus.com
mailing list for the Insight project.
Re: RFA: gdbtk-cmds.c: use paddr_nz() to convert addr to string
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Subject: Re: RFA: gdbtk-cmds.c: use paddr_nz() to convert addr to string
- From: James Ingham <jingham at cygnus dot com>
- Date: Mon, 11 Oct 1999 10:26:14 -0700 (PDT)
- Cc: "Insight (GDB GUI)" <insight at sourceware dot cygnus dot com>
- References: <38013863.B1DA0196@cygnus.com>
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,