summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver/source
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixed an issue in "SBError SBProcess::Destroy ()" where it wasn't properlyGreg Clayton2011-01-228-74/+193
| | | | | | | | | | | | | | | | | | | | 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
* Sped up the shutdown time on MacOSX by quite a bit by making sure anyGreg Clayton2011-01-221-5/+4
| | | | | | | | | | | | | | | | | threads that we spawn let us know when they are going away and that we don't timeout waiting for a message from threads that have gone away. We also now don't expect the "k" packet (kill) to send a response. This greatly speeds up debugger shutdown performance. The test suite now runs quite a bit faster. Added a fix to the variable display code that fixes the display of base classes. We were assuming the virtual or normal base class offsets were being given in bit sizes, but they were being given as character sizes, so we needed to multiply the offset by 8. This wasn't affecting the expression parser, but it was affecting the correct display of C++ class base classes and all of their children. llvm-svn: 124024
* Add a (currently disabled) bear trap where instead of deallocating pages, we ↵Jim Ingham2011-01-221-2/+9
| | | | | | remove all permissions. llvm-svn: 124012
* Took the timeout for a ClangUserExpression down from a 10 second timeout toGreg Clayton2011-01-198-162/+116
| | | | | | | | | | | | | | 500 ms. Make MachThreadList more threadsafe. Added code to make sure the thread register state was properly flushed for x86_64. Fixed an missing return code for the current thread in the new thread suffix code. Improved debugserver logging. llvm-svn: 123815
* Thread safety changes in debugserver and also in the process GDB remote plugin.Greg Clayton2011-01-189-158/+209
| | | | | | | | | | | | | | I added support for asking if the GDB remote server supports thread suffixes for packets that should be thread specific (register read/write packets) because the way the GDB remote protocol does it right now is to have a notion of a current thread for register and memory reads/writes (set via the "$Hg%x" packet) and a current thread for running ("$Hc%x"). Now we ask the remote GDB server if it supports adding the thread ID to the register packets and we enable that feature in LLDB if supported. This stops us from having to send a bunch of packets that update the current thread ID to some value which is prone to error, or extra packets. llvm-svn: 123762
* Modified the stop reply packet to be able to send the thread name using theGreg Clayton2011-01-081-1/+15
| | | | | | | | | | new "hexname" key for the "key:value;" duple that is part of the packet. This allows for thread names to contain special characters such as $ # : ; + - Debugserver now detects if the thread name contains special characters and sends the chars in hex format if needed. llvm-svn: 123053
* Bumped lldb Xcode version to 35 for lldb-35, and debugserver to 121 forGreg Clayton2010-12-081-2/+0
| | | | | | debugserver-121. llvm-svn: 121237
* Add '-no-stdio' option to 'process launch' command, which causes theCaroline Tice2010-12-035-24/+56
| | | | | | | | | | 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 a race condition that could cause ProcessGDBRemote::DoResume() to returnGreg Clayton2010-12-031-2/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | an error saying the resume timed out. Previously the thread that was trying to resume the process would eventually call ProcessGDBRemote::DoResume() which would broadcast an event over to the async GDB remote thread which would sent the continue packet to the remote gdb server. Right after this was sent, it would set a predicate boolean value (protected by a mutex and condition) and then the thread that issued the ProcessGDBRemote::DoResume() would then wait for that condition variable to be set. If the async gdb thread was too quick though, the predicate boolean value could have been set to true and back to false by the time the thread that issued the ProcessGDBRemote::DoResume() checks the boolean value. So we can't use the predicate value as a handshake. I have changed the code over to using a Event by having the GDB remote communication object post an event: GDBRemoteCommunication::eBroadcastBitRunPacketSent This allows reliable handshaking between the two threads and avoids the erroneous ProcessGDBRemote::DoResume() errors. Added a host backtrace service to allow in process backtraces when trying to track down tricky issues. I need to see if LLVM has any backtracing abilities abstracted in it already, and if so, use that, but I needed something ASAP for the current issue I was working on. The static function is: void Host::Backtrace (Stream &strm, uint32_t max_frames); And it will backtrace at most "max_frames" frames for the current thread and can be used with any of the Stream subclasses for logging. llvm-svn: 120793
* Fixed 32 bit debugging after recent architecture changes to debugserver.Greg Clayton2010-12-018-15/+47
| | | | llvm-svn: 120618
* Added missing file.Greg Clayton2010-11-181-0/+89
| | | | llvm-svn: 119709
* Fixed Process::Halt() as it was broken for "process halt" after recent changesGreg Clayton2010-11-1818-314/+463
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 more thread suspend/resume issues.Greg Clayton2010-11-121-35/+40
| | | | llvm-svn: 118877
* Fixed an issue with the MachThread class where we might not get the initialGreg Clayton2010-11-123-2/+42
| | | | | | | | | thread basic info state and not realize that a thread was already suspended or if a thread was starting up and not ready to be displayed to the user (in an uninterruptable state). If it is not user ready yet, we don't add it to our list of threads that can be played with. llvm-svn: 118866
* If debugserver is running on the local machine, pass it aCaroline Tice2010-11-052-7/+11
| | | | | | | | pseudoterminal to pass to the inferior for the inferior's I/O (to allow direct writing, rather than passing all the I/O around via packets). llvm-svn: 118308
* Fix problem where "process detach" was not working properly. TheCaroline Tice2010-11-022-9/+26
| | | | | | | | | | ptrace thread update that was replying to the SIGSTOP was also causing the process to not really be sigstop'd any more so then the call to ptrace detach was failing, and when debugserver exited the attached process was being killed. Now the ptrace thread update does not disturb the sigstop state of the thread, so the detach works properly. llvm-svn: 118018
* Fixed vAttachWait by fixing a missed "else if".Greg Clayton2010-10-261-1/+1
| | | | llvm-svn: 117395
* Still trying to get detach to work with debugserver. Got a bit closer,Greg Clayton2010-10-186-35/+62
| | | | | | | | | | | but something is still killing our inferior. Fixed an issue with darwin-debug where it wasn't passing all needed arguments to the inferior. Fixed a race condition with the attach to named process code. llvm-svn: 116697
* Fixed debugserver to properly attach to a process by name with the Greg Clayton2010-10-183-5/+35
| | | | | | | | | | | | | | | | | | | "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
* Fixed an issue with MachTask::TaskResume () where if the task was alreadyGreg Clayton2010-10-161-2/+6
| | | | | | | suspended, we would call "int ::task_resume (task_t task);" as many times as it took to resume the task which isn't what we want to do. llvm-svn: 116674
* Retry task_for_pid a few times to avoid some cases where task_for_pid fails.Greg Clayton2010-09-302-23/+34
| | | | llvm-svn: 115184
* Another patch from Jean-Daniel. Thanks.Johnny Chen2010-09-285-7/+7
| | | | | | Error in dbg server -> MachProcess::SetProcessID() and misc changes to make clang++ happy. llvm-svn: 114962
* Got the ARM version of debugserver up to date. Greg Clayton2010-09-099-176/+674
| | | | | | | | | Renamed the "dispatchqaddr" setting that was coming back for stop reply packets to be named "qaddr" so that gdb doesn't thing it is a register number. gdb was checking the first character and assuming "di" was a hex register number because 'd' is a hex digit. It has been shortened so gdb can safely ignore it. llvm-svn: 113475
* Added the ability to disable ASLR (Address Space Layout Randomization). ASLRGreg Clayton2010-08-315-16/+26
| | | | | | | | is disabled by default, and can be enabled using: (lldb) set disable-aslr 0 llvm-svn: 112616
* Fixed debugserver to not exit when we are able to spawn the process, yet notGreg Clayton2010-07-304-55/+39
| | | | | | | | launch it due to not being able to get the task port. A SIGHUP was killing us and also an error string wasn't properly being passed along. Got rid of a class error variable that can only lead to multi-threaded crashes. llvm-svn: 109930
* Merged Eli Friedman's linux build changes where he added Makefile files thatGreg Clayton2010-07-091-1/+1
| | | | | | | enabled LLVM make style building and made this compile LLDB on Mac OS X. We can now iterate on this to make the build work on both linux and macosx. llvm-svn: 108009
* More leaks detection:Greg Clayton2010-07-021-0/+2
| | | | | | | | | | - fixed 3 posix spawn attributes leaks - fixed us always leaking CXXBaseSpecifier objects when we create class base classes. Clang apparently copies the base classes we pass in. Fixed some code formatting in ClangASTContext.cpp. llvm-svn: 107459
* Initial checkin of lldb code from internal Apple repo.Chris Lattner2010-06-0879-0/+26881
llvm-svn: 105619
OpenPOWER on IntegriCloud