[lldb] Avoid duplicate vdso modules when opening core filesWhen opening core files (and also in some other situations) we could endup with two vdso modules. This could happen because the vdso modu
[lldb] Avoid duplicate vdso modules when opening core filesWhen opening core files (and also in some other situations) we could endup with two vdso modules. This could happen because the vdso module isvery special, and over the years, we have accumulated various ways toload it.In D10800, we added one mechanism for loading it, which took the form ofa generic load-from-memory capability. Unfortunately loading an elf filefrom memory is not possible (because the loader never loads the entirefile), and our attempts to do so were causing crashes. So, in D34352, wepartially reverted D10800 and implemented a custom mechanism specific tothe vdso.Unfortunately, enough of D10800 remained such that, under the rightcircumstances, it could end up loading a second (non-functional) copy ofthe vdso module. This happened when the process plugin did not supportthe extended MemoryRegionInfo query (added in D22219, to workaround adifferent bug), which meant that the loader plugin was not able torecognise that the linux-vdso.so.1 module (this is how the loader callsit) is in fact the same as the [vdso] module (the name used in/proc/$PID/maps) we loaded before. This typically happened in a corefile, as they don't store this kind of information.This patch fixes the issue by completing the revert of D10800 -- thememory loading code is removed completely. It also reduces the scope ofthe hackaround introduced in D22219 -- it isn't completely sound and isonly relevant for fairly old (but still supported) versions of android.I added the memory loading logic to the wasm dynamic loader, which hassince appeared and is relying on this feature (it even has a test). Asfar as I can tell loading wasm modules from memory is possible andreliable. MachO memory loading is not affected by this patch, as it usesa completely different code path.Since the scenarios/patches I described came without test cases, I havecreated two new gdb-client tests cases for them. They're notparticularly readable, but right now, this is the best way we cansimulate the behavior (bugs) of a particular dynamic linker.Differential Revision: https://reviews.llvm.org/D122660
show more ...
[lldb] Rename Logging.h to LLDBLog.h and clean up includesMost of our code was including Log.h even though that is not where the"lldb" log channel is defined (Log.h defines the generic logginginf
[lldb] Rename Logging.h to LLDBLog.h and clean up includesMost of our code was including Log.h even though that is not where the"lldb" log channel is defined (Log.h defines the generic logginginfrastructure). This worked because Log.h included Logging.h, eventhough it should.After the recent refactor, it became impossible the two files includeeach other in this direction (the opposite inclusion is needed), so thispatch removes the workaround that was put in place and cleans up allfiles to include the right thing. It also renames the file to LLDBLog tobetter reflect its purpose.
[lldb] Convert "LLDB" log channel to the new API
Remove ConstString from DynamicLoader, JITLoader and Instruction plugin names
[lldb] Return StringRef from PluginInterface::GetPluginNameThere is no reason why this function should be returning a ConstString.While modifying these files, I also fixed several instances where
[lldb] Return StringRef from PluginInterface::GetPluginNameThere is no reason why this function should be returning a ConstString.While modifying these files, I also fixed several instances whereGetPluginName and GetPluginNameStatic were returning different strings.I am not changing the return type of GetPluginNameStatic in this patch, as thatwould necessitate additional changes, and this patch is big enough as it is.Differential Revision: https://reviews.llvm.org/D111877
[lldb] Remove PluginInterface::GetPluginVersionIn all these years, we haven't found a use for this function (it haszero callers). Lets just remove the boilerplate.Differential Revision: https://
[lldb] Remove PluginInterface::GetPluginVersionIn all these years, we haven't found a use for this function (it haszero callers). Lets just remove the boilerplate.Differential Revision: https://reviews.llvm.org/D109600
[LLDB] Add DynamicLoaderWasmDYLD plugin for WebAssembly debuggingAdd a dynamic loader plug-in class for WebAssembly modules.Differential Revision: https://reviews.llvm.org/D72751
Revert "[LLDB] Add DynamicLoaderWasmDYLD plugin for WebAssembly debugging"This patch has a couple of outstanding issues. The test is not python3compatible, and it also seems to fail with python2 (
Revert "[LLDB] Add DynamicLoaderWasmDYLD plugin for WebAssembly debugging"This patch has a couple of outstanding issues. The test is not python3compatible, and it also seems to fail with python2 (at least under somecircumstances) due to an overambitious assertion.This reverts the patch as well as subsequent fixup attempts:014ea9337624fe20aca8892e73b6b3f741d8da9e,f5f70d1c8fbf12249b4b9598f10a10f12d4db029.4697e701b8cb40429818609814c7422e49b2ee07.5c15e8e682e365b3a7fcf35200df79f3fb93b924.3ec28da6d6430a00b46780555a87acd43fcab790.
Add missing directory from 3ec28da6Also revert 4697e701b8, restoring the original patch fromhttps://reviews.llvm.org/D72751