<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp, branch users/nico/python-2</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[lldb][DWARF] Support retrieving DW_FORM_implicit_const value with DWARFDebugInfoEntry::GetAttributeValue (#145328)</title>
<updated>2025-06-23T16:25:57+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2025-06-23T16:25:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=634fe0de50418464635227443c1ac866362e2f08'/>
<id>634fe0de50418464635227443c1ac866362e2f08</id>
<content type='text'>
`DWARFFormValue::ExtractValue` has nothing to extract for
`DW_FORM_implicit_const` since the value is stored in the abbreviation.
`DWARFFormValue` expects the user to have set the value of the
implicit_const. This patch does so in `GetAttributeValue`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`DWARFFormValue::ExtractValue` has nothing to extract for
`DW_FORM_implicit_const` since the value is stored in the abbreviation.
`DWARFFormValue` expects the user to have set the value of the
implicit_const. This patch does so in `GetAttributeValue`.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][DWARF] Don't try to compute address range information of forward declarations (#144059)</title>
<updated>2025-06-13T13:40:27+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2025-06-13T13:40:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c3ec9e3f6553b43caf2b9d754f128abbf44cf80e'/>
<id>c3ec9e3f6553b43caf2b9d754f128abbf44cf80e</id>
<content type='text'>
This fixes the error reported in
https://github.com/llvm/llvm-project/pull/144037.

When computing the aranges table of a CU, LLDB would currently visit all
`DW_TAG_subprogram` DIEs and check their
`DW_AT_low_pc`/`DW_AT_high_pc`/`DW_AT_ranges` attributes. If those don't
exist it would error out and spam the console. Some subprograms
(particularly forward declarations) don't have low/high pc attributes,
so it's not really an "error". See DWARFv5 spec section `3.3.3
Subroutine and Entry Point Locations`:
```
A subroutine entry may have either a DW_AT_low_pc and DW_AT_high_pc
pair of attributes or a DW_AT_ranges attribute whose values encode the
contiguous or non-contiguous address ranges, respectively, of the machine
instructions generated for the subroutine (see Section 2.17 on page 51).
...
A subroutine entry representing a subroutine declaration that is not also a
definition does not have code address or range attributes.
```

We should just ignore those DIEs.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes the error reported in
https://github.com/llvm/llvm-project/pull/144037.

When computing the aranges table of a CU, LLDB would currently visit all
`DW_TAG_subprogram` DIEs and check their
`DW_AT_low_pc`/`DW_AT_high_pc`/`DW_AT_ranges` attributes. If those don't
exist it would error out and spam the console. Some subprograms
(particularly forward declarations) don't have low/high pc attributes,
so it's not really an "error". See DWARFv5 spec section `3.3.3
Subroutine and Entry Point Locations`:
```
A subroutine entry may have either a DW_AT_low_pc and DW_AT_high_pc
pair of attributes or a DW_AT_ranges attribute whose values encode the
contiguous or non-contiguous address ranges, respectively, of the machine
instructions generated for the subroutine (see Section 2.17 on page 51).
...
A subroutine entry representing a subroutine declaration that is not also a
definition does not have code address or range attributes.
```

We should just ignore those DIEs.</pre>
</div>
</content>
</entry>
<entry>
<title>[LLDB][NFC] Added the interface DWARFExpression::Delegate to break dependencies and reduce lldb-server size (#131645)</title>
<updated>2025-03-24T14:40:49+00:00</updated>
<author>
<name>Dmitry Vasilyev</name>
<email>dvassiliev@accesssoftek.com</email>
</author>
<published>2025-03-24T14:40:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2edf534f5542a02f3ea3c70effb9503c99add809'/>
<id>2edf534f5542a02f3ea3c70effb9503c99add809</id>
<content type='text'>
This patch addresses the issue #129543.
After this patch DWARFExpression does not call DWARFUnit directly and does not depend on
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp and a lot of clang code.
After this patch the size of lldb-server binary (Linux Aarch64) is reduced from 47MB to 17MB.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch addresses the issue #129543.
After this patch DWARFExpression does not call DWARFUnit directly and does not depend on
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp and a lot of clang code.
After this patch the size of lldb-server binary (Linux Aarch64) is reduced from 47MB to 17MB.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Use the first address range as the function address (#122440)</title>
<updated>2025-01-24T11:50:06+00:00</updated>
<author>
<name>Pavel Labath</name>
<email>pavel@labath.sk</email>
</author>
<published>2025-01-24T11:50:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=57b48987f6c21e369e7bb1626dc79ca74aa34fdb'/>
<id>57b48987f6c21e369e7bb1626dc79ca74aa34fdb</id>
<content type='text'>
This is the behavior expected by DWARF. It also requires some fixups to
algorithms which were storing the addresses of some objects (Blocks and
Variables) relative to the beginning of the function.

There are plenty of things that still don't work in this setups, but
this change is sufficient for the expression evaluator to correctly
recognize the entry point of a function in this case.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is the behavior expected by DWARF. It also requires some fixups to
algorithms which were storing the addresses of some objects (Blocks and
Variables) relative to the beginning of the function.

There are plenty of things that still don't work in this setups, but
this change is sufficient for the expression evaluator to correctly
recognize the entry point of a function in this case.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][DWARF] Change GetAttributes parameter from SmallVector to SmallVectorImpl</title>
<updated>2025-01-17T14:56:41+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2025-01-17T14:56:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a4d45fe8462bf7042bac2edfb87e3e41e4156ba4'/>
<id>a4d45fe8462bf7042bac2edfb87e3e41e4156ba4</id>
<content type='text'>
Fixes the lldb-arm-ubuntu buildbot failure:
```
../llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp:374:26:
error: non-const lvalue reference to type 'SmallVector&lt;[...], (default)
CalculateSmallVectorDefaultInlinedElements&lt;T&gt;::value aka 6&gt;' cannot bind
to a value of unrelated type 'SmallVector&lt;[...], 3&gt;'
  374 |     if (!::GetAttributes(worklist, seen, attributes)) {
      |                          ^~~~~~~~
../llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp:288:56:
note: passing argument to parameter 'worklist' here
  288 | static bool GetAttributes(llvm::SmallVector&lt;DWARFDIE&gt; &amp;worklist,
      |                                                        ^
1 error generated.
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes the lldb-arm-ubuntu buildbot failure:
```
../llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp:374:26:
error: non-const lvalue reference to type 'SmallVector&lt;[...], (default)
CalculateSmallVectorDefaultInlinedElements&lt;T&gt;::value aka 6&gt;' cannot bind
to a value of unrelated type 'SmallVector&lt;[...], 3&gt;'
  374 |     if (!::GetAttributes(worklist, seen, attributes)) {
      |                          ^~~~~~~~
../llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp:288:56:
note: passing argument to parameter 'worklist' here
  288 | static bool GetAttributes(llvm::SmallVector&lt;DWARFDIE&gt; &amp;worklist,
      |                                                        ^
1 error generated.
```
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][DWARF] Change GetAttributes to always visit current DIE before recursing (#123261)</title>
<updated>2025-01-17T13:09:52+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2025-01-17T13:09:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5153a90453e692b834e38eec247a0c88a0678bfa'/>
<id>5153a90453e692b834e38eec247a0c88a0678bfa</id>
<content type='text'>
`GetAttributes` returns all attributes on a given DIE, including any
attributes that the DIE references via `DW_AT_abstract_origin` and
`DW_AT_specification`. However, if an attribute exists on both the
referring DIE and the referenced DIE, the first one encountered will be
the one that takes precendence when querying the returned
`DWARFAttributes`. But there was no guarantee in which order those
attributes get visited. That means there's no convenient way of ensuring
that an attribute of a definition doesn't get shadowed by one found on
the declaration. One use-case where we don't want this to happen is for
`DW_AT_object_pointer` (which can exist on both definitions and
declarations, see https://github.com/llvm/llvm-project/pull/123089).

This patch makes sure we visit the current DIE's attributes before
following DIE references. I tried keeping as much of the original
`GetAttributes` unchanged and just add an outer `GetAttributes` that
keeps track of the DIEs we need to visit next.

There's precendent for this iteration order in
`llvm::DWARFDie::findRecursively` and also
`lldb_private::ElaboratingDIEIterator`. We could use the latter to
implement `GetAttributes`, though it also follows `DW_AT_signature` so I
decided to leave it for follow-up.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`GetAttributes` returns all attributes on a given DIE, including any
attributes that the DIE references via `DW_AT_abstract_origin` and
`DW_AT_specification`. However, if an attribute exists on both the
referring DIE and the referenced DIE, the first one encountered will be
the one that takes precendence when querying the returned
`DWARFAttributes`. But there was no guarantee in which order those
attributes get visited. That means there's no convenient way of ensuring
that an attribute of a definition doesn't get shadowed by one found on
the declaration. One use-case where we don't want this to happen is for
`DW_AT_object_pointer` (which can exist on both definitions and
declarations, see https://github.com/llvm/llvm-project/pull/123089).

This patch makes sure we visit the current DIE's attributes before
following DIE references. I tried keeping as much of the original
`GetAttributes` unchanged and just add an outer `GetAttributes` that
keeps track of the DIEs we need to visit next.

There's precendent for this iteration order in
`llvm::DWARFDie::findRecursively` and also
`lldb_private::ElaboratingDIEIterator`. We could use the latter to
implement `GetAttributes`, though it also follows `DW_AT_signature` so I
decided to leave it for follow-up.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb/DWARF] s/DWARFRangeList/llvm::DWARFAddressRangeVector (#116620)</title>
<updated>2024-12-13T13:29:59+00:00</updated>
<author>
<name>Pavel Labath</name>
<email>pavel@labath.sk</email>
</author>
<published>2024-12-13T13:29:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fb8df8cb658278ceba9ef4b96e0b448aed32c1f6'/>
<id>fb8df8cb658278ceba9ef4b96e0b448aed32c1f6</id>
<content type='text'>
The main difference is that the llvm class (just a std::vector in
disguise) is not sorted. It turns out this isn't an issue because the
callers either:
- ignore the range list;
- convert it to a different format (which is then sorted);
- or query the minimum value (which is faster than sorting)

The last case is something I want to get rid of in a followup as a part
of removing the assumption that function's entry point is also its
lowest address.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The main difference is that the llvm class (just a std::vector in
disguise) is not sorted. It turns out this isn't an issue because the
callers either:
- ignore the range list;
- convert it to a different format (which is then sorted);
- or query the minimum value (which is faster than sorting)

The last case is something I want to get rid of in a followup as a part
of removing the assumption that function's entry point is also its
lowest address.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] rm DWARFDebugRanges (#116379)</title>
<updated>2024-11-18T09:21:49+00:00</updated>
<author>
<name>Pavel Labath</name>
<email>pavel@labath.sk</email>
</author>
<published>2024-11-18T09:21:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4e7682b1c47d4bd81acb6bcb028b48a4ebff9117'/>
<id>4e7682b1c47d4bd81acb6bcb028b48a4ebff9117</id>
<content type='text'>
The class is only used from one place, which is trivial to implement
using the llvm class.

The main difference is that in the new implementation, the ranges are
parsed each time anew (instead of being parsed at startup and cached). I
believe this is fine because:
- this is already how things work with DWARF v5 debug_rnglists
- parsing debug_ranges is fairly fast (definitely faster than rnglists)
- generally, this result will be cached at a higher level anyway.
Browsing the code I did find one instance where that is not the case --
SymbolFileDWARF::ResolveFunctionAndBlock -- which is called each time we
resolve an address (to the block level). However, this function is
already pretty suboptimal: it first traverses the DIE tree (which
involves parsing all the DIE attributes) to find the correct block, then
it parses them again to construct the `lldb_private::Block`
representation, and *then* it uses the ID of the block DIE it found in
the first step to look up the `Block` object. If this turns out to be a
bottleneck, I think there are better ways to optimize it than caching
the debug_ranges parse.

The motiviation for this is that DWARFDebugRanges sorts the block
ranges, even though the order of the ranges is load-bearing (in the
absence of DW_AT_low_pc, the "base address" of a scope is determined by
the first range entry). Delaying the parsing (and sorting) step makes it
easier to access the first entry.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The class is only used from one place, which is trivial to implement
using the llvm class.

The main difference is that in the new implementation, the ranges are
parsed each time anew (instead of being parsed at startup and cached). I
believe this is fine because:
- this is already how things work with DWARF v5 debug_rnglists
- parsing debug_ranges is fairly fast (definitely faster than rnglists)
- generally, this result will be cached at a higher level anyway.
Browsing the code I did find one instance where that is not the case --
SymbolFileDWARF::ResolveFunctionAndBlock -- which is called each time we
resolve an address (to the block level). However, this function is
already pretty suboptimal: it first traverses the DIE tree (which
involves parsing all the DIE attributes) to find the correct block, then
it parses them again to construct the `lldb_private::Block`
representation, and *then* it uses the ID of the block DIE it found in
the first step to look up the `Block` object. If this turns out to be a
bottleneck, I think there are better ways to optimize it than caching
the debug_ranges parse.

The motiviation for this is that DWARFDebugRanges sorts the block
ranges, even though the order of the ranges is load-bearing (in the
absence of DW_AT_low_pc, the "base address" of a scope is determined by
the first range entry). Delaying the parsing (and sorting) step makes it
easier to access the first entry.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Index static const members of classes, structs and unions as global variables in DWARF 4 and earlier (#111859)</title>
<updated>2024-11-07T11:06:03+00:00</updated>
<author>
<name>Ilia Kuklin</name>
<email>ikuklin@accesssoftek.com</email>
</author>
<published>2024-11-07T11:06:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1361c19c04d0b3d9156fe0c5393d158cf69c14e7'/>
<id>1361c19c04d0b3d9156fe0c5393d158cf69c14e7</id>
<content type='text'>
In DWARF 4 and earlier `static const` members of structs, classes and
unions have an entry tag `DW_TAG_member`, and are also tagged as
`DW_AT_declaration`, but otherwise follow the same rules as
`DW_TAG_variable`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In DWARF 4 and earlier `static const` members of structs, classes and
unions have an entry tag `DW_TAG_member`, and are also tagged as
`DW_AT_declaration`, but otherwise follow the same rules as
`DW_TAG_variable`.</pre>
</div>
</content>
</entry>
<entry>
<title>Fix an integer trunctation issues for the DW_AT_frame_base DWARF location expression (#110388)</title>
<updated>2024-09-30T16:04:09+00:00</updated>
<author>
<name>Greg Clayton</name>
<email>gclayton@fb.com</email>
</author>
<published>2024-09-30T16:04:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b086f7591ce8d4f810a472554d38b4437dff6919'/>
<id>b086f7591ce8d4f810a472554d38b4437dff6919</id>
<content type='text'>
This patch allows offsets to the DW_AT_frame_base to exceed 4GB. Prior
to this, for any .debug_info.dwo offset that exceeded 4GB, we would
truncate the offset to the DW_AT_frame_base expression bytes to be 32
bit only. Changing the offset to 64 bits restores correct functionality.

No test for this as we don't want to create a .dwp file that has a
.debug_info.dwo size that is over 4GB.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch allows offsets to the DW_AT_frame_base to exceed 4GB. Prior
to this, for any .debug_info.dwo offset that exceeded 4GB, we would
truncate the offset to the DW_AT_frame_base expression bytes to be 32
bit only. Changing the offset to 64 bits restores correct functionality.

No test for this as we don't want to create a .dwp file that has a
.debug_info.dwo size that is over 4GB.</pre>
</div>
</content>
</entry>
</feed>
