public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* RFA: gdbtk-cmds.c: use paddr_nz() to convert addr to string
@ 1999-10-10 18:08 Andrew Cagney
  1999-10-11 10:24 ` James Ingham
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Cagney @ 1999-10-10 18:08 UTC (permalink / raw)
  To: Insight (GDB GUI)

Hello,

The attached patch uses paddr_nz() (and asprintf()) instead of the host
dependant "%lx" to convert an address into a string.

Ok?

	Andrew
Mon 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,

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

* Re: RFA: gdbtk-cmds.c: use paddr_nz() to convert addr to string
  1999-10-10 18:08 RFA: gdbtk-cmds.c: use paddr_nz() to convert addr to string Andrew Cagney
@ 1999-10-11 10:24 ` James Ingham
  0 siblings, 0 replies; 2+ messages in thread
From: James Ingham @ 1999-10-11 10:24 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: Insight (GDB GUI)

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,

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

end of thread, other threads:[~1999-10-11 10:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-10-10 18:08 RFA: gdbtk-cmds.c: use paddr_nz() to convert addr to string Andrew Cagney
1999-10-11 10:24 ` James Ingham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).