[PATCH v2 1/3] Support for DW_AT_loclists_base and DW_FORM_loclistx.

Tom Tromey tom@tromey.com
Wed Apr 1 19:16:15 GMT 2020


>>>>> ">" == nitachra  <Nitika.Achra@amd.com> writes:

Still some style nits here.  I listed them below.

What I primarily don't understand is:

+  gdb::optional<ULONGEST> loclist_base;

This uses an optional but it's never checked for validity.
It seems like it should be checked somewhere.

>> +read_loclist_header (struct loclist_header *header, struct dwarf2_section_info *section)

Over-long line.

>> +/* Return the DW_AT_loclists_base value for the CU.  */
>> +static ULONGEST
>> +lookup_loclist_base (struct dwarf2_cu *cu)
>> +{
>> +  /* For the .dwo unit, the loclist_base points to the first offset following
>> +     the header. The header consists of the following entities-
>> +     1. Unit Length (4 bytes for 32 bit DWARF format, and 12 bytes for the 64 bit format)

Here too.

>> +/* Given a DW_FORM_loclistx value LOCLIST_INDEX, fetch the offset from the array

Here too.

>> +    complaint(_("DW_FORM_loclistx used without .debug_loclists section [in module %s]"),
>> +	objfile_name (objfile));

Space before the paren after "complaint"; second line should line up
just after the "(".

>> +    complaint(_("DW_FORM_loclistx pointing outside of "
>> +	".debug_loclists offset array [in module %s]"),
>> +	objfile_name (objfile));

Formatting here too, and another complaint in this function.

>>        info_ptr += bytes_read;
>>        break;
>> +    case DW_FORM_loclistx:
>> +    {
>> +      *need_reprocess = true;
>> +      DW_UNSND (attr) = read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
>> +      info_ptr += bytes_read;
>> +    }
>> +      break;

This doesn't look like it's indented properly.  See if it lines up with
the other cases.

Tom


More information about the Gdb-patches mailing list