summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Disassembler/llvm
Commit message (Collapse)AuthorAgeFilesLines
...
* Update to new API.Bill Wendling2013-06-181-1/+1
| | | | llvm-svn: 184177
* Added a parameter for relocation info to keep lldb in step with llvm due to ↵Ashok Thirumurthi2013-05-241-4/+13
| | | | | | | | r182625, which takes a first step towards symbolization of disassembled instructions. llvm-svn: 182650
* Also pass the MCRegInfo to createMCAsmInfo. Follow the modification ↵Sylvestre Ledru2013-05-131-2/+2
| | | | | | introduced in commit r181680 of llvm llvm-svn: 181703
* <rdar://problem/13854277>Greg Clayton2013-05-102-24/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <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
* <rdar://problem/13751683> Greg Clayton2013-05-031-2/+12
| | | | | | Make sure to handle all thumb variants correctly. llvm-svn: 180984
* After discussing with Chris Lattner, we require C++11, so lets get rid of ↵Greg Clayton2013-04-182-10/+10
| | | | | | 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-182-12/+16
| | | | | | | | 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-282-104/+104
| | | | | | | | | | 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
* DoesBranch needs to compute the instruction if it isn't already done.Jim Ingham2013-03-131-5/+55
| | | | | | Handle the "alternate_isa" correctly. llvm-svn: 176922
* Misc. clang build warning fixes.Matt Kopec2013-03-121-1/+1
| | | | llvm-svn: 176879
* Convert from the C-based LLVM Disassembler shim to the full MC Disassembler ↵Jim Ingham2013-03-022-139/+279
| | | | | | | | | | | | 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
* Adding CMake build system to LLDB. Some known issues remain:Daniel Malea2013-02-211-0/+5
| | | | | | | | | | | | | | - generate-vers.pl has to be called by cmake to generate the version number - parallel builds not yet supported; dependency on clang must be explicitly specified Tested on Linux. - Building on Mac will require code-signing logic to be implemented. - Building on Windows will require OS-detection logic and some selective directory inclusion Thanks to Carlo Kok (who originally prepared these CMakefiles for Windows) and Ben Langmuir who ported them to Linux! llvm-svn: 175795
* <rdar://problem/13069948>Greg Clayton2013-01-252-6/+6
| | | | | | | | | | | | 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
* Rmoved the old LLVM disassembler based on libedis.Sean Callanan2012-12-142-634/+0
| | | | llvm-svn: 170171
* Resolve printf formatting warnings on Linux:Daniel Malea2012-11-292-5/+5
| | | | | | | | - use macros from inttypes.h for format strings instead of OS-specific types Patch from Matt Kopec! llvm-svn: 168945
* Bunch of cleanups for warnings found by the llvm static analyzer.Jim Ingham2012-10-121-3/+7
| | | | llvm-svn: 165808
* A patch that allows for mach-o architectures to be specified as ↵Greg Clayton2012-09-191-4/+6
| | | | | | "<number>-<number>" where the first number is the cpu type and the second is the cpu subtype. Also added code to allow use of mach-o architectures that aren't in our tables so that symbolication and static file introspection (crashlogs) can work with them. llvm-svn: 164258
* <rdar://problem/11757916>Greg Clayton2012-08-291-0/+1
| | | | | | | | | | | | Make breakpoint setting by file and line much more efficient by only looking for inlined breakpoint locations if we are setting a breakpoint in anything but a source implementation file. Implementing this complex for a many reasons. Turns out that parsing compile units lazily had some issues with respect to how we need to do things with DWARF in .o files. So the fixes in the checkin for this makes these changes: - Add a new setting called "target.inline-breakpoint-strategy" which can be set to "never", "always", or "headers". "never" will never try and set any inlined breakpoints (fastest). "always" always looks for inlined breakpoint locations (slowest, but most accurate). "headers", which is the default setting, will only look for inlined breakpoint locations if the breakpoint is set in what are consudered to be header files, which is realy defined as "not in an implementation source file". - modify the breakpoint setting by file and line to check the current "target.inline-breakpoint-strategy" setting and act accordingly - Modify compile units to be able to get their language and other info lazily. This allows us to create compile units from the debug map and not have to fill all of the details in, and then lazily discover this information as we go on debuggging. This is needed to avoid parsing all .o files when setting breakpoints in implementation only files (no inlines). Otherwise we would need to parse the .o file, the object file (mach-o in our case) and the symbol file (DWARF in the object file) just to see what the compile unit was. - modify the "SymbolFileDWARFDebugMap" to subclass lldb_private::Module so that the virtual "GetObjectFile()" and "GetSymbolVendor()" functions can be intercepted when the .o file contenst are later lazilly needed. Prior to this fix, when we first instantiated the "SymbolFileDWARFDebugMap" class, we would also make modules, object files and symbol files for every .o file in the debug map because we needed to fix up the sections in the .o files with information that is in the executable debug map. Now we lazily do this in the DebugMapModule::GetObjectFile() Cleaned up header includes a bit as well. llvm-svn: 162860
* Changed the Opcode::GetData() API so that it didn'tSean Callanan2012-08-071-1/+1
| | | | | | | | require an AddressClass, which is useless at this point since it already knows the distinction between 32-bit Thumb opcodes and 32-bit ARM opcodes. llvm-svn: 161382
* Fixed an error in the thumb opcode encoding. We need the 32 bit thumb ↵Greg Clayton2012-08-071-3/+4
| | | | | | instructions to be encoded as a 32 bit value for the EmulateARM code. llvm-svn: 161381
* Improved raw disassembly output for Thumb.Sean Callanan2012-08-061-4/+5
| | | | llvm-svn: 161360
* Instructions generated by a disassembler can nowSean Callanan2012-08-011-0/+2
| | | | | | | | | | | | | | | | | | keep a shared pointer to their disassembler. This is important for the LLVM-C disassembler because it needs to lock its parent in order to disassemble itself. This means that every interface that returned a Disassembler* needs to return a DisassemblerSP, so that the instructions and any external owners share the same reference count on the object. I changed all clients to use this shared pointer, which also plugged a few leaks. <rdar://problem/12002822> llvm-svn: 161123
* <rdar://problem/11330621>Greg Clayton2012-05-104-635/+324
| | | | | | | | | | | | 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
* <rdar://problem/11358639>Greg Clayton2012-05-081-1/+4
| | | | | | | | Switch over to the "*-apple-macosx" for desktop and "*-apple-ios" for iOS triples. Also make the selection process for auto selecting platforms based off of an arch much better. llvm-svn: 156354
* Expose GetAddressClass() from both the SBAddress and SBInstruction so ↵Greg Clayton2012-04-132-3/+3
| | | | | | clients can tell the difference between ARM/Thumb opcodes when disassembling ARM. llvm-svn: 154633
* Cleaned up code that was getting SBData for an SBInstruction.Greg Clayton2012-04-111-22/+37
| | | | llvm-svn: 154535
* Improved detection of ARM branch instructions toSean Callanan2012-04-101-6/+4
| | | | | | cover all possible condition codes. llvm-svn: 154440
* Fixed a leak in the LLVM disassembler where weSean Callanan2012-04-061-0/+10
| | | | | | | did not destroy the underlying disassembler in our destructor. llvm-svn: 154185
* Order ivar initializers to how they're declared in the class.Bill Wendling2012-04-061-1/+1
| | | | llvm-svn: 154146
* Resolved two problems in the disassembler:Sean Callanan2012-03-221-5/+7
| | | | | | | | | | | - Addresses with no description were given comments, leading to useless comments like "; , " - Addresses weren't resolved with respect to the correct module. llvm-svn: 153274
* Fixed a bug in the disassembler where we didSean Callanan2012-03-221-29/+38
| | | | | | | not properly print the load addresses for PC-relative jumps. llvm-svn: 153233
* Since we are having issues with the new LLVM MC disassembler, we can haveGreg Clayton2012-03-222-4/+4
| | | | | | | | | | | | | | | | | them both installed with the LLVM MC version being the default. I renamed the name of the LLVM MC disassembler plug-in to "llvm-mc" and the LLVM enhanced disassembly plug-in to "llvm-edis" and they can both be installed for now. To use the "llvm-edis" disassembler, you can just specify it while disassembling: (lldb) disassemble --plugin llvm-edis --name main (lldb) disassemble --plugin llvm-mc --name main This will allow us to compare the output of the two disassembler and eventually deprecate the old one when the new one is ready. But it does use the new disassembler by default so we continue to test it on a daily basis. llvm-svn: 153231
* Added a function to the disassembler that checksSean Callanan2012-03-021-2/+92
| | | | | | | | (from the mnemonic) whether an instruction is a branch. This function's result is exposed through DoesBranch(). llvm-svn: 151953
* <rdar://problem/10103468>Greg Clayton2012-02-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | I started work on being able to add symbol files after a debug session had started with a new "target symfile add" command and quickly ran into problems with stale Address objects in breakpoint locations that had lldb_private::Section pointers into modules that had been removed or replaced. This also let to grabbing stale modules from those sections. So I needed to thread harded the Address, Section and related objects. To do this I modified the ModuleChild class to now require a ModuleSP on initialization so that a weak reference can created. I also changed all places that were handing out "Section *" to have them hand out SectionSP. All ObjectFile, SymbolFile and SymbolVendors were inheriting from ModuleChild so all of the find plug-in, static creation function and constructors now require ModuleSP references instead of Module *. Address objects now have weak references to their sections which can safely go stale when a module gets destructed. This checkin doesn't complete the "target symfile add" command, but it does get us a lot clioser to being able to do such things without a high risk of crashing or memory corruption. llvm-svn: 151336
* Updated LLVM to take some fixes that make theSean Callanan2012-02-231-19/+7
| | | | | | | | | | | Intel disassembler usable. Also flipped the switch: we are now exclusively using Disassembler.h instead of EnhancedDisassembly.h for all disassembly in LLDB. llvm-svn: 151306
* Fix compile error for DisassemblerLLVMC.cpp.Johnny Chen2012-02-201-1/+2
| | | | | | | | Patch by Dmitry Vyukov <dvyukov@google.com>. Also add the relevant files to the Xcode project. llvm-svn: 150991
* The second part in thread hardening the internals of LLDB where we makeGreg Clayton2012-02-181-16/+21
| | | | | | | | | | | | | | | | the lldb_private::StackFrame objects hold onto a weak pointer to the thread object. The lldb_private::StackFrame objects the the most volatile objects we have as when we are doing single stepping, frames can often get lost or thrown away, only to be re-created as another object that still refers to the same frame. We have another bug tracking that. But we need to be able to have frames no longer be able to get the thread when they are not part of a thread anymore, and this is the first step (this fix makes that possible but doesn't implement it yet). Also changed lldb_private::ExecutionContextScope to return shared pointers to all objects in the execution context to further thread harden the internals. llvm-svn: 150871
* Added a new disassembler plugin, DisassemblerLLVMC,Sean Callanan2012-02-172-0/+706
| | | | | | | | | | | | | | | | | | | 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
* Switching back to using std::tr1::shared_ptr. We originally switched awayGreg Clayton2012-01-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | due to RTTI worries since llvm and clang don't use RTTI, but I was able to switch back with no issues as far as I can tell. Once the RTTI issue wasn't an issue, we were looking for a way to properly track weak pointers to objects to solve some of the threading issues we have been running into which naturally led us back to std::tr1::weak_ptr. We also wanted the ability to make a shared pointer from just a pointer, which is also easily solved using the std::tr1::enable_shared_from_this class. The main reason for this move back is so we can start properly having weak references to objects. Currently a lldb_private::Thread class has a refrence to its parent lldb_private::Process. This doesn't work well when we now hand out a SBThread object that contains a shared pointer to a lldb_private::Thread as this SBThread can be held onto by external clients and if they end up using one of these objects we can easily crash. So the next task is to start adopting std::tr1::weak_ptr where ever it makes sense which we can do with lldb_private::Debugger, lldb_private::Target, lldb_private::Process, lldb_private::Thread, lldb_private::StackFrame, and many more objects now that they are no longer using intrusive ref counted pointer objects (you can't do std::tr1::weak_ptr functionality with intrusive pointers). llvm-svn: 149207
* Fixed an issue with the Instruction subclasses where the strings mightGreg Clayton2012-01-192-22/+2
| | | | | | | | | | be fetched too many times and the DisassemblerLLVM was appending to strings when the opcode, mnemonic and comment accessors were called multiple times and if any of the strings were empty. Also fixed the test suite failures from recent Objective C modifications. llvm-svn: 148460
* Handle all of the "thumb" target triple architecture variants that llvmGreg Clayton2011-12-161-1/+1
| | | | | | handles. llvm-svn: 146746
* Patch from Daniel Dunbar for future-proof against ↵Johnny Chen2011-11-291-0/+11
| | | | | | http://llvm.org/viewvc/llvm-project?view=rev&revision=145331. llvm-svn: 145345
* warnings: Fix a bunch of -Wreorder problems.Daniel Dunbar2011-10-311-2/+2
| | | | llvm-svn: 143381
* Fixed a leak in the LLVM disassembler where theSean Callanan2011-10-271-1/+7
| | | | | | | | InstructionLLVM class dropped its instruction handle on the floor instead of releasing it correctly. llvm-svn: 143156
* Fixed the public and internal disassembler API to be named correctly:Greg Clayton2011-09-272-8/+8
| | | | | | | | | | | | | | | const char * SBInstruction::GetMnemonic() const char * SBInstruction::GetOperands() const char * SBInstruction::GetComment() Fixed the symbolicate example script and the internals. llvm-svn: 140591
* Added more functionality to the public API to allow for betterGreg Clayton2011-09-262-14/+167
| | | | | | | | | | | | | | | | | | symbolication. Also improved the SBInstruction API to allow access to the instruction opcode name, mnemonics, comment and instruction data. Added the ability to edit SBLineEntry objects (change the file, line and column), and also allow SBSymbolContext objects to be modified (set module, comp unit, function, block, line entry or symbol). The SymbolContext and SBSymbolContext can now generate inlined call stack infomration for symbolication much easier using the SymbolContext::GetParentInlinedFrameInfo(...) and SBSymbolContext::GetParentInlinedFrameInfo(...) methods. llvm-svn: 140518
* Converted the lldb_private::Process over to use the intrusiveGreg Clayton2011-09-221-4/+10
| | | | | | | | | | | | | | | | | | | | shared pointers. Changed the ExecutionContext over to use shared pointers for the target, process, thread and frame since these objects can easily go away at any time and any object that was holding onto an ExecutionContext was running the risk of using a bad object. Now that the shared pointers for target, process, thread and frame are just a single pointer (they all use the instrusive shared pointers) the execution context is much safer and still the same size. Made the shared pointers in the the ExecutionContext class protected and made accessors for all of the various ways to get at the pointers, references, and shared pointers. llvm-svn: 140298
* Revert the workaround patch in the last check in. With the local patch to ↵Johnny Chen2011-08-191-30/+1
| | | | | | LLVM, it is no longer necessary. llvm-svn: 138046
* Apply some workaround for known crashers.Johnny Chen2011-08-181-1/+30
| | | | llvm-svn: 137991
* Fixed an issue of wrong (by +2) branch target calculation in the ↵Johnny Chen2011-08-031-0/+6
| | | | | | | | | | | disassembler's symbolic information output. A8.6.23 BLX (immediate T2) Target Address = Align(PC, 4) + offset value rdar://problem/9885678 llvm-svn: 136766
OpenPOWER on IntegriCloud