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 v2 01/10] vla: introduce new bound type abstraction adapt uses


Thanks for your review.

> There are various abstraction boundaries that gdb tries to maintain
> between gdb proper and other pieces (like debug format readers).
> We don't always maintain these boundaries (e.g., grep for existing
> uses of the word "dwarf" in gdbtypes.h) but IWBN to at least have a
> discussion every time such boundaries are violated.
> 
Agreed, the dwarf bits leak implementation details of the bounds
implementation. If you agree I will make this change below part of v3.
Of course the remaining files need to be adapted as well.

diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 85d2768..da1dfe2 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -367,14 +367,14 @@ enum type_instance_flag_value

 /* Used to store bound information for a type.  */

-struct dwarf2_prop
+struct bound_prop
 {
   /* Determine which field of the union dwarf2_prop.data is used.  */
   enum
   {
-    DWARF_UNDEFINED,
-    DWARF_CONST,
-    DWARF_LOCEXPR
+    BOUND_UNDEFINED,
+    BOUND_CONST,
+    BOUND_LOCEXPR
   } kind;

   /* Stores information as location expression, location list,
@@ -382,8 +382,8 @@ struct dwarf2_prop
   union data
   {
     LONGEST const_val;
-    struct dwarf2_locexpr_baton *locexpr;
+    void *locexpr;
   } data;
 };

@@ -613,11 +613,11 @@ struct main_type
     {
       /* Low bound of range.  */

-      struct dwarf2_prop low;
+      struct bound_prop low;

       /* High bound of range.  */

-      struct dwarf2_prop high;
+      struct bound_prop high;
     } *bounds;

   } flds_bnds;
@@ -1097,9 +1097,9 @@ extern void allocate_gnat_aux_type (struct type *);
 #define TYPE_HIGH_BOUND(range_type) \
   TYPE_RANGE_DATA(range_type)->high.data.const_val
 #define TYPE_LOW_BOUND_UNDEFINED(range_type) \
-  (TYPE_RANGE_DATA(range_type)->low.kind == DWARF_UNDEFINED)
+  (TYPE_RANGE_DATA(range_type)->low.kind == BOUND_UNDEFINED)
 #define TYPE_HIGH_BOUND_UNDEFINED(range_type) \
-  (TYPE_RANGE_DATA(range_type)->high.kind == DWARF_UNDEFINED)
+  (TYPE_RANGE_DATA(range_type)->high.kind == BOUND_UNDEFINED)
 #define TYPE_HIGH_BOUND_KIND(range_type) \
   TYPE_RANGE_DATA(range_type)->high.kind
 #define TYPE_LOW_BOUND_KIND(range_type) \
@@ -1567,8 +1567,8 @@ extern struct type *lookup_function_type_with_arguments (struct type *,
                                                         struct type **);

 extern struct type *create_range_type_1 (struct type *, struct type *,
-                                        const struct dwarf2_prop *,
-                                        const struct dwarf2_prop *);
+                                        const struct bound_prop *,
+                                        const struct bound_prop *);


 -Sanimir

Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052


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