summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins
Commit message (Collapse)AuthorAgeFilesLines
...
* Fill in EmulateLDRLImmediate to emulate the LDRD (immediate) ARM instruction.Caroline Tice2011-03-301-9/+137
| | | | llvm-svn: 128556
* linux: create thread plans for stepping thru PLT entriesStephen Wilson2011-03-301-6/+47
| | | | | | | | Using the new synthetic symbols generated by ObjectFileELF, have the Linux dynamic loader plugin generate a thread plan that will take us thru a PLT entry to the corresponding target function. llvm-svn: 128552
* elf: synthesize symbols for PLT entriesStephen Wilson2011-03-302-50/+463
| | | | | | | | | | | When populating symbol tables ObjectFileELF now generates a set of synthetic trampoline symbols. These new symbols correspond to entries in the program linkage table and have a (possibly mangled) name identifying the corresponding symbol in some DSO. These symbols will be used by the DynamicLoader loader plugin on Linux to provide thread plans when execution flows from one DSO to another. llvm-svn: 128550
* Fix typo in previous check-in.Caroline Tice2011-03-301-1/+1
| | | | llvm-svn: 128549
* elf: add support for ELF relocation entriesStephen Wilson2011-03-302-1/+194
| | | | llvm-svn: 128548
* linux: initial support for 'real' signal handlingStephen Wilson2011-03-3012-221/+927
| | | | | | | | This patch upgrades the Linux process plugin to handle a larger range of signal events. For example, we can detect when the inferior has "crashed" and why, interrupt a running process, deliver an arbitrary signal, and so on. llvm-svn: 128547
* Fill in EmulateSTRImmARM to emulate the STR (immediate,ARM) instruction.Caroline Tice2011-03-301-1/+94
| | | | llvm-svn: 128528
* Fill in EmulateSTRBImmARM to emulate the STRB (immediate, ARM) instruction.Caroline Tice2011-03-301-8/+83
| | | | llvm-svn: 128527
* Fill in EmulateSTREX to emulate the STREX ARM instruction.Caroline Tice2011-03-301-1/+94
| | | | llvm-svn: 128525
* Unfortunately, sranddev() is not available on all platforms so seed using theStephen Wilson2011-03-301-1/+4
| | | | | | current time instead. llvm-svn: 128514
* Fill in code in EmulateSUBReg to emulate the SUB (register) ARM instruction.Caroline Tice2011-03-291-2/+111
| | | | llvm-svn: 128508
* Fill in code in EmulateADDRegShift, to emulate the ADDCaroline Tice2011-03-292-3/+83
| | | | | | (register-shifted register) ARM instruction. llvm-svn: 128500
* Can't just call "rand" to get a random port, 'cause then you'll get the same ↵Jim Ingham2011-03-291-0/+7
| | | | | | sequence in two lldb's. This makes running lldb on lldb not work very well. llvm-svn: 128493
* Add subtraction context.Caroline Tice2011-03-292-65/+887
| | | | | | | | Add code to emulate SUB (SP minus register) ARM instruction. Add stubs for other ARM emulation functions that need to be written. llvm-svn: 128491
* Add missing encodings for EmulateMOVRdImm (MOV register) function.Caroline Tice2011-03-291-15/+63
| | | | llvm-svn: 128479
* Fix single quote characters throughout the ARM emulation stuff.Caroline Tice2011-03-281-274/+281
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix bugs in various ARM istruction emulation functions: EmulateVPUSH - Fix context. - Fix bug calculating register numbers. EmulateVPOP - Fix context. - Fix bug calculating register numbers. EmulateShiftIMM - Fix bug in assert statement. EmulateLDMDA - Fix context. EmulateLDMDB - Fix context. EmulateLDMIB - Fix context. EmulateSTM - Fix bug calculating lowest_set_bit. EmulateSTMDA - Fix context. - Fix bug calculating lowest_set_bit. EmulateSTMDB - Fix context. - Fix bug calculating lowest_set_bit. EmulateSTMIB - FIx context EmulateLDRSBImmed - Fix test to match correction in corrected manual llvm-svn: 128409
* Added the ability to get the min and max instruction byte size for Greg Clayton2011-03-262-18/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | an architecture into ArchSpec: uint32_t ArchSpec::GetMinimumOpcodeByteSize() const; uint32_t ArchSpec::GetMaximumOpcodeByteSize() const; Added an AddressClass to the Instruction class in Disassembler.h. This allows decoded instructions to know know if they are code, code with alternate ISA (thumb), or even data which can be mixed into code. The instruction does have an address, but it is a good idea to cache this value so we don't have to look it up more than once. Fixed an issue in Opcode::SetOpcodeBytes() where the length wasn't getting set. Changed: bool SymbolContextList::AppendIfUnique (const SymbolContext& sc); To: bool SymbolContextList::AppendIfUnique (const SymbolContext& sc, bool merge_symbol_into_function); This function was typically being used when looking up functions and symbols. Now if you lookup a function, then find the symbol, they can be merged into the same symbol context and not cause multiple symbol contexts to appear in a symbol context list that describes the same function. Fixed the SymbolContext not equal operator which was causing mixed mode disassembly to not work ("disassembler --mixed --name main"). Modified the disassembler classes to know about the fact we know, for a given architecture, what the min and max opcode byte sizes are. The InstructionList class was modified to return the max opcode byte size for all of the instructions in its list. These two fixes means when disassemble a list of instructions and dump them and show the opcode bytes, we can format the output more intelligently when showing opcode bytes. This affects any architectures that have varying opcode byte sizes (x86_64 and i386). Knowing the max opcode byte size also helps us to be able to disassemble N instructions without having to re-read data if we didn't read enough bytes. Added the ability to set the architecture for the disassemble command. This means you can easily cross disassemble data for any supported architecture. I also added the ability to specify "thumb" as an architecture so that we can force disassembly into thumb mode when needed. In GDB this was done using a hack of specifying an odd address when disassembling. I don't want to repeat this hack in LLDB, so the auto detection between ARM and thumb is failing, just specify thumb when disassembling: (lldb) disassemble --arch thumb --name main You can also have data in say an x86_64 file executable and disassemble data as any other supported architecture: % lldb a.out Current executable set to 'a.out' (x86_64). (lldb) b main (lldb) run (lldb) disassemble --arch thumb --count 2 --start-address 0x0000000100001080 --bytes 0x100001080: 0xb580 push {r7, lr} 0x100001082: 0xaf00 add r7, sp, #0 Fixed Target::ReadMemory(...) to be able to deal with Address argument object that isn't section offset. When an address object was supplied that was out on the heap or stack, target read memory would fail. Disassembly uses Target::ReadMemory(...), and the example above where we disassembler thumb opcodes in an x86 binary was failing do to this bug. llvm-svn: 128347
* linux: minor updates to account for recent namespace changesStephen Wilson2011-03-264-8/+10
| | | | llvm-svn: 128313
* Add PlatformGDBServer and ProcessGDBRemote to the build system.Stephen Wilson2011-03-263-4/+17
| | | | llvm-svn: 128312
* Simple fixes for the gdb remote process plugin on Linux.Stephen Wilson2011-03-252-1/+4
| | | | llvm-svn: 128291
* Cleaned up the Disassembler code a bit more. You can now request a disassemblerGreg Clayton2011-03-252-36/+32
| | | | | | | | | | | | | plugin by name on the command line for when there is more than one disassembler plugin. Taught the Opcode class to dump itself so that "disassembler -b" will dump the bytes correctly for each opcode type. Modified all places that were passing the opcode bytes buffer in so that the bytes could be displayed to just pass in a bool that indicates if we should dump the opcode bytes since the opcode now lives inside llvm_private::Instruction. llvm-svn: 128290
* Made the lldb_private::Opcode struct into a real boy... I mean class.Greg Clayton2011-03-244-642/+393
| | | | | | | | | | | Modified the Disassembler::Instruction base class to contain an Opcode instance so that we can know the bytes for an instruction without needing to keep the data around. Modified the DisassemblerLLVM's instruction class to correctly extract the opcode bytes if all goes well. llvm-svn: 128248
* Fixed the LLDB build so that we can have private types, private enums andGreg Clayton2011-03-2435-141/+157
| | | | | | | | public types and public enums. This was done to keep the SWIG stuff from parsing all sorts of enums and types that weren't needed, and allows us to abstract our API better. llvm-svn: 128239
* Fix small bug in ThumbExpandImm_C; arguments to a call to 'bits' wereCaroline Tice2011-03-241-1/+1
| | | | | | in the wrong order. llvm-svn: 128237
* Add missing encodings for EmulateLDRRtRnImm (ARM insn emulation funciton).Caroline Tice2011-03-241-22/+82
| | | | llvm-svn: 128229
* Did a lot more work on abtracting and organizing the platforms. Greg Clayton2011-03-2414-543/+956
| | | | | | | | | | | | | | | | | | | | On Mac OS X we now have 3 platforms: PlatformDarwin - must be subclassed to fill in the missing pure virtual funcs but this implements all the common functionality between remote-macosx and remote-ios. It also allows for another platform to be used (remote-gdb-server for now) when doing remote connections. Keeping this pluggable will allow for flexibility. PlatformMacOSX - Now implements both local and remote macosx desktop platforms. PlatformRemoteiOS - Remote only iOS that knows how to locate SDK files in the cached SDK locations on the host. A new agnostic platform has been created: PlatformRemoteGDBServer - this implements the platform using the GDB remote protocol and uses the built in lldb_private::Host static functions to implement many queries. llvm-svn: 128193
* linux: simple support for process input and outputStephen Wilson2011-03-233-0/+72
| | | | llvm-svn: 128137
* linux: PlatformLinux improvementsStephen Wilson2011-03-232-10/+100
| | | | | | | Add a few missing virtual methods to PlatformLinux and have it register itself with PluginManager. llvm-svn: 128128
* Added new platform commands:Greg Clayton2011-03-2311-124/+581
| | | | | | | | | | | | | | | | platform connect <args> platform disconnect Each platform can decide the args they want to use for "platform connect". I will need to add a function that gets the connect options for the current platform as each one can have different options and argument counts. Hooked up more functionality in the PlatformMacOSX and PlatformRemoteiOS. Also started an platform agnostic PlatformRemoteGDBServer.cpp which can end up being used by one or more actual platforms. It can also be specialized and allow for platform specific commands. llvm-svn: 128123
* More fixes for ARM instruction emulation code:Caroline Tice2011-03-221-13/+36
| | | | | | | | - Remove duplicate write from EmulateLDRRtPCRelative. - Add a missing encoding to EmulateADDSPImm. - Fix minor problems in Thumb instruction tables. llvm-svn: 128115
* Split the GDBRemoteCommunication class into three classes:Greg Clayton2011-03-229-1151/+1474
| | | | | | | | | | GDBRemoteCommunication - The base GDB remote communication class GDBRemoteCommunicationClient - designed to be used for clients the connect to a remote GDB server GDBRemoteCommunicationServer - designed to be used on the server side of a GDB server implementation. llvm-svn: 128070
* Add the ability to disassemble "n" instructions from the current PC, or the ↵Jim Ingham2011-03-222-3/+6
| | | | | | | | first "n" instructions in a function. Also added a "-p" flag that disassembles from the current pc. llvm-svn: 128063
* Split all of the core of LLDB.framework/lldb.so into aGreg Clayton2011-03-204-4/+10
| | | | | | | | | | | | | | | | | | | | static archive that can be linked against. LLDB.framework/lldb.so exports a very controlled API. Splitting the API into a static library allows other tools (debugserver for now) to use the power of the LLDB debugger core, yet not export it as its API is not portable or maintainable. The Host layer and many of the other internal only APIs can now be statically linked against. Now LLDB.framework/lldb.so links against "liblldb-core.a" instead of compiling the .o files only for the shared library. This fix is only for compiling with Xcode as the Makefile based build already does this. The Xcode projecdt compiler has been changed to LLVM. Anyone using Xcode 3 will need to manually change the compiler back to GCC 4.2, or update to Xcode 4. llvm-svn: 127963
* Added more platform support. There are now some new commands:Greg Clayton2011-03-1912-118/+1003
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | platform status -- gets status information for the selected platform platform create <platform-name> -- creates a new instance of a remote platform platform list -- list all available platforms platform select -- select a platform instance as the current platform (not working yet) When using "platform create" it will create a remote platform and make it the selected platform. For instances for iPhone OS debugging on Mac OS X one can do: (lldb) platform create remote-ios --sdk-version=4.0 Remote platform: iOS platform SDK version: 4.0 SDK path: "/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0" Not connected to a remote device. (lldb) file ~/Documents/a.out Current executable set to '~/Documents/a.out' (armv6). (lldb) image list [ 0] /Volumes/work/gclayton/Documents/devb/attach/a.out [ 1] /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0/Symbols/usr/lib/dyld [ 2] /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0/Symbols/usr/lib/libSystem.B.dylib Note that this is all happening prior to running _or_ connecting to a remote platform. Once connected to a remote platform the OS version might change which means we will need to update our dependecies. Also once we run, we will need to match up the actualy binaries with the actualy UUID's to files in the SDK, or download and cache them locally. This is just the start of the remote platforms, but this modification is the first iteration in getting the platforms really doing something. llvm-svn: 127934
* Fix various small problems with EmulateInstructionARM::EmulateSTRRtSP.Caroline Tice2011-03-181-14/+39
| | | | llvm-svn: 127898
* Relax the constraint on the types of ValueObjects that we'll by default try theJim Ingham2011-03-181-3/+5
| | | | | | ObjC runtime for print object to Pointer AND Integer (from just pointer.) llvm-svn: 127841
* Make all the codee that attempts to read the PC consistently useCaroline Tice2011-03-171-18/+17
| | | | | | | | | ReadCoreReg (which 'does the right thing', adding to pc when needed); fixed places in code where extra addition was being passed along. Fix bug in insn tables. llvm-svn: 127838
* Fix a problem where we were looking up the class pointer in the {class/sel ↵Jim Ingham2011-03-171-28/+113
| | | | | | -> implementation} cache for a objc_msgSendSuper call - where we should have looked up the class's super-class. llvm-svn: 127830
* Get ObjC stepping working again when the process is not the default host ↵Jim Ingham2011-03-172-2/+2
| | | | | | architecture. llvm-svn: 127825
* Add code to emulate STRH (Register) Arm instruction.Caroline Tice2011-03-162-4/+197
| | | | | | | | Remove inaccurate comments from EmulateInstruction::Context definition. Fix contexts in a few arm instruction emulation routines. llvm-svn: 127770
* Fix various small bugs found in the instruction emulation functions.Caroline Tice2011-03-161-6/+10
| | | | llvm-svn: 127712
* Added a fix that should help incorrect type uniquing. There was an issueGreg Clayton2011-03-153-13/+88
| | | | | | | | for templatized types that could cause parts of a std::vector (and I am sure other STL types) to be incorrectly uniqued to each other wreaking havoc on variable display for types within the same executable module. llvm-svn: 127662
* Added a fix to not re-use object files when doing DWARF with debug map.Greg Clayton2011-03-151-16/+7
| | | | llvm-svn: 127659
* Updated to LLVM/Clang revision 127600.Sean Callanan2011-03-151-2/+1
| | | | llvm-svn: 127634
* Add Makefile support for the Platform plugins.Stephen Wilson2011-03-104-1/+55
| | | | | | | | | This patch supports building the Linux platform plugin, and should also support the MacOSX plugin as well (the MacOSX side has not been tested, unfortunately). A small typo was corrected in lldb.cpp to initialize the new platform code on Linux. llvm-svn: 127393
* Centralize the GDB remote timeout value into the GDBRemoteCommunication as aGreg Clayton2011-03-106-102/+72
| | | | | | | member variable (m_packet_timeout which is a value in seconds). This value is then used for all packets sent to/from the remote GDB server. llvm-svn: 127392
* Fixed a bug where the disassembly syntax specified for theSean Callanan2011-03-091-1/+2
| | | | | | | ARM disassembler was wrong, causing the disassembler to fail to initialize. llvm-svn: 127302
* LLDB now has "Platform" plug-ins. Platform plug-ins are plug-ins that provideGreg Clayton2011-03-0847-700/+590
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | an interface to a local or remote debugging platform. By default each host OS that supports LLDB should be registering a "default" platform that will be used unless a new platform is selected. Platforms are responsible for things such as: - getting process information by name or by processs ID - finding platform files. This is useful for remote debugging where there is an SDK with files that might already or need to be cached for debug access. - getting a list of platform supported architectures in the exact order they should be selected. This helps the native x86 platform on MacOSX select the correct x86_64/i386 slice from universal binaries. - Connect to remote platforms for remote debugging - Resolving an executable including finding an executable inside platform specific bundles (macosx uses .app bundles that contain files) and also selecting the appropriate slice of universal files for a given platform. So by default there is always a local platform, but remote platforms can be connected to. I will soon be adding a new "platform" command that will support the following commands: (lldb) platform connect --name machine1 macosx connect://host:port Connected to "machine1" platform. (lldb) platform disconnect macosx This allows LLDB to be well setup to do remote debugging and also once connected process listing and finding for things like: (lldb) process attach --name x<TAB> The currently selected platform plug-in can now auto complete any available processes that start with "x". The responsibilities for the platform plug-in will soon grow and expand. llvm-svn: 127286
* Fix ObjectFileElf::GetEntryPointAddress()Stephen Wilson2011-03-082-19/+19
| | | | | | | | | | | | | | ELF object files do not implicitly have a symbol named "start" as an entry point. For example, on Linux it is often named "_start", but can be trivially set to any symbol by passing an --entry argument to the linker. Use the ELF header to determine the entry point and resolve the associated section based on that address. Also, update the linux dynamic loader to call GetEntryPointAddress instead of GetEntryPoint. llvm-svn: 127218
* Add Makefile support for the new DynamicLoaderStatic plugin.Stephen Wilson2011-03-082-1/+15
| | | | llvm-svn: 127215
OpenPOWER on IntegriCloud