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] Re: x86-64-tdep.h cleanup


Andreas Schwab wrote:
> I think the registration of the Linux specific gdbarch functions should be
> moved to x86-64-linux-tdep.c.

It seems reasonable. Perhaps I can do it like in the attachment?
Michal Ludvig
-- 
* SuSE CR, s.r.o     * mludvig@suse.cz
* +420 2 9654 5373   * http://www.suse.cz
Index: x86-64-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/x86-64-linux-tdep.c,v
retrieving revision 1.4
diff -c -3 -p -r1.4 x86-64-linux-tdep.c
*** x86-64-linux-tdep.c	2002/02/24 22:14:33	1.4
--- x86-64-linux-tdep.c	2002/03/06 16:34:55
*************** x86_64_linux_frame_saved_pc (struct fram
*** 134,136 ****
--- 134,144 ----
      return x86_64_linux_sigtramp_saved_pc (frame);
    return cfi_get_ra (frame);
  }
+ 
+ /* Set Linux specific functions into gdbarch vector.  */
+ void
+ linux_gdbarch_init (struct gdbarch *gdbarch)
+ {
+   set_gdbarch_saved_pc_after_call (gdbarch, x86_64_linux_saved_pc_after_call);
+   set_gdbarch_frame_saved_pc (gdbarch, x86_64_linux_frame_saved_pc);
+ }
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/06 16:34:55
*************** int x86_64_register_raw_size_table[X86_6
*** 59,64 ****
--- 59,67 ----
    4
  };
  
+ /* Prototype of function from x86-64-linux-tdep.c.  */
+ void linux_gdbarch_init (struct gdbarch *gdbarch);
+ 
  /* Number of bytes of storage in the actual machine representation for
     register REGNO.  */
  int
*************** i386_gdbarch_init (struct gdbarch_info i
*** 892,898 ****
  
    set_gdbarch_frameless_function_invocation (gdbarch,
  					     x86_64_frameless_function_invocation);
-   set_gdbarch_frame_saved_pc (gdbarch, x86_64_linux_frame_saved_pc);
  
    set_gdbarch_frame_args_address (gdbarch, default_frame_address);
    set_gdbarch_frame_locals_address (gdbarch, default_frame_address);
--- 895,900 ----
*************** i386_gdbarch_init (struct gdbarch_info i
*** 966,973 ****
  
    set_gdbarch_skip_prologue (gdbarch, x86_64_skip_prologue);
  
-   set_gdbarch_saved_pc_after_call (gdbarch, x86_64_linux_saved_pc_after_call);
- 
    set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
  
    set_gdbarch_breakpoint_from_pc (gdbarch, x86_64_breakpoint_from_pc);
--- 968,973 ----
*************** i386_gdbarch_init (struct gdbarch_info i
*** 979,984 ****
--- 979,988 ----
  
  /* Use dwarf2 debug frame informations.  */
    set_gdbarch_dwarf2_build_frame_info (gdbarch, dwarf2_build_frame_info);
+ 
+ /* Set Linux specific functions.  */
+   linux_gdbarch_init (gdbarch);
+ 
    return gdbarch;
  }
  

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