This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [DWARF/RFC] end-address overflow in location description entry
- From: Joel Brobecker <brobecker at adacore dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 9 Nov 2010 11:42:01 -0800
- Subject: Re: [DWARF/RFC] end-address overflow in location description entry
- References: <20101109193527.GI2811@adacore.com>
[wrong patch attached, sorry]
> like this:
>
> if (low == 0 && high == base_mask)
> {
> *locexpr_length = length;
> return loc_ptr;
Here is the actual patch (lacking comments, but this is only for
experimenting). If we decide to handle this situation, I'll add
proper comments.
--
Joel
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index b2aecf2..0e3cfff 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -104,6 +104,9 @@ find_location_expression (struct dwarf2_loclist_baton *baton,
if (low == 0 && high == 0)
return NULL;
+ if (low == 0 && high == base_mask)
+ base_address = 0;
+
/* Otherwise, a location expression entry. */
low += base_address;
high += base_address;
@@ -2546,6 +2549,9 @@ loclist_describe_location (struct symbol *symbol, CORE_ADDR addr,
if (low == 0 && high == 0)
break;
+ if (low == 0 && high == base_mask)
+ base_address = 0;
+
/* Otherwise, a location expression entry. */
low += base_address;
high += base_address;