<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/lldb/source/Symbol/FuncUnwinders.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] Disable some unwind plans for discontinuous functions (#140927)</title>
<updated>2025-05-22T12:18:35+00:00</updated>
<author>
<name>Pavel Labath</name>
<email>pavel@labath.sk</email>
</author>
<published>2025-05-22T12:18:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b63c1c47b78a3c7af3014c4c77d1aad87ec78729'/>
<id>b63c1c47b78a3c7af3014c4c77d1aad87ec78729</id>
<content type='text'>
Basically, disable everything except the eh_frame unwind plan, as that's
the only one which supports this right now. The other plans are working
with now trying the interpret everything in between the function parts
as a part of the function, which is more likely to produce wrong results
than correct ones.

I changed the interface for object file plans, to give the
implementations a chance to implement this correctly, but I haven't
actually converted PECallFrameInfo (its only implementation) to handle
that. (from the looks of things, it should be relatively easy to do, if
it becomes necessary)

I'm also deleting UnwindPlan::GetFirstNonPrologueInsn, as it's not used,
and it doesn't work for discontinuous functions.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Basically, disable everything except the eh_frame unwind plan, as that's
the only one which supports this right now. The other plans are working
with now trying the interpret everything in between the function parts
as a part of the function, which is more likely to produce wrong results
than correct ones.

I changed the interface for object file plans, to give the
implementations a chance to implement this correctly, but I haven't
actually converted PECallFrameInfo (its only implementation) to handle
that. (from the looks of things, it should be relatively easy to do, if
it becomes necessary)

I'm also deleting UnwindPlan::GetFirstNonPrologueInsn, as it's not used,
and it doesn't work for discontinuous functions.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Merge/unify ABI-provided AArch64 unwind plans (#139545)</title>
<updated>2025-05-14T09:29:56+00:00</updated>
<author>
<name>Pavel Labath</name>
<email>pavel@labath.sk</email>
</author>
<published>2025-05-14T09:29:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=adabc83a92130e556d4d16adaee6e81e09fdf570'/>
<id>adabc83a92130e556d4d16adaee6e81e09fdf570</id>
<content type='text'>
The macos and sysv ABIs return functionally equivalent unwind plans, so
they can be implemented in the base AArch64 class. The only difference
between them was that the macos plan provided a "pc=lr" rule whereas the
sysv plan called SetReturnAddressRegister (which causes the unwind
machinery to act as if that rule was present). This difference was
enough to cause `CompareUnwindPlansForIdenticalInitialPCLocation` to
return a different value and break the (temporarily reverted)
TestUnwindFramelessFaulted test.

While merging the two functions, I couldn't stop myself from simplifying
them to use the generic register number schemes -- which exposed another
bug in CompareUnwindPlansForIdenticalInitialPCLocation, namely that it
was expecting all unwind plans to use the LLDB numbering scheme. This
patch fixes that as well.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The macos and sysv ABIs return functionally equivalent unwind plans, so
they can be implemented in the base AArch64 class. The only difference
between them was that the macos plan provided a "pc=lr" rule whereas the
sysv plan called SetReturnAddressRegister (which causes the unwind
machinery to act as if that rule was present). This difference was
enough to cause `CompareUnwindPlansForIdenticalInitialPCLocation` to
return a different value and break the (temporarily reverted)
TestUnwindFramelessFaulted test.

While merging the two functions, I couldn't stop myself from simplifying
them to use the generic register number schemes -- which exposed another
bug in CompareUnwindPlansForIdenticalInitialPCLocation, namely that it
was expecting all unwind plans to use the LLDB numbering scheme. This
patch fixes that as well.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Parse DWARF CFI for discontinuous functions (#137006)</title>
<updated>2025-05-07T13:04:22+00:00</updated>
<author>
<name>Pavel Labath</name>
<email>pavel@labath.sk</email>
</author>
<published>2025-05-07T13:04:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d865f32fe820f543f0a53bfeba08774f2c270589'/>
<id>d865f32fe820f543f0a53bfeba08774f2c270589</id>
<content type='text'>
This patch uses the previously build infrastructure to parse multiple
FDE entries into a single unwind plan. There is one catch though: we
parse only one FDE entry per unwind range. This is not fully correct
because lldb coalesces adjecant address ranges, which means that
something that originally looked like two separate address ranges (and
two FDE entries) may get merged into one because if the linker decides
to put the two ranges next to each other. In this case, we will ignore
the second FDE entry.

It would be more correct to try to parse another entry when the one we
found turns out to be short, but I'm not doing this (yet), because:
- this is how we've done things so far (although, monolithic functions
are unlikely to have more than one FDE entry)
- in cases where we don't have debug info or (full) symbol tables, we
can end up with "symbols" which appear to span many megabytes
(potentially, the whole module). If we tried to fill short FDE entries,
we could end up parsing the entire eh_frame section in a single go. In a
way, this would be more correct, but it would also probably be very
slow.

I haven't quite decided what to do about this case yet, though it's not
particularly likely to happen in the "production" cases as typically the
functions are split into two parts (hot/cold) instead of one part per
basic block.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch uses the previously build infrastructure to parse multiple
FDE entries into a single unwind plan. There is one catch though: we
parse only one FDE entry per unwind range. This is not fully correct
because lldb coalesces adjecant address ranges, which means that
something that originally looked like two separate address ranges (and
two FDE entries) may get merged into one because if the linker decides
to put the two ranges next to each other. In this case, we will ignore
the second FDE entry.

It would be more correct to try to parse another entry when the one we
found turns out to be short, but I'm not doing this (yet), because:
- this is how we've done things so far (although, monolithic functions
are unlikely to have more than one FDE entry)
- in cases where we don't have debug info or (full) symbol tables, we
can end up with "symbols" which appear to span many megabytes
(potentially, the whole module). If we tried to fill short FDE entries,
we could end up parsing the entire eh_frame section in a single go. In a
way, this would be more correct, but it would also probably be very
slow.

I haven't quite decided what to do about this case yet, though it's not
particularly likely to happen in the "production" cases as typically the
functions are split into two parts (hot/cold) instead of one part per
basic block.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Remove unused UnwindPlan functions (#134630)</title>
<updated>2025-04-09T09:04:45+00:00</updated>
<author>
<name>Pavel Labath</name>
<email>pavel@labath.sk</email>
</author>
<published>2025-04-09T09:04:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ea7dd70b5326706141be2a768f2fd47ae71ee6a8'/>
<id>ea7dd70b5326706141be2a768f2fd47ae71ee6a8</id>
<content type='text'>
`GetLSDAAddress` and `GetPersonalityRoutinePtrAddress` are unused and
they create a bit of a problem for discontinuous functions, because the
unwind plan for these consists of multiple eh_frame descriptors and (at
least in theory) each of them could have a different value for these
entities.

We could say we only support functions for which these are always the
same, or create some sort of a Address2LSDA lookup map, but I think it's
better to leave this question to someone who actually needs this.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`GetLSDAAddress` and `GetPersonalityRoutinePtrAddress` are unused and
they create a bit of a problem for discontinuous functions, because the
unwind plan for these consists of multiple eh_frame descriptors and (at
least in theory) each of them could have a different value for these
entities.

We could say we only support functions for which these are always the
same, or create some sort of a Address2LSDA lookup map, but I think it's
better to leave this question to someone who actually needs this.</pre>
</div>
</content>
</entry>
<entry>
<title>Reapply "[lldb] Return *const* UnwindPlan pointers from FuncUnwinders " (#134246)</title>
<updated>2025-04-04T07:49:27+00:00</updated>
<author>
<name>Pavel Labath</name>
<email>pavel@labath.sk</email>
</author>
<published>2025-04-04T07:49:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e4f76e3a3335dda608c661d76efacc70e607a5e4'/>
<id>e4f76e3a3335dda608c661d76efacc70e607a5e4</id>
<content type='text'>
This reverts commit 094904303d50e0ab14bc5f2586a602f79af95953, reapplying
d7afafdbc464e65c56a0a1d77bad426aa7538306 (#133247).

The failure ought to be fixed by
0509932bb6a291ba11253f30c465ab3ad164ae08.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 094904303d50e0ab14bc5f2586a602f79af95953, reapplying
d7afafdbc464e65c56a0a1d77bad426aa7538306 (#133247).

The failure ought to be fixed by
0509932bb6a291ba11253f30c465ab3ad164ae08.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[lldb] Return *const* UnwindPlan pointers from FuncUnwinders (#133247)"</title>
<updated>2025-04-03T09:33:11+00:00</updated>
<author>
<name>Vladislav Dzhidzhoev</name>
<email>vdzhidzhoev@accesssoftek.com</email>
</author>
<published>2025-04-03T09:33:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=094904303d50e0ab14bc5f2586a602f79af95953'/>
<id>094904303d50e0ab14bc5f2586a602f79af95953</id>
<content type='text'>
This reverts commit d7afafdbc464e65c56a0a1d77bad426aa7538306.

Caused remote Linux to Linux buildbot failure
https://lab.llvm.org/buildbot/#/builders/195/builds/7046.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit d7afafdbc464e65c56a0a1d77bad426aa7538306.

Caused remote Linux to Linux buildbot failure
https://lab.llvm.org/buildbot/#/builders/195/builds/7046.
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Return *const* UnwindPlan pointers from FuncUnwinders (#133247)</title>
<updated>2025-04-02T10:48:57+00:00</updated>
<author>
<name>Pavel Labath</name>
<email>pavel@labath.sk</email>
</author>
<published>2025-04-02T10:48:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d7afafdbc464e65c56a0a1d77bad426aa7538306'/>
<id>d7afafdbc464e65c56a0a1d77bad426aa7538306</id>
<content type='text'>
These plans are cached and accessed from multiple threads. Modifying
them would be a Bad Idea(tm).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These plans are cached and accessed from multiple threads. Modifying
them would be a Bad Idea(tm).</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Teach FuncUnwinders about discontinuous functions (#133072)</title>
<updated>2025-03-27T11:51:20+00:00</updated>
<author>
<name>Pavel Labath</name>
<email>pavel@labath.sk</email>
</author>
<published>2025-03-27T11:51:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=17aca79d98d92510d131c4766a040b02adf6c4b8'/>
<id>17aca79d98d92510d131c4766a040b02adf6c4b8</id>
<content type='text'>
The main change here is that we're now able to correctly look up plans
for these functions. Previously, due to caching, we could end up with
one entry covering most of the address space (because part of the
function was at the beginning and one at the end). Now, we can correctly
recognise that the part in between does not belong to that function, and
we can create a different FuncUnwinders instance for it. It doesn't help
the discontinuous function much (its plan will still be garbled), but
we can at least properly unwind out of the simple functions in between.

Fixing the unwind plans for discontinuous functions requires handling
each unwind source specially, and this setup allows us to make the
transition incrementally.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The main change here is that we're now able to correctly look up plans
for these functions. Previously, due to caching, we could end up with
one entry covering most of the address space (because part of the
function was at the beginning and one at the end). Now, we can correctly
recognise that the part in between does not belong to that function, and
we can create a different FuncUnwinders instance for it. It doesn't help
the discontinuous function much (its plan will still be garbled), but
we can at least properly unwind out of the simple functions in between.

Fixing the unwind plans for discontinuous functions requires handling
each unwind source specially, and this setup allows us to make the
transition incrementally.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Modernize ABI-based unwind plan creation (#128505)</title>
<updated>2025-02-26T10:22:11+00:00</updated>
<author>
<name>Pavel Labath</name>
<email>pavel@labath.sk</email>
</author>
<published>2025-02-26T10:22:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=13245cea11050f875891389ce36115c78aaedd4a'/>
<id>13245cea11050f875891389ce36115c78aaedd4a</id>
<content type='text'>
Replace the by-ref return value with an actual result.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace the by-ref return value with an actual result.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Don't hand out UnwindPlan::Row shared_ptrs (#128181)</title>
<updated>2025-02-25T07:58:58+00:00</updated>
<author>
<name>Pavel Labath</name>
<email>pavel@labath.sk</email>
</author>
<published>2025-02-25T07:58:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3872503d6eb3eed7f2b2db13daad27307369f0be'/>
<id>3872503d6eb3eed7f2b2db13daad27307369f0be</id>
<content type='text'>
The whole unwind plan is already stored in a shared pointer, and there's
no need to persist Rows individually. If there's ever a need to do that,
there are at least two options:
- copy the row (they're not that big, and they're being copied left and
right during construction already)
- use the shared_ptr subobject constructor to create a shared_ptr which
points to a Row but holds the entire unwind plan alive

This also changes all of the getter functions to return const Row
pointers, which is important for safety because all of these objects are
cached and potentially accessed from multiple threads. (Technically one
could hand out `shared_ptr&lt;const Row&gt;`s, but we don't have a habit of
doing that.)

As a next step, I'd like to remove the internal UnwindPlan usages of the
shared pointer, but I'm doing this separately to gauge feedback, and
also because the patch got rather big.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The whole unwind plan is already stored in a shared pointer, and there's
no need to persist Rows individually. If there's ever a need to do that,
there are at least two options:
- copy the row (they're not that big, and they're being copied left and
right during construction already)
- use the shared_ptr subobject constructor to create a shared_ptr which
points to a Row but holds the entire unwind plan alive

This also changes all of the getter functions to return const Row
pointers, which is important for safety because all of these objects are
cached and potentially accessed from multiple threads. (Technically one
could hand out `shared_ptr&lt;const Row&gt;`s, but we don't have a habit of
doing that.)

As a next step, I'd like to remove the internal UnwindPlan usages of the
shared pointer, but I'm doing this separately to gauge feedback, and
also because the patch got rather big.</pre>
</div>
</content>
</entry>
</feed>
