summaryrefslogtreecommitdiff
path: root/lldb/test/Shell/ObjectFile
AgeCommit message (Collapse)Author
2021-12-03[LLDB] XFAIL on Arm/Linux minidebuginfo-set-and-hit-breakpoint.testMuhammad Omair Javaid
minidebuginfo-set-and-hit-breakpoint.test is failing on Arm/Linux most probably due to an ill formed binary after removal of certain sections from executable. I am marking it as XFAIL for further investigation.
2021-12-02Include extra input contents on this test so we can see why lldb-arm-ubuntu ↵Greg Clayton
buildbot is failing. Only lldb-arm-ubuntu is failing after https://reviews.llvm.org/D114288 and there isn't enough input context to see why this is failing. It works on x86_64 linux just fine.
2021-10-26[LLDB] Fix LLDB buildbots break due to --image-baseMuhammad Omair Javaid
LLDB build were failing due to following two test failures: lldb-shell :: ObjectFile/ELF/basic-info.yaml lldb-shell :: SymbolFile/DWARF/x86/debug-types-address-ranges.s There were caused by commit 6506907a0a1a8a789ad7036ef911f7e31213c9a5
2021-07-27Create synthetic symbol names on demand to improve memory consumption and ↵Greg Clayton
startup times. This is a resubmission of https://reviews.llvm.org/D105160 after fixing testing issues. This fix was created after profiling the target creation of a large C/C++/ObjC application that contained almost 4,000,000 redacted symbol names. The symbol table parsing code was creating names for each of these synthetic symbols and adding them to the name indexes. The code was also adding the object file basename to the end of the symbol name which doesn't allow symbols from different shared libraries to share the names in the constant string pool. Prior to this fix this was creating 180MB of "___lldb_unnamed_symbol" symbol names and was taking a long time to generate each name, add them to the string pool and then add each of these names to the name index. This patch fixes the issue by: not adding a name to synthetic symbols at creation time, and allows name to be dynamically generated when accessed doesn't add synthetic symbol names to the name indexes, but catches this special case as name lookup time. Users won't typically set breakpoints or lookup these synthetic names, but support was added to do the lookup in case it does happen removes the object file baseanme from the generated names to allow the names to be shared in the constant string pool Prior to this fix the startup times for a large application was: 12.5 seconds (cold file caches) 8.5 seconds (warm file caches) After this fix: 9.7 seconds (cold file caches) 5.7 seconds (warm file caches) The names of the symbols are auto generated by appending the symbol's UserID to the end of the "___lldb_unnamed_symbol" string and is only done when the name is requested from a synthetic symbol if it has no name. Differential Revision: https://reviews.llvm.org/D106837
2021-07-26[test] Fix PayloadString: in lldb testsFangrui Song
2021-07-02Revert "Create synthetic symbol names on demand to improve memory ↵Jonas Devlieghere
consumption and startup times." This reverts commit c8164d0276b97679e80db01adc860271ab4a5d11 and 43f6dad2344247976d5777f56a1fc29e39c6c717 because it breaks TestDyldTrieSymbols.py on GreenDragon.
2021-06-29Create synthetic symbol names on demand to improve memory consumption and ↵Greg Clayton
startup times. This fix was created after profiling the target creation of a large C/C++/ObjC application that contained almost 4,000,000 redacted symbol names. The symbol table parsing code was creating names for each of these synthetic symbols and adding them to the name indexes. The code was also adding the object file basename to the end of the symbol name which doesn't allow symbols from different shared libraries to share the names in the constant string pool. Prior to this fix this was creating 180MB of "___lldb_unnamed_symbol" symbol names and was taking a long time to generate each name, add them to the string pool and then add each of these names to the name index. This patch fixes the issue by: - not adding a name to synthetic symbols at creation time, and allows name to be dynamically generated when accessed - doesn't add synthetic symbol names to the name indexes, but catches this special case as name lookup time. Users won't typically set breakpoints or lookup these synthetic names, but support was added to do the lookup in case it does happen - removes the object file baseanme from the generated names to allow the names to be shared in the constant string pool Prior to this fix the startup times for a large application was: 12.5 seconds (cold file caches) 8.5 seconds (warm file caches) After this fix: 9.7 seconds (cold file caches) 5.7 seconds (warm file caches) The names of the symbols are auto generated by appending the symbol's UserID to the end of the "___lldb_unnamed_symbol" string and is only done when the name is requested from a synthetic symbol if it has no name. Differential Revision: https://reviews.llvm.org/D105160
2021-06-29Revert D104488 and friends since it broke the windows botStella Stamenova
Reverts commits: "Fix failing tests after https://reviews.llvm.org/D104488." "Fix buildbot failure after https://reviews.llvm.org/D104488." "Create synthetic symbol names on demand to improve memory consumption and startup times." This series of commits broke the windows lldb bot and then failed to fix all of the failing tests.
2021-06-28Fix failing tests after https://reviews.llvm.org/D104488.Greg Clayton
Synthetic names no longer have the shared library name appended to the end.
2021-04-21[lldb/ELF] Fix IDs of synthetic eh_frame symbolsPavel Labath
The code used the total number of symbols to create a symbol ID for the synthetic symbols. This is not correct because the IDs of real symbols can be higher than their total number, as we do not add all symbols (and in particular, we never add symbol zero, which is not a real symbol). This meant we could have symbols with duplicate IDs, which caused problems if some relocations were referring to the duplicated IDs. This was the cause of the failure of the test D97786. This patch fixes the code to use the ID of the highest (last) symbol instead.
2021-04-09[lldb] Update object.test after 'nosync' inference was enabled.Alexander Belyaev
https://reviews.llvm.org/D99769
2021-02-11ObjectFileELF: Test whether reloc_header is non-null instead of asserting.Peter Collingbourne
It is possible for the GetSectionHeaderByIndex lookup to fail because the previous FindSectionContainingFileAddress lookup found a segment instead of a section. This is possible if the binary does not have a PLT (which means that lld will in some circumstances set DT_JMPREL to 0, which is typically an address that is part of the ELF headers and not in a section) and may also be possible if the section headers have been stripped. To handle this possibility, replace the assert with an if. Differential Revision: https://reviews.llvm.org/D93438
2021-01-26[LLDB][test] - Fix test after yaml2obj change.Georgii Rymar
D95354 started to set the sh_link field for SHT_SYMTAB sections. Previously it was set for symbol tables basing on their names (e.g. ".symtab"). This test now crashes see: http://lab.llvm.org:8011/#/builders/68/builds/5911 I updated it to restore the old behavior.
2021-01-14[lldb][wasm] Parse DWO section namesPhilip Pfaffe
Mirror ELF section parsing to support DWARF section names for debug fission. Reviewed By: labath Differential Revision: https://reviews.llvm.org/D93621
2021-01-07[LLDB][RISCV] Add RISC-V ArchSpec and rv32/rv64 variant detectionLuís Marques
Adds the RISC-V ArchSpec bits contributed by @simoncook as part of D62732, plus logic to distinguish between riscv32 and riscv64 based on ELF class. The patch follows the implementation approach previously used for MIPS. It defines RISC-V architecture subtypes and inspects the ELF header, namely the ELF class, to detect the right subtype. Differential Revision: https://reviews.llvm.org/D86292
2020-11-09[lldb][test] - Update test cases after yaml2obj change.Georgii Rymar
The format of program header descriptions was changed by D90458.
2020-10-26[lldb][PDB] Add ObjectFile PDB pluginZequan Wu
To allow loading PDB file with `target symbols add` command. Differential Revision: https://reviews.llvm.org/D89812
2020-08-20[test] Replace `yaml2obj >` with `yaml2obj -o` and remove unneeded input ↵Fangrui Song
redirection
2020-07-20[LLDB] [COFF] Fix handling of symbols with more than one aux symbolMartin Storsjö
Differential Revision: https://reviews.llvm.org/D84070
2020-05-13[LLDB] Fix minidebuginfo-set-and-hit-breakpoint.test for arm 32-bitMuhammad Omair Javaid
This patch fixes minidebuginfo-set-and-hit-breakpoint.test for arm-linux targets. 32-bit elf executables use .rel.dyn and 64-bit uses .rela.dyn for relocation entries for dynamic symbols.
2020-02-25[lldb] Mark ObjectFileBreakpad test inputs as non-textPavel Labath
These are technically text files, but the object file layer treats them as binary, and the relevant tests verify the parsed contents byte for byte. Git's crlf conversion can make those tests fail. Marking the files as non-text disables that.
2020-02-20[lldb] Add boilerplate to recognize the .debug_tu_index sectionPavel Labath
It's just like debug_cu_index, only for type units.
2020-02-17[LLDB] Add DynamicLoaderWasmDYLD plugin for WebAssembly debuggingPaolo Severini
Add a dynamic loader plug-in class for WebAssembly modules. Differential Revision: https://reviews.llvm.org/D72751
2020-02-05Revert "[LLDB] Add DynamicLoaderWasmDYLD plugin for WebAssembly debugging"Pavel Labath
This patch has a couple of outstanding issues. The test is not python3 compatible, and it also seems to fail with python2 (at least under some circumstances) due to an overambitious assertion. This reverts the patch as well as subsequent fixup attempts: 014ea9337624fe20aca8892e73b6b3f741d8da9e, f5f70d1c8fbf12249b4b9598f10a10f12d4db029. 4697e701b8cb40429818609814c7422e49b2ee07. 5c15e8e682e365b3a7fcf35200df79f3fb93b924. 3ec28da6d6430a00b46780555a87acd43fcab790.
2020-02-05[LLDB] Add DynamicLoaderWasmDYLD plugin for WebAssembly debuggingPaolo Severini
Add a dynamic loader plug-in class for WebAssembly modules. Differential Revision: https://reviews.llvm.org/D72751
2020-02-05[test] yaml2obj -docnum => --docnum=Fangrui Song
2020-01-30[AVR] Recognize the AVR architecture in lldbAyke van Laethem
This commit adds AVR support to lldb. With this change, it can load a binary and do basic things like dump a line table. Not much else has been implemented, that should be done in later changes. Differential Revision: https://reviews.llvm.org/D73539
2020-01-24[lldb/Test] Update minidebuginfo-set-and-hit-breakpoint.testJonas Devlieghere
Update test to account for the new 'hardware' field between 'resolved' and 'hit count'.
2020-01-22[lldb] s/lldb/%lldb in two testsPavel Labath
%lldb is the proper substitution. Using "lldb" can cause us to execute the system lldb instead of the one we are testing. This happens at least in standalone builds.
2020-01-17[lldb] Try to fix writing outside temp dir from ↵Sam McCall
4bafceced6a7641be7b090229c6ccef22cf55bff
2020-01-16[LLDB] Add SymbolVendorWasm plugin for WebAssembly debuggingPaolo Severini
Add plugin class SymbolVendorWasm, with the logic to manage debug symbols for Wasm modules. Reviewers: clayborg, labath, aprantl, sbc100, teemperor Reviewed By: labath Tags: #lldb Differential Revision: https://reviews.llvm.org/D72650
2020-01-15[LLDB] Add ObjectFileWasm plugin for WebAssembly debuggingPaolo Severini
Summary: This is the first in a series of patches to enable LLDB debugging of WebAssembly targets. Current versions of Clang emit (partial) DWARF debug information in WebAssembly modules and we can leverage this debug information to give LLDB the ability to do source-level debugging of Wasm code that runs in a WebAssembly engine. A way to do this could be to use the remote debugging functionalities provided by LLDB via the GDB-remote protocol. Remote debugging can indeed be useful not only to connect a debugger to a process running on a remote machine, but also to connect the debugger to a managed VM or script engine that runs locally, provided that the engine implements a GDB-remote stub that offers the ability to access the engine runtime internal state. To make this work, the GDB-remote protocol would need to be extended with a few Wasm-specific custom query commands, used to access aspects of the Wasm engine state (like the Wasm memory, Wasm local and global variables, and so on). Furthermore, the DWARF format would need to be enriched with a few Wasm-specific extensions, here detailed: https://yurydelendik.github.io/webassembly-dwarf. This CL introduce classes **ObjectFileWasm**, a file plugin to represent a Wasm module loaded in a debuggee process. It knows how to parse Wasm modules and store the Code section and the DWARF-specific sections. Reviewers: jasonmolenda, clayborg, labath Tags: #lldb Differential Revision: https://reviews.llvm.org/D71575
2020-01-14[lldb/DWARF] Move location list sections into DWARFContextPavel Labath
These are the last sections not managed by the DWARFContext object. I also introduce separate SectionType enums for dwo section variants, as this is necessary for proper handling of single-file split dwarf.
2019-11-28[LLDB] [test] Add a missing "REQUIRES: arm" lineMartin Storsjö
2019-11-28[LLDB] Always interpret arm instructions as thumb on windowsMartin Storsjö
Windows on ARM always uses thumb mode, and doesn't have most of the mechanisms that are used in e.g. ELF for distinguishing between arm and thumb. Differential Revision: https://reviews.llvm.org/D70796
2019-11-28[LLDB] [PECOFF] Look for the truncated ".eh_fram" section nameMartin Storsjö
COFF section names can either be stored truncated to 8 chars, in the section header, or as a longer section name, stored separately in the string table. libunwind locates the .eh_frame section by runtime introspection, which only works for section names stored in the section header (as the string table isn't mapped at runtime). To support this behaviour, lld always truncates the section names for sections that will be mapped, like .eh_frame. Differential Revision: https://reviews.llvm.org/D70745
2019-11-26[lldb/symbolvendorelf] Copy more sections from separate debug filesPavel Labath
Include the fancier DWARF5 sections too.
2019-11-26[lldb] Add boilerplate to recognize the .debug_rnglists.dwo sectionPavel Labath
2019-10-31[lldb/lit] Introduce %clang_host substitutionsPavel Labath
Summary: This patch addresses an ambiguity in how our existing tests invoke the compiler. Roughly two thirds of our current "shell" tests invoke the compiler to build the executables for the host. However, there is also a significant number of tests which don't build a host binary (because they don't need to run it) and instead they hardcode a certain target. We also have code which adds a bunch of default arguments to the %clang substitutions. However, most of these arguments only really make sense for the host compilation. So far, this has worked mostly ok, because the arguments we were adding were not conflicting with the target-hardcoding tests (though they did provoke an occasional "argument unused" warning). However, this started to break down when we wanted to use target-hardcoding clang-cl tests (D69031) because clang-cl has a substantially different command line, and it was getting very confused by some of the arguments we were adding on non-windows hosts. This patch avoid this problem by creating separate %clang(xx,_cl)_host substutitions, which are specifically meant to be used for compiling host binaries. All funny host-specific options are moved there. To ensure that the regular %clang substitutions are not used for compiling host binaries (skipping the extra arguments) I employ a little hac^H^H^Htrick -- I add an invalid --target argument to the %clang substitution, which means that one has to use an explicit --target in order for the compilation to succeed. Reviewers: JDevlieghere, aprantl, mstorsjo, espindola Subscribers: emaste, arichardson, MaskRay, jfb, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69619
2019-10-31[LLDB] [PECOFF] Fix error handling for executables that object::createBinary ↵Martin Storsjö
errors out on llvm::object::createBinary returns an Expected<>, which requires not only checking the object for success, but also requires consuming the Error, if one was set. Use LLDB_LOG_ERROR for this case, and change an existing similar log statement to use it as well, to make sure the Error is consumed even if the log channel is disabled. Differential Revision: https://reviews.llvm.org/D69646
2019-10-30COFF: Set section permissionsPavel Labath
Summary: This enables us to reason about whether a given address can be executable, for instance during unwinding. Reviewers: amccarth, mstorsjo Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D69102
2019-10-29[LLDB] [PECOFF] Use FindSectionByID to associate symbols to sectionsMartin Storsjö
The virtual container/header section caused the section list to be offset by one, but by using FindSectionByID, the layout of the section list shouldn't matter. Differential Revision: https://reviews.llvm.org/D69366
2019-10-25lldb/COFF: Create a separate "section" for the file headerPavel Labath
In an attempt to ensure that every part of the module's memory image is accounted for, D56537 created a special "container section" spanning the entire image. While that seemed reasonable at the time (and it still mostly does), it did create a problem of what to put as the "file size" of the section, because the image is not continuous on disk, as we generally assume (which is why I put zero there). Additionally, this arrangement makes it unclear what kind of permissions should be assigned to that section (which is what my next patch does). To get around these, this patch partially reverts D56537, and goes back to top-level sections. Instead, what I do is create a new "section" for the object file header, which is also being loaded into memory, though its not considered to be a section in the strictest sense. This makes it possible to correctly assign file size section, and we can later assign permissions to it as well. Reviewers: amccarth, mstorsjo Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D69100
2019-10-21[lldb] drop .symtab removal in minidebuginfo testsKonrad Kleine
Summary: After D69041, we no longer have to manually remove the .symtab section once yaml2obj was run. Reviewers: espindola, alexshap Subscribers: emaste, arichardson, MaskRay, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69254 llvm-svn: 375415
2019-10-15[LLDB] [PECOFF] Use a "pc" vendor name in aarch64 triplesMartin Storsjo
This matches all other architectures listed in the same file. This fixes debugging aarch64 executables with lldb-server, which otherwise fails, with log messages like these: Target::SetArchitecture changing architecture to aarch64 (aarch64-pc-windows-msvc) Target::SetArchitecture Trying to select executable file architecture aarch64 (aarch64-pc-windows-msvc) ArchSpec::SetArchitecture sets the vendor to llvm::Triple::PC for any coff/win32 combination, and if this doesn't match the triple set by the PECOFF module, things doesn't seem to work with when using lldb-server. Differential Revision: https://reviews.llvm.org/D68939 llvm-svn: 374867
2019-10-10[test] Trim the symbtab test case (NFC)Jonas Devlieghere
We don't actually need the section content for this tests. llvm-svn: 374382
2019-10-10[lldb] Fix minidebuginfo-set-and-hit-breakpoint.testRaphael Isemann
This was failing for me because of this error: llvm-objcopy: error: 'build/tools/lldb/test/ObjectFile/ELF/Output/minidebuginfo-set-and-hit-breakpoint.test.tmp.mini_debuginfo': section '.dynsym' cannot be removed because it is referenced by the section '.hash' Patch by Konrad Kleine! llvm-svn: 374352
2019-10-09Re-land "[test] Split LLDB tests into API, Shell & Unit"Jonas Devlieghere
The original patch got reverted because it broke `check-lldb` on a clean build. This fixes that. llvm-svn: 374201
2019-10-09Revert [test] Split LLDB tests into API, Shell & UnitAdrian Prantl
as it appears to have broken check-lldb. This reverts r374184 (git commit 22314179f0660c172514b397060fd8f34b586e82) llvm-svn: 374187
2019-10-09[test] Split LLDB tests into API, Shell & UnitJonas Devlieghere
LLDB has three major testing strategies: unit tests, tests that exercise the SB API though dotest.py and what we currently call lit tests. The later is rather confusing as we're now using lit as the driver for all three types of tests. As most of this grew organically, the directory structure in the LLDB repository doesn't really make this clear. The 'lit' tests are part of the root and among these tests there's a Unit and Suite folder for the unit and dotest-tests. This layout makes it impossible to run just the lit tests. This patch changes the directory layout to match the 3 testing strategies, each with their own directory and their own configuration file. This means there are now 3 directories under lit with 3 corresponding targets: - API (check-lldb-api): Test exercising the SB API. - Shell (check-lldb-shell): Test exercising command line utilities. - Unit (check-lldb-unit): Unit tests. Finally, there's still the `check-lldb` target that runs all three test suites. Finally, this also renames the lit folder to `test` to match the LLVM repository layout. Differential revision: https://reviews.llvm.org/D68606 llvm-svn: 374184