summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/UnwindAssembly/x86
Commit message (Collapse)AuthorAgeFilesLines
* Fix the unwinding plan augmentation from x86 assemblyPavel Labath2019-10-101-16/+15
| | | | | | | | | | | | | | | | | | Unwind plan augmentation should compute the plan row at offset x from the instruction before offset x, but currently we compute it from the instruction at offset x. Note that this behavior is a regression introduced when moving the x86 assembly inspection engine to its own file (https://github.com/llvm/llvm-project/commit/1c9858b298d79ce82c45a2954096718b39550109#diff-375a2be066db6f34bb9a71442c9b71fcL913); the original version handled this properly by copying the previous instruction out before advancing the instruction pointer. The relevant bug with more info is here: https://bugs.llvm.org/show_bug.cgi?id=43561 Differential Revision: https://reviews.llvm.org/D68454 Patch by Jaroslav Sevcik <jarin@google.com>. llvm-svn: 374342
* Support Linux signal return trampolines in frame initializationJoseph Tremoulet2019-07-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add __kernel_rt_sigreturn to the list of trap handlers for Linux (it's used as such on aarch64 at least), and __restore_rt as well (used on x86_64). Skip decrement-and-recompute for trap handlers in InitializeNonZerothFrame, as signal dispatch may point the child frame's return address to the start of the return trampoline. Parse the 'S' flag for signal handlers from eh_frame augmentation, and propagate it to the unwind plan. Reviewers: labath, jankratochvil, compnerd, jfb, jasonmolenda Reviewed By: jasonmolenda Subscribers: clayborg, MaskRay, wuzish, nemanjai, kbarton, jrtc27, atanasyan, jsji, javed.absar, kristof.beyls, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D63667 llvm-svn: 366580
* Fix -Wsign-compare by explicit cast after r362557Fangrui Song2019-06-051-1/+1
| | | | llvm-svn: 362570
* Call abs to avoid signed/unsigned comparison warning.Jason Molenda2019-06-041-1/+1
| | | | llvm-svn: 362557
* [lldb] Fix out-of-bounds read after c3ea7c66fec021867e005ad1b02f3c7e80feaa85James Y Knight2019-06-041-1/+1
| | | | | | | | "Add support for mid-function epilogues on x86 that end in a non-local jump." Detected by asan. llvm-svn: 362510
* Add support for mid-function epilogues on x86 that end in a non-local jump.Jason Molenda2019-06-032-19/+257
| | | | | | | | | | | | | | | | | | | | | | | | | The x86 assembly inspection engine has code to support detecting a mid-function epilogue that ends in a RET instruction; add support for recognizing an epilogue that ends in a JMP, and add a check that the unwind state has been restored to the original stack setup; reinstate the post-prologue unwind state after this JMP instruction. The assembly inspection engine used for other architectures, UnwindAssemblyInstEmulation, detects mid-function epilogues by tracking branch instructions within the function and "forwards" the current unwind state to the targets of the branches. If an epilogue unwinds the stack and exits, followed by a branch target, we get back to the correct unwind state. The x86 unwinder should move to this same algorithm, or possibly even look at implementing an x86 instruction emulation plugin and get UnwindAssemblyInstEmulation to work for x86 too. I added a branch instruction recognizier method that will be necessary if we want to switch the algorithm. Differential Revision: https://reviews.llvm.org/D62764 <rdar://problem/51074422> llvm-svn: 362456
* [lldb] NFC modernize codebase with modernize-use-nullptrKonrad Kleine2019-05-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: NFC = [[ https://llvm.org/docs/Lexicon.html#nfc | Non functional change ]] This commit is the result of modernizing the LLDB codebase by using `nullptr` instread of `0` or `NULL`. See https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html for more information. This is the command I ran and I to fix and format the code base: ``` run-clang-tidy.py \ -header-filter='.*' \ -checks='-*,modernize-use-nullptr' \ -fix ~/dev/llvm-project/lldb/.* \ -format \ -style LLVM \ -p ~/llvm-builds/debug-ninja-gcc ``` NOTE: There were also changes to `llvm/utils/unittest` but I did not include them because I felt that maybe this library shall be updated in isolation somehow. NOTE: I know this is a rather large commit but it is a nobrainer in most parts. Reviewers: martong, espindola, shafik, #lldb, JDevlieghere Reviewed By: JDevlieghere Subscribers: arsenm, jvesely, nhaehnle, hiraditya, JDevlieghere, teemperor, rnkovacs, emaste, kubamracek, nemanjai, ki.stfu, javed.absar, arichardson, kbarton, jrtc27, MaskRay, atanasyan, dexonsmith, arphaman, jfb, jsji, jdoerfert, lldb-commits, llvm-commits Tags: #lldb, #llvm Differential Revision: https://reviews.llvm.org/D61847 llvm-svn: 361484
* [NFC] Remove ASCII lines from commentsJonas Devlieghere2019-04-102-6/+0
| | | | | | | | | | | | | | | | | | | | | | | A lot of comments in LLDB are surrounded by an ASCII line to delimit the begging and end of the comment. Its use is not really consistent across the code base, sometimes the lines are longer, sometimes they are shorter and sometimes they are omitted. Furthermore, it looks kind of weird with the 80 column limit, where the comment actually extends past the line, but not by much. Furthermore, when /// is used for Doxygen comments, it looks particularly odd. And when // is used, it incorrectly gives the impression that it's actually a Doxygen comment. I assume these lines were added to improve distinguishing between comments and code. However, given that todays editors and IDEs do a great job at highlighting comments, I think it's worth to drop this for the sake of consistency. The alternative is fixing all the inconsistencies, which would create a lot more churn. Differential revision: https://reviews.llvm.org/D60508 llvm-svn: 358135
* Use std::make_shared in LLDB (NFC)Jonas Devlieghere2019-02-111-1/+3
| | | | | | | | | | | Unlike std::make_unique, which is only available since C++14, std::make_shared is available since C++11. Not only is std::make_shared a lot more readable compared to ::reset(new), it also performs a single heap allocation for the object and control block. Differential revision: https://reviews.llvm.org/D57990 llvm-svn: 353764
* Fix x86 return pattern detectionRaphael Isemann2019-02-101-2/+2
| | | | | | | | | | | | | | | | Summary: Replace 0xc9 (LEAVE) with 0xcb (RETF) in ret_pattern_p(). Also put 0xc3 first, since it is the most common form and will match first. Reviewers: jasonmolenda Reviewed By: jasonmolenda Subscribers: labath, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D57928 llvm-svn: 353643
* [x64] Process the B field of the REX prefix correctly for the PUSH and POPAleksandr Urakov2019-02-061-4/+4
| | | | | | | | | | | | | | | | | | | | | instructions Summary: This patch makes `x86AssemblyInspectionEngine` to process zero value of the `B` field of the `REX` prefix in a correct way for `PUSH` and `POP` instructions. MSVC sometimes emits `pushq %rbp` instruction as `0x40 0x55`, and it was not parsed correctly before. Reviewers: jasonmolenda, labath Reviewed By: jasonmolenda, labath Subscribers: abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D57745 llvm-svn: 353281
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-194-16/+12
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Simplify Boolean expressionsJonas Devlieghere2018-12-152-22/+14
| | | | | | | | | | | This patch simplifies boolean expressions acorss LLDB. It was generated using clang-tidy with the following command: run-clang-tidy.py -checks='-*,readability-simplify-boolean-expr' -format -fix $PWD Differential revision: https://reviews.llvm.org/D55584 llvm-svn: 349215
* Remove header grouping comments.Jonas Devlieghere2018-11-111-4/+0
| | | | | | | | This patch removes the comments grouping header includes. They were added after running IWYU over the LLDB codebase. However they add little value, are often outdates and burdensome to maintain. llvm-svn: 346626
* [x86] Fix issues with a realigned stack in MSVC compiled applicationsAleksandr Urakov2018-10-303-74/+249
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch fixes issues with a stack realignment. MSVC maintains two frame pointers (`ebx` and `ebp`) for a realigned stack - one is used for access to function parameters, while another is used for access to locals. To support this the patch: - adds an alternative frame pointer (`ebx`); - considers stack realignment instructions (e.g. `and esp, -32`); - along with CFA (Canonical Frame Address) which point to the position next to the saved return address (or to the first parameter on the stack) introduces AFA (Aligned Frame Address) which points to the position of the stack pointer right after realignment. AFA is used for access to registers saved after the realignment (see the test); Here is an example of the code with the realignment: ``` struct __declspec(align(256)) OverAligned { char c; }; void foo(int foo_arg) { OverAligned oa_foo = { 1 }; auto aaa_foo = 1234; } void bar(int bar_arg) { OverAligned oa_bar = { 2 }; auto aaa_bar = 5678; foo(1111); } int main() { bar(2222); return 0; } ``` and here is the `bar` disassembly: ``` push ebx mov ebx, esp sub esp, 8 and esp, -100h add esp, 4 push ebp mov ebp, [ebx+4] mov [esp+4], ebp mov ebp, esp sub esp, 200h mov byte ptr [ebp-200h], 2 mov dword ptr [ebp-4], 5678 push 1111 ; foo_arg call j_?foo@@YAXH@Z ; foo(int) add esp, 4 mov esp, ebp pop ebp mov esp, ebx pop ebx retn ``` Reviewers: labath, zturner, jasonmolenda, stella.stamenova Reviewed By: jasonmolenda Subscribers: abidh, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D53435 llvm-svn: 345577
* Reflow paragraphs in comments.Adrian Prantl2018-04-302-87/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is intended as a clean up after the big clang-format commit (r280751), which unfortunately resulted in many of the comment paragraphs in LLDB being very hard to read. FYI, the script I used was: import textwrap import commands import os import sys import re tmp = "%s.tmp"%sys.argv[1] out = open(tmp, "w+") with open(sys.argv[1], "r") as f: header = "" text = "" comment = re.compile(r'^( *//) ([^ ].*)$') special = re.compile(r'^((([A-Z]+[: ])|([0-9]+ )).*)|(.*;)$') for line in f: match = comment.match(line) if match and not special.match(match.group(2)): # skip intentionally short comments. if not text and len(match.group(2)) < 40: out.write(line) continue if text: text += " " + match.group(2) else: header = match.group(1) text = match.group(2) continue if text: filled = textwrap.wrap(text, width=(78-len(header)), break_long_words=False) for l in filled: out.write(header+" "+l+'\n') text = "" out.write(line) os.rename(tmp, sys.argv[1]) Differential Revision: https://reviews.llvm.org/D46144 llvm-svn: 331197
* Move ArchSpec to the Utility modulePavel Labath2017-11-132-4/+3
| | | | | | | | | | | | | 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
* The x86 instruction unwinder can be asked to disassemble non-instruction Jason Molenda2017-07-082-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | blocks of memory, and if the final bytes of that block look like a long x86 instruction, it can cause the llvm disassembler to read past the end of the buffer. Use the maximum allowed instruction length that we pass to the llvm disassembler as a way to limit this to the size of the buffer. An example of how to trigger this is when lldb does a function call, it puts a breakpoint on the beginning of main() and uses that as the return address from the function call. When we stop at that location, lldb may try to find the first frame up the stack. Because this is on the first instruction of a function, it will get the word-size value at the stack pointer and assume that this was the caller's pc value. But this is random stack memory and could point to anything - an object in memory, something in the data section, whatever. And if we have a symbol for that thing, we'll try to disassemble it. This was leading to infrequent crashes in customer scenarios; figured out what was happening with address sanitizer. <rdar://problem/30463256> llvm-svn: 307454
* [UnwindAssembly/x86] Add support for "lea imm(%ebp), %esp" patternPavel Labath2017-06-292-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The instruction pattern: and $-16, %esp sub $imm, %esp ... lea imm(%ebp), %esp appears when the compiler is realigning the stack (for example in main(), or almost everywhere with -mstackrealign switch). The "and" instruction is very difficult to model, but that's not necessary, as these frames are always %ebp-based (the compiler also needs a way to restore the original %esp). Therefore the plans we were generating for these function were almost correct already. The only place we were doing it wrong were the last instructions of the epilogue (usually just "ret"), where we had to revert to %esp-based unwinding, as the %ebp had been popped already. This was wrong because our "distance of esp from cfa" counter had picked up the "sub" instruction (and incremented the counter) but it had not seen that the register was reset by the "lea" instruction. This patch fixes that shortcoming, and adds a test for handling functions like this. I have not been able to tickle the compiler into producing a 64-bit function with this pattern, but I don't see a reason why it couldn't produce it, if it chose to, so I add a x86_64 test as well. Reviewers: jasonmolenda, tberghammer Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D34750 llvm-svn: 306666
* Rename Error -> Status.Zachary Turner2017-05-121-5/+5
| | | | | | | | | | | | | | | 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
* PluginUnwindAssemblyX86: add missing linkage to MCDisasmMichal Gorny2017-03-251-0/+1
| | | | | | | | | | | | | | Add missing linkage of the lldbPluginUnwindAssemblyX86 to LLVMMCDisasm library. This fixes the following build failure when linking against shared libraries: lib64/liblldbPluginUnwindAssemblyX86.a(x86AssemblyInspectionEngine.cpp.o):x86AssemblyInspectionEngine.cpp:function lldb_private::x86AssemblyInspectionEngine::instruction_length(unsigned char*, int&): error: undefined reference to 'LLVMDisasmInstruction' lib64/liblldbPluginUnwindAssemblyX86.a(x86AssemblyInspectionEngine.cpp.o):x86AssemblyInspectionEngine.cpp:function lldb_private::x86AssemblyInspectionEngine::~x86AssemblyInspectionEngine(): error: undefined reference to 'LLVMDisasmDispose' lib64/liblldbPluginUnwindAssemblyX86.a(x86AssemblyInspectionEngine.cpp.o):x86AssemblyInspectionEngine.cpp:function lldb_private::x86AssemblyInspectionEngine::x86AssemblyInspectionEngine(lldb_private::ArchSpec const&): error: undefined reference to 'LLVMCreateDisasm' Differential Revision: https://reviews.llvm.org/D31369 llvm-svn: 298777
* x86AssemblyInspectionEngine::AugmentUnwindPlanFromCallSite could accessJason Molenda2017-03-021-4/+5
| | | | | | | the byte past the end of the buffer it had been given. ASAN catch. <rdar://problem/30774863> llvm-svn: 296733
* Remove dependencies from Utility to Core and Target.Zachary Turner2017-02-141-1/+1
| | | | | | | | | | With this patch, the only dependency left is from Utility to Host. After this is broken, Utility will finally be standalone. Differential Revision: https://reviews.llvm.org/D29909 llvm-svn: 295088
* Fix another build issue with shared libraries on LinuxChris Bieneman2017-02-101-2/+0
| | | | | | In r294767, I added these dependencies in the wrong place. llvm-svn: 294768
* Fix another build issue with shared libraries on LinuxChris Bieneman2017-02-101-0/+2
| | | | llvm-svn: 294767
* Fix build issue with shared libraries reported via emailChris Bieneman2017-02-101-0/+1
| | | | llvm-svn: 294763
* Revert r294580 , it didn't fix the shared buildIsmail Donmez2017-02-091-1/+0
| | | | llvm-svn: 294583
* Fix shared library buildIsmail Donmez2017-02-091-0/+1
| | | | llvm-svn: 294580
* Move classes from Core -> Utility.Zachary Turner2017-02-022-2/+2
| | | | | | | | | | | | | | | | | | | | | | | This moves the following classes from Core -> Utility. ConstString Error RegularExpression Stream StreamString The goal here is to get lldbUtility into a state where it has no dependendencies except on itself and LLVM, so it can be the starting point at which to start untangling LLDB's dependencies. These are all low level and very widely used classes, and previously lldbUtility had dependencies up to lldbCore in order to use these classes. So moving then down to lldbUtility makes sense from both the short term and long term perspective in solving this problem. Differential Revision: https://reviews.llvm.org/D29427 llvm-svn: 293941
* [CMake] [4/4] Update a batch of pluginsChris Bieneman2017-01-311-1/+9
| | | | | | This is extending the updates from r293696 to more LLDB plugins. llvm-svn: 293701
* Finish adding the individual instruction tests to the x86 unwinderJason Molenda2016-10-042-2/+51
| | | | | | | | | | | | | unittests. If I have time, I'd like to see if I can write some tests of the eh_frame augmentation which is a wholly separate code path (it seems like maybe it should be rolled into the main instruction scanning codepath, to be honest, and operate on the generated UnwindPlan instead of bothering with raw instructions at all). Outside the eh_frame augmentation, I'm comfortable that this unwind generator is being tested well now. llvm-svn: 283186
* Add support for some extended push instructions in i386/x86_64 likeJason Molenda2016-10-012-30/+75
| | | | | | | | | | | | | | | | | | | | | | 'push 0x20(%esp)' which clang can generate when emitting -fomit-frame-pointer code for 32-bit. Add a unit test program which includes this instruction. Also fix a bug in the refactoring/rewrite of the x86 assembly instruction profiler where I'd hard coded it as a 64-bit disassembler instead of using the ArchSpec to pick a 32-bit or 64-bit disassembler from llvm. When the disassembler would hit an instruction that is invalid in 64-bit mode, it would stop disassembling the function. This likely led to the TestSBData testsuite failure on linux with 32-bit i386 and gcc-4.9; I'll test that in a bit. The newly added unit test program is 32-bit i386 code and it includes an instruction which is invalid in 64-bit mode so it will catch this. <rdar://problem/28557876> llvm-svn: 282991
* Re-commit the changes from r282565 that I had to back out because of Jason Molenda2016-09-295-1197/+1364
| | | | | | | | | | | | | | a linux bot test failure. That one is fixed; hopefully there won't be any others turned up this time. The eh_frame augmentation code wasn't working right after the reorg/rewrite of the classes. It works correctly now for the one test that was failing - but we'll see what the test bots come up with. <rdar://problem/28509178> llvm-svn: 282659
* Reverting r282565.Jason Molenda2016-09-285-1369/+1197
| | | | | | | | | | A testbot found a regression introduced in the testsuite with the changes in r282565 on Ubuntu (TestStepNoDebug.ReturnValueTestCase). I'll get this set up on an ubuntu box and figure out what is happening there -- likely a problem with the eh_frame augmentation, which isn't used on macosx. llvm-svn: 282566
* Refactor the x86 UnwindAssembly class into a separate class calledJason Molenda2016-09-285-1197/+1369
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | x86AssemblyInspectionEngine and the current UnwindAssembly_x86 to allow for the core engine to be exercised by unit tests. The UnwindAssembly_x86 class will have access to Targets, Processes, Threads, RegisterContexts -- it will be working in the full lldb environment. x86AssemblyInspectionEngine is layered away from all of that, it is given some register definitions and a bag of bytes to profile. I wrote an initial unittest for a do-nothing simple x86_64/i386 function to start with. I'll be adding more. The x86 assembly unwinder was added to lldb early in its bringup; I made some modernization changes as I was refactoring the code to make it more consistent with how we write lldb today. I also added RegisterContextMinidump_x86_64.cpp to the xcode project file so I can run the unittests from that. The testsuite passes with this change, but there was quite a bit of code change by the refactoring and it's possible there are some issues. I'll be testing this more in the coming days, but it looks like it is behaving correctly as far as I can tell with automated testing. <rdar://problem/28509178> llvm-svn: 282565
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-062-1371/+1207
| | | | | | | | | | | | | | | | | | | | | | | *** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
* Remove autoconf support from source directories.Eugene Zelenko2016-01-281-14/+0
| | | | | | Differential revision: http://reviews.llvm.org/D16662 llvm-svn: 259098
* Add support for the LEAVE x86 instruction to AssemblyParse_x86.Jason Molenda2016-01-081-7/+38
| | | | llvm-svn: 257209
* Fix Clang-tidy modernize-use-override warnings in some files in ↵Eugene Zelenko2015-10-211-25/+26
| | | | | | | | source/Plugins; other minor fixes. Differential Revision: http://reviews.llvm.org/D13951 llvm-svn: 250925
* [cmake] Remove LLVM_NO_RTTI.Bruce Mitchener2015-09-031-2/+0
| | | | | | | | | | | | | | Summary: This doesn't exist in other LLVM projects any longer and doesn't do anything. Reviewers: chaoren, labath Subscribers: emaste, tberghammer, lldb-commits, danalbert Differential Revision: http://reviews.llvm.org/D12586 llvm-svn: 246749
* [Makefiles] Align library names with CMake buildKeno Fischer2015-07-141-3/+3
| | | | | | | | | | | | Summary: This aligns the library names used by the Makefile build to be the same as those create by the CMake build to make switching between the two easier. The only major difficulty was lldbHost which was one library in the CMake system and several in the Makefile system. Most of the other changes are trivial renames. Reviewers: labath Subscribers: emaste, tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D11154 llvm-svn: 242196
* Add support for 'leal' instruction to UnwindAssembly-x86Tamas Berghammer2015-03-251-1/+58
| | | | | | | | | | | Gcc for android use the leal instruction to substract from the stack pointer in the prologue of a function call. This patch add basic support for evaluating this instruction to support stack unwinding on android-x86. Differential revision: http://reviews.llvm.org/D8583 llvm-svn: 233178
* Don't #include ClangPersistentVariables.h from Process.hZachary Turner2015-03-031-0/+1
| | | | | | | Nothing from this header file was even being referenced in Process.h anyway, so it was a completely unnecessary include. llvm-svn: 231131
* Reduce header footprint of Target.hZachary Turner2015-03-031-0/+1
| | | | | | | | | | | | This continues the effort to reduce header footprint and improve build speed by removing clang and other unnecessary headers from Target.h. In one case, some headers were included solely for the purpose of declaring a nested class in Target, which was not needed by anybody outside the class. In this case the definition and implementation of the nested class were isolated in the .cpp file so the header could be removed. llvm-svn: 231107
* UnwindPlan::Row refactor -- add support for CFA set by a DWARF expressionPavel Labath2015-02-231-39/+39
| | | | | | | | | | | | | | | | | | | Summary: This change refactors UnwindPlan::Row to be able to store the fact that the CFA is value is set by evaluating a dwarf expression (DW_CFA_def_cfa_expression). This is achieved by creating a new class CFAValue and moving all CFA setting/getting code there. Note that code using the new CFAValue::isDWARFExpression is not yet present and will be added in a follow-up patch. Therefore, this patch should not change the functionality in any way. Test Plan: Ran tests on Mac and Linux. No regressions detected. Reviewers: jasonmolenda, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7755 llvm-svn: 230210
* Fix the last two warnings I see on Linx building 'lldb': mismatchedChandler Carruth2015-02-131-2/+2
| | | | | | | | | | | | | signed and unsigned types in comparisons. For the text offset, use the addr_t type that is used elsewhere to get these kinds of offsets, and which it is being compared against. This seems to make things more consistent. For the other, the numbers are clearly small and uninteresting, so just cast them to the most boring 'int' type. llvm-svn: 229085
* Save & restore the array of which registers have already beenJason Molenda2015-01-131-2/+17
| | | | | | | | | saved/restored across a mid-function epilogue. We ignore repeated push/pops of a register so once we saw one 'pop %rbp', we'd ignore it the second time we saw it. <rdar://problem/19417410> llvm-svn: 225853
* Enhance the eh_frame unwind instruction augmenter so thatJason Molenda2015-01-131-6/+46
| | | | | | | | | it will do the right thing on x86 routines with a mid-function epilogue sequence (where the unwind rules need to be reinstalled after the epilogue has completed). <rdar://problem/19417410> llvm-svn: 225773
* Add an additional check to UnwindAssembly_x86::AugmentUnwindPlanFromCallSite Jason Molenda2015-01-131-17/+36
| | | | | | | | | | | | | | | | which will verify if the eh_frame instructions include details about the prologue or not. Both clang and gcc include prologue instructions but there's no requirement for them to do so -- and I'm sure we'll have to interoperate with a compiler that doesn't generate prologue info at some point. I don't have any compilers that omit the prologue instructions so the testing was of the "makre sure augmented unwind info is still created". With an eh_frame without prologue, this code should reject the augmentation scheme altogether and we should fall back to using assembly instruction profiling. llvm-svn: 225771
* Change the x86 assembly instruction unwind parser toJason Molenda2015-01-131-170/+129
| | | | | | | | | | | | | | | step through the complete function looking for any epilogue instructions. If we find an epilogue sequence, re-instate the correct unwind instructions if there is more code past that epilogue -- this will correctly handle an x86 function with multiple epilogues in it. NB there is still a bug with the "eh_frame augmented" UnwindPlans and mid-function epilogues. Looking at that next. <rdar://problem/18863406> llvm-svn: 225770
OpenPOWER on IntegriCloud