summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h
Commit message (Collapse)AuthorAgeFilesLines
* [NFC] Remove ASCII lines from commentsJonas Devlieghere2019-04-101-4/+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
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | 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
* Remove header grouping comments.Jonas Devlieghere2018-11-111-3/+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
* Use a RAII guard to control access to DisassemblerLLVMC.Raphael Isemann2018-08-281-13/+0
| | | | | | | | | | | | | | | | | | | | Summary: This patch replaces the manual lock/unlock calls for gaining exclusive access to the disassembler with a RAII-powered access scope. This should prevent that we somehow skip over these trailing Unlock calls (e.g. with early returns). We also have a second `GetDisasmToUse` method now that takes an already constructed access scope to prevent deadlocks when we call this from other methods. Reviewers: #lldb, davide, vsk Reviewed By: #lldb, davide, vsk Subscribers: davide, vsk, lldb-commits Differential Revision: https://reviews.llvm.org/D51319 llvm-svn: 340835
* Check existence of each required component during construction of ↵Tatyana Krasnukha2018-01-111-53/+7
| | | | | | | | | | | | | | | | | | | | | | | LLVMCDisassembler. Summary: Actually, fix two issues: # remove repeat creation of reg_info, use m_reg_info_ap for createMCAsmInfo instead; # remove possibility to dereference nullptr during createMCAsmInfo invocation, that could lead to undefined behavior. Placed checking of a component right after its creation to simplify the code and avoid same issues later. Reviewers: zturner, clayborg, jingham, jasonmolenda, labath Reviewed By: clayborg, labath Subscribers: labath, lldb-commits Differential Revision: https://reviews.llvm.org/D41584 llvm-svn: 322270
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-061-126/+106
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* Added the "frame diagnose" command and use its output to make crash info better.Sean Callanan2016-09-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When a process stops due to a crash, we get the crashing instruction and the crashing memory location (if there is one). From the user's perspective it is often unclear what the reason for the crash is in a symbolic sense. To address this, I have added new fuctionality to StackFrame to parse the disassembly and reconstruct the sequence of dereferneces and offsets that were applied to a known variable (or fuction retrn value) to obtain the invalid pointer. This makes use of enhancements in the disassembler, as well as new information provided by the DWARF expression infrastructure, and is exposed through a "frame diagnose" command. It is also used to provide symbolic information, when available, in the event of a crash. The algorithm is very rudimentary, and it needs a bunch of work, including - better parsing for assembly, preferably with help from LLVM - support for non-Apple platforms - cleanup of the algorithm core, preferably to make it all work in terms of Operands instead of register/offset pairs - improvement of the GetExpressioPath() logic to make prettier expression paths, and - better handling of vtables. I welcome all suggestios, improvements, and testcases. llvm-svn: 280692
* remove use of Mutex in favour of std::{,recursive_}mutexSaleem Abdulrasool2016-05-181-4/+4
| | | | | | | | | | This is a pretty straightforward first pass over removing a number of uses of Mutex in favor of std::mutex or std::recursive_mutex. The problem is that there are interfaces which take Mutex::Locker & to lock internal locks. This patch cleans up most of the easy cases. The only non-trivial change is in CommandObjectTarget.cpp where a Mutex::Locker was split into two. llvm-svn: 269877
* DisassemblerLLVMC now gets the disassembler comments for an instructionSean Callanan2015-12-111-1/+1
| | | | | | | and appends them to our list of comments (which can additionally include things like decoded addresses). llvm-svn: 255358
* Fix Clang-tidy modernize-use-override warnings in include/lldb/Disassembler ↵Eugene Zelenko2015-10-221-25/+29
| | | | | | | | and OperatingSystem; other minor fixes. Second attempt which should work for MSVC. llvm-svn: 251066
* Revert r250872 in source/Plugins/Disassembler to fix MSVC builds failures.Eugene Zelenko2015-10-211-29/+26
| | | | llvm-svn: 250874
* Fix Clang-tidy modernize-use-override warnings in some files in ↵Eugene Zelenko2015-10-211-26/+29
| | | | | | | | source/Plugins; other minor fixes. Differential Revision: http://reviews.llvm.org/D13916 llvm-svn: 250872
* [MIPS] Avoid breakpoint in delay slotBhushan D. Attarde2015-08-261-0/+1
| | | | | | | | | | | | | | SUMMARY: This patch implements Target::GetBreakableLoadAddress() method that takes an address and checks for any reason there is a better address than this to put a breakpoint on. If there is then return that address. MIPS uses this method to avoid breakpoint in delay slot. Reviewers: clayborg, jingham Subscribers: jingham, mohit.bhakkad, sagar, jaydeep, nitesh.jain, lldb-commits Differential Revision: http://http://reviews.llvm.org/D12184 llvm-svn: 246015
* [LLDB][MIPS] Detect MIPS application specific extensions like micromipsJaydeep Patil2015-07-161-1/+1
| | | | | | | | | | | | | | SUMMARY: The patch detects MIPS application specific extensions (ASE) like micromips by reading ELF header.e_flags and SHT_MIPS_ABIFLAGS section. MIPS triple does not contain ASE information like micromips, mips16, DSP, MSA etc. These can be read from header.e_flags or SHT_MIPS_ABIFLAGS section. Reviewers: clayborg Subscribers: mohit.bhakkad, sagar, lldb-commits Differential Revision: http://reviews.llvm.org/D11133 llvm-svn: 242381
* [LLDB][MIPS] Emulation of MIPS64 floating-point branch instructionsMohit K. Bhakkad2015-06-181-1/+1
| | | | | | | | | | | | | | | | | Patch by Jaydeep Patil SUMMARY: 1. Added emulation of MIPS64 floating-point branch instructions 2. Updated GetRegisterInfo to recognize floating-point registers 3. Provided CPU information while creating createMCSubtargetInfo in disassembler 4. Bug fix in emulation of JIC and JIALC 5. Correct identification of breakpoint when set in a delay slot of a branch instruction Reviewers: clayborg Subscribers: bhushan, mohit.bhakkad, sagar, nitesh.jain, lldb-commits. Differential Revision: http://reviews.llvm.org/D10355 llvm-svn: 239996
* Remove trailing spacesSylvestre Ledru2014-04-151-23/+23
| | | | llvm-svn: 206278
* New settings: target.use-hex-immediates and target.hex-immediates-styleDaniel Malea2013-08-071-1/+2
| | | | | | | | | | - Immediates can be shown as hex (either Intel or MASM style) - See TestSettings.py for usage examples - Verified to cause no regressions on Linux x86_64 (Ubuntu 12.10) Patch by Richard Mitton! llvm-svn: 187921
* <rdar://problem/13854277>Greg Clayton2013-05-101-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <rdar://problem/13594769> Main changes in this patch include: - cleanup plug-in interface and use ConstStrings for plug-in names - Modfiied the BSD Archive plug-in to be able to pick out the correct .o file when .a files contain multiple .o files with the same name by using the timestamp - Modified SymbolFileDWARFDebugMap to properly verify the timestamp on .o files it loads to ensure we don't load updated .o files and cause problems when debugging The plug-in interface changes: Modified the lldb_private::PluginInterface class that all plug-ins inherit from: Changed: virtual const char * GetPluginName() = 0; To: virtual ConstString GetPluginName() = 0; Removed: virtual const char * GetShortPluginName() = 0; - Fixed up all plug-in to adhere to the new interface and to return lldb_private::ConstString values for the plug-in names. - Fixed all plug-ins to return simple names with no prefixes. Some plug-ins had prefixes and most ones didn't, so now they all don't have prefixed names, just simple names like "linux", "gdb-remote", etc. llvm-svn: 181631
* After discussing with Chris Lattner, we require C++11, so lets get rid of ↵Greg Clayton2013-04-181-9/+9
| | | | | | the macros and just use C++11. llvm-svn: 179805
* Since we use C++11, we should switch over to using std::unique_ptr when ↵Greg Clayton2013-04-181-11/+11
| | | | | | | | C++11 is being used. To do this, we follow what we have done for shared pointers and we define a STD_UNIQUE_PTR macro that can be used and it will "do the right thing". Due to some API differences in std::unique_ptr and due to the fact that we need to be able to compile without C++11, we can't use move semantics so some code needed to change so that it can compile with either C++. Anyone wanting to use a unique_ptr or auto_ptr should now use the "STD_UNIQUE_PTR(TYPE)" macro. llvm-svn: 179779
* <rdar://problem/11730263>Greg Clayton2013-03-281-3/+5
| | | | | | | | | | PC relative loads are missing disassembly comments when disassembled in a live process. This issue was because some sections, like __TEXT and __DATA in libobjc.A.dylib, were being moved when they were put into the dyld shared cache. This could also affect any other system that slides sections individually. The solution is to keep track of wether the bytes we will disassemble are from an executable file (file address), or from a live process (load address). We now do the right thing based off of this input in all cases. llvm-svn: 178315
* Convert from the C-based LLVM Disassembler shim to the full MC Disassembler ↵Jim Ingham2013-03-021-7/+52
| | | | | | | | | | | | API's. Calculate "can branch" using the MC API's rather than our hand-rolled regex'es. As extra credit, allow setting the disassembly flavor for x86 based architectures to intel or att. <rdar://problem/11319574> <rdar://problem/9329275> llvm-svn: 176392
* <rdar://problem/13069948>Greg Clayton2013-01-251-2/+2
| | | | | | | | | | | | Major fixed to allow reading files that are over 4GB. The main problems were that the DataExtractor was using 32 bit offsets as a data cursor, and since we mmap all of our object files we could run into cases where if we had a very large core file that was over 4GB, we were running into the 4GB boundary. So I defined a new "lldb::offset_t" which should be used for all file offsets. After making this change, I enabled warnings for data loss and for enexpected implicit conversions temporarily and found a ton of things that I fixed. Any functions that take an index internally, should use "size_t" for any indexes and also should return "size_t" for any sizes of collections. llvm-svn: 173463
* <rdar://problem/11330621>Greg Clayton2012-05-101-10/+8
| | | | | | | | | | | | Fixed the DisassemblerLLVMC disassembler to parse more efficiently instead of parsing opcodes over and over. The InstructionLLVMC class now only reads the opcode in the InstructionLLVMC::Decode function. This can be done very efficiently for ARM and architectures that have fixed opcode sizes. For x64 it still calls the disassembler to get the byte size. Moved the lldb_private::Instruction::Dump(...) function up into the lldb_private::Instruction class and it now uses the function that gets the mnemonic, operandes and comments so that all disassembly is using the same code. Added StreamString::FillLastLineToColumn() to allow filling a line up to a column with a character (which is used by the lldb_private::Instruction::Dump(...) function). Modified the Opcode::GetData() fucntion to "do the right thing" for thumb instructions. llvm-svn: 156532
* Added a new disassembler plugin, DisassemblerLLVMC,Sean Callanan2012-02-171-0/+126
which uses the Disassembler.h interface to the LLVM disassemblers rather than the EnhancedDisassembly.h interface. Disassembler.h is a better-maintained API and will be stabler in the long term. Currently the output from Disassembler.h does not provide for symbolic disassembly in all the places that the old disassembler did, so I have gated (and disabled) the disassembler. It'll be easy to flip the switch later. In the meantime, to enable the new disassembler, uncomment "#define USE_NEW_DISASSEMBLER" in lldb.cpp. llvm-svn: 150772
OpenPOWER on IntegriCloud