x86-64-tdep.h cleanup

Michal Ludvig mludvig@suse.cz
Tue Mar 5 07:56:00 GMT 2002


As it was recommended by lots of people here I moved <sys/reg.h> along 
with regmap from x86-64-tdep.h to x86-64-linux-nat.c.
Also to let x86-64-tdep.h contain only #defines, I moved declarations of 
x86_64_linux_frame_saved_pc and x86_64_linux_saved_pc_after_call to 
x86-64-tdep.c. Are these changes OK to commit?

Michal Ludvig

Index: ChangeLog
from Michal Ludvig  <mludvig@suse.cz>

* x86-64-tdep.h (sys/reg.h, x86_64_regmap): Moved to x86-64-linux-nat.c
(x86_64_linux_frame_saved_pc,
x86_64_linux_saved_pc_after_call): Moved to x86-64-tdep.c
* x86-64-linux-nat.c (sys/reg.h, x86_64_regmap): Moved here
from x86-64-tdep.h
* x86-64-tdep.c (x86_64_linux_frame_saved_pc,
x86_64_linux_saved_pc_after_call): Moved here from x86-64-tdep.h

Index: x86-64-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/x86-64-tdep.h,v
retrieving revision 1.1
diff -c -3 -p -r1.1 x86-64-tdep.h
*** x86-64-tdep.h	2001/09/21 12:19:15	1.1
--- x86-64-tdep.h	2002/03/05 15:03:37
***************
*** 24,49 ****
   #define X86_64_TDEP_H

   #include "i386-tdep.h"
- #include <sys/reg.h>
- /* Mapping between the general-purpose registers in `struct user'
-    format and GDB's register array layout.  */
-
- static int x86_64_regmap[] = {
-   RAX, RDX, RCX, RBX,
-   RSI, RDI, RBP, RSP,
-   R8, R9, R10, R11,
-   R12, R13, R14, R15,
-   RIP, EFLAGS
- };
-
   /* Number of all registers */
   #define X86_64_NUM_REGS (51)

   /* Number of general registers.  */
   #define X86_64_NUM_GREGS (18)
-
- gdbarch_frame_saved_pc_ftype x86_64_linux_frame_saved_pc;
- gdbarch_saved_pc_after_call_ftype x86_64_linux_saved_pc_after_call;

   #endif
--- 24,34 ----
Index: x86-64-linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/x86-64-linux-nat.c,v
retrieving revision 1.5
diff -c -3 -p -r1.5 x86-64-linux-nat.c
*** x86-64-linux-nat.c	2002/02/24 22:14:33	1.5
--- x86-64-linux-nat.c	2002/03/05 15:03:37
***************
*** 33,39 ****
--- 33,51 ----
   #include <sys/debugreg.h>
#include <sys/syscall.h>
#include <sys/procfs.h>
+ #include <sys/reg.h>
+ /* Mapping between the general-purpose registers in `struct user'
+    format and GDB's register array layout.  */
+
+ static int x86_64_regmap[] = {
+   RAX, RDX, RCX, RBX,
+   RSI, RDI, RBP, RSP,
+   R8, R9, R10, R11,
+   R12, R13, R14, R15,
+   RIP, EFLAGS
+ };
+ 	
   static unsigned long
   x86_64_linux_dr_get (int regnum)
   {
Index: x86-64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/x86-64-tdep.c,v
retrieving revision 1.10
diff -c -3 -p -r1.10 x86-64-tdep.c
*** x86-64-tdep.c	2002/03/04 11:08:28	1.10
--- x86-64-tdep.c	2002/03/05 15:03:37
*************** int x86_64_register_raw_size_table[X86_6
*** 59,64 ****
--- 59,69 ----
     4
   };

+ /* Prototypes of some functions from x86-64-linux-tdep.c  */
+
+ gdbarch_frame_saved_pc_ftype x86_64_linux_frame_saved_pc;
+ gdbarch_saved_pc_after_call_ftype x86_64_linux_saved_pc_after_call;
+
   /* Number of bytes of storage in the actual machine representation for
      register REGNO.  */
   int



Michal Ludvig
-- 
* SuSE CR, s.r.o     * mludvig@suse.cz
* +420 2 9654 5373   * http://www.suse.cz
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: x8664-01.diff
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20020305/ec046df9/attachment.ksh>


More information about the Gdb-patches mailing list