summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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-101-334/+310
| | | | | | | | | | | | 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
* Expose GetAddressClass() from both the SBAddress and SBInstruction so ↵Greg Clayton2012-04-131-2/+2
| | | | | | 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-221-2/+2
| | | | | | | | | | | | | | | | | 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
* 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
* Added a new disassembler plugin, DisassemblerLLVMC,Sean Callanan2012-02-171-0/+580
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