|
Revision tags: llvmorg-6.0.0 |
|
| #
ec03d7e3 |
| 28-Feb-2018 |
Pavel Labath <[email protected]> |
Revert "[lldb] Use vFlash commands when writing to target's flash memory regions"
This reverts commit r326261 as it introduces inconsistencies in the handling of load addresses for ObjectFileELF --
Revert "[lldb] Use vFlash commands when writing to target's flash memory regions"
This reverts commit r326261 as it introduces inconsistencies in the handling of load addresses for ObjectFileELF -- some parts of the class use physical addresses, and some use virtual. This has manifested itself as us not being able to set the load address of the vdso "module" on android.
llvm-svn: 326367
show more ...
|
| #
029fb693 |
| 27-Feb-2018 |
Pavel Labath <[email protected]> |
[lldb] Use vFlash commands when writing to target's flash memory regions
Summary: When writing an object file over gdb-remote, use the vFlashErase, vFlashWrite, and vFlashDone commands if the write
[lldb] Use vFlash commands when writing to target's flash memory regions
Summary: When writing an object file over gdb-remote, use the vFlashErase, vFlashWrite, and vFlashDone commands if the write address is in a flash memory region. A bare metal target may have this kind of setup.
- Update ObjectFileELF to set load addresses using physical addresses. A typical case may be a data section with a physical address in ROM and a virtual address in RAM, which should be loaded to the ROM address. - Add support for querying the target's qXfer:memory-map, which contains information about flash memory regions, leveraging MemoryRegionInfo data structures with minor modifications - Update ProcessGDBRemote to use vFlash commands in DoWriteMemory when the target address is in a flash region
Original discussion at http://lists.llvm.org/pipermail/lldb-dev/2018-January/013093.html
Reviewers: clayborg, labath
Reviewed By: labath
Subscribers: arichardson, emaste, mgorny, lldb-commits
Differential Revision: https://reviews.llvm.org/D42145 Patch by Owen Shaw <[email protected]>
llvm-svn: 326261
show more ...
|
|
Revision tags: llvmorg-6.0.0-rc3, llvmorg-6.0.0-rc2 |
|
| #
4f033125 |
| 05-Feb-2018 |
Pavel Labath <[email protected]> |
Fix parsing of object files with "early" section headers
ObjectFileELF::GetModuleSpecifications contained a lot of tip-toing code which was trying to avoid loading the full object file into memory.
Fix parsing of object files with "early" section headers
ObjectFileELF::GetModuleSpecifications contained a lot of tip-toing code which was trying to avoid loading the full object file into memory. It did this by trying to load data only up to the offset if was accessing. However, in practice this was useless, as 99% of object files we encounter have section headers at the end, so we would load the whole file as soon as we start parsing the section headers.
In fact, this would break as soon as we encounter a file which does *not* have section headers at the end (yaml2obj produces these), as the access to .strtab (which we need to get the section names) was not guarded by this offset check.
As this strategy was completely ineffective anyway, I do not attempt to proliferate it further by guarding the .strtab accesses. Instead I just lead the full file as soon as we are reasonably sure that we are indeed processing an elf file.
If we really care about the load size here, we would need to reimplement this to just load the bits of the object file we need, instead of loading everything from the start of the object file to the given offset. However, given that the OS will do this for us for free when using mmap, I think think this is really necessary.
For testing this I check a (tiny) SO file instead of yaml2obj-ing it because the fact that they come out first is an implementation detail of yaml2obj that can change in the future.
llvm-svn: 324254
show more ...
|
| #
c561a6a9 |
| 30-Jan-2018 |
Pavel Labath <[email protected]> |
Add LLDB_LOG_ERROR macro
Summary: The difference between this and regular LLDB_LOG is that this one clears the error object unconditionally. This was inspired by the ObjectFileELF bug (r322664), wh
Add LLDB_LOG_ERROR macro
Summary: The difference between this and regular LLDB_LOG is that this one clears the error object unconditionally. This was inspired by the ObjectFileELF bug (r322664), where the error object was being cleared only if logging was enabled.
Reviewers: davide, zturner, jingham, clayborg
Subscribers: lldb-commits, emaste
Differential Revision: https://reviews.llvm.org/D42182
llvm-svn: 323753
show more ...
|
|
Revision tags: llvmorg-6.0.0-rc1 |
|
| #
b424de39 |
| 17-Jan-2018 |
Pavel Labath <[email protected]> |
Fix assertion in ObjectFileELF
In D40616 I (mistakenly) assumed that logging an llvm::Error would clear it. This of course is only true if logging is actually enabled.
This fixes the assertion by m
Fix assertion in ObjectFileELF
In D40616 I (mistakenly) assumed that logging an llvm::Error would clear it. This of course is only true if logging is actually enabled.
This fixes the assertion by manually clearing the error, but it raises the point of whether we need a special error-clearing logging primitive.
llvm-svn: 322664
show more ...
|
| #
50251fc7 |
| 21-Dec-2017 |
Pavel Labath <[email protected]> |
Make sure DataBufferLLVM contents are writable
Summary: We sometimes need to write to the object file we've mapped into memory, generally to apply relocations to debug info sections. We've had that
Make sure DataBufferLLVM contents are writable
Summary: We sometimes need to write to the object file we've mapped into memory, generally to apply relocations to debug info sections. We've had that ability before, but with the introduction of DataBufferLLVM, we have lost it, as the underlying llvm class (MemoryBuffer) only supports read-only mappings.
This switches DataBufferLLVM to use the new llvm::WritableMemoryBuffer class as a back-end, as this one guarantees to return a writable buffer.
This removes the need for the "Private" flag to the DataBufferLLVM creation functions, as it was really used to mean "writable". The LLVM function also does not have the NullTerminate flag, so I've modified our clients to not require this feature and removed that flag as well.
Reviewers: zturner, clayborg, jingham
Subscribers: emaste, aprantl, arichardson, krytarowski, lldb-commits
Differential Revision: https://reviews.llvm.org/D40079
llvm-svn: 321255
show more ...
|
| #
4c2eb8b2 |
| 15-Dec-2017 |
Pavel Labath <[email protected]> |
Fix 32-bit builds broken by 320813
cast to size_t to avoid narrowing error.
llvm-svn: 320816
|
| #
e2867bc4 |
| 15-Dec-2017 |
Pavel Labath <[email protected]> |
ObjectFileELF: Add support for compressed sections
Summary: We use the llvm decompressor to decompress SHF_COMPRESSED sections. This enables us to read data from debug info sections, which are somet
ObjectFileELF: Add support for compressed sections
Summary: We use the llvm decompressor to decompress SHF_COMPRESSED sections. This enables us to read data from debug info sections, which are sometimes compressed, particuarly in the split-dwarf case. This functionality is only available if llvm is compiled with zlib support.
Reviewers: clayborg, zturner
Subscribers: emaste, mgorny, aprantl, lldb-commits
Differential Revision: https://reviews.llvm.org/D40616
llvm-svn: 320813
show more ...
|
|
Revision tags: llvmorg-5.0.1, llvmorg-5.0.1-rc3 |
|
| #
a6d5464c |
| 02-Dec-2017 |
Zachary Turner <[email protected]> |
Add a symbols subcommand to lldb-test.
Differential Revision: https://reviews.llvm.org/D40745
llvm-svn: 319599
|
|
Revision tags: llvmorg-5.0.1-rc2 |
|
| #
5f19b907 |
| 13-Nov-2017 |
Pavel Labath <[email protected]> |
Move ArchSpec to the Utility module
The rationale here is that ArchSpec is used throughout the codebase, including in places which should not depend on the rest of the code in the Core module.
This
Move ArchSpec to the Utility module
The rationale here is that ArchSpec is used throughout the codebase, including in places which should not depend on the rest of the code in the Core module.
This commit touches many files, but most of it is just renaming of #include lines. In a couple of cases, I removed the #include ArchSpec line altogether, as the file was not using it. In one or two places, this necessitated adding other #includes like lldb-private-defines.h.
llvm-svn: 318048
show more ...
|
|
Revision tags: llvmorg-5.0.1-rc1 |
|
| #
d13f691f |
| 02-Oct-2017 |
Ed Maste <[email protected]> |
Improve FreeBSD kernel debugging
FreeBSD kernel modules are actually relocatable (.o) ELF files and this previously caused some issues for LLDB. This change addresses these when using lldb to symbol
Improve FreeBSD kernel debugging
FreeBSD kernel modules are actually relocatable (.o) ELF files and this previously caused some issues for LLDB. This change addresses these when using lldb to symbolicate FreeBSD kernel backtraces.
The major problems:
- Relocations were not being applied to the DWARF debug info despite there being code to do this. Several issues prevented it from working:
- Relocations are computed at the same time as the symbol table, but in the case of split debug files, symbol table parsing always redirects to the primary object file, meaning that relocations would never be applied in the debug file.
- There's actually no guarantee that the symbol table has been parsed yet when trying to parse debug information.
- When actually applying relocations, it will segfault because the object files are not mapped with MAP_PRIVATE and PROT_WRITE.
- LLDB returned invalid results when performing ordinary address-to- symbol resolution. It turned out that the addresses specified in the section headers were all 0, so LLDB believed all the sections had overlapping "file addresses" and would sometimes return a symbol from the wrong section.
Patch by Brian Koropoff
Differential Revision: https://reviews.llvm.org/D38142
llvm-svn: 314672
show more ...
|
| #
e1a6074b |
| 14-Sep-2017 |
Benjamin Kramer <[email protected]> |
Remove uses of std::auto_ptr, it's going away in C++17.
std::unique_ptr is pretty much a drop-in replacement here. Also remove nullptr checks that are doing nothing.
llvm-svn: 313265
|
|
Revision tags: llvmorg-5.0.0, llvmorg-5.0.0-rc5, llvmorg-5.0.0-rc4, llvmorg-5.0.0-rc3 |
|
| #
963ce483 |
| 25-Aug-2017 |
Tamas Berghammer <[email protected]> |
Add support for the DWP debug info format
Summary: The DWP (DWARF package) format is used to pack multiple dwo files generated by split-dwarf into a single ELF file to make distributing them easier.
Add support for the DWP debug info format
Summary: The DWP (DWARF package) format is used to pack multiple dwo files generated by split-dwarf into a single ELF file to make distributing them easier. It is part of the DWARFv5 spec and can be generated by dwp or llvm-dwp from a set of dwo files.
Caviats: * Only the new version of the dwp format is supported (v2 in GNU numbering schema and v5 in the DWARF spec). The old version (v1) is already deprecated but binutils 2.24 still generates that one. * Combining DWP files with module debugging is not yet supported.
Subscribers: emaste, mgorny, aprantl
Differential Revision: https://reviews.llvm.org/D36062
llvm-svn: 311775
show more ...
|
| #
8ac63e8f |
| 14-Aug-2017 |
Nitesh Jain <[email protected]> |
[LLDB][MIPS] Set the Section's file address for ELF section to LLDB_INVALID_ADDRESS if SHF_ALLOC is not set.
Reviewers: labath, clayborg
Subscribers: jaydeep, bhushan, lldb-commits
Differential Re
[LLDB][MIPS] Set the Section's file address for ELF section to LLDB_INVALID_ADDRESS if SHF_ALLOC is not set.
Reviewers: labath, clayborg
Subscribers: jaydeep, bhushan, lldb-commits
Differential Revision: https://reviews.llvm.org/D35784
llvm-svn: 310855
show more ...
|
|
Revision tags: llvmorg-5.0.0-rc2, llvmorg-5.0.0-rc1 |
|
| #
38d0632e |
| 29-Jun-2017 |
Pavel Labath <[email protected]> |
Move Timer and TraceOptions from Core to Utility
Summary: The classes have no dependencies, and they are used both by lldb and lldb-server, so it makes sense for them to live in the lowest layers.
Move Timer and TraceOptions from Core to Utility
Summary: The classes have no dependencies, and they are used both by lldb and lldb-server, so it makes sense for them to live in the lowest layers.
Reviewers: zturner, jingham
Subscribers: emaste, mgorny, lldb-commits
Differential Revision: https://reviews.llvm.org/D34746
llvm-svn: 306682
show more ...
|
| #
d16a6e32 |
| 23-Jun-2017 |
Mehdi Amini <[email protected]> |
Fix typo: using && instead of & when evaluating a mask
Summary: Reported by coverity, I don't know how to provide a test.
Reviewers: zturner
Subscribers: lldb-commits, emaste
Differential Revisio
Fix typo: using && instead of & when evaluating a mask
Summary: Reported by coverity, I don't know how to provide a test.
Reviewers: zturner
Subscribers: lldb-commits, emaste
Differential Revision: https://reviews.llvm.org/D34550
llvm-svn: 306134
show more ...
|
| #
df1a0d11 |
| 20-Jun-2017 |
Pavel Labath <[email protected]> |
[linux] Change the way we load vdso pseudo-module
Summary: This is basically a revert of D16107 and parts of D10800, which were trying to get vdso loading working. They did this by implementing a ge
[linux] Change the way we load vdso pseudo-module
Summary: This is basically a revert of D16107 and parts of D10800, which were trying to get vdso loading working. They did this by implementing a generic load-an-elf-file from memory approach, which is not correct, since we cannot assume that an elf file is loaded in memory in full (it usually isn't, as there's no need to load section headers for example). This meant that we would read garbage instead of section sizes, and if that garbage happened to be a large number, we would crash while trying to allocate a buffer to accomodate the hypothetical section.
Instead of this, I add a bit of custom code to load the vdso to DynamicLoaderPOSIXDYLD (which already needed to handle the vdso specially). I determine the size of the memory to read using Process::GetMemoryRegionInfo, which is information coming from the OS, and cannot be forged by a malicious/misbehaving application.
Reviewers: eugene, clayborg
Subscribers: lldb-commits, ravitheja, tberghammer, emaste
Differential Revision: https://reviews.llvm.org/D34352
llvm-svn: 305780
show more ...
|
|
Revision tags: llvmorg-4.0.1, llvmorg-4.0.1-rc3, llvmorg-4.0.1-rc2 |
|
| #
f9d16476 |
| 15-May-2017 |
Pavel Labath <[email protected]> |
Remove an expensive lock from Timer
The Timer destructor would grab a global mutex in order to update execution time. Add a class to define a category once, statically; the class adds itself to an a
Remove an expensive lock from Timer
The Timer destructor would grab a global mutex in order to update execution time. Add a class to define a category once, statically; the class adds itself to an atomic singly linked list, and thus subsequent updates only need to use an atomic rather than grab a lock and perform a hashtable lookup.
Differential Revision: https://reviews.llvm.org/D32823 Patch by Scott Smith <[email protected]>.
llvm-svn: 303058
show more ...
|
| #
97206d57 |
| 12-May-2017 |
Zachary Turner <[email protected]> |
Rename Error -> Status.
This renames the LLDB error class to Status, as discussed on the lldb-dev mailing list.
A change of this magnitude cannot easily be done without find and replace, but that h
Rename Error -> Status.
This renames the LLDB error class to Status, as discussed on the lldb-dev mailing list.
A change of this magnitude cannot easily be done without find and replace, but that has potential to catch unwanted occurrences of common strings such as "Error". Every effort was made to find all the obvious things such as the word "Error" appearing in a string, etc, but it's possible there are still some lingering occurences left around. Hopefully nothing too serious.
llvm-svn: 302872
show more ...
|
| #
efddda3d |
| 02-May-2017 |
Pavel Labath <[email protected]> |
ObjectFileELF: Fix symbol lookup in bss section
Summary: If we have symbol information in a separate file, we need to be very careful about presenting a unified section view of module to the rest of
ObjectFileELF: Fix symbol lookup in bss section
Summary: If we have symbol information in a separate file, we need to be very careful about presenting a unified section view of module to the rest of the debugger. ObjectFileELF had code to handle that, but it was being overly cautious -- the section->GetFileSize()!=0 meant that the unification would fail for sections which do not occupy any space in the object file (e.g., .bss). In my case, that manifested itself as not being able to display the values of .bss variables properly as the section associated with the variable did not have it's load address set (because it was not present in the unified section list).
I test this by making sure the unified section list and the variables refer to the same section.
Reviewers: eugene, zturner
Subscribers: tberghammer, lldb-commits, mgorny
Differential Revision: https://reviews.llvm.org/D32434
llvm-svn: 301917
show more ...
|
| #
4d35d6b3 |
| 02-May-2017 |
Pavel Labath <[email protected]> |
Change UniqueCStringMap to use ConstString as the key
Summary: UniqueCStringMap "sorts" the entries for fast lookup, but really it only cares about uniqueness. ConstString can be compared by pointe
Change UniqueCStringMap to use ConstString as the key
Summary: UniqueCStringMap "sorts" the entries for fast lookup, but really it only cares about uniqueness. ConstString can be compared by pointer alone, rather than with strcmp, resulting in much faster comparisons. Change the interface to take ConstString instead, and propagate use of the type to the callers where appropriate.
Reviewers: #lldb, clayborg
Reviewed By: clayborg
Subscribers: labath, jasonmolenda, lldb-commits
Differential Revision: https://reviews.llvm.org/D32316 Patch by Scott Smith <[email protected]>.
llvm-svn: 301908
show more ...
|
|
Revision tags: llvmorg-4.0.1-rc1 |
|
| #
706c5205 |
| 31-Mar-2017 |
Nitesh Jain <[email protected]> |
[LLDB][MIPS] Fix Core file Architecture and OS information.
Reviewers: labath, clayborg
Subscribers: jaydeep, bhushan, lldb-commits, slthakur
Differential Revision: https://reviews.llvm.org/D31280
[LLDB][MIPS] Fix Core file Architecture and OS information.
Reviewers: labath, clayborg
Subscribers: jaydeep, bhushan, lldb-commits, slthakur
Differential Revision: https://reviews.llvm.org/D31280
llvm-svn: 299199
show more ...
|
| #
12801f1e |
| 26-Mar-2017 |
Kamil Rytarowski <[email protected]> |
[LLDB] OpenBSD support
Summary: Add basic OpenBSD support. This is enough to be able to analyze core dumps for OpenBSD/amd64, OpenBSD/arm, OpenBSD/arm64 and OpenBSD/i386.
Note that part of the chan
[LLDB] OpenBSD support
Summary: Add basic OpenBSD support. This is enough to be able to analyze core dumps for OpenBSD/amd64, OpenBSD/arm, OpenBSD/arm64 and OpenBSD/i386.
Note that part of the changes to source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp fix a bug that probably affects other platforms as well. The GetProgramHeaderByIndex() interface use 1-based indices, but in some case when looping over the headers the, the loop starts at 0 and misses the last header. This caused problems on OpenBSD since OpenBSD core dumps have the PT_NOTE segment as the last program header.
Reviewers: joerg, labath, krytarowski
Reviewed By: krytarowski
Subscribers: aemerson, emaste, rengolin, srhines, krytarowski, mgorny, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D31131
llvm-svn: 298810
show more ...
|
|
Revision tags: llvmorg-4.0.0, llvmorg-4.0.0-rc4 |
|
| #
7f6a7a37 |
| 06-Mar-2017 |
Zachary Turner <[email protected]> |
Remove FileSpec::ReadFileContents.
This functionality is subsumed by DataBufferLLVM, which is also more efficient since it will try to mmap. However, we don't yet support mmaping writable private s
Remove FileSpec::ReadFileContents.
This functionality is subsumed by DataBufferLLVM, which is also more efficient since it will try to mmap. However, we don't yet support mmaping writable private sections, and in some cases we were using ReadFileContents and then modifying the buffer. To address that I've added a flag to the DataBufferLLVM methods that allow you to map privately, which disables the mmaping path entirely. Eventually we should teach DataBufferLLVM to use mmap with writable private, but that is orthogonal to this effort.
Differential Revision: https://reviews.llvm.org/D30622
llvm-svn: 297095
show more ...
|
| #
666cc0b2 |
| 04-Mar-2017 |
Zachary Turner <[email protected]> |
Move DataBuffer / DataExtractor and friends from Core -> Utility.
llvm-svn: 296943
|