This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [Patch v2 01/10] vla: introduce new bound type abstraction adapt uses
- From: "Agovic, Sanimir" <sanimir dot agovic at intel dot com>
- To: 'Doug Evans' <xdje42 at gmail dot com>
- Cc: Tom Tromey <tromey at redhat dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, "Boell, Keven" <keven dot boell at intel dot com>
- Date: Mon, 25 Nov 2013 15:48:28 +0000
- Subject: RE: [Patch v2 01/10] vla: introduce new bound type abstraction adapt uses
- Authentication-results: sourceware.org; auth=none
- References: <1385044223-24650-1-git-send-email-sanimir dot agovic at intel dot com> <1385044223-24650-2-git-send-email-sanimir dot agovic at intel dot com> <CAP9bCMQLMe=ByQP1c2J5i-FP5=+JT7vtin82ctbbpPb=VnO8kQ at mail dot gmail dot com>
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