summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/UnwindAssembly
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-233-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-104-12/+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
* Replace 'ap' with 'up' suffix in variable names. (NFC)Jonas Devlieghere2019-02-132-18/+18
| | | | | | | | | | | | | | | | | The `ap` suffix is a remnant of lldb's former use of auto pointers, before they got deprecated. Although all their uses were replaced by unique pointers, some variables still carried the suffix. In r353795 I removed another auto_ptr remnant, namely redundant calls to ::get for unique_pointers. Jim justly noted that this is a good opportunity to clean up the variable names as well. I went over all the changes to ensure my find-and-replace didn't have any undesired side-effects. I hope I didn't miss any, but if you end up at this commit doing a git blame on a weirdly named variable, please know that the change was unintentional. llvm-svn: 353912
* Remove redundant ::get() for smart pointer. (NFC)Jonas Devlieghere2019-02-121-1/+1
| | | | | | | | This commit removes redundant calls to smart pointer’s ::get() method. https://clang.llvm.org/extra/clang-tidy/checks/readability-redundant-smartptr-get.html llvm-svn: 353795
* 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-196-24/+18
| | | | | | | | | | | | | | | | | 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-112-8/+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
* Fix typos.Bruce Mitchener2018-10-041-1/+1
| | | | | | | | | | Reviewers: lldb-commits Subscribers: srhines, ki.stfu Differential Revision: https://reviews.llvm.org/D52884 llvm-svn: 343825
* Move RegisterValue,Scalar,State from Core to UtilityPavel Labath2018-08-071-1/+1
| | | | | | | | | | | | | These three classes have no external dependencies, but they are used from various low-level APIs. Moving them down to Utility improves overall code layering (although it still does not break any particular dependency completely). The XCode project will need to be updated after this change. Differential Revision: https://reviews.llvm.org/D49740 llvm-svn: 339127
* Move dumping code out of RegisterValue classPavel Labath2018-07-241-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The dump function was the only part of this class which depended on high-level functionality. This was due to the DumpDataExtractor function, which uses info from a running target to control dump format (although, RegisterValue doesn't really use the high-level part of DumpDataExtractor). This patch follows the same approach done for the DataExtractor class, and extracts the dumping code into a separate function/file. This file can stay in the higher level code, while the RegisterValue class and anything that does not depend in dumping can stay go to lower layers. The XCode project will need to be updated after this patch. Reviewers: zturner, jingham, clayborg Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D48351 llvm-svn: 337832
* Typo fixes.Bruce Mitchener2018-05-291-3/+3
| | | | | | | | | | Reviewers: javed.absar Subscribers: ki.stfu, JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D47421 llvm-svn: 333399
* Reflow paragraphs in comments.Adrian Prantl2018-04-303-120/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-133-5/+4
| | | | | | | | | | | | | 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-122-7/+7
| | | | | | | | | | | | | | | 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
* Move DataBuffer / DataExtractor and friends from Core -> Utility.Zachary Turner2017-03-041-2/+2
| | | | llvm-svn: 296943
* Isolate Target-specific functionality of DataExtractor.Zachary Turner2017-03-031-1/+3
| | | | | | | | | | | | | | | | In an effort to move the various DataBuffer / DataExtractor classes from Core -> Utility, we have to separate the low-level functionality from the higher level functionality. Only a few functions required anything other than reading/writing raw bytes, so those functions are separated out into a more appropriate area. Specifically, Dump() and DumpHexBytes() are moved into free functions in Core/DumpDataExtractor.cpp, and GetGNUEHPointer is moved into a static function in the only file that it's referenced from. Differential Revision: https://reviews.llvm.org/D30560 llvm-svn: 296910
* Move Log from Core -> Utility.Zachary Turner2017-03-031-1/+1
| | | | | | | | | All references to Host and Core have been removed, so this class can now safely be lowered into Utility. Differential Revision: https://reviews.llvm.org/D30559 llvm-svn: 296909
* 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-023-4/+4
| | | | | | | | | | | | | | | | | | | | | | | 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-312-2/+15
| | | | | | This is extending the updates from r293696 to more LLDB plugins. llvm-svn: 293701
* Make lldb -Werror clean for -Wstring-conversionDavid Blaikie2017-01-061-9/+8
| | | | | | | | | Also found/fixed one bug identified by this warning in RenderScriptx86ABIFixups.cpp where a string literal was being used in an effort to provide a name for an instruction/register, but was instead being passed as the bool 'isVolatile' parameter. llvm-svn: 291198
* Don't allow direct access to StreamString's internal buffer.Zachary Turner2016-11-161-8/+7
| | | | | | | | | | | | | | | This is a large API change that removes the two functions from StreamString that return a std::string& and a const std::string&, and instead provide one function which returns a StringRef. Direct access to the underlying buffer violates the concept of a "stream" which is intended to provide forward only access, and makes porting to llvm::raw_ostream more difficult in the future. Differential Revision: https://reviews.llvm.org/D26698 llvm-svn: 287152
* Add a first unit test for the arm64 instruction profiled unwindJason Molenda2016-10-112-13/+48
| | | | | | | | | | | | | | | | | | | | | | | plan generator. Fix a small bug in EmulateInstructionARM64::GetFramePointerRegister which was returning the stack pointer reg instead of fp, prevented the unwinder from recognizing the switch to using the fp in a function. (<rdar://problem/28663117>) Add a new eContextRestoreStackPointer context hint so that the arm64 emulator can flag when the frame pointer value is copied back in to the stack pointer and that should be used to compute the canonical frame address again in an epilogue sequence. (<rdar://problem/28704862>) Small changes to UnwindAssemblyInstEmulation to have a method we can call without a live process/thread/etc for unit tests. <rdar://problem/28663117> <rdar://problem/28704862> <rdar://problem/28509178> llvm-svn: 283847
* 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-064-2126/+1891
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* Now that there are no cycles that cause leaks in the ↵Greg Clayton2016-06-071-3/+0
| | | | | | | | disassembler/instruction classes, we can get rid of the FIXME lines that were working around this issue. <rdar://problem/26684190> llvm-svn: 272071
* Stack unwinding emulation: handle adjustment of FPTamas Berghammer2016-02-191-1/+16
| | | | | | | | | | | | | | | | | | | | This change is improving the instruction emulation based unwinding to handle when the frame pointer is adjusted (increment/decrement) after it has been initialized. The situation can occur in the prologue of some function where FP is adjusted before it is copied back to SP. Example code (thumb, generated by gcc 4.8): < +0>: push {r4, r7, lr} < +2>: sub sp, #0x14 < +4>: add r7, sp, #0x0 ... <+50>: adds r7, #0x14 ; The CL fixes the handling of this instruction <+52>: mov sp, r7 ; Previously unwinding from here was broken <+54>: pop {r4, r7, pc} Differential revision: http://reviews.llvm.org/D17295 llvm-svn: 261318
OpenPOWER on IntegriCloud