diff mbox

[1/3] arc: Add a gdbarch_tdep structure

Message ID 1475843870-11449-1-git-send-email-Anton.Kolesov@synopsys.com
State New
Headers show

Commit Message

Anton Kolesov Oct. 7, 2016, 12:37 p.m. UTC
Add target-specific structure gdbarch_tdep for ARC.

gdb/ChangeLog:

	* arc-tdep.h: Define gdbarch_tdep.
	* arc-tdep.c (arc_gdbarch_init): Allocate gdbarch_tdep.
---
 gdb/arc-tdep.c | 5 ++++-
 gdb/arc-tdep.h | 6 ++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

Comments

Yao Qi Oct. 11, 2016, 4:16 p.m. UTC | #1
Anton Kolesov <Anton.Kolesov@synopsys.com> writes:

Patch is good to me.

> gdb/ChangeLog:
>
> 	* arc-tdep.h: Define gdbarch_tdep.

Nit,

        * arc-tdep.h (struct gdbarch_tdep): New.

> 	* arc-tdep.c (arc_gdbarch_init): Allocate gdbarch_tdep.
diff mbox

Patch

diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c
index 60a4e04..58de8e9 100644
--- a/gdb/arc-tdep.c
+++ b/gdb/arc-tdep.c
@@ -1159,7 +1159,10 @@  arc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   if (!arc_tdesc_init (info, &tdesc, &tdesc_data))
     return NULL;
 
-  struct gdbarch *gdbarch = gdbarch_alloc (&info, NULL);
+  /* Allocate the ARC-private target-dependent information structure, and the
+     GDB target-independent information structure.  */
+  struct gdbarch_tdep *tdep = XCNEW (struct gdbarch_tdep);
+  struct gdbarch *gdbarch = gdbarch_alloc (&info, tdep);
 
   /* Data types.  */
   set_gdbarch_short_bit (gdbarch, 16);
diff --git a/gdb/arc-tdep.h b/gdb/arc-tdep.h
index 1b2694b..ea34b9e 100644
--- a/gdb/arc-tdep.h
+++ b/gdb/arc-tdep.h
@@ -77,6 +77,12 @@  enum arc_regnum
 
 extern int arc_debug;
 
+/* Target-dependent information.  */
+
+struct gdbarch_tdep
+{
+};
+
 /* Utility functions used by other ARC-specific modules.  */
 
 static inline int