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: [DWARF/RFC] end-address overflow in location description entry


[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;

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