summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver
Commit message (Collapse)AuthorAgeFilesLines
...
* Expose SBPlatform through the public API.Greg Clayton2013-11-201-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example code: remote_platform = lldb.SBPlatform("remote-macosx"); remote_platform.SetWorkingDirectory("/private/tmp") debugger.SetSelectedPlatform(remote_platform) connect_options = lldb.SBPlatformConnectOptions("connect://localhost:1111"); err = remote_platform.ConnectRemote(connect_options) if err.Success(): print >> result, 'Connected to remote platform:' print >> result, 'hostname: %s' % (remote_platform.GetHostname()) src = lldb.SBFileSpec("/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework", False) dst = lldb.SBFileSpec() # copy src to platform working directory since "dst" is empty err = remote_platform.Install(src, dst); if err.Success(): print >> result, '%s installed successfully' % (src) else: print >> result, 'error: failed to install "%s": %s' % (src, err) Implemented many calls needed in lldb-platform to be able to install a directory that contains symlinks, file and directories. The remote lldb-platform can now launch GDB servers on the remote system so that remote debugging can be spawned through the remote platform when connected to a remote platform. The API in SBPlatform is subject to change and will be getting many new functions. llvm-svn: 195273
* <rdar://problem/14814689>Greg Clayton2013-11-131-2/+1
| | | | | | Add a log message to the console that will display the error code when we fail to reply to a mach message. llvm-svn: 194623
* <rdar://problem/15172417>Greg Clayton2013-11-1316-91/+441
| | | | | | | | | | | | | | | Added two new GDB server packets to debugserver: "QSaveRegisterState" and "QRestoreRegiterState". "QSaveRegisterState" makes the remote GDB server save all register values and it returns a save identifier as an unsigned integer. This packet can be used prior to running expressions to save all registers. All registers can them we later restored with "QRestoreRegiterState:SAVEID" what SAVEID is the integer identifier that was returned from the call to QSaveRegisterState. Cleaned up redundant code in lldb_private::Thread, lldb_private::ThreadPlanCallFunction. Moved the lldb_private::Thread::RegisterCheckpoint into its own header file and it is now in the lldb_private namespace. Trimmed down the RegisterCheckpoint class to omit stuff that wasn't used (the stack ID). Added a few new virtual methods to lldb_private::RegisterContext that allow subclasses to efficiently save/restore register states and changed the RegisterContextGDBRemote to take advantage of these new calls. llvm-svn: 194621
* Fixed up registers in debugserver.Greg Clayton2013-11-099-659/+725
| | | | | | | | | | | | - removed all gaps from the g/G packets - optimized registers for x86_64 to not send/receive xmm0-xmm15 as well as ymm0-ymm15, now we only send ymm0-15 and xmm0-15 are now pseudo regs - Fixed x86_64 floating point register gaps - Fixed x86_64 so that xmm8-xmm15 don't overlap with ymm0-ymm3. This could lead to bad values showing in the debugger and was due to bad register info structure contents - Fixed i386 so we only send ymm0-ymm7 and xmm0-xmm7 are now pseudo regs. - Fixed ARM register definitions to not have any gaps - Fixed it so value registers and invalidation registers are specified using register names which avoid games we had to play with register numbering in the ARM plugin. llvm-svn: 194302
* Fixed printf warnings.Greg Clayton2013-10-311-4/+4
| | | | llvm-svn: 193806
* Fix a few errors found when building lldb with newer versions of clang.Jason Molenda2013-10-052-5/+6
| | | | | | <rdar://problem/15148224> llvm-svn: 192024
* Update RNBRemote to handle the new pseudo_regs field added to DNBRegisterInfoJason Molenda2013-10-011-9/+14
| | | | | | | | | | back in r173096 by Greg. When constructing a g packet or parsing a G packet, and we're iterate over our register list, skip registers that are actually just slices of other, real, registers. For instance, eax is 32-bits of rax on x86_64. <rdar://problem/15104187> llvm-svn: 191802
* Add a new qGDBServerVersion packet so lldb can queryJason Molenda2013-10-012-0/+16
| | | | | | | | | the name of the remote gdb-protocol server, and get a version number from it. This can be useful if lldb needs to interoperate with a gdb-protocol server with a known issue or bug. llvm-svn: 191729
* r189295 inadvertently set the codesigning identity for the debugserver Debug ↵Jim Ingham2013-09-061-1/+1
| | | | | | | | configuration to "", which causes debugging to fail for that configuration. Setting it back to lldb_codesign. llvm-svn: 190172
* merge lldb-platform-work branch (and assorted fixes) into trunkDaniel Malea2013-08-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This merge brings in the improved 'platform' command that knows how to interface with remote machines; that is, query OS/kernel information, push and pull files, run shell commands, etc... and implementation for the new communication packets that back that interface, at least on Darwin based operating systems via the POSIXPlatform class. Linux support is coming soon. Verified the test suite runs cleanly on Linux (x86_64), build OK on Mac OS X Mountain Lion. Additional improvements (not in the source SVN branch 'lldb-platform-work'): - cmake build scripts for lldb-platform - cleanup test suite - documentation stub for qPlatform_RunCommand - use log class instead of printf() directly - reverted work-in-progress-looking changes from test/types/TestAbstract.py that work towards running the test suite remotely. - add new logging category 'platform' Reviewers: Matt Kopec, Greg Clayton Review: http://llvm-reviews.chandlerc.com/D1493 llvm-svn: 189295
* Add support for building debugserver with CMake (on Mac OS X)Daniel Malea2013-08-098-3/+145
| | | | | | | | - updated RNBDefs.h to allow version numbers to be passed in via preprocessor defines - update libdebugserver.cpp to compile against latest DNBProcessKill signature Review: http://llvm-reviews.chandlerc.com/D1331 llvm-svn: 188078
* Use the correct call to close down the lockdown connection.Jim Ingham2013-07-181-4/+2
| | | | | | <rdar://problem/14460024> llvm-svn: 186597
* Didn't get the right version of these files in the checkin for r186132.Jim Ingham2013-07-182-17/+18
| | | | llvm-svn: 186596
* Bump version number to 310.99.0.Jason Molenda2013-07-151-8/+8
| | | | llvm-svn: 186304
* Get debugserver to call task_set_state to prime the control registers so ↵Jim Ingham2013-07-1110-141/+72
| | | | | | | | | | | | | that watchpoints take for threads created while the program is running. Remove the testcase skips from TestConcurrentEvents.py, since they all pass now, and fix TestWatchpointMultipleThreads.py - which should have caught this problem - so it doesn't artificially break on new thread creation before the watchpoint triggers. llvm.org/pr16566 <rdar://problem/14383244> llvm-svn: 186132
* <rdar://problem/14195566>Greg Clayton2013-06-272-9/+13
| | | | | | Found a race condition when killing an application where the state could be set to exited by the waitpid_thread() _before_ we call task resume (via MachProcess::PrivateResume()) in MachProcess::Kill(). llvm-svn: 185048
* <rdar://problem/14281898>Han Ming Ong2013-06-261-0/+18
| | | | | | Much faster way to get dirty size. llvm-svn: 185033
* <rdar://problem/14262854>Han Ming Ong2013-06-261-3/+16
| | | | | | | Match up with top’s implementation on recent Cab as API has changed a bit. Tested the same binary running on Zin as well. Tested ARM binary on iOS as well. llvm-svn: 185017
* If debugserver fails to interrogate the inferior process CPU typeJason Molenda2013-06-251-1/+35
| | | | | | | | | for any reason, use debugserver own's cputype as a best guess when we reply to the debugger's qProcessInfo packet or when initializing our register tables. <rdar://problem/13406879> llvm-svn: 184829
* Remove some unnecessary uses of nub_break_t in the arm specificJason Molenda2013-06-253-126/+1
| | | | | | | | | support files for debugserver to fix a build failure for arm. Also remove some of the code used for software-driven single instruction stepping; this is slowly being yanked out and these particular bits overlap with the nub_break_t going away. llvm-svn: 184828
* Huge performance improvements when one breakpoint contains many locations.Greg Clayton2013-06-1214-815/+312
| | | | | | | | | | 325,000 breakpoints for running "breakpoint set --func-regex ." on lldb itself (after hitting a breakpoint at main so that LLDB.framework is loaded) used to take up to an hour to set, now we are down under a minute. With warm file caches, we are at 40 seconds, and that is with setting 325,000 breakpoint through the GDB remote API. Linux and the native debuggers might be faster. I haven't timed what how much is debug info parsing and how much is the protocol traffic to/from GDB remote. That there were many performance issues. Most of them were due to storing breakpoints in the wrong data structures, or using the wrong iterators to traverse the lists, traversing the lists in inefficient ways, and not optimizing certain function name lookups/symbol merges correctly. Debugging after that is also now very efficient. There were issues with replacing the breakpoint opcodes in memory that was read, and those routines were also fixed. llvm-svn: 183820
* Remove the debugserver "--open-connection" option and obey the hostname that ↵Greg Clayton2013-06-063-54/+132
| | | | | | | | | | | | | | is passed into debugserver. you can now specify: debugserver host:port debugserver port debugserver /path/to/file When "host" is specified, we will only accept connections from that host. If host is not specified, we default to "localhost". llvm-svn: 183457
* <rdar://problem/13963648>Han Ming Ong2013-05-221-2/+6
| | | | | | | Changes after feedback: Directly use function pointer, just to be safer on 10.8. llvm-svn: 182529
* <rdar://problem/13963648>Han Ming Ong2013-05-224-19/+80
| | | | | | Collect 'anonymous memory' info, if possible llvm-svn: 182523
* <rdar://problem/13892516>Greg Clayton2013-05-2110-840/+99
| | | | | | LLDB can now debug across calls to exec when the architecture changes from say i386 to x86_64 (on darwin). llvm-svn: 182345
* <rdar://problem/13891604>Greg Clayton2013-05-162-3/+14
| | | | | | Fixed a 2 second delay when sending the 'k' (kill) packet that happened due to a race condition. llvm-svn: 182025
* Removed unused code and an unused event.Greg Clayton2013-05-163-13/+1
| | | | llvm-svn: 181948
* fix a couple of clang static analyzer warnings.Jason Molenda2013-05-042-4/+2
| | | | | | | Most important was a new[] + delete mismatch in ScanFormatDescriptor() and a couple of possible memory leaks in FileSpec::EnumerateDirectory(). llvm-svn: 181080
* After discussing with Chris Lattner, we require C++11, so lets get rid of ↵Greg Clayton2013-04-186-21/+8
| | | | | | 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-183-3/+5
| | | | | | | | 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
* Cache the VM page size that we get from task_vm_info so we don'tJason Molenda2013-04-061-1/+2
| | | | | | re-fetch the value. llvm-svn: 178962
* Add optional LOG_TASK logging for MachVMMemory::PageSize when the call ↵Jason Molenda2013-04-061-0/+1
| | | | | | succeeds, too. llvm-svn: 178955
* Add optional LOG_TASK logging for MachVMMemory::PageSize() task_info call ↵Jason Molenda2013-04-061-0/+4
| | | | | | failure. llvm-svn: 178954
* Update MachVMMemory::PageSize to get the page size of a specific processJason Molenda2013-04-064-16/+45
| | | | | | | | | | | if we have an updated task_info call available; else fall back to getting the default host-wide page size. Update all uses of the vm page size to get it via MachVMMemory::PageSize(). <rdar://problem/13477763>, <rdar://problem/13498504> llvm-svn: 178953
* <rdar://problem/13457391>Greg Clayton2013-04-041-3/+3
| | | | | | LLDB now can use a single dash for all long options for all commands form the command line and from the command interpreter. This involved just switching all calls from getopt_long() to getopt_long_only(). llvm-svn: 178789
* <rdar://problem/13198919>Greg Clayton2013-04-041-0/+15
| | | | | | Try and reap process when sending the "k" packet to avoid a race condition. We now wait for at most 1 second to reap the child process that we are killing. llvm-svn: 178726
* <rdar://problem/12789467>Greg Clayton2013-04-031-1/+2
| | | | | | Fixed an attach case for ARM that was imporperly detecting an application bundle when there wasn't one. llvm-svn: 178704
* Remove a bit of code duplication in RNBRemote::HandlePacket_qProcessInfo -Jason Molenda2013-04-031-11/+3
| | | | | | call DNBProcessGetCPUType() to get the cputype of the process we're debugging. llvm-svn: 178620
* Fix another old usage of GetCurrentThread() to get a mach portJason Molenda2013-04-035-1/+21
| | | | | | | | | number in RNBRemote::HandlePacket_qProcessInfo -- add a new GetCurrentThreadMachPort() so callers who need to make a mach thred_get_state() call at the RNBRemote level will have a way to get the port number. llvm-svn: 178619
* Remove some unused code.Jim Ingham2013-04-021-13/+0
| | | | llvm-svn: 178512
* Debugserver fix for launching iOS apps who are named "com.apple.something"Jason Molenda2013-03-281-2/+16
| | | | | | | | - the ".app" would be treated as the app bundle final characters and the SpringBoard launch would fail. <rdar://problem/13258935> llvm-svn: 178209
* <rdar://problem/13521159>Greg Clayton2013-03-272-2/+13
| | | | | | | | LLDB is crashing when logging is enabled from lldb-perf-clang. This has to do with the global destructor chain as the process and its threads are being torn down. All logging channels now make one and only one instance that is kept in a global pointer which is never freed. This guarantees that logging can correctly continue as the process tears itself down. llvm-svn: 178191
* Remove FunctionProfiler and ProfileObjectiveC action classes as they are not ↵Greg Clayton2013-03-265-849/+0
| | | | | | used. llvm-svn: 178035
* <rdar://problem/13498504>Han Ming Ong2013-03-252-11/+36
| | | | | | Don't hard code vm page size in profiling code llvm-svn: 177907
* Add two additional DNBLog's in places where we're about to killJason Molenda2013-03-232-0/+2
| | | | | | | | off the inferior process so we stand a better chance of understanding what caused us to send a PT_KILL. <rdar://problem/12720340> llvm-svn: 177817
* Change debugserver to open the socket it listensJason Molenda2013-03-233-10/+22
| | | | | | | | | | | | | | | to in INADDR_LOOPBACK mode by default ("localhost only") instead of INADDR_ANY ("accept connections from any system"). Add a new command line argument to debugserver, --open-connection or -H which will enable the previous behavior. It would be used if you were doing two-system debugging, with lldb running on one system and debugserver running on the other. But it is a less common workflow and should not be the default. <rdar://problem/12583284> llvm-svn: 177790
* Simplify the logic for DNBDataRef::ValidOffsetForDataOfSize() and ↵Greg Clayton2013-03-211-2/+16
| | | | | | DNBDataRef::ValidOffset() functions. llvm-svn: 177615
* More cleanup on the lldb-perf code:Greg Clayton2013-03-191-24/+20
| | | | | | | | | | | | | | | - TestCase.m_thread is now filled in with the first thread that has a valid stop reason. This eliminates the need for the SelectMyThread() functions. - The first thread that stops for a reason is also set as the selected thread in the process in case any command line commands are run. - Changed launch over to take a SBLaunchInfo parameter so that the launch function doesn't keep getting new arguments as they are needed. - TestCase::Setup() and TestCase::Launch(SBLaunchInfo) now return bool to indicate success of setup and launch. - ActionWanted::Next(SBThread) was renamed to ActionWanted::StepOver(SBThread) - ActionWanted::Finish(SBThread) was renamed to ActionWanted::StepOut(SBThread) llvm-svn: 177376
* <rdar://problem/13100435>Han Ming Ong2013-03-151-4/+1
| | | | | | Don't discount regions that vmmap is not discounting. llvm-svn: 177202
* <rdar://problem/13415471>Han Ming Ong2013-03-131-6/+6
| | | | | | Don't get dirty page size if we are not going to send it back llvm-svn: 176992
OpenPOWER on IntegriCloud