summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process
Commit message (Collapse)AuthorAgeFilesLines
* Fixed the issue that was causing our monitor process threads to crash, it Greg Clayton2011-11-172-1/+8
| | | | | | | | | | turned out to be unitialized data in the ProcessLaunchInfo default constructor. Turning on MallocScribble in the environment helped track this down. When we launch and attach using the host layer, we now inform the process that it shouldn't detach when by calling an accessor. llvm-svn: 144882
* Made the darwin host layer properly reap any child processes that it spawns.Greg Clayton2011-11-162-52/+65
| | | | | | | | | | | | | | | | | | | | | | After recent changes we weren't reaping child processes resulting in many zombie processes. This was fixed by adding more settings to the ProcessLaunchOptions class that allow clients to specify a callback function and baton to be notified when their process dies. If one is not supplied a default callback will be used that "does the right thing". Cleaned up a race condition in the ProcessGDBRemote class that would attempt to monitor when debugserver died. Added an extra boolean to the process monitor callbacks that indicate if a process exited or not. If your process exited with a zero exit status and no signal, both items could be zero. Modified the process monitor functions to not require a callback function in order to reap the child process. llvm-svn: 144780
* Added a new class to Process.h: ProcessAttachInfo. This class contains enoughGreg Clayton2011-11-152-2/+2
| | | | | | | | | | | | | | | | | | | | | info for us to attach by pid, or by name and will also allow us to eventually do a lot more powerful attaches. If you look at the options for the "platform process list" command, there are many options which we should be able to specify. This will allow us to do things like "attach to a process named 'tcsh' that has a parent process ID of 123", or "attach to a process named 'x' which has an effective user ID of 345". I finished up the --shell implementation so that it can be used without the --tty option in "process launch". The "--shell" option now can take an optional argument which is the path to the shell to use (or a partial name like "sh" which we will find using the current PATH environment variable). Modified the Process::Attach to use the new ProcessAttachInfo as the sole argument and centralized a lot of code that was in the "process attach" Execute function so that everyone can take advantage of the powerful new attach functionality. llvm-svn: 144615
* <rdar://problem/10103980>Greg Clayton2011-11-132-53/+0
| | | | | | | A long time ago we started to centralized the STDOUT in lldb_private::Process but we missed a few things still in ProcessGDBRemote. llvm-svn: 144491
* Patch from Dragos Tatulea which was a modified version of a patch fromGreg Clayton2011-11-053-22/+119
| | | | | | | | | Joel Dillon that fixed 64 debugging for Linux. I also added a patch to fix up the ProcessLinux::DoLaunch() to be up to date. I wasn't able to verify it compiles, but it should b really close. llvm-svn: 143772
* Fixed the Xcode project building of LLVM to be a bit more user friendly:Greg Clayton2011-11-043-4/+8
| | | | | | | | | | | | | | | | | | | - If you download and build the sources in the Xcode project, x86_64 builds by default using the "llvm.zip" checkpointed LLVM. - If you delete the "lldb/llvm.zip" and the "lldb/llvm" folder, and build the Xcode project will download the right LLVM sources and build them from scratch - If you have a "lldb/llvm" folder already that contains a "lldb/llvm/lib" directory, we will use the sources you have placed in the LLDB directory. Python can now be disabled for platforms that don't support it. Changed the way the libllvmclang.a files get used. They now all get built into arch specific directories and never get merged into universal binaries as this was causing issues where you would have to go and delete the file if you wanted to build an extra architecture slice. llvm-svn: 143678
* Modified all Process::Launch() calls to use a ProcessLaunchInfo structureGreg Clayton2011-11-034-44/+45
| | | | | | | | on internal only (public API hasn't changed) to simplify the paramter list to the launch calls down into just one argument. Also all of the argument, envronment and stdio things are now handled in a much more centralized fashion. llvm-svn: 143656
* Restructure the relationship between UnwindLLDB and theJason Molenda2011-11-014-100/+154
| | | | | | | | | | | | | | | | | | RegisterContextLLDBs it contains. Previously RegisterContextLLDB objects had a pointer to their "next" frame down the stack. e.g. stack starts at frame 0; frame 3 has a pointer to frame 2. This is used to retreive callee saved register values. When debugging an inferior that has blown out its own stack, however, this could result in lldb blowing out its own stack while recursing down to retrieve register values. RegisterContextLLDB no longer has a pointer to its next frame; it has a reference to the UnwindLLDB which contains it. When it needs to retrieve a reg value, it asks the UnwindLLDB for that reg value and UnwindLLDB iterates through the frames until it finds a location. llvm-svn: 143423
* Enhanced the ObjC DynamicCheckerFunction to test for "object responds to ↵Jim Ingham2011-11-011-1/+0
| | | | | | | | | | | | | | selector" as well as "object borked"... Also made the error when the checker fails reflect this fact rather than report a crash at 0x0. Also a little cleanup: - StopInfoMachException had a redundant copy of the description string. - ThreadPlanCallFunction had a redundant copy of the thread, and had a copy of the process that it didn't really need. llvm-svn: 143419
* warnings: Fix another place with extension warnings I somehow missed.Daniel Dunbar2011-10-311-3/+10
| | | | llvm-svn: 143397
* warnings: Use LLVM_EXTENSION to suppress a bunch of pedantic warnings.Daniel Dunbar2011-10-312-4/+18
| | | | llvm-svn: 143387
* warnings: Fix several uses of trailing comma on enumeration extensions.Daniel Dunbar2011-10-311-1/+1
| | | | llvm-svn: 143380
* build: Fixup Darwin process plugin build for Makefiles.Daniel Dunbar2011-10-311-0/+14
| | | | llvm-svn: 143376
* Fix up how we shut down the communication with debugserver so we don't rely onJim Ingham2011-10-281-12/+4
| | | | | | debugserver being responsive to shut down. llvm-svn: 143174
* <rdar://problem/10357230>Greg Clayton2011-10-271-1/+11
| | | | | | | | Fixed an issue where async packets were incurring a delay even though they were sent correctly. We now properly broadcast the private run state being resumed correctly. Also fixed logging to reflect what is happening. llvm-svn: 143154
* Cleaned up many error codes. For any who is filling in error strings intoGreg Clayton2011-10-262-4/+4
| | | | | | | | | | | | | lldb_private::Error objects the rules are: - short strings that don't start with a capitol letter unless the name is a class or anything else that is always capitolized - no trailing newline character - should be one line if possible Implemented a first pass at adding "--gdb-format" support to anything that accepts format with optional size/count. llvm-svn: 142999
* If a process plug-in was specified by name, always let the plug-in get used.Greg Clayton2011-10-212-3/+7
| | | | llvm-svn: 142688
* Lock the Unwinder before accessing it.Jim Ingham2011-10-214-18/+16
| | | | llvm-svn: 142632
* Moved lldb::user_id_t values to be 64 bit. This was going to be needed forGreg Clayton2011-10-195-34/+34
| | | | | | | | | | | process IDs, and thread IDs, but was mainly needed for for the UserID's for Types so that DWARF with debug map can work flawlessly. With DWARF in .o files the type ID was the DIE offset in the DWARF for the .o file which is not unique across all .o files, so now the SymbolFileDWARFDebugMap class will make the .o file index part (the high 32 bits) of the unique type identifier so it can uniquely identify the types. llvm-svn: 142534
* This patch fixes debugging of single threaded apps on Linux. Johnny Chen2011-10-1813-31/+600
| | | | | | | | It also adds some asserts and additional logging support. from dawn@burble.org llvm-svn: 142384
* Add code to RegisterContextLLDB::InitializeNonZerothFrame to detect a ↵Jason Molenda2011-10-182-0/+42
| | | | | | | | | multiple stack frames with the same CFA (or an alternating sequence between two CFA values) to catch a handful of unwind cases where lldb will inf loop trying to unwind a stack. llvm-svn: 142331
* Quiet the default "log enable lldb step" output down a little bit.Jim Ingham2011-10-152-4/+4
| | | | llvm-svn: 142024
* SBValue::Watch() and SBValue::WatchPointee() are now the official API for ↵Johnny Chen2011-10-147-20/+20
| | | | | | | | | | | | | | | | | | creating a watchpoint for either the variable encapsulated by SBValue (Watch) or the pointee encapsulated by SBValue (WatchPointee). Removed SBFrame::WatchValue() and SBFrame::WatchLocation() API as a result of that. Modified the watchpoint related test suite to reflect the change. Plus replacing WatchpointLocation with Watchpoint throughout the code base. There are still cleanups to be dome. This patch passes the whole test suite. Check it in so that we aggressively catch regressions. llvm-svn: 141925
* Patch by Dawn to add the logging capabilities to ProcessLinux.cpp.Johnny Chen2011-10-113-1/+255
| | | | llvm-svn: 141712
* Fix a typo in ProcessKDP::DidAttach().Johnny Chen2011-10-111-1/+1
| | | | | | Patch by Dawn. llvm-svn: 141711
* Patch from dawn@burble.org to build on linux!Johnny Chen2011-10-103-1/+12
| | | | llvm-svn: 141593
* ProcessGDBRemote::BuildDynamicRegisterInfo() - even if we don't have a ↵Jason Molenda2011-10-061-1/+11
| | | | | | | | | Target architecture set up yet, if we're talking to an Apple arm device set the register set based on the arm device's attributes; this is a safe assumption to make in this particular environment. llvm-svn: 141265
* Cleaned up the the code that figures out the inlined stack frames given a Greg Clayton2011-10-011-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | symbol context that represents an inlined function. This function has been renamed internally to: bool SymbolContext::GetParentOfInlinedScope (const Address &curr_frame_pc, SymbolContext &next_frame_sc, Address &next_frame_pc) const; And externally to: SBSymbolContext SBSymbolContext::GetParentOfInlinedScope (const SBAddress &curr_frame_pc, SBAddress &parent_frame_addr) const; The correct blocks are now correctly calculated. Switched the stack backtracing engine (in StackFrameList) and the address context printing over to using the internal SymbolContext::GetParentOfInlinedScope(...) so all inlined callstacks will match exactly. llvm-svn: 140910
* Fix verbose logging of unwinders.Jason Molenda2011-09-291-10/+10
| | | | llvm-svn: 140817
* Add SB API class SBWatchpointLocation and some extra methods to the SBTarget ↵Johnny Chen2011-09-261-0/+1
| | | | | | | | | | | class to iterate on the available watchpoint locations and to perform watchpoint manipulations. I still need to export the SBWatchpointLocation class as well as the added watchpoint manipulation methods to the Python interface. And write test cases for them. llvm-svn: 140575
* Added the ability to restrict breakpoints by function name, function regexp, ↵Jim Ingham2011-09-231-1/+1
| | | | | | | | | | selector etc to specific source files. Added SB API's to specify these source files & also more than one module. Added an "exact" option to CompileUnit's FindLineEntry API. llvm-svn: 140362
* Update declarations for all functions/methods that accept printf-styleJason Molenda2011-09-204-7/+7
| | | | | | | | stdarg formats to use __attribute__ format so the compiler can flag incorrect uses. Fix all incorrect uses. Most of these are innocuous, a few were resulting in crashes. llvm-svn: 140185
* Foe x86_64/i386, piggyback the hardware index of the fired watchpoint in the ↵Johnny Chen2011-09-173-3/+13
| | | | | | | | | | exception data sent back to the debugger. On the debugger side, use the opportunity during the StopInfoMachException::CreateStopReasonWithMachException() method to set the hardware index for the very watchpoint location. llvm-svn: 139975
* Tighten up the 'log enable lldb unwind' printing forJason Molenda2011-09-161-4/+4
| | | | | | | | the arm emulate instruction unwinder so you can leave it on by default and not be overwhelmed. Set verbose mode to get the full story on how the unwindplans were created. llvm-svn: 139897
* Have the FuncUnwinder object request & provide an architecture-definedJason Molenda2011-09-151-1/+13
| | | | | | | | | | | | | | | | | | | | | UnwindPlan for unwinding from the first instruction of an otherwise unknown function call (GetUnwindPlanArchitectureDefaultAtFunctionEntry()). Update RegisterContextLLDB::GetFullUnwindPlanForFrame() to detect the case of a frame 0 at address 0x0 which indicates that we jumped through a NULL function pointer. Use the ABI's FunctionEntryUnwindPlan to find the caller frame. These changes make it so lldb can identify the calling frame correctly in code like int main () { void (*f)(void) = 0; f(); } llvm-svn: 139760
* Set the OS in the triple correctly in response to the qHostInfo packet.Greg Clayton2011-09-151-1/+1
| | | | llvm-svn: 139759
* Fixed the logging output to be done consistently across all plug-ins.Greg Clayton2011-09-122-30/+30
| | | | | | | Added a new log category for DWARF called "aranges" to log the parsing of address ranges. llvm-svn: 139489
* Fix compiler warnings for GetGDBStoppointType().Johnny Chen2011-09-091-2/+2
| | | | llvm-svn: 139402
* Watchpoint WIP: on the debugger side, create an instance of eitherJohnny Chen2011-09-081-1/+8
| | | | | | StopInfoTrace or StopInfoWatchpoint based on the exc_sub_code, as well. llvm-svn: 139315
* Fill out implementation of Enable/DisableWatchpoint() for ProcessGDBRemote ↵Johnny Chen2011-09-061-4/+46
| | | | | | | | class (Not Tested Yet). Also update the signature of WatchpointLocation::SetEnable() to take a bool as input arg. llvm-svn: 139198
* Added the ability for DWARF locations to use the ABI plug-ins to resolveGreg Clayton2011-09-021-1/+1
| | | | | | | | register names when dumping variable locations and location lists. Also did some cleanup where "int" types were being used for "lldb::RegisterKind" values. llvm-svn: 138988
* Make ThreadList::GetSelectedThread() select and return the 0th thread if ↵Johnny Chen2011-08-251-3/+1
| | | | | | | | there's no currently selected thread. And update the call sites accordingly. llvm-svn: 138577
* Added a new plug-in type: lldb_private::OperatingSystem. The operating system Greg Clayton2011-08-2214-142/+695
| | | | | | | | | | | | | | | | | | | | plug-ins are add on plug-ins for the lldb_private::Process class that can add thread contexts that are read from memory. It is common in kernels to have a lot of threads that are not currently executing on any cores (JTAG debugging also follows this sort of thing) and are context switched out whose state is stored in memory data structures. Clients can now subclass the OperatingSystem plug-ins and then make sure their Create functions correcltly only enable themselves when the right binary/target triple are being debugged. The operating system plug-ins get a chance to attach themselves to processes just after launching or attaching and are given a lldb_private::Process object pointer which can be inspected to see if the main executable, target triple, or any shared libraries match a case where the OS plug-in should be used. Currently the OS plug-ins can create new threads, define the register contexts for these threads (which can all be different if desired), and populate and manage the thread info (stop reason, registers in the register context) as the debug session goes on. llvm-svn: 138228
* Third round of code cleanups:Enrico Granata2011-08-192-5/+5
| | | | | | | | | | | - reorganizing the PTS (Partial Template Specializations) in FormatManager.h - applied a patch by Filipe Cabecinhas to make LLDB compile with GCC Functional changes: - fixed an issue where command type summary add for type "struct Foo" would not match any types. currently, "struct" will be stripped off and type "Foo" will be matched. similar behavior occurs for class, enum and union specifiers. llvm-svn: 138020
* Added the ability to remove orphaned module shared pointers from a ModuleList.Greg Clayton2011-08-112-6/+6
| | | | | | | | | | | | | | This is helping us track down some extra references to ModuleSP objects that are causing things to get kept around for too long. Added a module pointer accessor to target and change a lot of code to use it where it would be more efficient. "taret delete" can now specify "--clean=1" which will cleanup the global module list for any orphaned module in the shared module cache which can save memory and also help track down module reference leaks like we have now. llvm-svn: 137294
* Include the qLaunchSuccess and qC packets in the Greg Clayton2011-08-101-1/+2
| | | | | | | | 10 second timeout zone. When launching we increase the timeout to 10 seconds to ensure we have time to launch a process, and then set it back. llvm-svn: 137256
* While tracking down memory consumption issue a few things were needed: the Greg Clayton2011-08-102-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ability to dump more information about modules in "target modules list". We can now dump the shared pointer reference count for modules, the pointer to the module itself (in case performance tools can help track down who has references to said pointer), and the modification time. Added "target delete [target-idx ...]" to be able to delete targets when they are no longer needed. This will help track down memory usage issues and help to resolve when module ref counts keep getting incremented. If the command gets no arguments, the currently selected target will be deleted. If any arguments are given, they must all be valid target indexes (use the "target list" command to get the current target indexes). Took care of a bunch of "no newline at end of file" warnings. TimeValue objects can now dump their time to a lldb_private::Stream object. Modified the "target modules list --global" command to not error out if there are no targets since it doesn't require a target. Fixed an issue in the MacOSX DYLD dynamic loader plug-in where if a shared library was updated on disk, we would keep using the older one, even if it was updated. Don't allow the ModuleList::GetSharedModule(...) to return an empty module. Previously we could specify a valid path on disc to a module, and specify an architecture that wasn't contained in that module and get a shared pointer to a module that wouldn't be able to return an object file or a symbol file. We now make sure an object file can be extracted prior to adding the shared pointer to the module to get added to the shared list. llvm-svn: 137196
* Fix a crash while running the test suite. Need to check the (LogSP)log ↵Johnny Chen2011-08-091-3/+6
| | | | | | shared pointer before using it. llvm-svn: 137136
* Added some logging and did some member renaming.Greg Clayton2011-08-091-0/+9
| | | | llvm-svn: 137112
* Patch from David Forsythe for FreeBSD build!Johnny Chen2011-08-033-2/+7
| | | | llvm-svn: 136800
OpenPOWER on IntegriCloud