This is the mail archive of the gdb-cvs@sourceware.org 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]

[binutils-gdb] gdb: Add gen_return_address for powerpc.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a67914defbe57290c714975d7c1ccefa787fd635

commit a67914defbe57290c714975d7c1ccefa787fd635
Author: Marcin KoÅ?cielnicki <koriakin@0x04.net>
Date:   Thu Jan 7 17:24:48 2016 +0100

    gdb: Add gen_return_address for powerpc.
    
    gdb/ChangeLog:
    
    	* rs6000-tdep.c: Add "ax.h" and "ax-gdb.h" includes.
    	(rs6000_gen_return_address): New function.
    	(rs6000_gdbarch_init): Wire in the above.

Diff:
---
 gdb/ChangeLog     |  6 ++++++
 gdb/rs6000-tdep.c | 17 +++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f2d21d8..74dec87 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
 2016-03-09  Marcin KoÅ?cielnicki  <koriakin@0x04.net>
 
+	* rs6000-tdep.c: Add "ax.h" and "ax-gdb.h" includes.
+	(rs6000_gen_return_address): New function.
+	(rs6000_gdbarch_init): Wire in the above.
+
+2016-03-09  Marcin KoÅ?cielnicki  <koriakin@0x04.net>
+
 	* rs6000-tdep.c (rs6000_ax_pseudo_register_collect): New function.
 	(rs6000_gdbarch_init): Wire in the above.
 
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 3bcd205..565c620 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -63,6 +63,9 @@
 #include "frame-unwind.h"
 #include "frame-base.h"
 
+#include "ax.h"
+#include "ax-gdb.h"
+
 #include "features/rs6000/powerpc-32.c"
 #include "features/rs6000/powerpc-altivec32.c"
 #include "features/rs6000/powerpc-vsx32.c"
@@ -2963,6 +2966,18 @@ rs6000_ax_pseudo_register_collect (struct gdbarch *gdbarch,
 }
 
 
+static void
+rs6000_gen_return_address (struct gdbarch *gdbarch,
+			   struct agent_expr *ax, struct axs_value *value,
+			   CORE_ADDR scope)
+{
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  value->type = register_type (gdbarch, tdep->ppc_lr_regnum);
+  value->kind = axs_lvalue_register;
+  value->u.reg = tdep->ppc_lr_regnum;
+}
+
+
 /* Convert a DBX STABS register number to a GDB register number.  */
 static int
 rs6000_stab_reg_to_regnum (struct gdbarch *gdbarch, int num)
@@ -5972,6 +5987,8 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 	      rs6000_ax_pseudo_register_collect);
     }
 
+  set_gdbarch_gen_return_address (gdbarch, rs6000_gen_return_address);
+
   set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
 
   /* Select instruction printer.  */


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