summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins
Commit message (Collapse)AuthorAgeFilesLines
* Improved the packet throughput when debugging with GDB remote by over 3x onGreg Clayton2011-06-177-211/+253
| | | | | | | | | | | | | darwin (not sure about other platforms). Modified the communication and connection classes to not require the BytesAvailable function. Now the "Read(...)" function has a timeout in microseconds. Fixed a lot of assertions that were firing off in certain cases and replaced them with error output and code that can deal with the assertion case. llvm-svn: 133224
* Primitive attach support for linuxJohnny Chen2011-06-143-24/+214
| | | | | | | This patch is a starting point for the attach functionality. Signed-off-by: Johnny Chen <johnny.chen@apple.com> llvm-svn: 133006
* Improve error reporting in ProcessMonitor::LaunchPeter Collingbourne2011-06-141-8/+46
| | | | llvm-svn: 132972
* Fix mistakes relating to ProcessMonitor::DupDescriptorPeter Collingbourne2011-06-141-4/+4
| | | | llvm-svn: 132971
* If ProcessMonitor::Launch fails, post semaphore to notify callerPeter Collingbourne2011-06-141-1/+3
| | | | llvm-svn: 132970
* Add license header to InferiorCallPOSIX.cppPeter Collingbourne2011-06-141-0/+9
| | | | llvm-svn: 132966
* Remove assert() calls that were firing off and crashing the LLDB framework.Greg Clayton2011-06-141-14/+33
| | | | llvm-svn: 132960
* Header file cleanup and moved an inline to the implementation file.Greg Clayton2011-06-102-6/+11
| | | | llvm-svn: 132828
* Created a std::string in the base StopInfo class for the description andGreg Clayton2011-06-042-5/+105
| | | | | | | cleaned up all base classes that had their own copy. Added a SetDescription accessor to the StopInfo class. llvm-svn: 132615
* Implement RegisterContextLinux_x86_64::{Read,Write}AllRegisterValuesPeter Collingbourne2011-06-034-1/+118
| | | | llvm-svn: 132587
* Move SaveFrameZeroState and RestoreSaveFrameZero implementations to Thread ↵Peter Collingbourne2011-06-036-86/+0
| | | | | | base class llvm-svn: 132586
* Implement ProcessLinux::Do{Allocate,Deallocate}Memory using inferior ↵Peter Collingbourne2011-06-032-12/+34
| | | | | | mmap/munmap calls llvm-svn: 132585
* Move inferior mmap/munmap call code into their own functions in utility libPeter Collingbourne2011-06-033-154/+241
| | | | llvm-svn: 132584
* Scan dynamic symbol table of ELF object filesPeter Collingbourne2011-06-031-1/+1
| | | | llvm-svn: 132582
* Bail out if we have an invalid thumb instruction.Johnny Chen2011-06-021-2/+4
| | | | llvm-svn: 132511
* Turn the commented-out assert()'s into appropriate bail-out actions.Johnny Chen2011-06-021-2/+5
| | | | llvm-svn: 132507
* When emulating an ill-formed instruction, we should bail out instead of ↵Johnny Chen2011-06-022-70/+187
| | | | | | asserting and bringing down the whole process. llvm-svn: 132506
* Remove asserts that will crash LLDB. These should be changed to returnGreg Clayton2011-06-023-26/+29
| | | | | | | true/false in an extra boolean parameter and not cause the the binary that us using the LLDB framework to crash. llvm-svn: 132501
* Make sure we don't lose our stop reply packet in the case where the otherGreg Clayton2011-06-022-22/+7
| | | | | | GDB server doesn't support the LLDB specific qThreadStopInfo packet. llvm-svn: 132499
* EmulateShiftReg() also accepts shifter type of SRType_ROR.Johnny Chen2011-06-021-1/+4
| | | | llvm-svn: 132484
* lldb-59.Greg Clayton2011-05-302-2/+6
| | | | llvm-svn: 132304
* Added some comments.Greg Clayton2011-05-251-0/+2
| | | | llvm-svn: 132066
* ABI plug-ins must implement the following pure virtual functions:Greg Clayton2011-05-246-29/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | virtual bool ABI::StackUsesFrames () = 0; Should return true if your ABI uses frames when doing stack backtraces. This means a frame pointer is used that points to the previous stack frame in some way or another. virtual bool ABI::CallFrameAddressIsValid (lldb::addr_t cfa) = 0; Should take a look at a call frame address (CFA) which is just the stack pointer value upon entry to a function. ABIs usually impose alignment restrictions (4, 8 or 16 byte aligned), and zero is usually not allowed. This function should return true if "cfa" is valid call frame address for the ABI, and false otherwise. This is used by the generic stack frame unwinding code to help determine when a stack ends. virtual bool ABI::CodeAddressIsValid (lldb::addr_t pc) = 0; Validates a possible PC value and returns true if an opcode can be at "pc". Some ABIs or architectures have fixed width instructions and must be aligned to a 2 or 4 byte boundary. "pc" can be an opcode or a callable address which means the load address might be decorated with extra bits (such as bit zero to indicate a thumb function call for ARM targets), so take this into account when returning true or false. The address should also be validated to ensure it is a valid address for the address size of the inferior process. 32 bit targets should make sure the address is less than UINT32_MAX. Modified UnwindLLDB to use the new ABI functions to help it properly terminate stacks. Modified the mach-o function that extracts dependent files to not resolve the path as the paths inside a binary might not match those on the current host system. llvm-svn: 132021
* Add comment.Johnny Chen2011-05-241-0/+2
| | | | llvm-svn: 131998
* Fix a thinko in converting to ReadCStringFromMemory.Jim Ingham2011-05-241-2/+3
| | | | llvm-svn: 131984
* Refactor InstructionLLVM::Dump() a little bit to reduce the entropy by ↵Johnny Chen2011-05-231-45/+35
| | | | | | | | | introducing a new file static utility function AddSymbolicInfo() which is called from places within InstructionLLVM::Dump(). llvm-svn: 131937
* Don't resolve the path when we extract the path from the dyld info or weGreg Clayton2011-05-231-4/+3
| | | | | | | | | | | | can end up with an invalid path if the path resolves to something different on the local machine. It is very important not to since remote debugging will mention paths that might exist on the current machine (like "/System/Library/Frameworks/CoreFoundation/CoreFoundation" which on the desktop systems is a symlink to "/System/Library/Frameworks/CoreFoundation/Versions/A/CoreFoundation"). We will let the platform plug-ins resolve the paths in a later stage. llvm-svn: 131934
* Calculate the dyld slide from all in memory info without having to use theGreg Clayton2011-05-232-46/+66
| | | | | | lldb module. llvm-svn: 131914
* Add more workarounds for "bl #..." and "blx #..." where the ARMAsmParser ↵Johnny Chen2011-05-231-0/+28
| | | | | | | | fails to parse/recognize the (PC-relative) immediate operand. llvm-svn: 131913
* Fixed an issue in the EmulateInstructionARM there the IT opcode was trying toGreg Clayton2011-05-234-9/+64
| | | | | | | | | | | | | | | | | | | | | | | | parse NOP instructions. I added the new table entries for the NOP for the plain NOP, Yield, WFE, WFI, and SEV variants. Modified the opcode emulation function EmulateInstructionARM::EmulateMOVRdSP(...) to notify us when it is creating a frame. Also added an abtract way to detect the frame pointer register for both the standard ARM ABI and for Darwin. Fixed GDBRemoteRegisterContext::WriteAllRegisterValues(...) to correctly be able to individually write register values back if case the 'G' packet is not implemented or returns an error. Modified the StopInfoMachException to "trace" stop reasons. On ARM we currently use the BVR/BCR register pairs to say "stop when the PC is not equal to the current PC value", and this results in a EXC_BREAKPOINT mach exception that has 0x102 in the code. Modified debugserver to create the short option string from long option definitions to make sure it doesn't get out of date. The short option string was missing many of the newer short option values due to a modification of the long options defs, and not modifying the short option string. llvm-svn: 131911
* Fix the Align() utility which tries to align the raw disassembly with the ↵Johnny Chen2011-05-231-4/+10
| | | | | | | | | | | edis'ed disassembly so that both the opcode and the operands are aligned with the rest of output. Comment out the code related to force_raw mode when disassembling arm or thumb for now. It testing goes ok, we will remove the section of code related to force_raw. llvm-svn: 131910
* Added new lldb_private::Process memory read/write functions to stop a bunchGreg Clayton2011-05-226-203/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of duplicated code from appearing all over LLDB: lldb::addr_t Process::ReadPointerFromMemory (lldb::addr_t vm_addr, Error &error); bool Process::WritePointerToMemory (lldb::addr_t vm_addr, lldb::addr_t ptr_value, Error &error); size_t Process::ReadScalarIntegerFromMemory (lldb::addr_t addr, uint32_t byte_size, bool is_signed, Scalar &scalar, Error &error); size_t Process::WriteScalarToMemory (lldb::addr_t vm_addr, const Scalar &scalar, uint32_t size, Error &error); in lldb_private::Process the following functions were renamed: From: uint64_t Process::ReadUnsignedInteger (lldb::addr_t load_addr, size_t byte_size, Error &error); To: uint64_t Process::ReadUnsignedIntegerFromMemory (lldb::addr_t load_addr, size_t byte_size, uint64_t fail_value, Error &error); Cleaned up a lot of code that was manually doing what the above functions do to use the functions listed above. Added the ability to get a scalar value as a buffer that can be written down to a process (byte swapping the Scalar value if needed): uint32_t Scalar::GetAsMemoryData (void *dst, uint32_t dst_len, lldb::ByteOrder dst_byte_order, Error &error) const; The "dst_len" can be smaller that the size of the scalar and the least significant bytes will be written. "dst_len" can also be larger and the most significant bytes will be padded with zeroes. Centralized the code that adds or removes address bits for callable and opcode addresses into lldb_private::Target: lldb::addr_t Target::GetCallableLoadAddress (lldb::addr_t load_addr, AddressClass addr_class) const; lldb::addr_t Target::GetOpcodeLoadAddress (lldb::addr_t load_addr, AddressClass addr_class) const; All necessary lldb_private::Address functions now use the target versions so changes should only need to happen in one place if anything needs updating. Fixed up a lot of places that were calling : addr_t Address::GetLoadAddress(Target*); to call the Address::GetCallableLoadAddress() or Address::GetOpcodeLoadAddress() as needed. There were many places in the breakpoint code where things could go wrong for ARM if these weren't used. llvm-svn: 131878
* Added functions to lldb_private::Address to set an address from a load addressGreg Clayton2011-05-224-39/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and set the address as an opcode address or as a callable address. This is needed in various places in the thread plans to make sure that addresses that might be found in symbols or runtime might already have extra bits set (ARM/Thumb). The new functions are: bool Address::SetCallableLoadAddress (lldb::addr_t load_addr, Target *target); bool Address::SetOpcodeLoadAddress (lldb::addr_t load_addr, Target *target); SetCallableLoadAddress will initialize a section offset address if it can, and if so it might possibly set some bits in the address to make the address callable (bit zero might get set for ARM for Thumb functions). SetOpcodeLoadAddress will initialize a section offset address using the specified target and it will strip any special address bits if needed depending on the target. Fixed the ABIMacOSX_arm::GetArgumentValues() function to require arguments 1-4 to be in the needed registers (previously this would incorrectly fallback to the stack) and return false if unable to get the register values. The function was also modified to first look for the generic argument registers and then fall back to finding the registers by name. Fixed the objective trampoline handler to use the new Address::SetOpcodeLoadAddress function when needed to avoid address mismatches when trying to complete steps into objective C methods. Make similar fixes inside the AppleThreadPlanStepThroughObjCTrampoline::ShouldStop() function. Modified ProcessGDBRemote::BuildDynamicRegisterInfo(...) to be able to deal with the new generic argument registers. Modified RNBRemote::HandlePacket_qRegisterInfo() to handle the new generic argument registers on the debugserver side. Modified DNBArchMachARM::NumSupportedHardwareBreakpoints() to be able to detect how many hardware breakpoint registers there are using a darwin sysctl. Did the same for hardware watchpoints in DNBArchMachARM::NumSupportedHardwareWatchpoints(). llvm-svn: 131834
* A little refactoring.Johnny Chen2011-05-211-7/+10
| | | | llvm-svn: 131779
* When in non-raw mode and edis fails to parse the tokens of the instruction, ↵Johnny Chen2011-05-211-1/+10
| | | | | | | | output the raw disassembly so that the opcode aligns with the edis'ed disassembly. llvm-svn: 131773
* Centralize the code that gathers the thread ID list from the remote GDBGreg Clayton2011-05-203-26/+66
| | | | | | | server so that it happens in command sequence where no other packets can sneak between. llvm-svn: 131769
* Fix build error - strstr returns a const char *Peter Collingbourne2011-05-201-1/+1
| | | | llvm-svn: 131766
* Workaround the issue of llvm:tB (A8.6.16 B Encoding T2) not being processed asJohnny Chen2011-05-201-0/+24
| | | | | | | | | | a branch instruction and therefore the symbolic information is not being dumped for non-raw mode. The problem is that the ARMAsmParser is not recognizing the "#274" in "b #274" as a valid operand when doing disassembly in non-raw mode. llvm-svn: 131738
* Do not parse DIE's outside a compilation units range.Stephen Wilson2011-05-201-11/+19
| | | | | | | | | | | | | | | In DWARFCompileUnit::ExtractDIEsIfNeeded we are relying on a compilation units DIEs to be terminated by a null entry. I think the standard is fairly clear that all sibling chains are to be terminated by null, but at least gcc 4.5.2 disagrees -- the top level chain drops the final entry. This results in us interpreting the next compilation unit header as a DIE. Regardless of whether gcc is right or wrong, we should not overstep a compilation units extent. This patch ensures that we do not attempt to extract a DIE beyond the length specified for a given DWARFCompileUnit by ensuring our current offset is strictly less than the start of the next CU. llvm-svn: 131721
* Fixed an issue in GDBRemoteCommunicationClient where we weren't listening toGreg Clayton2011-05-204-23/+25
| | | | | | | | | | | | | | | | | | | | the "payload_length" argument for the "payload" packet data. This meant we could end up sending random extra data with a packet depending on how the packet was constructed. Fixed GDBRemoteRegisterContext to properly save and restore all registers. Previous fixes had been added to work around the "payload_length" issues fixed above and aren't needed anymore. Fix logging in GDBRemoteCommunication to make sure we log the correct packet data being sent by using the packet length when dumping the packet contents. Added register definitions for 'arm-lldb' in the "disasm-gdb-remote.pl" script so if you have a register dump from the GDB remote that doesn't include the qRegisterInfo packets, you can manually tell the script which registers are which. llvm-svn: 131715
* Add the LanguageRuntime plugins to the makefile build, and remove theCharles Davis2011-05-193-2/+33
| | | | | | | | | Mac OS X Process plugin from the build. I'm surprised no one caught this earlier. Am I the only one who builds with the makefiles on Mac? llvm-svn: 131704
* A bit of clean up.Johnny Chen2011-05-193-113/+9
| | | | | | | | Removed ifdeffed out functions and added the implementation of WriteRegister for x86_64 architecture. Signed-off-by: Johnny Chen <johnny.chen@apple.com> llvm-svn: 131696
* API fix and missing headers.Johnny Chen2011-05-191-1/+1
| | | | | | | | | | | | | | Host.cpp was missing Error.h and the implementation of LaunchProcess. Once againg I have added a "fake" implementation waiting for a real one. Fixed the call GetAddressRange to reflect the new interface in DynamicLoaderLinuxDYLD.cpp. Added string.h to ARM_DWARF_Registers.cpp that is needed for ::memset. Signed-off-by: Johnny Chen <johnny.chen@apple.com> llvm-svn: 131695
* Fix trailing commas at the end of enumerator lists.Charles Davis2011-05-192-2/+2
| | | | | | Seriously, I have no idea how you guys managed to build LLDB before. llvm-svn: 131684
* Build and initialise the Darwin ABI plugins on all platformsPeter Collingbourne2011-05-191-1/+1
| | | | llvm-svn: 131661
* Add UnwindAssembly plugins to makefile buildPeter Collingbourne2011-05-193-1/+30
| | | | llvm-svn: 131650
* Use the portable memchr function instead of the BSD-only strnstrPeter Collingbourne2011-05-191-2/+2
| | | | llvm-svn: 131646
* Fixed a crasher that was happened when a log shared pointer wasn't valid.Greg Clayton2011-05-191-5/+13
| | | | | | | | | | | Fixed ThreadPlanCallFunction::ReportRegisterState(...) to only dump when verbose logging is enabled and fixed the function to use the new RegisterValue method of reading registers. Fixed the GDB remote client to not send a continue packet after receiving stdout or stderr from the inferior process. llvm-svn: 131628
* Make InstructionLLVM::Dump() more robust for edis in cases when all theJohnny Chen2011-05-191-24/+36
| | | | | | | | | | | | EDOperandIndexForToken(token) calls fail to return a meaningful operand index, resulting in both operands and comment being empty. We will use the raw disassembly string as output in these cases. There is still a known bug where llvm:tB (A8.6.16 B Encoding T2) is not being processed as a branch instruction and therefore the symbolic information is not being dumped for non-raw mode. llvm-svn: 131615
* Added the ability to sign extend a Scalar at any bit position for integerGreg Clayton2011-05-191-151/+108
| | | | | | | | | | | | | | types. Added the abilty to set a RegisterValue type via accessor and enum. Added the ability to read arguments for a function for ARM if you are on the first instruction in ABIMacOSX_arm. Fixed an issue where a file descriptor becoming invalid could cause an inifnite loop spin in the libedit thread. llvm-svn: 131610
OpenPOWER on IntegriCloud