This is the mail archive of the gdb-patches@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]

Re: [PATCH 03/25] Class-fy tdesc_reg tdesc_type and tdesc_feature


On 2017-06-12 10:41, Yao Qi wrote:
--- a/gdb/target-descriptions.c
+++ b/gdb/target-descriptions.c
@@ -48,6 +48,32 @@ DEF_VEC_O(property_s);

 typedef struct tdesc_reg
 {
+public:
+  tdesc_reg (struct tdesc_feature *feature, const char *name_,
+	     int regnum, int save_restore_, const char *group_,
+	     int bitsize_, const char *type_)
+    : name (xstrdup (name_)), target_regnum (regnum),
+      save_restore (save_restore_),
+      group (group_ ? xstrdup (group_) : NULL),
+      bitsize (bitsize_),
+      type (type_ ? xstrdup (type_) : xstrdup ("<unknown>"))

Oh, I forgot to mention: you could take this opportunity to make these expression respect our coding style (use != NULL to check for NULL pointer).

Simon


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