| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Re-land "[test] Split LLDB tests into API, Shell & Unit" The original patch got reverted because it broke check-lldb on a clean build. This fixes that. llvm-svn: 374201 | 6 年前 | |
[test] Replace yaml2obj > with yaml2obj -o and remove unneeded input redirection | 5 年前 | |
[lldb][test] - Update test cases after yaml2obj change. The format of program header descriptions was changed by D90458. | 5 年前 | |
[lldb][test] - Update test cases after yaml2obj change. The format of program header descriptions was changed by D90458. | 5 年前 | |
[lldb][test] - Update test cases after yaml2obj change. The format of program header descriptions was changed by D90458. | 5 年前 | |
[lldb][test] - Update test cases after yaml2obj change. The format of program header descriptions was changed by D90458. | 5 年前 | |
[lldb][test] - Update test cases after yaml2obj change. The format of program header descriptions was changed by D90458. | 5 年前 | |
[lldb] Fix a bug for PT_TLS segments getting loaded when they shouldn't. (#98432) PT_LOAD and PT_TLS segments are top level sections in the ObjectFileELF section list. The two segments can often have the same program header p_vaddr and p_paddr values and this can cause section load list issues in LLDB if we load the PT_TLS segments. What happens is the SectionLoadList::m_addr_to_sect, when a library is loaded, will first map one of the sections named "PT_LOAD[0]" with the load address that matches the p_vaddr entry from the program header. Then the "PT_TLS[0]" would come along and try to load this section at the same address. This would cause the "PT_LOAD[0]" section to be unloaded as the SectionLoadList::m_addr_to_sect would replace the value for the matching p_vaddr with the last section to be seen. The sizes of the PT_TLS and PT_LOAD that have the same p_vaddr value don't need to have the same byte size, so this could cause lookups to fail for an addresses in the "PT_LOAD[0]" section or any of its children if the offset is greater than the offset size of the PT_TLS segment. It could also cause us to incorrectly attribute addresses from the "PT_LOAD[0]" to the "PT_TLS[0]" segment when doing lookups for offset that are less than the size of the PT_TLS segment. This fix stops us from loading PT_TLS segments in the section load lists and will prevent the bugs that resulted from this. No addresses the the DWARF refer to TLS data with a "file address" in any way. They all have TLS DWARF location expressions to locate these variables. We also don't have any support for having actual thread specific sections and having those sections resolve to something different for each thread, so there currently is no point in loading thread specific sections. Both the ObjectFileMachO and ObjectFileCOFF both ignore thread specific sections at the moment, so this brings the ObjectFileELF to parity with those plug-ins. I added a test into an existing test to verify that things work as expected. Prior to this fix with a real binary, the output of "target dump section-load-list" would look like this for the old LLDB: // (lldb) target dump section-load-list // addr = 0x0000000000000000, section = 0x55d46ab8c510: 0xfffffffffffffffd container [0x0000000000000000-0x0000000000000628) r-- 0x00000000 0x00000628 0x00000000 a.out.PT_LOAD[0] // addr = 0x0000000000001000, section = 0x55d46ab8b0c0: 0xfffffffffffffffc container [0x0000000000001000-0x0000000000001185) r-x 0x00001000 0x00000185 0x00000000 a.out.PT_LOAD[1] // addr = 0x0000000000002000, section = 0x55d46ac040f0: 0xfffffffffffffffb container [0x0000000000002000-0x00000000000020cc) r-- 0x00002000 0x000000cc 0x00000000 a.out.PT_LOAD[2] // addr = 0x0000000000003db0, section = 0x55d46ab7cef0: 0xfffffffffffffff6 container [0x0000000000003db0-0x0000000000003db4) r-- 0x00002db0 0x00000000 0x00000000 a.out.PT_TLS[0] And this for the fixed LLDB: // (lldb) target dump section-load-list // addr = 0x0000000000000000, section = 0x105f0a9a8: 0xfffffffffffffffd container [0x0000000000000000-0x0000000000000628) r-- 0x00000000 0x00000628 0x00000000 a.out.PT_LOAD[0] // addr = 0x0000000000001000, section = 0x105f0adb8: 0xfffffffffffffffc container [0x0000000000001000-0x0000000000001185) r-x 0x00001000 0x00000185 0x00000000 a.out.PT_LOAD[1] // addr = 0x0000000000002000, section = 0x105f0af48: 0xfffffffffffffffb container [0x0000000000002000-0x00000000000020cc) r-- 0x00002000 0x000000cc 0x00000000 a.out.PT_LOAD[2] // addr = 0x0000000000003db0, section = 0x105f0b078: 0xfffffffffffffffa container [0x0000000000003db0-0x0000000000004028) rw- 0x00002db0 0x00000274 0x00000000 a.out.PT_LOAD[3] We can see that previously the "PT_LOAD[3]" segment would be removed from the section load list, and after the fix it remains and there is on PT_TLS in the loaded sections. | 2 年前 | |
[lldb][ObjectFileELF] Support AArch32 in ApplyRelocations Allow the ObjectFileELF plugin to resolve R_ARM_ABS32 relocations from AArch32 object files. This fixes https://github.com/llvm/llvm-project/issues/61948 The existing architectures work with RELA-type relocation records that read addend from the relocation entry. REL-type relocations in AArch32 store addend in-place. The new function doesn't re-use ELFRelocation::RelocAddend32(), because the interface doesn't match: in addition to the relocation entry we need the actual target section memory. Reviewed By: labath Differential Revision: https://reviews.llvm.org/D147642 | 3 年前 | |
[test] Replace yaml2obj > with yaml2obj -o and remove unneeded input redirection | 5 年前 | |
[test] Replace yaml2obj > with yaml2obj -o and remove unneeded input redirection | 5 年前 | |
[lldb][test] - Update test cases after yaml2obj change. The format of program header descriptions was changed by D90458. | 5 年前 | |
[LLDB] Fix LLDB buildbots break due to --image-base 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 | 4 年前 | |
[test] Replace yaml2obj > with yaml2obj -o and remove unneeded input redirection | 5 年前 | |
[lldb] Remove ELF .zdebug support clang 14 removed -gz=zlib-gnu support and ld.lld/llvm-objcopy removed zlib-gnu support recently. Remove lldb support by migrating away from llvm::object::Decompressor::isCompressedELFSection. The API has another user llvm-dwp, so it is not removed in this patch. Reviewed By: labath Differential Revision: https://reviews.llvm.org/D129724 | 3 年前 | |
[test] Replace yaml2obj > with yaml2obj -o and remove unneeded input redirection | 5 年前 | |
Create synthetic symbol names on demand to improve memory consumption and 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 | 4 年前 | |
[test] Replace yaml2obj > with yaml2obj -o and remove unneeded input redirection | 5 年前 | |
lldb: Add support for R_386_32 relocations to ObjectFileELF I encountered an issue where p &variable was finding an incorrect address for 32-bit PIC ELF files loaded into a running process. The problem was that the R_386_32 ELF relocations were not being applied to the DWARF section, so all variables in that file were reporting as being at the start of their respective section. There is an assert that catches this on debug builds, but silently ignores the issue on non-debug builds. In this changeset, I added handling for the R_386_32 relocation type to ObjectFileELF, and a supporting function to ELFRelocation to differentiate between DT_REL & DT_RELA in ObjectFileELF::ApplyRelocations(). Demonstration of issue: `` [dmlary@host work]$ cat rel.c volatile char padding[32] = "make sure var isnt at .data+0"; volatile char var[] = "test"; [dmlary@host work]$ gcc -c rel.c -FPIC -fpic -g -m32 [dmlary@host work]$ lldb ./exec (lldb) target create "./exec" Current executable set to '/home/dmlary/src/work/exec' (i386). (lldb) process launch --stop-at-entry Process 21278 stopped * thread #1, name = 'exec', stop reason = signal SIGSTOP frame #0: 0xf7fdb150 ld-2.17.so_start ld-2.17.so_start: -> 0xf7fdb150 <+0>: movl %esp, %eax 0xf7fdb152 <+2>: calll 0xf7fdb990 ; _dl_start ld-2.17.so_dl_start_user: 0xf7fdb157 <+0>: movl %eax, %edi 0xf7fdb159 <+2>: calll 0xf7fdb140 Process 21278 launched: '/home/dmlary/src/work/exec' (i386) (lldb) image add ./rel.o (lldb) image load --file rel.o .text 0x40000000 .data 0x50000000 section '.text' loaded at 0x40000000 section '.data' loaded at 0x50000000 (lldb) image dump symtab rel.o Symtab, file = rel.o, num_symbols = 13: Debug symbol |Synthetic symbol ||Externally Visible ||| Index UserID DSX Type File Address/Value Load Address Size Flags Name ------- ------ --- --------------- ------------------ ------------------ ------------------ ---------- ---------------------------------- [ 0] 1 SourceFile 0x0000000000000000 0x0000000000000000 0x00000004 rel.c [ 1] 2 Invalid 0x0000000000000000 0x0000000000000020 0x00000003 [ 2] 3 Invalid 0x0000000000000000 0x50000000 0x0000000000000020 0x00000003 [ 3] 4 Invalid 0x0000000000000025 0x0000000000000000 0x00000003 [ 4] 5 Invalid 0x0000000000000000 0x0000000000000020 0x00000003 [ 5] 6 Invalid 0x0000000000000000 0x0000000000000020 0x00000003 [ 6] 7 Invalid 0x0000000000000000 0x0000000000000020 0x00000003 [ 7] 8 Invalid 0x0000000000000000 0x0000000000000020 0x00000003 [ 8] 9 Invalid 0x0000000000000000 0x0000000000000020 0x00000003 [ 9] 10 Invalid 0x0000000000000000 0x0000000000000020 0x00000003 [ 10] 11 Invalid 0x0000000000000000 0x0000000000000020 0x00000003 [ 11] 12 X Data 0x0000000000000000 0x50000000 0x0000000000000020 0x00000011 padding [ 12] 13 X Data 0x0000000000000020 0x50000020 0x0000000000000005 0x00000011 var (lldb) p &var (volatile char (*)[5]) $1 = 0x50000000 ``` Reviewed By: labath Differential Revision: https://reviews.llvm.org/D132954 | 3 年前 | |
[LLDB][LoongArch] Add LoongArch ArchSpec and subtype detection Define LoongArch architecture subtypes, add the LoongArch ArchSpec bits, and inspect the ELF header to detect the right subtype based on ELF class. Here is a simple test: [loongson@linux ~]$ cat hello.c int main() { printf("Hello, World!\n"); return 0; } [loongson@linux ~]$ clang hello.c -g -o hello Without this patch: [loongson@linux ~]$ llvm-project/llvm/build/bin/lldb hello (lldb) target create "hello" error: '/home/loongson/hello' doesn't contain any 'host' platform architectures: unknown With this patch: [loongson@linux ~]$ llvm-project/llvm/build/bin/lldb hello (lldb) target create "hello" Current executable set to '/home/loongson/hello' (loongarch64). (lldb) run Process 735167 launched: '/home/loongson/hello' (loongarch64) Hello, World! Process 735167 exited with status = 0 (0x00000000) (lldb) quit [loongson@linux ~]$ llvm-project/llvm/build/bin/llvm-lit llvm-project/lldb/test/Shell/ObjectFile/ELF/loongarch-arch.yaml llvm-lit: /home/loongson/llvm-project/llvm/utils/lit/lit/llvm/config.py:456: note: using clang: /home/loongson/llvm-project/llvm/build/bin/clang -- Testing: 1 tests, 1 workers -- PASS: lldb-shell :: ObjectFile/ELF/loongarch-arch.yaml (1 of 1) Testing Time: 0.09s Passed: 1 Reviewed By: SixWeining, xen0n, DavidSpickett Differential Revision: https://reviews.llvm.org/D137057 | 3 年前 | |
[LLDB][ObjectFileELF] Correct the return type of RelocOffset64 and RelocAddend64 According to /usr/include/elf.h and lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h. For ELF64 relocation, types of offset and addend should be elf_addr and elf_sxword. Reviewed By: DavidSpickett Differential Revision: https://reviews.llvm.org/D145550 | 3 年前 | |
Re-land "[test] Split LLDB tests into API, Shell & Unit" The original patch got reverted because it broke check-lldb on a clean build. This fixes that. llvm-svn: 374201 | 6 年前 | |
[test] Replace yaml2obj > with yaml2obj -o and remove unneeded input redirection | 5 年前 | |
[test] Replace yaml2obj > with yaml2obj -o and remove unneeded input redirection | 5 年前 | |
[test] Replace yaml2obj > with yaml2obj -o and remove unneeded input redirection | 5 年前 | |
Reland "[Driver] Default CLANG_DEFAULT_PIE_ON_LINUX to ON"" (With C++ exceptions, clang++ --target=mips64{,el}-linux-gnu -fpie -pie -fuse-ld=lld has link errors (lld does not implement some strange R_MIPS_64 .eh_frame handling in GNU ld). However, sanitizer-x86_64-linux-qemu used this to build ScudoUnitTests. Pined ScudoUnitTests to -no-pie.) Default the option introduced in D113372 to ON to match all(?) major Linux distros. This matches GCC and improves consistency with Android and linux-musl which always default to PIE. Note: CLANG_DEFAULT_PIE_ON_LINUX may be removed in the future. Differential Revision: https://reviews.llvm.org/D120305 | 4 年前 | |
Re-land "[test] Split LLDB tests into API, Shell & Unit" The original patch got reverted because it broke check-lldb on a clean build. This fixes that. llvm-svn: 374201 | 6 年前 | |
[test] Replace yaml2obj > with yaml2obj -o and remove unneeded input redirection | 5 年前 | |
ObjectFileELF: Test whether reloc_header is non-null instead of asserting. 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 | 5 年前 | |
[LLDB][RISCV] Add RISC-V ArchSpec and rv32/rv64 variant detection 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 | 5 年前 | |
[test] Replace yaml2obj > with yaml2obj -o and remove unneeded input redirection | 5 年前 | |
[lldb][test] - Update test cases after yaml2obj change. The format of program header descriptions was changed by D90458. | 5 年前 | |
[test] Replace yaml2obj > with yaml2obj -o and remove unneeded input redirection | 5 年前 | |
[LLDB][test] - Fix test after yaml2obj change. 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. | 5 年前 | |
[test] Replace yaml2obj > with yaml2obj -o and remove unneeded input redirection | 5 年前 | |
[test] Replace yaml2obj > with yaml2obj -o and remove unneeded input redirection | 5 年前 | |
| 2 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 6 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 3 年前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 6 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 6 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 2 年前 |