summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [FreeBSD] Use a cast sledgehammer to placate newer versions of clang.Davide Italiano2016-01-041-2/+2
| | | | | | Now lldb can build on FreeBSD with -Werror again. llvm-svn: 256771
* Remove POSIX thread/process abstractionEd Maste2015-07-281-3/+3
| | | | | | | | | As of r240543 ProcessPOSIX and POSIXThread are used only on FreeBSD, so just roll them into ProcessFreeBSD and FreeBSDThread. Differential Revision: http://reviews.llvm.org/D10698 llvm-svn: 243427
* Fix FreeBSD build.Chaoren Lin2015-07-141-3/+3
| | | | llvm-svn: 242113
* Reduce FreeBSD log spamEd Maste2015-06-241-4/+2
| | | | | | | | The values of four important registers are included in logs for ptrace PT_GETREGS. Put all four on the same line for a more compact log. Also use the proper 64-bit register names. llvm-svn: 240581
* Refactor many file functions to use FileSpec over strings.Ed Maste2015-06-011-28/+29
| | | | | | This is the FreeBSD change for r238604. llvm-svn: 238752
* Move debug register output into __amd64__ (FreeBSD)Ed Maste2015-03-271-2/+0
| | | | | | | This debug register diagnostic is really only applicable to amd64 at present. llvm-svn: 233403
* Use POSIX pid_t and not lldb::pid_t.Davide Italiano2015-03-221-1/+1
| | | | | | | | | | The latter is uint64_t beacuse lldb supports arbitrary pid/platforms but in this case we're using it as return value for fork() which might return -1 to the parent in case the syscall fails. Differential Revision: http://reviews.llvm.org/D8491 llvm-svn: 232926
* Fix FreeBSD build after r231145Ed Maste2015-03-031-0/+1
| | | | llvm-svn: 231157
* Fix TestProcesslaunch regression caused by D7372Pavel Labath2015-02-061-5/+4
| | | | | | | | | | | | | | | | | | | | | | | Summary: After closing all the leaked file descriptors to the inferior tty, the following problem occured: - when stdin, stdout and stderr are redirected, there are no slave descriptors open (which is good) - lldb has a reader thread, which attempts to read from the master end of the tty - this thread receives an EOF - in response, it closes it's master end - as this is the last open file descriptor for the master end, this deletes the tty and sends SIGHUP to the inferior (this is bad) I fix this problem by making sure the master end remains open for the duration of the inferior process by storing a copy of the file descriptor in ProcessMonitor. I create a copy to avoid ownership issues with the reading thread. Reviewers: ovyalov, emaste Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7440 llvm-svn: 228391
* Avoid leakage of file descriptors in LLDB (apply r228130 to FreeBSD)Ed Maste2015-02-051-1/+9
| | | | llvm-svn: 228305
* Share crash information between LLGS and local POSIX debugging withChaoren Lin2015-02-031-156/+8
| | | | | | | CrashReason class. Deliver crash information from LLGS to lldb via description field of thread stop packet. llvm-svn: 227926
* Add test for denied process attach by pid and fix found bugs in ↵Oleksiy Vyalov2014-11-191-9/+5
| | | | | | | | | | Process/ProcessPOSIX.cpp and FreeBSD/ProcessMonitor. http://reviews.llvm.org/D6240 llvm-svn: 222372
* Improve PowerPC unwind supportJustin Hibbits2014-11-121-3/+8
| | | | | | | | | | | | | | | | | Summary: Taking advantage of the new 'CFAIsRegisterDereferenced' CFA register type, add full stack unwind support to the PowerPC/PowerPC64 ABI. Also, add a new register set for powerpc32-on-64, so the register sizes are correct. This also requires modifying the ProcessMonitor to add support for non-uintptr_t-sized register values. Reviewers: jasonmolenda, emaste Subscribers: emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D6183 llvm-svn: 221789
* First cut of PowerPC(64) support in LLDB.Justin Hibbits2014-10-311-0/+2
| | | | | | | | | | | | | | | | | | | | | | | Summary: This adds preliminary support for PowerPC/PowerPC64, for FreeBSD. There are some issues still: * Breakpoints don't work well on powerpc64. * Shared libraries don't yet get loaded for a 32-bit process on powerpc64 host. * Backtraces don't work. This is due to PowerPC ABI using a backchain pointer in memory, instead of a dedicated frame pointer register for the backchain. * Breakpoints on functions without debug info may not work correctly for 32-bit powerpc. Reviewers: emaste, tfiala, jingham, clayborg Reviewed By: clayborg Subscribers: emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D5988 llvm-svn: 220944
* Fix FreeBSD build.Zachary Turner2014-09-301-6/+6
| | | | llvm-svn: 218685
* Create a HostThread abstraction.Zachary Turner2014-09-091-24/+15
| | | | | | | | | | | | | This patch moves creates a thread abstraction that represents a thread running inside the LLDB process. This is a replacement for otherwise using lldb::thread_t, and provides a platform agnostic interface to managing these threads. Differential Revision: http://reviews.llvm.org/D5198 Reviewed by: Jim Ingham llvm-svn: 217460
* Fix Linux to respect ASLR settings when launching processes to debug locally ↵Todd Fiala2014-08-171-0/+1
| | | | | | | | | | and remotely. See the following links for details: http://llvm.org/bugs/show_bug.cgi?id=20658 See http://reviews.llvm.org/D4941 llvm-svn: 215822
* Avoid passing null signal name for Log %s argumentEd Maste2014-05-281-3/+7
| | | | llvm-svn: 209739
* Implement ProcessMonitor::Kill for FreeBSDEd Maste2014-04-011-2/+2
| | | | | | | | | | | | | | | | | On FreeBSD ptrace(PT_KILL) is used to terminate the traced process (as if PT_CONTINUE had been used with SIGKILL as the signal to be delivered), and is the desired behaviour for ProcessPOSIX::DoDestroy. On Linux, after ptrace(PTRACE_KILL) the traced process still exists and can be interrogated. It is only upon resume that it exits as though it received SIGKILL. For now I'm committing only the FreeBSD change, until the Linux change (review D3159) is successfully tested. http://llvm.org/pr18894 llvm-svn: 205315
* Correct copy-and-pasted comments for DetachOperationEd Maste2014-03-171-1/+1
| | | | llvm-svn: 204064
* FreeBSD hardware watchpoint implementationEd Maste2014-02-191-3/+108
| | | | | | | | | | | | | | | Implement x86_64 debug register read/write in support of hardware watchpoints. Hoist LinuxThread::TraceNotify code back into POSIXThread::TraceNotify() Patch by John Wolfe. We still need to rework this later to avoid the #ifdef FreeBSD. llvm-reviews.chandlerc.com/D2572 llvm.org/pr16706 llvm-svn: 201706
* If setgid fails for any reason, exit lldb.Ed Maste2014-02-041-2/+7
| | | | | | | This is SVN r191618 by Sylvestre Ledru applied to the FreeBSD ProcessMonitor. llvm-svn: 200791
* Threaded inferior support for FreeBSDEd Maste2013-12-091-18/+75
| | | | | | | Modelled in part on GDBRemoteCommunicationClient. Review: http://llvm-reviews.chandlerc.com/D2267 llvm-svn: 196787
* Fix compile warningsEd Maste2013-11-251-2/+2
| | | | llvm-svn: 195685
* Remove unused variableEd Maste2013-11-251-2/+0
| | | | llvm-svn: 195683
* PT_CONTINUE and PT_STEP are process-scope on FreeBSDEd Maste2013-11-251-14/+14
| | | | | | | | | | Although ptrace() can be passed a PID or TID for PT_CONTINUE and PT_STEP, the kernel operates on all threads in the process in both cases. (See the FOREACH_THREAD_IN_PROC in FreeBSD's sys_process.c:kern_ptrace.) Make this clear by using the PID from the ProcessMonitor instance. llvm-svn: 195656
* Fix the format warnings.Sylvestre Ledru2013-10-311-2/+2
| | | | | | | | | | In almost all cases, the misuse is about "%lu" being used instead of the correct "%zu" (even though these are compatible on 64-bit platforms in practice). There are even a couple of cases where "%ld" (ie., signed int) is used instead of "%zu", and one where "%lu" is used instead of "%" PRIu64. Fixes bug #17551. Patch by "/dev/humancontroller" llvm-svn: 193832
* Add stub FreeBSD ProcessMonitor::ReadThreadPointerEd Maste2013-10-181-0/+6
| | | | llvm-svn: 192994
* Removed unnecessary call to OpenFirstAvailableMaster.Richard Mitton2013-10-171-8/+0
| | | | | | | | ::Fork already does this internally, so this was simply leaking file handles. This fixes the problem where the test suite would occasionally run out of file handles. llvm-svn: 192929
* Apply ProcessMonitor changes from r190820 to FreeBSDEd Maste2013-09-181-101/+24
| | | | llvm-svn: 190954
* Fixing a problem with thread creation signal order dependencyAndrew Kaylor2013-09-171-0/+23
| | | | llvm-svn: 190831
* Stop closing terminal fd from ProcessMonitor. It is owned by ↵Andrew Kaylor2013-09-141-1/+4
| | | | | | ConnectionFileDescriptor. llvm-svn: 190733
* Clean up handling of FreeBSD thread list on Launch / AttachEd Maste2013-09-031-22/+3
| | | | | | | | Instead of directly manipulating the thread list in Launch and Attach, just rely on RefreshStateAfterStop to populate the initial list. Review: http://llvm-reviews.chandlerc.com/D1565 llvm-svn: 189889
* Fix thread name updating in Linux. "thread list" should report correct names ↵Michael Sartain2013-07-311-2/+2
| | | | | | | | | | | always now. Created new LinuxThread class inherited from POSIXThread and removed linux / freebsd ifdefs Removed several un-needed set thread name calls CR (and multiple suggestions): mkopec llvm-svn: 187545
* Fix i386 FreeBSD buildEd Maste2013-07-221-0/+2
| | | | llvm-svn: 186871
* Correct comment to match class nameEd Maste2013-07-171-1/+1
| | | | llvm-svn: 186509
* FreeBSD: Replace GetSignalInfo with GetLwpInfoEd Maste2013-07-171-13/+13
| | | | | | | For thread support we are going to need other members of struct ptrace_lwpinfo. llvm-svn: 186505
* Reverting ProcessMonitor shared pointer changesAndrew Kaylor2013-07-091-5/+5
| | | | llvm-svn: 185981
* Use shared pointers to hold the process in ProcessMonitorAndrew Kaylor2013-07-091-5/+5
| | | | llvm-svn: 185946
* Pass tid through to ptrace operationsEd Maste2013-07-041-27/+35
| | | | | | This change is equivalent to the Linux threading support. llvm-svn: 185671
* Sync parts of FreeBSD Process plugin with LinuxEd Maste2013-07-021-36/+98
| | | | | | | | | | | | * Use PseudoTerminal to fix stdio handling / passthrough to the inferior process. * Add log messages equivalent to the Linux ones. * Port changes relating to process creation / termination. This revision contains changes equivalent to (parts of) SVN revisions 109318 142384 166055 168503 169645 177116 182809. llvm-svn: 185442
* Match printf format specifiers and argumentsEd Maste2013-06-251-2/+2
| | | | llvm-svn: 184854
* Sync FreeBSD files to Linux equivalents, to reduce noise in diffEd Maste2013-06-241-19/+18
| | | | | | | | | - Sort functions in the same order - Match whitespace - Remove commetned out code - Make filename in comments match filename llvm-svn: 184746
* Update comment to match class nameEd Maste2013-06-241-1/+1
| | | | llvm-svn: 184745
* Eliminate missing virtual destructor warning on FreeBSDEd Maste2013-06-241-0/+1
| | | | | | Akin to r181712 (88e529b7) of Linux/ProcessMonitor.cpp llvm-svn: 184742
* Fix FreeBSD build due to previous changes to ProcessMonitor::Detach.Matt Kopec2013-06-031-1/+1
| | | | llvm-svn: 183150
* Fixed "log enable linux registers" and added a test.Ashok Thirumurthi2013-05-091-2/+2
| | | | | | | | | | - Eliminated the use of static for methods that read m_register_infos, so that these routines can be implemented in the base class. - Eliminated m_register_infos in the base class because this is not used when derived classes call UpdateRegisterInfo. - Also moved the namespace using declarations from headers to source files. Thanks to Daniel and Samuel for their review feedback. llvm-svn: 181538
* Build fixes for FreeBSD 9.1.Ashok Thirumurthi2013-05-011-4/+17
| | | | | | | | - TODO: Support extended register sets on FreeBSD. Patch by Samuel Jacob. llvm-svn: 180879
* After discussing with Chris Lattner, we require C++11, so lets get rid of ↵Greg Clayton2013-04-181-2/+2
| | | | | | the macros and just use C++11. llvm-svn: 179805
* Since we use C++11, we should switch over to using std::unique_ptr when ↵Greg Clayton2013-04-181-2/+2
| | | | | | | | C++11 is being used. To do this, we follow what we have done for shared pointers and we define a STD_UNIQUE_PTR macro that can be used and it will "do the right thing". Due to some API differences in std::unique_ptr and due to the fact that we need to be able to compile without C++11, we can't use move semantics so some code needed to change so that it can compile with either C++. Anyone wanting to use a unique_ptr or auto_ptr should now use the "STD_UNIQUE_PTR(TYPE)" macro. llvm-svn: 179779
OpenPOWER on IntegriCloud