Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] another const char *register_name()
@ 2002-06-19  8:01 Andrew Cagney
  2002-06-20  6:08 ` Michal Ludvig
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Cagney @ 2002-06-19  8:01 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 29 bytes --]

Just FYI,

committed,
Andrew

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 623 bytes --]

2002-06-19  Andrew Cagney  <cagney@redhat.com>

	* i386-linux-tdep.c (i386_linux_register_name): Make return type
	constant.

Index: i386-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-linux-tdep.c,v
retrieving revision 1.13
diff -u -r1.13 i386-linux-tdep.c
--- i386-linux-tdep.c	14 Jun 2002 19:42:19 -0000	1.13
+++ i386-linux-tdep.c	19 Jun 2002 14:58:26 -0000
@@ -38,7 +38,7 @@
 
 /* Return the name of register REG.  */
 
-static char *
+static const char *
 i386_linux_register_name (int reg)
 {
   /* Deal with the extra "orig_eax" pseudo register.  */

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

* Re: [patch] another const char *register_name()
  2002-06-19  8:01 [patch] another const char *register_name() Andrew Cagney
@ 2002-06-20  6:08 ` Michal Ludvig
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Ludvig @ 2002-06-20  6:08 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 174 bytes --]

My two cents to this thread. Just some renaming ... committed as obvious.

Michal Ludvig
-- 
* SuSE CR, s.r.o     * mludvig@suse.cz
* +420 2 9654 5373   * http://www.suse.cz

[-- Attachment #2: regname.diff --]
[-- Type: text/plain, Size: 4644 bytes --]

2002-06-19  Michal Ludvig  <mludvig@suse.cz>

	* x86-64-tdep.c (x86_64_register_nr2name): Rename to 
	x86_64_register_name. Return type changed to 'const char *'.
	(x86_64_register_name2nr): Rename to x86_64_register_number.
	(x86_64_gdbarch_init): Update to reflect the change.
	* x86-64-tdep.h: Ditto.
	* x86-64-linux-nat.c (x86_64_fxsave_offset)
	(supply_fpregset): Ditto.

Index: x86-64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/x86-64-tdep.c,v
retrieving revision 1.23
diff -c -3 -p -r1.23 x86-64-tdep.c
*** x86-64-tdep.c	14 Jun 2002 22:55:41 -0000	1.23
--- x86-64-tdep.c	20 Jun 2002 12:52:09 -0000
*************** x86_64_store_return_value (struct type *
*** 798,805 ****
  }
  \f
  
! char *
! x86_64_register_nr2name (int reg_nr)
  {
    if (reg_nr < 0 || reg_nr >= X86_64_NUM_REGS)
      return NULL;
--- 798,805 ----
  }
  \f
  
! const char *
! x86_64_register_name (int reg_nr)
  {
    if (reg_nr < 0 || reg_nr >= X86_64_NUM_REGS)
      return NULL;
*************** x86_64_register_nr2name (int reg_nr)
*** 807,813 ****
  }
  
  int
! x86_64_register_name2nr (const char *name)
  {
    int reg_nr;
  
--- 807,813 ----
  }
  
  int
! x86_64_register_number (const char *name)
  {
    int reg_nr;
  
*************** x86_64_gdbarch_init (struct gdbarch_info
*** 989,995 ****
    set_gdbarch_long_double_format (gdbarch, &floatformat_i387_ext);
  
    set_gdbarch_num_regs (gdbarch, X86_64_NUM_REGS);
!   set_gdbarch_register_name (gdbarch, x86_64_register_nr2name);
    set_gdbarch_register_size (gdbarch, 8);
    set_gdbarch_register_raw_size (gdbarch, x86_64_register_raw_size);
    set_gdbarch_max_register_raw_size (gdbarch, 16);
--- 989,995 ----
    set_gdbarch_long_double_format (gdbarch, &floatformat_i387_ext);
  
    set_gdbarch_num_regs (gdbarch, X86_64_NUM_REGS);
!   set_gdbarch_register_name (gdbarch, x86_64_register_name);
    set_gdbarch_register_size (gdbarch, 8);
    set_gdbarch_register_raw_size (gdbarch, x86_64_register_raw_size);
    set_gdbarch_max_register_raw_size (gdbarch, 16);
Index: x86-64-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/x86-64-tdep.h,v
retrieving revision 1.4
diff -c -3 -p -r1.4 x86-64-tdep.h
*** x86-64-tdep.h	7 Jun 2002 16:11:09 -0000	1.4
--- x86-64-tdep.h	20 Jun 2002 12:52:09 -0000
***************
*** 28,35 ****
  extern int x86_64_num_regs;
  extern int x86_64_num_gregs;
  
! int x86_64_register_name2nr (const char *name);
! char *x86_64_register_nr2name (int reg_nr);
  
  gdbarch_frame_saved_pc_ftype x86_64_linux_frame_saved_pc;
  gdbarch_saved_pc_after_call_ftype x86_64_linux_saved_pc_after_call;
--- 28,36 ----
  extern int x86_64_num_regs;
  extern int x86_64_num_gregs;
  
! int x86_64_register_number (const char *name);
! const char *x86_64_register_name (int reg_nr);
! 	
  
  gdbarch_frame_saved_pc_ftype x86_64_linux_frame_saved_pc;
  gdbarch_saved_pc_after_call_ftype x86_64_linux_saved_pc_after_call;
Index: x86-64-linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/x86-64-linux-nat.c,v
retrieving revision 1.13
diff -c -3 -p -r1.13 x86-64-linux-nat.c
*** x86-64-linux-nat.c	7 Jun 2002 16:11:09 -0000	1.13
--- x86-64-linux-nat.c	20 Jun 2002 12:52:09 -0000
*************** store_regs (int tid, int regno)
*** 197,208 ****
  static void *
  x86_64_fxsave_offset (elf_fpregset_t * fxsave, int regnum)
  {
!   char *reg_name;
    int reg_index;
  
    gdb_assert (x86_64_num_gregs - 1 < regnum && regnum < x86_64_num_regs);
  
!   reg_name = x86_64_register_nr2name (regnum);
  
    if (reg_name[0] == 's' && reg_name[1] == 't')
      {
--- 197,208 ----
  static void *
  x86_64_fxsave_offset (elf_fpregset_t * fxsave, int regnum)
  {
!   const char *reg_name;
    int reg_index;
  
    gdb_assert (x86_64_num_gregs - 1 < regnum && regnum < x86_64_num_regs);
  
!   reg_name = x86_64_register_name (regnum);
  
    if (reg_name[0] == 's' && reg_name[1] == 't')
      {
*************** supply_fpregset (elf_fpregset_t * fxsave
*** 231,238 ****
  {
    int i, reg_st0, reg_mxcsr;
  
!   reg_st0 = x86_64_register_name2nr ("st0");
!   reg_mxcsr = x86_64_register_name2nr ("mxcsr");
  
    gdb_assert (reg_st0 > 0 && reg_mxcsr > reg_st0);
  
--- 231,238 ----
  {
    int i, reg_st0, reg_mxcsr;
  
!   reg_st0 = x86_64_register_number ("st0");
!   reg_mxcsr = x86_64_register_number ("mxcsr");
  
    gdb_assert (reg_st0 > 0 && reg_mxcsr > reg_st0);
  

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

end of thread, other threads:[~2002-06-20 13:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-19  8:01 [patch] another const char *register_name() Andrew Cagney
2002-06-20  6:08 ` Michal Ludvig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox