[Dwarf-Discuss] DWARF and online-compiled programs (Simon Brand)

Pedro Alves palves@redhat.com
Mon Jun 13 10:28:37 GMT 2016


(sorry for the double-post for those to got it, hadn't realized
this address wasn't subscribed to the list, and thus got rejected.)

On 06/13/2016 09:07 AM, Simon Brand wrote:

> Also, the source might not be "in memory", as it might be placed in a
> binary segment which is not loaded. The debugger should be interpreting
> the location as something like the ELF virtual address to locate the
> source in the object file.

In that case, wouldn't it be better to instead represent the source
as another debug string, with DW_FORM_string, or
.debug_str/DW_FORM_strp, or .debug_str_offsets/DW_FORM_strx, etc. ?

For example, add a new attribute, e.g., DW_AT_source, and in 3.1.1
where DW_AT_name is described:

 Compilation unit entries may have the following attributes:
 ...
 2. A DW_AT_name attribute whose value is a null-terminated string containing
 the full or relative path name of the primary source file from which the
 compilation unit was derived.

Change it to say either DW_AT_name or DW_AT_source.  Something like:

 2. Either a DW_AT_name attribute whose value is a null-terminated string
 containing the full or relative path name of the primary source file from
 which the compilation unit was derived, or a DW_AT_source attribute whose
 value is a null-terminated string containing the full contents of the source
 code from which the compilation unit was derived.

Thanks,
Pedro Alves




More information about the Dwarf-discuss mailing list