From: Michal Ludvig <mludvig@suse.cz>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [patch] another const char *register_name()
Date: Thu, 20 Jun 2002 06:08:00 -0000 [thread overview]
Message-ID: <3D11D3D5.3080602@suse.cz> (raw)
In-Reply-To: <3D109C94.6050205@cygnus.com>
[-- 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);
prev parent reply other threads:[~2002-06-20 13:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-19 8:01 Andrew Cagney
2002-06-20 6:08 ` Michal Ludvig [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3D11D3D5.3080602@suse.cz \
--to=mludvig@suse.cz \
--cc=ac131313@cygnus.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox