summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process
Commit message (Collapse)AuthorAgeFilesLines
* Add emulation for "ADR" operations. Add a ThumbImm8Scaled() convenience ↵Johnny Chen2011-02-231-1/+8
| | | | | | | | function and rename the original ThumbImmScaled() function to ThumbImm7Scaled(). llvm-svn: 126335
* Abtracted all mach-o and ELF out of ArchSpec. This patch is a modified formGreg Clayton2011-02-2312-98/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of Stephen Wilson's idea (thanks for the input Stephen!). What I ended up doing was: - Got rid of ArchSpec::CPU (which was a generic CPU enumeration that mimics the contents of llvm::Triple::ArchType). We now rely upon the llvm::Triple to give us the machine type from llvm::Triple::ArchType. - There is a new ArchSpec::Core definition which further qualifies the CPU core we are dealing with into a single enumeration. If you need support for a new Core and want to debug it in LLDB, it must be added to this list. In the future we can allow for dynamic core registration, but for now it is hard coded. - The ArchSpec can now be initialized with a llvm::Triple or with a C string that represents the triple (it can just be an arch still like "i386"). - The ArchSpec can still initialize itself with a architecture type -- mach-o with cpu type and subtype, or ELF with e_machine + e_flags -- and this will then get translated into the internal llvm::Triple::ArchSpec + ArchSpec::Core. The mach-o cpu type and subtype can be accessed using the getter functions: uint32_t ArchSpec::GetMachOCPUType () const; uint32_t ArchSpec::GetMachOCPUSubType () const; But these functions are just converting out internal llvm::Triple::ArchSpec + ArchSpec::Core back into mach-o. Same goes for ELF. All code has been updated to deal with the changes. This should abstract us until later when the llvm::TargetSpec stuff gets finalized and we can then adopt it. llvm-svn: 126278
* Renamed macro definition of CPSR_C to be CPSR_C_POS to avoid confusions and ↵Johnny Chen2011-02-231-22/+22
| | | | | | subtle bugs. llvm-svn: 126271
* Add two convenience functions: DecodeImmShiftThumb() and DecodeImmShiftARM() ↵Johnny Chen2011-02-221-18/+32
| | | | | | | | to ARMUtils.h. Use them within EmulateInstructionARM.cpp to save repetitive typing. llvm-svn: 126247
* Remove an assertion that was causing a crash.Greg Clayton2011-02-221-2/+12
| | | | llvm-svn: 126235
* Move Align(val, alignment) utility function to ARMUtils.h.Johnny Chen2011-02-171-0/+5
| | | | llvm-svn: 125753
* Add emulation methods for ROR (immediate), ROR (register), and RRX.Johnny Chen2011-02-161-1/+1
| | | | | | | | | | Turns out that they can be funneled through the helper methods EmulateShiftImm()/ EmulateShiftReg() as well. Modify EmulateShiftImm() to handle SRType_ROR and SRType_RRX. And fix a typo in the impl of utility Shift_C() in ARMUtils.h. llvm-svn: 125689
* The DynamicLoader plug-in instance now lives up in lldb_private::Process whereGreg Clayton2011-02-166-78/+4
| | | | | | | | | | | | | | | | | it should live and the lldb_private::Process takes care of managing the auto pointer to the dynamic loader instance. Also, now that the ArchSpec contains the target triple, we are able to correctly set the Target architecture in DidLaunch/DidAttach in the subclasses, and then the lldb_private::Process will find the dynamic loader plug-in by letting the dynamic loader plug-ins inspect the arch/triple in the target. So now the ProcessGDBRemote plug-in is another step closer to be purely process/platform agnostic. I updated the ProcessMacOSX and the ProcessLinux plug-ins accordingly. llvm-svn: 125650
* Add emulation methods for LSL (immediate), LSL (register), LSR (immediate), ↵Johnny Chen2011-02-162-11/+11
| | | | | | | | | | | and LSR (register). Create two helper methods EmulateShiftImm() and EmulateShiftReg() and have ASR, LSL, and LSR delegate to the helper methods which take an extra ARM_ShifterType parameter. The opcodes tables have not been updated yet to reflect these new entries. llvm-svn: 125633
* Fixed an issue where detection of vCont support wasn't being done correctly.Greg Clayton2011-02-161-0/+2
| | | | | | Fixed how the LLDBDisassembler computes and uses a target triple. llvm-svn: 125617
* Modify the various shift routines to handle cases where the shift amount comesJohnny Chen2011-02-151-13/+23
| | | | | | from the bottom byte of a register. llvm-svn: 125606
* Made lldb_private::ArchSpec contain much more than just an architecture. ItGreg Clayton2011-02-155-63/+16
| | | | | | | | | | now, in addition to cpu type/subtype and architecture flavor, contains: - byte order (big endian, little endian) - address size in bytes - llvm::Triple for true target triple support and for more powerful plug-in selection. llvm-svn: 125602
* A8.6.14 ASR (immediate)Johnny Chen2011-02-151-0/+6
| | | | | | Add EmulateASRImm() Encodings T1, T2, and A1 to the opcodes tables. llvm-svn: 125592
* Add a bunch of utilities and an enum (ARM_ShifterType) for shift and rotate ↵Johnny Chen2011-02-151-0/+170
| | | | | | | | | operations pertaining to: o A2.2.1 Pseudocode details of shift and rotate operations o A8.4.3 Pseudocode details of instruction-specified shifts and rotates llvm-svn: 125575
* All UnwindPlan objects are now passed around as shared pointers.Greg Clayton2011-02-1511-247/+380
| | | | | | | | | | | | | ArchDefaultUnwindPlan plug-in interfaces are now cached per architecture instead of being leaked for every frame. Split the ArchDefaultUnwindPlan_x86 into ArchDefaultUnwindPlan_x86_64 and ArchDefaultUnwindPlan_i386 interfaces. There were sporadic crashes that were due to something leaking or being destroyed when doing stack crawls. This patch should clear up these issues. llvm-svn: 125541
* Add comment.Johnny Chen2011-02-141-1/+1
| | | | llvm-svn: 125509
* Enhanced the existing ARMExpandImm() and ThumbExpandImm() functions which expandJohnny Chen2011-02-141-35/+66
| | | | | | | | an imm12 into imm32 for ARM or Thumb so that they now handle carry_in/carry_out. Funnel ARMExpandImm()/ThumbExpandImm() to the enhanced ARMExpandImm_C()/ThumbExpandImm_C() functions. llvm-svn: 125508
* Added the ability to detect which vCont packets (using the "vCont?") packetGreg Clayton2011-02-125-123/+458
| | | | | | | | | are supported by the remote GDB target. We can also now deal with the lack of vCont support and send packets that the remote GDB stub can use. We also error out of the continue if LLDB tries to do something too complex when vCont isn't supported. llvm-svn: 125433
* Changed comments of some functions to be consistent with existing ones.Johnny Chen2011-02-121-14/+8
| | | | llvm-svn: 125423
* Add a couple of utility functions plus some comments.Johnny Chen2011-02-111-0/+28
| | | | llvm-svn: 125416
* Cleaned up some parameter types and names.Johnny Chen2011-02-101-7/+7
| | | | llvm-svn: 125313
* Namings are important. Renamed Bits32(const uint32_t val, uint32_t bit) to ↵Johnny Chen2011-02-101-3/+3
| | | | | | | | Bit32(val, bit) and SetBits32(uint32_t &bits, uint32_t bit, uint32_t val) to SetBit32(bits, bit, val). llvm-svn: 125312
* Add a generic EmulateMovRdRm() method and modify/add entries to the ↵Johnny Chen2011-02-102-11/+36
| | | | | | | | g_thumb_opcodes table. Also add some more defines and convenience functions. llvm-svn: 125300
* linux: use IS_VALID_LLDB_HOST_THREAD.Stephen Wilson2011-02-091-4/+4
| | | | | | | Update the linux plugin code to use the new check for a valid host thread introduced in r125067. llvm-svn: 125213
* Added the DWARF unique type map such that we only create a type once in theGreg Clayton2011-02-091-1/+0
| | | | | | | | | | | | | | | | | module's AST context. Prior to this fix, with gcc binaries, we end up with a full class definition for any used classes in each compile unit due to the one definition rule. This would result in us making N copies of class T, where N is the number of compile units that use class T, in the module AST. When an expression would then try and use any types that were duplicated, it would quickly confuse clang and make expression evaluation fail due to all of the duplicate types that got copied over. This is now fixed by making a map of types in the DWARF that maps type names to a collection of types + declaration (file + line number) + DIE. Then later when we find a type we look in this module map and find any already cached types that we can just use. 8935777 llvm-svn: 125207
* Patch from Kirk Beitz to make things compile on MinGW minus the putenv part.Greg Clayton2011-02-091-1/+1
| | | | llvm-svn: 125199
* Fix comment text.Greg Clayton2011-02-091-1/+1
| | | | llvm-svn: 125162
* <rdar://problem/8972204> Test failure: ./dotest.py -v -t -f ↵Greg Clayton2011-02-091-31/+33
| | | | | | | | UniversalTestCase.test_process_launch_for_universal Fix for bad architecture settings that were being used from the qHostInfo. llvm-svn: 125161
* Rework the RunThreadPlan event handling to use Event Hijacking not stopping ↵Jim Ingham2011-02-081-0/+4
| | | | | | the event thread. Also clarify the logic of the function. llvm-svn: 125083
* Add _pthread_wqthread to the list of thread stop points, and change the ↵Jim Ingham2011-02-081-3/+4
| | | | | | logging a bit. llvm-svn: 125081
* Moved FileSpec into the Host layer since it will vary from host to host.Greg Clayton2011-02-082-2/+2
| | | | | | We have a common unix implementation in lldb/source/Host/common/FileSpec.cpp. llvm-svn: 125078
* Patch that allows for thread_t to be something more complex than anGreg Clayton2011-02-082-6/+9
| | | | | | integer. Modified patch from Kirk Beitz. llvm-svn: 125067
* Namespace patch for linux builds from Jai Menon.Greg Clayton2011-02-071-1/+2
| | | | llvm-svn: 125016
* Apple specific change from Kirk Beitz.Greg Clayton2011-02-051-1/+6
| | | | llvm-svn: 124941
* Added a quicker lookup in the SectionLoadList when looking things up byGreg Clayton2011-02-052-38/+25
| | | | | | | | section by using a DenseMap. Fixed some logging calls to get the log shared pointer. llvm-svn: 124926
* Add a utility class ITSession to maintain the ITState for the Thumb ISA.Johnny Chen2011-02-041-0/+9
| | | | llvm-svn: 124906
* Add some comments and a little utility to convert ARM conditions to strings.Johnny Chen2011-02-041-16/+38
| | | | llvm-svn: 124898
* Remove bzero use and replace with memset (patch from Kirk Beitz).Greg Clayton2011-02-042-7/+7
| | | | llvm-svn: 124897
* Patch to remove uses of non-standard strcasestr and replace then withGreg Clayton2011-02-042-55/+55
| | | | | | strncasecmp equivalents from Kirk Beitz. llvm-svn: 124889
* Added support for attaching to a remote debug server with the new command:Greg Clayton2011-02-043-22/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (lldb) process connect <remote-url> Currently when you specify a file with the file command it helps us to find a process plug-in that is suitable for debugging. If you specify a file you can rely upon this to find the correct debugger plug-in: % lldb a.out Current executable set to 'a.out' (x86_64). (lldb) process connect connect://localhost:2345 ... If you don't specify a file, you will need to specify the plug-in name that you wish to use: % lldb (lldb) process connect --plugin process.gdb-remote connect://localhost:2345 Other connection URL examples: (lldb) process connect connect://localhost:2345 (lldb) process connect tcp://127.0.0.1 (lldb) process connect file:///dev/ttyS1 We are currently treating the "connect://host:port" as a way to do raw socket connections. If there is a URL for this already, please let me know and we will adopt it. So now you can connect to a remote debug server with the ProcessGDBRemote plug-in. After connection, it will ask for the pid info using the "qC" packet and if it responds with a valid process ID, it will be equivalent to attaching. If it response with an error or invalid process ID, the LLDB process will be in a new state: eStateConnected. This allows us to then download a program or specify the program to run (using the 'A' packet), or specify a process to attach to (using the "vAttach" packets), or query info about the processes that might be available. llvm-svn: 124846
* Fixed the SendInterrupt logic to return the true if the target was haltedGreg Clayton2011-02-031-6/+14
| | | | | | (regardless if the interrupt was sent), and false of not. llvm-svn: 124766
* A missed endian fix for the linux register context for x86_64.Greg Clayton2011-02-011-1/+1
| | | | llvm-svn: 124658
* Endian patch from Kirk Beitz that allows better cross platform building.Greg Clayton2011-02-019-55/+60
| | | | llvm-svn: 124643
* Made the EmulateInstruction class into a plug-in interface and moved theGreg Clayton2011-02-014-1732/+0
| | | | | | source files around into the places they need to go. llvm-svn: 124631
* Add emulate_pop (loads multiple registers from the stack) entries to both theJohnny Chen2011-01-312-4/+139
| | | | | | | | g_arm_opcodes and g_thumb_opcodes tables. Plus a minor comment fix for EmulateInstruction.h. llvm-svn: 124617
* Add emulate_add_sp_imm entry to the g_thumb_opcodes table, which represents ↵Johnny Chen2011-01-311-1/+70
| | | | | | | | an operation to adjust the stack pointer by adding an imm7-scaled value to the SP. llvm-svn: 124596
* Align comment.Johnny Chen2011-01-311-1/+1
| | | | llvm-svn: 124595
* Add some comments to the emulate_* functions.Johnny Chen2011-01-311-1/+6
| | | | llvm-svn: 124588
* Minor comment fix.Johnny Chen2011-01-311-4/+4
| | | | llvm-svn: 124586
* Added the start of the plug-in interface to EmulateInstructionGreg Clayton2011-01-303-5/+98
| | | | | | and implemented it for the EmulateInstructionARM class. llvm-svn: 124563
OpenPOWER on IntegriCloud