summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver/source
Commit message (Collapse)AuthorAgeFilesLines
...
* Watchpoint work in progress: add helper methods to DNB arch impl for I386 to ↵Johnny Chen2011-08-313-48/+122
| | | | | | implment Enable/DisableHardwareWatchpoint. llvm-svn: 138847
* Watchpoint work in progress: add helper methods to DNB arch impl for X86_64 ↵Johnny Chen2011-08-313-44/+118
| | | | | | to implment Enable/DisableHardwareWatchpoint. llvm-svn: 138844
* Add stubs of incomplete watchpoint implementation with "FIXME" markers.Johnny Chen2011-08-305-6/+236
| | | | llvm-svn: 138790
* Added the debug registers for i386 and x86_64 in preparation for watchpoints.Greg Clayton2011-08-296-14/+104
| | | | llvm-svn: 138770
* Remove an extra break statement.Johnny Chen2011-08-291-2/+0
| | | | llvm-svn: 138763
* To silence the static analyzer.Johnny Chen2011-08-111-1/+1
| | | | llvm-svn: 137326
* To silence the static analyzer.Johnny Chen2011-08-111-1/+1
| | | | llvm-svn: 137319
* Incremental fixes of issues found by Xcode static analyzer.Johnny Chen2011-08-111-2/+1
| | | | llvm-svn: 137288
* In the case where we are trying to resume a thread all the way to 0, if we getJim Ingham2011-08-111-1/+3
| | | | llvm-svn: 137287
* Ignore the static analyzer, instead; and add comment why.Johnny Chen2011-08-101-2/+2
| | | | llvm-svn: 137275
* Incremental fixes of issues found by Xcode static analyzer.Johnny Chen2011-08-102-2/+3
| | | | llvm-svn: 137267
* Fixed a problem where the HasAVX() code inSean Callanan2011-08-093-16/+20
| | | | | | | | debugserver did not back up %ebx/%rbx, even though it was being clobbered by the CPUID instruction. llvm-svn: 137131
* The "bool HasAVX()" function doesn't backup and restore theGreg Clayton2011-08-092-0/+14
| | | | | | | | cpu registers it uses and it crashes the release version of debugserver. We just get lucky in Debug builds. Until this is fixed I am disabling AVX detection to avoid the crashes. llvm-svn: 137113
* Added some logging and did some member renaming.Greg Clayton2011-08-092-46/+57
| | | | llvm-svn: 137112
* RNBRemote.cpp, RNBRemote.h: Add a new qGetPid packet which returnsJason Molenda2011-07-262-0/+18
| | | | | | | | | | | | | | | the pid of the process currently being debugged by debugserer in hex, or 0 if unavailable. This is effectively the same as the qC packet but that packet is not clear in either its documentation or implementation (in gdb et al) as to whether it is intended to return a pid or a thread id. qGetPid is unambiguous. If qGetPid is unimplemented in the remote debugserver, the debugger may try qC and see what kind of value is returned.. llvm-svn: 136055
* If we are telling only one thread to run in debugserver, and that thread has ↵Jim Ingham2011-07-213-31/+99
| | | | | | | | been suspended from outside the debugger, resume it before running so we will actually make progress. llvm-svn: 135655
* Added support for dynamic detection of AVX, andSean Callanan2011-07-166-16/+77
| | | | | | | | | | | | | | | | | | | | fixed a few bugs that revealed. Now the "register read" command should show AVX registers (ymm0-ymm15) on Mac OS X platforms that support them. When testing this on Mac OS X, run debugserver manually, like this: debugserver --native-regs localhost:1111 /path/to/executable Then lldb /path/to/executable ... (lldb) process connect connect://localhost:1111 llvm-svn: 135331
* Added the ability to see block variables when looking up addressesGreg Clayton2011-07-111-7/+7
| | | | | | | | | | | | with the "target modules lookup --address <addr>" command. The variable ID's, names, types, location for the address, and declaration is displayed. This can really help with crash logs since we get, on MacOSX at least, the registers for the thread that crashed so it is often possible to figure out some of the variable contents. llvm-svn: 134886
* Handle the possible case where the process launch failedJason Molenda2011-07-081-1/+7
| | | | | | but we don't have an error message. llvm-svn: 134662
* Add support for a QEnvironmentHexEncoded packet which takes itsJason Molenda2011-06-252-0/+50
| | | | | | | | | arguments in hex-encoded form instead of the old QEnvironment packet which takes them as plain-text strings. Environment variables containing remote protocol special chars like '#' would fail to set with QEnvironment. llvm-svn: 133857
* Fixed an issue in the EmulateInstructionARM there the IT opcode was trying toGreg Clayton2011-05-233-3/+48
| | | | | | | | | | | | | | | | | | | | | | | | parse NOP instructions. I added the new table entries for the NOP for the plain NOP, Yield, WFE, WFI, and SEV variants. Modified the opcode emulation function EmulateInstructionARM::EmulateMOVRdSP(...) to notify us when it is creating a frame. Also added an abtract way to detect the frame pointer register for both the standard ARM ABI and for Darwin. Fixed GDBRemoteRegisterContext::WriteAllRegisterValues(...) to correctly be able to individually write register values back if case the 'G' packet is not implemented or returns an error. Modified the StopInfoMachException to "trace" stop reasons. On ARM we currently use the BVR/BCR register pairs to say "stop when the PC is not equal to the current PC value", and this results in a EXC_BREAKPOINT mach exception that has 0x102 in the code. Modified debugserver to create the short option string from long option definitions to make sure it doesn't get out of date. The short option string was missing many of the newer short option values due to a modification of the long options defs, and not modifying the short option string. llvm-svn: 131911
* Added new lldb_private::Process memory read/write functions to stop a bunchGreg Clayton2011-05-221-67/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of duplicated code from appearing all over LLDB: lldb::addr_t Process::ReadPointerFromMemory (lldb::addr_t vm_addr, Error &error); bool Process::WritePointerToMemory (lldb::addr_t vm_addr, lldb::addr_t ptr_value, Error &error); size_t Process::ReadScalarIntegerFromMemory (lldb::addr_t addr, uint32_t byte_size, bool is_signed, Scalar &scalar, Error &error); size_t Process::WriteScalarToMemory (lldb::addr_t vm_addr, const Scalar &scalar, uint32_t size, Error &error); in lldb_private::Process the following functions were renamed: From: uint64_t Process::ReadUnsignedInteger (lldb::addr_t load_addr, size_t byte_size, Error &error); To: uint64_t Process::ReadUnsignedIntegerFromMemory (lldb::addr_t load_addr, size_t byte_size, uint64_t fail_value, Error &error); Cleaned up a lot of code that was manually doing what the above functions do to use the functions listed above. Added the ability to get a scalar value as a buffer that can be written down to a process (byte swapping the Scalar value if needed): uint32_t Scalar::GetAsMemoryData (void *dst, uint32_t dst_len, lldb::ByteOrder dst_byte_order, Error &error) const; The "dst_len" can be smaller that the size of the scalar and the least significant bytes will be written. "dst_len" can also be larger and the most significant bytes will be padded with zeroes. Centralized the code that adds or removes address bits for callable and opcode addresses into lldb_private::Target: lldb::addr_t Target::GetCallableLoadAddress (lldb::addr_t load_addr, AddressClass addr_class) const; lldb::addr_t Target::GetOpcodeLoadAddress (lldb::addr_t load_addr, AddressClass addr_class) const; All necessary lldb_private::Address functions now use the target versions so changes should only need to happen in one place if anything needs updating. Fixed up a lot of places that were calling : addr_t Address::GetLoadAddress(Target*); to call the Address::GetCallableLoadAddress() or Address::GetOpcodeLoadAddress() as needed. There were many places in the breakpoint code where things could go wrong for ARM if these weren't used. llvm-svn: 131878
* Added functions to lldb_private::Address to set an address from a load addressGreg Clayton2011-05-222-55/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and set the address as an opcode address or as a callable address. This is needed in various places in the thread plans to make sure that addresses that might be found in symbols or runtime might already have extra bits set (ARM/Thumb). The new functions are: bool Address::SetCallableLoadAddress (lldb::addr_t load_addr, Target *target); bool Address::SetOpcodeLoadAddress (lldb::addr_t load_addr, Target *target); SetCallableLoadAddress will initialize a section offset address if it can, and if so it might possibly set some bits in the address to make the address callable (bit zero might get set for ARM for Thumb functions). SetOpcodeLoadAddress will initialize a section offset address using the specified target and it will strip any special address bits if needed depending on the target. Fixed the ABIMacOSX_arm::GetArgumentValues() function to require arguments 1-4 to be in the needed registers (previously this would incorrectly fallback to the stack) and return false if unable to get the register values. The function was also modified to first look for the generic argument registers and then fall back to finding the registers by name. Fixed the objective trampoline handler to use the new Address::SetOpcodeLoadAddress function when needed to avoid address mismatches when trying to complete steps into objective C methods. Make similar fixes inside the AppleThreadPlanStepThroughObjCTrampoline::ShouldStop() function. Modified ProcessGDBRemote::BuildDynamicRegisterInfo(...) to be able to deal with the new generic argument registers. Modified RNBRemote::HandlePacket_qRegisterInfo() to handle the new generic argument registers on the debugserver side. Modified DNBArchMachARM::NumSupportedHardwareBreakpoints() to be able to detect how many hardware breakpoint registers there are using a darwin sysctl. Did the same for hardware watchpoints in DNBArchMachARM::NumSupportedHardwareWatchpoints(). llvm-svn: 131834
* Added generic register numbers for simple ABI argument registers and definedGreg Clayton2011-05-153-15/+24
| | | | | | | | | | | | | | | | | the appropriate registers for arm and x86_64. The register names for the arguments that are the size of a pointer or less are all named "arg1", "arg2", etc. This allows you to read these registers by name: (lldb) register read arg1 arg2 arg3 ... You can also now specify you want to see alternate register names when executing the read register command: (lldb) register read --alternate (lldb) register read -A llvm-svn: 131376
* Change an unconditional log to a conditional one.Jim Ingham2011-05-091-2/+2
| | | | llvm-svn: 131079
* Fixed not being able to launch the i386 slice of a universal binary by addingGreg Clayton2011-05-082-0/+12
| | | | | | | | a new "QLaunchArch:<arch-name>" where <arch-name> is the architecture name. This allows us to remotely launch a debugserver and then set the architecture for the binary we will launch. llvm-svn: 131064
* Added new OptionGroup classes for UInt64, UUID, File and Boolean values.Greg Clayton2011-05-037-2/+10
| | | | | | | | | | | | | | | | | | | | | 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
* Moved the execution context that was in the Debugger intoGreg Clayton2011-04-124-59/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the CommandInterpreter where it was always being used. Make sure that Modules can track their object file offsets correctly to allow opening of sub object files (like the "__commpage" on darwin). Modified the Platforms to be able to launch processes. The first part of this move is the platform soon will become the entity that launches your program and when it does, it uses a new ProcessLaunchInfo class which encapsulates all process launching settings. This simplifies the internal APIs needed for launching. I want to slowly phase out process launching from the process classes, so for now we can still launch just as we used to, but eventually the platform is the object that should do the launching. Modified the Host::LaunchProcess in the MacOSX Host.mm to correctly be able to launch processes with all of the new eLaunchFlag settings. Modified any code that was manually launching processes to use the Host::LaunchProcess functions. Fixed an issue where lldb_private::Args had implicitly defined copy constructors that could do the wrong thing. This has now been fixed by adding an appropriate copy constructor and assignment operator. Make sure we don't add empty ModuleSP entries to a module list. Fixed the commpage module creation on MacOSX, but we still need to train the MacOSX dynamic loader to not get rid of it when it doesn't have an entry in the all image infos. Abstracted many more calls from in ProcessGDBRemote down into the GDBRemoteCommunicationClient subclass to make the classes cleaner and more efficient. Fixed the default iOS ARM register context to be correct and also added support for targets that don't support the qThreadStopInfo packet by selecting the current thread (only if needed) and then sending a stop reply packet. Debugserver can now start up with a --unix-socket (-u for short) and can then bind to port zero and send the port it bound to to a listening process on the other end. This allows the GDB remote platform to spawn new GDB server instances (debugserver) to allow platform debugging. llvm-svn: 129351
* Get rid of LONG_LONG_MAX and ULONG_LONG_MAX, and use LLONG_MAX and ULLONG_MAXGreg Clayton2011-04-011-1/+1
| | | | | | respectively. llvm-svn: 128720
* Added the ability to get a broadcaster event name for a given broadcasterGreg Clayton2011-04-013-0/+56
| | | | | | | | | | | | | | event. Modified the ProcessInfo structure to contain all process arguments. Using the new function calls on MacOSX allows us to see the full process name, not just the first 16 characters. Added a new platform command: "platform process info <pid> [<pid> <pid> ...]" that can be used to get detailed information for a process including all arguments, user and group info and more. llvm-svn: 128694
* Many improvements to the Platform base class and subclasses. The base PlatformGreg Clayton2011-03-306-53/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | class now implements the Host functionality for a lot of things that make sense by default so that subclasses can check: int PlatformSubclass::Foo () { if (IsHost()) return Platform::Foo (); // Let the platform base class do the host specific stuff // Platform subclass specific code... int result = ... return result; } Added new functions to the platform: virtual const char *Platform::GetUserName (uint32_t uid); virtual const char *Platform::GetGroupName (uint32_t gid); The user and group names are cached locally so that remote platforms can avoid sending packets multiple times to resolve this information. Added the parent process ID to the ProcessInfo class. Added a new ProcessInfoMatch class which helps us to match processes up and changed the Host layer over to using this new class. The new class allows us to search for processs: 1 - by name (equal to, starts with, ends with, contains, and regex) 2 - by pid 3 - And further check for parent pid == value, uid == value, gid == value, euid == value, egid == value, arch == value, parent == value. This is all hookup up to the "platform process list" command which required adding dumping routines to dump process information. If the Host class implements the process lookup routines, you can now lists processes on your local machine: machine1.foo.com % lldb (lldb) platform process list PID PARENT USER GROUP EFF USER EFF GROUP TRIPLE NAME ====== ====== ========== ========== ========== ========== ======================== ============================ 99538 1 username usergroup username usergroup x86_64-apple-darwin FileMerge 94943 1 username usergroup username usergroup x86_64-apple-darwin mdworker 94852 244 username usergroup username usergroup x86_64-apple-darwin Safari 94727 244 username usergroup username usergroup x86_64-apple-darwin Xcode 92742 92710 username usergroup username usergroup i386-apple-darwin debugserver This of course also works remotely with the lldb-platform: machine1.foo.com % lldb-platform --listen 1234 machine2.foo.com % lldb (lldb) platform create remote-macosx Platform: remote-macosx Connected: no (lldb) platform connect connect://localhost:1444 Platform: remote-macosx Triple: x86_64-apple-darwin OS Version: 10.6.7 (10J869) Kernel: Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386 Hostname: machine1.foo.com Connected: yes (lldb) platform process list PID PARENT USER GROUP EFF USER EFF GROUP TRIPLE NAME ====== ====== ========== ========== ========== ========== ======================== ============================ 99556 244 username usergroup username usergroup x86_64-apple-darwin trustevaluation 99548 65539 username usergroup username usergroup x86_64-apple-darwin lldb 99538 1 username usergroup username usergroup x86_64-apple-darwin FileMerge 94943 1 username usergroup username usergroup x86_64-apple-darwin mdworker 94852 244 username usergroup username usergroup x86_64-apple-darwin Safari The lldb-platform implements everything with the Host:: layer, so this should "just work" for linux. I will probably be adding more stuff to the Host layer for launching processes and attaching to processes so that this support should eventually just work as well. Modified the target to be able to be created with an architecture that differs from the main executable. This is needed for iOS debugging since we can have an "armv6" binary which can run on an "armv7" machine, so we want to be able to do: % lldb (lldb) platform create remote-ios (lldb) file --arch armv7 a.out Where "a.out" is an armv6 executable. The platform then can correctly decide to open all "armv7" images for all dependent shared libraries. Modified the disassembly to show the current PC value. Example output: (lldb) disassemble --frame a.out`main: 0x1eb7: pushl %ebp 0x1eb8: movl %esp, %ebp 0x1eba: pushl %ebx 0x1ebb: subl $20, %esp 0x1ebe: calll 0x1ec3 ; main + 12 at test.c:18 0x1ec3: popl %ebx -> 0x1ec4: calll 0x1f12 ; getpid 0x1ec9: movl %eax, 4(%esp) 0x1ecd: leal 199(%ebx), %eax 0x1ed3: movl %eax, (%esp) 0x1ed6: calll 0x1f18 ; printf 0x1edb: leal 213(%ebx), %eax 0x1ee1: movl %eax, (%esp) 0x1ee4: calll 0x1f1e ; puts 0x1ee9: calll 0x1f0c ; getchar 0x1eee: movl $20, (%esp) 0x1ef5: calll 0x1e6a ; sleep_loop at test.c:6 0x1efa: movl $12, %eax 0x1eff: addl $20, %esp 0x1f02: popl %ebx 0x1f03: leave 0x1f04: ret This can be handy when dealing with the new --line options that was recently added: (lldb) disassemble --line a.out`main + 13 at test.c:19 18 { -> 19 printf("Process: %i\n\n", getpid()); 20 puts("Press any key to continue..."); getchar(); -> 0x1ec4: calll 0x1f12 ; getpid 0x1ec9: movl %eax, 4(%esp) 0x1ecd: leal 199(%ebx), %eax 0x1ed3: movl %eax, (%esp) 0x1ed6: calll 0x1f18 ; printf Modified the ModuleList to have a lookup based solely on a UUID. Since the UUID is typically the MD5 checksum of a binary image, there is no need to give the path and architecture when searching for a pre-existing image in an image list. Now that we support remote debugging a bit better, our lldb_private::Module needs to be able to track what the original path for file was as the platform knows it, as well as where the file is locally. The module has the two following functions to retrieve both paths: const FileSpec &Module::GetFileSpec () const; const FileSpec &Module::GetPlatformFileSpec () const; llvm-svn: 128563
* Added AVX support to the Intel portion of debugserver. AVXSean Callanan2011-03-227-346/+1515
| | | | | | | autodetection is not yet implemented, but the structures and register reading/writing code are there. llvm-svn: 128111
* Abtracted the innards of lldb-core away from the SB interface. There was someGreg Clayton2011-03-221-72/+0
| | | | | | | | | | | | | | | | overlap in the SWIG integration which has now been fixed by introducing callbacks for initializing SWIG for each language (python only right now). There was also a breakpoint command callback that called into SWIG which has been abtracted into a callback to avoid cross over as well. Added a new binary: lldb-platform This will be the start of the remote platform that will use as much of the Host functionality to do its job so it should just work on all platforms. It is pretty hollowed out for now, but soon it will implement a platform using the GDB remote packets as the transport. llvm-svn: 128053
* Split all of the core of LLDB.framework/lldb.so into aGreg Clayton2011-03-203-11/+187
| | | | | | | | | | | | | | | | | | | | static archive that can be linked against. LLDB.framework/lldb.so exports a very controlled API. Splitting the API into a static library allows other tools (debugserver for now) to use the power of the LLDB debugger core, yet not export it as its API is not portable or maintainable. The Host layer and many of the other internal only APIs can now be statically linked against. Now LLDB.framework/lldb.so links against "liblldb-core.a" instead of compiling the .o files only for the shared library. This fix is only for compiling with Xcode as the Makefile based build already does this. The Xcode projecdt compiler has been changed to LLVM. Anyone using Xcode 3 will need to manually change the compiler back to GCC 4.2, or update to Xcode 4. llvm-svn: 127963
* If the user sets a working directory path using "process launch -w <path>", ↵Johnny Chen2011-02-261-1/+3
| | | | | | | | | | | honor that dir path; otherwise, use the thing the debugserver is started with. Fixed rdar://problem/9056462 The process launch flag '-w' for setting the current working directory not working? llvm-svn: 126537
* Fixed CommandReturnObject::SetImmediateErrorFile() to set the correct stream.Greg Clayton2011-02-249-81/+235
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* The DynamicLoader plug-in instance now lives up in lldb_private::Process whereGreg Clayton2011-02-161-0/+4
| | | | | | | | | | | | | | | | | it should live and the lldb_private::Process takes care of managing the auto pointer to the dynamic loader instance. Also, now that the ArchSpec contains the target triple, we are able to correctly set the Target architecture in DidLaunch/DidAttach in the subclasses, and then the lldb_private::Process will find the dynamic loader plug-in by letting the dynamic loader plug-ins inspect the arch/triple in the target. So now the ProcessGDBRemote plug-in is another step closer to be purely process/platform agnostic. I updated the ProcessMacOSX and the ProcessLinux plug-ins accordingly. llvm-svn: 125650
* Made lldb_private::ArchSpec contain much more than just an architecture. ItGreg Clayton2011-02-151-1/+4
| | | | | | | | | | now, in addition to cpu type/subtype and architecture flavor, contains: - byte order (big endian, little endian) - address size in bytes - llvm::Triple for true target triple support and for more powerful plug-in selection. llvm-svn: 125602
* Added the ability to detect which vCont packets (using the "vCont?") packetGreg Clayton2011-02-121-8/+5
| | | | | | | | | are supported by the remote GDB target. We can also now deal with the lack of vCont support and send packets that the remote GDB stub can use. We also error out of the continue if LLDB tries to do something too complex when vCont isn't supported. llvm-svn: 125433
* Rework the RunThreadPlan event handling to use Event Hijacking not stopping ↵Jim Ingham2011-02-081-3/+5
| | | | | | the event thread. Also clarify the logic of the function. llvm-svn: 125083
* The thread_info changes over the life of the thread, so you can't get it ↵Jim Ingham2011-01-281-4/+4
| | | | | | once and cache it, you have to fetch it every time you want to use it. llvm-svn: 124463
* Finally tracked down the racy condition that would hose up our debugGreg Clayton2011-01-272-60/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sessions: When continue packet has been sent and an interrupt packet was quickly sent, it would get read at the same time: $c#00\x03 There was an error where the packet end index was always being computed incorrectly by debugserver, but it wouldn't matter if there weren't extra bytes on the end (the hex \x03 interrupt byte in this case). The first '$' last 3 bytes of the data in the packet buffer were being trimmed (trying to trim the '#' + checksum (#XX)) which made: c# And this would then be passed to the handle routine for the 'c' packet which would see an extra character at the end and assume it was going to be in the form c[addr] where "[addr]" was a hex address to resume at and this would result in a malformed packet response. This is now fixed and everything works great. Another issue was issuing async packets correctly by doing correct handshakes between the thread that wants to send the async packet, and the thread that is tracking the current run. Added a write lock to the communication class as well to make sure you never get two threads trying to write data at the same time. This wasn't happening, but it is a good idea to make sure it doesn't. llvm-svn: 124369
* Trivial comment fix.Johnny Chen2011-01-251-2/+2
| | | | llvm-svn: 124195
* Reverting recent thread resume changes as it was causing testing issues.Greg Clayton2011-01-252-117/+60
| | | | | | We will need to try again soon, but this change was causing instability. llvm-svn: 124180
* When we are stepping a thread, force it to resume ALL the way to 0. And of ↵Jim Ingham2011-01-252-60/+117
| | | | | | | | course, when we stop if we undid some user provided suspends, we need to re-do the suspends. llvm-svn: 124178
* One more thing... Resume any threads that we discover were created while we ↵Greg Clayton2011-01-241-5/+21
| | | | | | | | | stop as they may be in sensitive areas and we set breakpoints on the thread creation routines if we are running expressions, so the threads should quickly get to a safe spot. llvm-svn: 124115
* Discover new threads right before we continue a process since libdispatch hasGreg Clayton2011-01-241-13/+14
| | | | | | been known to make threads for us while our process/task is suspended. llvm-svn: 124111
* Added logging for threads that are spawned while we stop. We log theirGreg Clayton2011-01-242-2/+25
| | | | | | existence if the "thread" log bit is enabled right before we resume. llvm-svn: 124110
* Linebuffer the log file.Jim Ingham2011-01-241-1/+5
| | | | llvm-svn: 124103
* Added a new variant of SBTarget::Launch() that deprectates the old one thatGreg Clayton2011-01-233-20/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud