This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] core_addr_string and core_addr_to_string_nz


Hi,

I would like to change the current core_addr_to_string and add a new
core_add_to_string_nz so that these functions parallel the usage of phex
and phex_nz.

Since Insight is the only client for these, there are no test regressions
anywhere.

Keith

ChangeLog
2002-02-12  Keith Seitz  <keiths@redhat.com>

	* defs.h (core_addr_to_string_nz): New function.
	* utils.c (core_addr_to_string): Use phex instead of phex_nz.
	(core_addr_to_string_nz): New function.

Patch
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.77
diff -p -r1.77 defs.h
*** defs.h	2002/02/10 04:08:41	1.77
--- defs.h	2002/02/13 04:58:48
*************** extern char *phex_nz (ULONGEST l, int si
*** 692,697 ****
--- 692,698 ----
     core_addr_to_string() can be passed direct to
     string_to_core_addr().  */
  extern const char *core_addr_to_string (const CORE_ADDR addr);
+ extern const char *core_addr_to_string_nz (const CORE_ADDR addr);
  extern CORE_ADDR string_to_core_addr (const char *my_string);

  extern void fprintf_symbol_filtered (struct ui_file *, char *,
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.63
diff -p -r1.63 utils.c
*** utils.c	2002/02/10 04:08:42	1.63
--- utils.c	2002/02/13 04:58:49
*************** core_addr_to_string (const CORE_ADDR add
*** 2476,2481 ****
--- 2476,2490 ----
  {
    char *str = get_cell ();
    strcpy (str, "0x");
+   strcat (str, phex (addr, sizeof (addr)));
+   return str;
+ }
+
+ const char *
+ core_addr_to_string_nz (const CORE_ADDR addr)
+ {
+   char *str = get_cell ();
+   strcpy (str, "0x");
    strcat (str, phex_nz (addr, sizeof (addr)));
    return str;
  }


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