summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver/source/RNBRemote.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixed an issue where we would try to interrupt a process while it is in the ↵Greg Clayton2014-04-241-5/+6
| | | | | | | | | | process of naturally stopping due to another reason (breakpoint, or step). Added a new MachProcess::Interrupt() which correctly tracks such cases and "does the right thing". <rdar://problem/16593556> llvm-svn: 207139
* lldb arm64 import.Jason Molenda2014-03-291-6/+79
| | | | | | | | | | | | | | | | These changes were written by Greg Clayton, Jim Ingham, Jason Molenda. It builds cleanly against TOT llvm with xcodebuild. I updated the cmake files by visual inspection but did not try a build. I haven't built these sources on any non-Mac platforms - I don't think this patch adds any code that requires darwin, but please let me know if I missed something. In debugserver, MachProcess.cpp and MachTask.cpp were renamed to MachProcess.mm and MachTask.mm as they picked up some new Objective-C code needed to launch processes when running on iOS. llvm-svn: 205113
* Wait for the reply from the 'D' detach packet before tearing down the ↵Jim Ingham2014-03-281-2/+10
| | | | | | | | | | | | debugger. Avoids a race condition where we could end up killing debugserver (and thus the target) before it had a chance to detach. Also fix debugserver to send the OK AFTER it detaches to avoid the same race condition. <rdar://problem/16202713> llvm-svn: 205043
* Since lldb version doesn’t have to be a valid floating point literal, like ↵Todd Fiala2014-03-131-1/+1
| | | | | | | | | | x.y.z, the uses of DEBUGSERVER_VERSION_NUM are invalid and have to be removed. Change by Kuba Ober. llvm-svn: 203828
* Add support for the qSpeedTest packet so we can test packet speeds and data ↵Greg Clayton2014-02-211-1/+24
| | | | | | throughput. llvm-svn: 201874
* Don’t leak memory when reading memory and we do an early return for error ↵Greg Clayton2014-02-111-4/+3
| | | | | | conditions. llvm-svn: 201164
* Change RNBRemote::HandlePacket_m() to store the packet on the heapJason Molenda2014-02-111-1/+6
| | | | | | instead of on the stack. Handles larger packet read requests better. llvm-svn: 201118
* If we fail to attach, return an error rather than returning the success or ↵Jim Ingham2014-02-041-1/+3
| | | | | | | | failure of sending the error packet. llvm-svn: 200732
* Switch local launching of debugserver over to always use a FIFO in order to ↵Greg Clayton2013-12-041-1/+0
| | | | | | | | | | handshake with the launched debugserver. This helps ensure that the launched debugserver is ready and listening for a connection. Prior to this we had a race condition. Consolidate the launching of debugserver into a single place: a static function in GDBRemoteCommunication. llvm-svn: 196401
* <rdar://problem/15172417>Greg Clayton2013-11-131-0/+84
| | | | | | | | | | | | | | | 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-091-432/+146
| | | | | | | | | | | | - 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
* Fix a few errors found when building lldb with newer versions of clang.Jason Molenda2013-10-051-2/+2
| | | | | | <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-011-0/+14
| | | | | | | | | 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
* 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
* Huge performance improvements when one breakpoint contains many locations.Greg Clayton2013-06-121-113/+19
| | | | | | | | | | 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
* <rdar://problem/13892516>Greg Clayton2013-05-211-3/+18
| | | | | | LLDB can now debug across calls to exec when the architecture changes from say i386 to x86_64 (on darwin). llvm-svn: 182345
* 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-031-1/+1
| | | | | | | | | 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
* Add two additional DNBLog's in places where we're about to killJason Molenda2013-03-231-0/+1
| | | | | | | | 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
* Various fixes for armv7 floating point/vector register support.Jason Molenda2013-03-131-59/+82
| | | | | | | | | | | | | Drop the old f registers from debugserver's register list. Add the NEON 128-bit q registers to debugserver, support reading and writing. Add the new contains / invalidates mappings for the s, d, and q registers so lldb will know what registers overlay what other registers. Change the default format of s and d registers to be floating point instead of hex. Remove some UTF-8 hyphen chars in comments in the ARM register number definition headers. <rdar://problem/13121797> llvm-svn: 176915
* <rdar://problem/13338758>Han Ming Ong2013-03-041-7/+35
| | | | | | | Make it configurable what to profile. For Mac, we don't use the dirty page size yet and hence there is no need to gather that. This should be way better in not draining the battery since we are operating between 0% to 0.1% on the Mac after this change. llvm-svn: 176451
* <rdar://problem/12693921>Greg Clayton2013-02-141-4/+4
| | | | | | Rename the monitor command from "qCmd" (incorrect) to "qRcmd". llvm-svn: 175191
* Added support for the qCmd monitor packet command. Currently it can only do:Greg Clayton2013-02-021-2/+130
| | | | | | | | | set logfile=<path> set logmask=<num> But this opens the door for us to do much more. llvm-svn: 174258
* Remove a compile time warning in RNBRemote::HandlePacket_qProcessInfoJason Molenda2013-01-231-2/+1
| | | | | | for non-x86 builds. llvm-svn: 173226
* Change the container-regs kv pair in the qRegsiterInfoJason Molenda2013-01-231-1/+1
| | | | | | | | | | reply to be hex encoded, not decimal. Fix the whitespace in the container-regs/invalidate-regs documentation, fix one ambiguous hex/decimal number in an example. llvm-svn: 173225
* Changed the register number lists for the qRegisterInfo packet response to ↵Greg Clayton2013-01-211-1/+1
| | | | | | be raw hex to match all other register reading and writing APIs. llvm-svn: 173105
* <rdar://problem/13020634>Greg Clayton2013-01-211-0/+24
| | | | | | | | | | Fixed the 32, 16, and 8 bit pseudo regs for x86_64 (real reg of "rax" which subvalues "eax", "ax", etc...) to correctly get updated when stepping. Also fixed it so actual registers can specify what other registers must be invalidated when a register is modified. Previously, only pseudo registers could invalidate other registers. Modified the LLDB qRegisterInfo extension to the GDB remote interface to support specifying the containing registers with the new "container-regs" key whose value is a comma separated list of register numbers. Also added a "invalidate-regs" key whose value is also a comma separated list of register numbers. Removed the hack GDBRemoteDynamicRegisterInfo::Addx86_64ConvenienceRegisters() function and modified "debugserver" to specify the registers correctly using the new "container-regs" and "invalidate-regs" keys. llvm-svn: 173096
* <rdar://problem/13019628>Han Ming Ong2013-01-161-5/+5
| | | | | | Prevent profiling from working on older debugserver. Just a simple renaming since the caller is prepared to handle the ‘unimplemented’ answer. llvm-svn: 172583
* Add a few other missing LOG_ types to set_logging() in RNBRemote.cpp;Jason Molenda2013-01-151-10/+37
| | | | | | | document some simple bourne shell to re-generate these from the DNBDefs.h header file in case this needs to be done again in the future. llvm-svn: 172494
* Recognize LOG_WATCHPOINTS in the QSetLogging gdb-remote packet.Jason Molenda2013-01-121-0/+5
| | | | llvm-svn: 172311
* <rdar://problem/11961650> Jason Molenda2012-12-191-17/+45
| | | | | | | | | | | | | | | | | Update the debugserver "qProcessInfo" implementation to return the cpu type, cpu subtype, OS and vendor information just like qHostInfo does so lldb can create an ArchSpec based on the returned values. Add a new GetProcessArchitecture to GDBRemoteCommunicationClient akin to GetHostArchitecture. If the qProcessInfo packet is supported, GetProcessArchitecture will return the cpu type / subtype of the process -- e.g. a 32-bit user process running on a 64-bit x86_64 Mac system. Have ProcessGDBRemote set the Target's architecture based on the GetProcessArchitecture when we've completed an attach/launch/connect. llvm-svn: 170491
* Add a new qProcessInfo packet to debugserver.Jason Molenda2012-12-181-0/+79
| | | | | | | | | This can be used by lldb to ask for information about the process debugserver is attached to/launched. Particularly useful on a 64-bit x86 Mac system which can run 32-bit or 64-bit user-land processes. llvm-svn: 170409
* <rdar://problem/12780259>Han Ming Ong2012-11-291-4/+4
| | | | | | | Prevent async and sync calls to get profile data from stomping on each other. At the same time, don't use '$' as end delimiter per chunk of profile data. llvm-svn: 168948
* <rdar://problem/12720514> Sub-TLF: Provide service to profile the inferiorHan Ming Ong2012-11-171-0/+85
| | | | | | This allows client to query profiling states on the inferior. llvm-svn: 168228
* Stop using the "%z" size_t modifier and cast all size_t values to uint64_t. ↵Greg Clayton2012-09-181-1/+1
| | | | | | Some platforms don't support this modification. llvm-svn: 164148
* <rdar://problem/11935492>Greg Clayton2012-09-111-0/+7
| | | | | | Fixed an issue where if we call "Process::Destroy()" and the process is running, if we try to stop it and get "exited" back as the stop reason, we will still deliver the exited event. llvm-svn: 163591
* Add a call to "sync" a thread state before checkpointing registers in ↵Jim Ingham2012-07-251-0/+33
| | | | | | | | | | | 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-32/+54
| | | | | | process if it exists OR wait for it" without race conditions. Use that in lldb. llvm-svn: 160578
* Ran the static analyzer on the codebase and found a few things.Greg Clayton2012-07-171-17/+27
| | | | llvm-svn: 160338
* Fix an off by one error when handling a packet where our read buffer size ↵Jim Ingham2012-07-161-2/+2
| | | | | | | | | | truncates the first chunk of the packet between the two chars representing the checksum. <rdar://problem/11882074> llvm-svn: 160310
* <rdar://problem/11782789> Changes to the watchpoint implementation on ARM so ↵Enrico Granata2012-07-131-0/+3
| | | | | | that we single-step before stopping at the WP. This is necessary because on ARM the WP triggers before the opcode is actually executed, so we would be unable to continue since we would keep hitting the WP. We work around this by disabling the WP, single stepping and then putting the WP back in place. llvm-svn: 160199
* Spelling fixes.Greg Clayton2012-06-291-1/+1
| | | | llvm-svn: 159466
* Add the capability to display the number of supported hardware watchpoints ↵Johnny Chen2012-05-231-0/+28
| | | | | | | | | 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/11358639>Greg Clayton2012-05-081-6/+17
| | | | | | | | Switch over to the "*-apple-macosx" for desktop and "*-apple-ios" for iOS triples. Also make the selection process for auto selecting platforms based off of an arch much better. llvm-svn: 156354
* Added a new packet to our GDB remote protocol:Greg Clayton2012-04-101-15/+66
| | | | | | | | QListThreadsInStopReply This GDB remote query command can enable added a "threads" key/value pair to all stop reply packets so that we always get a list of all threads in each stop reply packet. It increases performance if enabled (the reply to the "QListThreadsInStopReply" is "OK") by saving us from sending to command/reply pairs (the "qfThreadInfo" and "qsThreadInfo" packets), and also helps us keep the current process state up to date. llvm-svn: 154380
* Send an "OK" response to the "D" (detach) packet.Jason Molenda2012-03-131-2/+1
| | | | | | | | v. http://sourceware.org/gdb/current/onlinedocs/gdb/Packets.html#Packets the detach packet is supposed to send a reply. llvm-svn: 152671
* Fixed an error with the 'G' packet on ARM when using the default GDBGreg Clayton2012-02-171-2/+5
| | | | | | | register set where it could get an error when trying to restore the fake "f0" - "f7" 12 byte float regs. llvm-svn: 150781
* Always return a valid answer for qMemoryRegionInfo if the packet is supported.Greg Clayton2011-12-121-39/+15
| | | | | | | | | 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-10/+45
| | | | | | | | | | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud