summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver/source/DNB.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* <rdar://problem/12720514> Sub-TLF: Provide service to profile the inferiorHan Ming Ong2012-11-171-0/+41
| | | | | | This allows client to query profiling states on the inferior. llvm-svn: 168228
* <rdar://problem/12647273>Greg Clayton2012-11-061-4/+4
| | | | | | Added the ability to get the full process list when using the --applist option in debugserver. llvm-svn: 167502
* Switch from using KERN_PROCARGS2 to get the path to the executed process to ↵Jim Ingham2012-11-011-11/+14
| | | | | | | | proc_pidpath. The former was flakey, and the whole point of libproc is to protect us from potential flakiness at that level... <rdar://problem/12594781> llvm-svn: 167194
* Resolve any bundle paths we are given when the specified executable is a bundle.Greg Clayton2012-10-311-0/+17
| | | | llvm-svn: 167175
* Stop using the "%z" size_t modifier and cast all size_t values to uint64_t. ↵Greg Clayton2012-09-181-3/+3
| | | | | | Some platforms don't support this modification. llvm-svn: 164148
* Add a call to "sync" a thread state before checkpointing registers in ↵Jim Ingham2012-07-251-0/+13
| | | | | | | | | | | preparation for calling functions. This is necessary on Mac OS X, since bad things can happen if you set the registers of a thread that's sitting in a kernel trap. <rdar://problem/11145013> llvm-svn: 160756
* Add "vAttachOrWait" to debugserver, so you can implement "attach to the ↵Jim Ingham2012-07-201-2/+7
| | | | | | process if it exists OR wait for it" without race conditions. Use that in lldb. llvm-svn: 160578
* <rdar://problem/11908082>Greg Clayton2012-07-191-5/+46
| | | | | | Allow debugserver to match process names that are longer than MAXCOMLEN (16) characters. We do this by digging up argv[0] from another sysctl if the process name supplied is longer than 16 characters. llvm-svn: 160487
* Ran the static analyzer on the codebase and found a few things.Greg Clayton2012-07-171-12/+14
| | | | llvm-svn: 160338
* Add the capability to display the number of supported hardware watchpoints ↵Johnny Chen2012-05-231-0/+12
| | | | | | | | | to the "watchpoint list" command. Add default Process::GetWatchpointSupportInfo() impl which returns an error of "not supported". Add "qWatchpointSupportInfo" packet to the gdb communication layer to support this, and modify TestWatchpointCommands.py to test it. llvm-svn: 157345
* <rdar://problem/10434005>Greg Clayton2012-03-141-1/+1
| | | | | | | Prepare LLDB to be built with C++11 by hiding all accesses to std::tr1 behind macros that allows us to easily compile for either C++. llvm-svn: 152698
* Pull side effects out of asserts. Fixes debugserver with NDEBUG defined.Charles Davis2012-02-211-2/+4
| | | | llvm-svn: 151013
* Kill our child process that we launch when we can't get the task_for_pid()Greg Clayton2012-02-021-0/+4
| | | | | | | | otherwise we will have a launched process stopped at the entry point and it will get reparented when debugserver goes away and we won't be able to kill the process later. llvm-svn: 149622
* Always return a valid answer for qMemoryRegionInfo if the packet is supported.Greg Clayton2011-12-121-1/+1
| | | | | | | | | We will return a valid range when possible and omit the "permissions" key when the memory is not readable, writeable or executeable. This will help us know the difference between an error back from this packet and unsupported, from just "this address isn't in a valid region". llvm-svn: 146394
* Added optional calls to lldb_private::Process for getting memory region infoGreg Clayton2011-11-181-4/+3
| | | | | | | | | | | | | | | | | | | | | | | from a process and hooked it up to the new packet that was recently added to our GDB remote executable named debugserver. Now Process has the following new calls: virtual Error Process::GetMemoryRegionInfo (lldb::addr_t load_addr, MemoryRegionInfo &range_info); virtual uint32_t GetLoadAddressPermissions (lldb::addr_t load_addr); Only the first one needs to be implemented by subclasses that can add this support. Cleaned up the way the new packet was implemented in debugserver to be more useful as an API inside debugserver. Also found an error where finding a region for an address actually will pick up the next region that follows the address in the query so we also need ot make sure that the address we requested the region for falls into the region that gets returned. llvm-svn: 144976
* Remove the QAddressIsExecutable packet I added last night.Jason Molenda2011-11-091-15/+12
| | | | | | | | | | | | | | | Add a more general purpose qMemoryRegionInfo packet which can describe various attributes about a memory region. Currently it will return the start address, size, and permissions (read, write, executable) for the memory region. It may be possible to add additional attributes in the future such as whether the region is designated as stack memory or jitted code a la vmmap. I still haven't implemented the lldb side of the code to use this packet yet so there may be unexpected behavior - but the basic implementation looks about right. I'll hook it up to lldb soon and fix any problems that crop up. llvm-svn: 144175
* Add "QAddressIsExecutable" packet to debugserver. Used to testJason Molenda2011-11-081-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | whether a given address is in an executable region of memory or not. I haven't written the lldb side that will use this packet it hasn't been tested yet but it's a simple enough bit of code. I want to have this feature available for the unwinder code. When we're stopped at an address with no valid symbol context, there are a number of questions I'd like to ask -- is the current pc value in an executable region (e.g. did they jump to unallocated/unexecutable memory? we know how to unwind from here if so.) Is the stack pointer or the frame pointer the correct register to use to find the caller's saved pc value? Once we're past the first frame we can trust things like eh_frame and ABI unwind schemes but the first frame is challenging and having a way to check potential addresses to see if they're executable or not would help narrow down the possibilities a lot. llvm-svn: 144074
* Enabled the "printf" attribute on all debugserver logging functions and fixed Greg Clayton2011-10-281-1/+1
| | | | | | the ensuing mayhem. llvm-svn: 143244
* DNBBreakpoint::SetEnabled() should take a bool, not a uint32_t, as its input ↵Johnny Chen2011-09-061-6/+6
| | | | | | | | | argument. Plus for watchpoint related functions, add new macros INVALID_NUB_WATCH_ID and NUB_WATCH_ID_IS_VALID and use them, instead. llvm-svn: 139163
* To silence the static analyzer.Johnny Chen2011-08-111-1/+1
| | | | llvm-svn: 137326
* Added new OptionGroup classes for UInt64, UUID, File and Boolean values.Greg Clayton2011-05-031-0/+1
| | | | | | | | | | | | | | | | | | | | | Removed the "image" command and moved it to "target modules". Added an alias for "image" to "target modules". Added some new target commands to be able to add and load modules to a target: (lldb) target modules add <path> (lldb) target modules load [--file <path>] [--slide <offset>] [<sect-name> <sect-load-addr> ...] So you can load individual sections without running a target: (lldb) target modules load --file /usr/lib/libSystem.B.dylib __TEXT 0x7fccc80000 __DATA 0x1234000000 Or you can rigidly slide an entire shared library: (lldb) target modules load --file /usr/lib/libSystem.B.dylib --slid 0x7fccc80000 This should improve bare board debugging when symbol files need to be slid around manually. llvm-svn: 130796
* Fixed CommandReturnObject::SetImmediateErrorFile() to set the correct stream.Greg Clayton2011-02-241-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | Modifed lldb_private::Process to be able to handle connecting to a remote target that isn't running a process. This leaves lldb_private::Process in the eStateConnected state from which we can then do an attach or launch. Modified ProcessGDBRemote to be able to set stdin, stdout, stderr, working dir, disable ASLR and a few other settings down by using new GDB remote packets. This allows us to keep all of our current launch flags and settings intact and still be able to communicate them over to the remote GDB server. Previously these were being sent as arguments to the debugserver binary that we were spawning. Also modified ProcessGDBRemote to handle losing connection to the remote GDB server and always exit immediately. We do this by watching the lldb_private::Communication event bit for the read thread exiting in the ProcessGDBRemote async thread. Added support for many of the new 'Q' packets for setting stdin, stdout, stderr, working dir and disable ASLR to the GDBRemoteCommunication class for easy accesss. Modified debugserver for all of the new 'Q' packets and also made it so that debugserver always exists if it loses connection with the remote debugger. llvm-svn: 126444
* Added a new variant of SBTarget::Launch() that deprectates the old one thatGreg Clayton2011-01-231-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | takes separate file handles for stdin, stdout, and stder and also allows for the working directory to be specified. Added support to "process launch" to a new option: --working-dir=PATH. We can now set the working directory. If this is not set, it defaults to that of the process that has LLDB loaded. Added the working directory to the host LaunchInNewTerminal function to allows the current working directory to be set in processes that are spawned in their own terminal. Also hooked this up to the lldb_private::Process and all mac plug-ins. The linux plug-in had its API changed, but nothing is making use of it yet. Modfied "debugserver" and "darwin-debug" to also handle the current working directory options and modified the code in LLDB that spawns these tools to pass the info along. Fixed ProcessGDBRemote to properly pass along all file handles for stdin, stdout and stderr. After clearing the default values for the stdin/out/err file handles for process to be NULL, we had a crasher in UserSettingsController::UpdateStringVariable which is now fixed. Also fixed the setting of boolean values to be able to be set as "true", "yes", "on", "1" for true (case insensitive) and "false", "no", "off", or "0" for false. Fixed debugserver to properly handle files for STDIN, STDOUT and STDERR that are not already opened. Previous to this fix debugserver would only correctly open and dupe file handles for the slave side of a pseudo terminal. It now correctly handles getting STDIN for the inferior from a file, and spitting STDOUT and STDERR out to files. Also made sure the file handles were correctly opened with the NOCTTY flag for terminals. llvm-svn: 124060
* Fixed an issue in "SBError SBProcess::Destroy ()" where it wasn't properlyGreg Clayton2011-01-221-2/+15
| | | | | | | | | | | | | | | | | | | | checking the validity of the shared pointer prior to using it. Fixed the GDB remote plug-in to once again watch for a reply from the "k" packet, and fixed the logic to make sure the thread requesting the kill and the async thread play nice (and very quickly) by synchronizing the packet sending and reply. I also tweaked some of the shut down packet ("k" kill, "D" detach, and the halt packet) to make sure they do the right thing. Fixed "StateType Process::WaitForProcessStopPrivate (...)" to correctly pass the timeout along to WaitForStateChangedEventsPrivate() and made the function behave correctly with respect to timing out. Added separate STDIN, STDOUT, and STDERR support to debugserver. Also added the start of being able to set the working directory for the inferior process. llvm-svn: 124049
* Add '-no-stdio' option to 'process launch' command, which causes theCaroline Tice2010-12-031-1/+2
| | | | | | | | | | inferior to be launched without setting up terminal stdin/stdout for it (leaving the lldb command line accessible while the program is executing). Also add a user settings variable, 'target.process.disable-stdio' to allow the user to set this globally rather than having to use the command option each time the process is launched. llvm-svn: 120825
* Fixed 32 bit debugging after recent architecture changes to debugserver.Greg Clayton2010-12-011-0/+15
| | | | llvm-svn: 120618
* Fixed Process::Halt() as it was broken for "process halt" after recent changesGreg Clayton2010-11-181-37/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | to the DoHalt down in ProcessGDBRemote. I also moved the functionality that was in ProcessGDBRemote::DoHalt up into Process::Halt so not every class has to implement a tricky halt/resume on the internal state thread. The functionality is the same as it was before with two changes: - when we eat the event we now just reuse the event we consume when the private state thread is paused and set the interrupted bool on the event if needed - we also properly update the Process::m_public_state with the state of the event we consume. Prior to this, if you issued a "process halt" it would eat the event, not update the process state, and then produce a new event with the interrupted bit set and send it. Anyone listening to the event would get the stopped event with a process that whose state was set to "running". Fixed debugserver to not have to be spawned with the architecture of the inferior process. This worked fine for launching processes, but when attaching to processes by name or pid without a file in lldb, it would fail. Now debugserver can support multiple architectures for a native debug session on the current host. This currently means i386 and x86_64 are supported in the same binary and a x86_64 debugserver can attach to a i386 executable. This change involved a lot of changes to make sure we dynamically detect the correct registers for the inferior process. llvm-svn: 119680
* Fixed debugserver to properly attach to a process by name with the Greg Clayton2010-10-181-3/+6
| | | | | | | | | | | | | | | | | | | "vAttachName;<PROCNAME>" packet, and wait for a new process by name to launch with the "vAttachWait;<PROCNAME>". Fixed a few issues with attaching where if DoAttach() returned no error, yet there was no valid process ID, we would deadlock waiting for an event that would never happen. Added a new "process launch" option "--tty" that will launch the process in a new terminal if the Host layer supports the "Host::LaunchInNewTerminal(...)" function. This currently works on MacOSX and will allow the debugging of terminal applications that do complex operations with the terminal. Cleaned up the output when the process resumes, stops and halts to be consistent with the output format. llvm-svn: 116693
* Added the ability to disable ASLR (Address Space Layout Randomization). ASLRGreg Clayton2010-08-311-2/+3
| | | | | | | | is disabled by default, and can be enabled using: (lldb) set disable-aslr 0 llvm-svn: 112616
* Initial checkin of lldb code from internal Apple repo.Chris Lattner2010-06-081-0/+1996
llvm-svn: 105619
OpenPOWER on IntegriCloud