4 Commits

Author SHA1 Message Date
Jonas Devlieghere
096c530ab3
[lldb] Fix Python test formatting (NFC) 2024-02-15 22:54:00 -08:00
Pavel Labath
15311d5822 [lldb] Skip TestExecutableFirst.test_executable_is_first_before_run on ELF
ELF does not have a hard distinction between shared libraries (and
position-independent) executables. It is possible to create a shared
library that will also be executable.
2024-01-17 10:36:44 +00:00
jimingham
705c5b80ac
Add the Linux "you can use this binary" bits to run_to_source_breakpoint (#78377)
Follow-on to a4cd99ea8736eda2b8b4de34453f55008bcf9c30 - I forgot you
have to add ANY shared library you want to use to extra_images...
2024-01-16 17:54:12 -08:00
jimingham
a4cd99ea87
Ensure that the executable module is ModuleList[0] (#78360)
We claim in a couple places that the zeroth element of the module list
for a target is the main executable, but we don't actually enforce that
in the ModuleList class. As we saw, for instance, in

32dd5b20973bde1ef77fa3b84b9f85788a1a303a

it's not all that hard to get this to be off. This patch ensures that
the first object file of type Executable added to it is moved to the
front of the ModuleList. I also added a test for this.

In the normal course of operation, where the executable is added first,
this only adds a check for whether the first element in the module list
is an executable. If that's true, we just append as normal.

Note, the code in Target::GetExecutableModule doesn't actually agree
that the zeroth element must be the executable, it instead returns the
first Module of type Executable. But I can't tell whether that was a
change in intention or just working around the bug that we don't always
maintain this ordering. But given we've said this in scripting as well
as internally, I think we shouldn't change our minds about this.
2024-01-16 17:12:32 -08:00