summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Instruction
Commit message (Collapse)AuthorAgeFilesLines
* [Disassembler] Delete the VStream parameter of MCDisassembler::getInstruction()Fangrui Song2020-01-112-12/+10
| | | | | | | | | | The argument is llvm::null() everywhere except llvm::errs() in llvm-objdump in -DLLVM_ENABLE_ASSERTIONS=On builds. It is used by no target but X86 in -DLLVM_ENABLE_ASSERTIONS=On builds. If we ever have the needs to add verbose log to disassemblers, we can record log with a member function, instead of passing it around as an argument.
* [LLDB] [ARM] Use r11 as frame pointer on Windows on ARMMartin Storsjö2019-11-291-2/+6
| | | | | | | Extend EmulateMOVRdRm to identify "mov r11, sp" in thumb mode as setting the frame pointer, if r11 is the frame pointer register. Differential Revision: https://reviews.llvm.org/D70797
* [Mips] Use appropriate private label prefix based on Mips ABIMirko Brkusanin2019-10-232-4/+10
| | | | | | | | | | MipsMCAsmInfo was using '$' prefix for Mips32 and '.L' for Mips64 regardless of -target-abi option. By passing MCTargetOptions to MCAsmInfo we can find out Mips ABI and pick appropriate prefix. Tags: #llvm, #clang, #lldb Differential Revision: https://reviews.llvm.org/D66795
* Add arm64_32 support to lldb, an ILP32 codegen Jason Molenda2019-10-161-1/+2
| | | | | | | | | | that runs on arm64 ISA targets, specifically Apple watches. Differential Revision: https://reviews.llvm.org/D68858 llvm-svn: 375032
* Support Linux signal return trampolines in frame initializationJoseph Tremoulet2019-07-195-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 integer literals which are cast to boolJonas Devlieghere2019-05-241-2/+2
| | | | | | | | | This change replaces built-in types that are implicitly converted to booleans. Differential revision: https://reviews.llvm.org/D62284 llvm-svn: 361580
* [lldb] NFC modernize codebase with modernize-use-nullptrKonrad Kleine2019-05-235-26/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Simplify Triple::ppc64{,le} checks with Triple::isPPC64()Fangrui Song2019-05-161-11/+3
| | | | | | | | | | While here, update some ppc64le specific check to isPPC64(), if it applies to big-endian as well, in the hope that it will ease the support of big-endian if people are interested in this area. The big-endian variant is used by at least FreeBSD, Gentoo Linux, Adélie Linux, and Void Linux. llvm-svn: 360868
* typedef enum -> enumFangrui Song2019-05-142-31/+23
| | | | | | | | Reviewed By: labath Differential Revision: https://reviews.llvm.org/D61883 llvm-svn: 360654
* Fix file names in file headers. NFCFangrui Song2019-05-132-2/+2
| | | | llvm-svn: 360554
* [CMake] Remove EmulateInstructionMIPS dependency on InterpreterAlex Langford2019-05-022-2/+4
| | | | llvm-svn: 359748
* Fix UNPREDICTABLE check in EmulateInstructionARM::EmulateADDRegShiftRaphael Isemann2019-04-271-1/+1
| | | | | | | | | | | | | | | | | | | Summary: As reported in LLVM bug 41487, the check in this function is wrong and should be the same as the described check in the comment (which is correctly copied from the ARM ISA reference). Reviewers: #lldb, davide, JDevlieghere Reviewed By: #lldb, davide, JDevlieghere Subscribers: davide, javed.absar, kristof.beyls, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D60654 llvm-svn: 359387
* [NFC] Remove ASCII lines from commentsJonas Devlieghere2019-04-104-66/+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-131-6/+6
| | | | | | | | | | | | | | | | | 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-2/+2
| | | | | | | | 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
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1912-48/+36
| | | | | | | | | | | | | | | | | 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-154-254/+99
| | | | | | | | | | | 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
* Revert a hunk that shouldn't have been included in the last commit.Frederic Riss2018-12-091-1/+1
| | | | | | I've seen this line trigger UB, but that's obviously not the correct fix... llvm-svn: 348711
* Remove some UB in RegisterContextDarwin_arm64.cppFrederic Riss2018-12-091-1/+1
| | | | llvm-svn: 348710
* Remove header grouping comments.Jonas Devlieghere2018-11-113-12/+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
* Remove comments after header includes.Jonas Devlieghere2018-11-113-5/+3
| | | | | | | | | | This patch removes the comments following the header includes. They were added after running IWYU over the LLDB codebase. However they add little value, are often outdates and burdensome to maintain. Differential revision: https://reviews.llvm.org/D54385 llvm-svn: 346625
* Upstreaming the BridgeOS device support and the Jason Molenda2018-10-111-0/+1
| | | | | | | | | | | | | | | LC_BUILD_VERSION load command handling - this commit is a combination of patches by Adrian Prantl and myself. llvm::Triple::BridgeOS isn't defined yet, so all references to that are currently commented out. Also update Xcode project file to build the NativePDB etc plugins. <rdar://problem/43353615> llvm-svn: 344209
* [MIPS] Fix signed overflow in DADDIU emulationVedant Kumar2018-09-111-1/+12
| | | | | | | | This fixes a signed integer overflow diagnostic reported by ubsan. rdar://44353380 llvm-svn: 342008
* Move RegisterValue,Scalar,State from Core to UtilityPavel Labath2018-08-074-5/+5
| | | | | | | | | | | | | 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
* Change AddressClass type from 'enum' to 'enum class'.Tatyana Krasnukha2018-06-262-5/+5
| | | | | | If we have a function with signature f(addr_t, AddressClass), it is easy to muddle up the order of arguments without any warnings from compiler. 'enum class' prevents passing integer in place of AddressClass and vice versa. llvm-svn: 335599
* Reflow paragraphs in comments.Adrian Prantl2018-04-305-341/+272
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [LLDB] Initial version of PPC64 InstEmulationPavel Labath2018-02-274-0/+515
| | | | | | | | | | | | | | | Summary: Supports common prologue/epilogue instructions. Reviewers: clayborg, labath Reviewed By: clayborg, labath Subscribers: davide, anajuliapc, alexandreyy, lbianc, nemanjai, mgorny, kbarton Differential Revision: https://reviews.llvm.org/D43345 Author: Leandro Lupori <leandro.lupori@gmail.com> llvm-svn: 326224
* [ARM64] Remove unused function. NFCI.Davide Italiano2018-01-021-13/+0
| | | | llvm-svn: 321651
* Move ArchSpec to the Utility modulePavel Labath2017-11-134-4/+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
* Remove uses of std::auto_ptr, it's going away in C++17.Benjamin Kramer2017-09-143-12/+3
| | | | | | | std::unique_ptr is pretty much a drop-in replacement here. Also remove nullptr checks that are doing nothing. llvm-svn: 313265
* [LLDB][MIPS] Fix emulation of Instruction for MIPS64R6 target.Nitesh Jain2017-07-271-18/+57
| | | | | Subscribers: jaydeep, bhushan, lldb-commits, slthakur llvm-svn: 309250
* silence a couple of -Wqual-cast warning from GCC (NFC)Saleem Abdulrasool2017-07-191-1/+2
| | | | | | | | | | | | | | | Cast to `const uint8_t *` instead of `uint8_t *` to avoid the warning from GCC. EmulationStateARM.cpp:206:34: warning: cast from type 'const void*' to type 'uint8_t* {aka unsigned char*}' casts away qualifiers [-Wcast-qual] Cast to `const uint32_t *` and the explicitly cast away the const-ness of the value. This seems pretty sketchy as the `DataExtractor` holds a const reference to the data. However, this is no worse than before. ObjectFilePECOFF.cpp:540:78: warning: cast from type 'const uint8_t* {aka const unsigned char*}' to type 'uint32_t* {aka unsigned int*}' casts away qualifiers [-Wcast-qual] llvm-svn: 308489
* Rename Error -> Status.Zachary Turner2017-05-127-17/+17
| | | | | | | | | | | | | | | 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
* [ARM/Emulation] Remove an unneeded comparison and simplify. NFCI.Davide Italiano2017-04-141-2/+2
| | | | | | | reg0 is always zero and comparison to an unsigned always yields true. llvm-svn: 300375
* iwyu fixes for lldbCore.Zachary Turner2017-04-063-4/+5
| | | | | | | | | | | | | | This adjusts header file includes for headers and source files in Core. In doing so, one dependency cycle is eliminated because all the includes from Core to that project were dead includes anyway. In places where some files in other projects were only compiling due to a transitive include from another header, fixups have been made so that those files also include the header they need. Tested on Windows and Linux, and plan to address failures on OSX and FreeBSD after watching the bots. llvm-svn: 299714
* Fix two places where an arm instruction emulation methodJason Molenda2017-03-211-3/+6
| | | | | | | can dereference misaligned memory. <rdar://problem/31106315>, <rdar://problem/31106337> llvm-svn: 298337
* Move DataBuffer / DataExtractor and friends from Core -> Utility.Zachary Turner2017-03-042-2/+2
| | | | llvm-svn: 296943
* Fix various warnings. NFCZachary Turner2017-03-021-352/+0
| | | | llvm-svn: 296717
* [CMake] Add dependency on Mips target if it is availableChris Bieneman2017-02-082-0/+10
| | | | | | | | | | The Mips plugins conditionally link the Mips backend, so we need to conditionally add the target as a dependency. This resolves a bot failure from r294515. http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-buildserver/builds/4606/steps/build%20android/logs/stdio llvm-svn: 294521
* Move classes from Core -> Utility.Zachary Turner2017-02-028-13/+13
| | | | | | | | | | | | | | | | | | | | | | | 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
* Break some dependencies in lldbUtility.Zachary Turner2017-02-011-0/+909
| | | | | | Differential Revision: https://reviews.llvm.org/D29359 llvm-svn: 293806
* [CMake] [1/4] Update a batch of pluginsChris Bieneman2017-01-314-4/+42
| | | | | | This is extending the updates from r293696 to more LLDB plugins. llvm-svn: 293698
* Convert AutoComplete related code to StringRef.Zachary Turner2016-11-171-2/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D26721 llvm-svn: 287188
* Don't allow direct access to StreamString's internal buffer.Zachary Turner2016-11-161-2/+2
| | | | | | | | | | | | | | | 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
* Fix a bug where the EmulateInstructionARM64 handling of STP/LDP instructionsJason Molenda2016-11-011-67/+75
| | | | | | | | | | | | | | | for floating point registers was not recording them correctly. I needed to change the EmulateInstructionARM64 unwind plans from using the DWARF register numbering scheme to using the LLDB register numbering scheme (because dwarf doesn't define register numbers for the 64-bit "d" registers). Updated the EmulateInstructionARM64 unit tests to work with the LLDB register numbering scheme and added a unit test to check the floating point register spills & restores are correctly recorded. https://reviews.llvm.org/D25864 <rdar://problem/28745483> llvm-svn: 285662
* Add a first unit test for the arm64 instruction profiled unwindJason Molenda2016-10-111-3/+8
| | | | | | | | | | | | | | | | | | | | | | | 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
* Use StringRef instead of raw pointers in MCAsmInfo/MCInstrInfo APIs (NFC)Mehdi Amini2016-10-012-23/+23
| | | | llvm-svn: 283018
* [LLDB][MIPS] Fix Emulation for JALR64 InstructionNitesh Jain2016-09-091-0/+1
| | | | | Subscribers: jaydeep, bhushan, slthakur, sdardis, lldb-commits llvm-svn: 281032
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-0610-18349/+18627
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* Delete Host/windows/win32.hZachary Turner2016-08-092-0/+2
| | | | | | | | | | | | | | | | | | | It's always hard to remember when to include this file, and when you do include it it's hard to remember what preprocessor check it needs to be behind, and then you further have to remember whether it's windows.h or win32.h which you need to include. This patch changes the name to PosixApi.h, which is more appropriately named, and makes it independent of any preprocessor setting. There's still the issue of people not knowing when to include this, because there's not a well-defined set of things it exposes other than "whatever is missing on Windows", but at least this should make it less painful to fix when problems arise. This patch depends on LLVM revision r278170. llvm-svn: 278177
OpenPOWER on IntegriCloud