summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Communication.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Added the ability to get a broadcaster event name for a given broadcasterGreg Clayton2011-04-011-0/+6
| | | | | | | | | | | | | | 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
* Did a lot more work on abtracting and organizing the platforms. Greg Clayton2011-03-241-0/+3
| | | | | | | | | | | | | | | | | | | | On Mac OS X we now have 3 platforms: PlatformDarwin - must be subclassed to fill in the missing pure virtual funcs but this implements all the common functionality between remote-macosx and remote-ios. It also allows for another platform to be used (remote-gdb-server for now) when doing remote connections. Keeping this pluggable will allow for flexibility. PlatformMacOSX - Now implements both local and remote macosx desktop platforms. PlatformRemoteiOS - Remote only iOS that knows how to locate SDK files in the cached SDK locations on the host. A new agnostic platform has been created: PlatformRemoteGDBServer - this implements the platform using the GDB remote protocol and uses the built in lldb_private::Host static functions to implement many queries. llvm-svn: 128193
* Split all of the core of LLDB.framework/lldb.so into aGreg Clayton2011-03-201-0/+1
| | | | | | | | | | | | | | | | | | | | 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
* Patch that allows for thread_t to be something more complex than anGreg Clayton2011-02-081-3/+3
| | | | | | integer. Modified patch from Kirk Beitz. llvm-svn: 125067
* Fix the ctr-D and end-of-file stuff.Caroline Tice2011-02-031-1/+12
| | | | llvm-svn: 124810
* Endian patch from Kirk Beitz that allows better cross platform building.Greg Clayton2011-02-011-0/+1
| | | | llvm-svn: 124643
* Finally tracked down the racy condition that would hose up our debugGreg Clayton2011-01-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Do not pass an invalid thread to Thread{Cancel,Join}.Stephen Wilson2011-01-121-4/+5
| | | | | | | | | | | | | A race condition exists between StopReadThread and the reader thread proper. When StopReadThread sets m_read_thread_enabled to false the reader thread can terminate and set m_read_thread to LLDB_INVALID_HOST_THREAD on exit. Thus calls to ThreadCancel or ThreadJoin in StopReadThread can be passed an invalid handle. This patch removes the race by using m_read_thread_enabled as the flag thru which the reader thread can notify the parent thread of early/abnormal termination. llvm-svn: 123309
* Modified LLDB expressions to not have to JIT and run code just to see variableGreg Clayton2010-12-141-25/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | values or persistent expression variables. Now if an expression consists of a value that is a child of a variable, or of a persistent variable only, we will create a value object for it and make a ValueObjectConstResult from it to freeze the value (for program variables only, not persistent variables) and avoid running JITed code. For everything else we still parse up and JIT code and run it in the inferior. There was also a lot of clean up in the expression code. I made the ClangExpressionVariables be stored in collections of shared pointers instead of in collections of objects. This will help stop a lot of copy constructors on these large objects and also cleans up the code considerably. The persistent clang expression variables were moved over to the Target to ensure they persist across process executions. Added the ability for lldb_private::Target objects to evaluate expressions. We want to evaluate expressions at the target level in case we aren't running yet, or we have just completed running. We still want to be able to access the persistent expression variables between runs, and also evaluate constant expressions. Added extra logging to the dynamic loader plug-in for MacOSX. ModuleList objects can now dump their contents with the UUID, arch and full paths being logged with appropriate prefix values. Thread hardened the Communication class a bit by making the connection auto_ptr member into a shared pointer member and then making a local copy of the shared pointer in each method that uses it to make sure another thread can't nuke the connection object while it is being used by another thread. Added a new file to the lldb/test/load_unload test that causes the test a.out file to link to the libd.dylib file all the time. This will allow us to test using the DYLD_LIBRARY_PATH environment variable after moving libd.dylib somewhere else. llvm-svn: 121745
* Fixed a multi-threaded race condition that could happen when communication ↵Greg Clayton2010-12-121-1/+11
| | | | | | classes are shutting down. We currently don't protect communication connection classes against multi-threaded access. The connection is stored in the lldb_private::Communication.m_connection_ap auto_ptr member. We either need to add protections when accessing this class or not let anything racy occur. With this fix, we are doing the latter. llvm-svn: 121647
* Added the ability to dump sections to a certain depth (for when sectionsGreg Clayton2010-12-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | have children sections). Modified SectionLoadList to do it's own multi-threaded protected on its map. The ThreadSafeSTLMap class was difficult to deal with and wasn't providing much utility, it was only getting in the way. Make sure when the communication read thread is about to exit, it clears the thread in the main class. Fixed the ModuleList to correctly ignore architectures and UUIDs if they aren't valid when searching for a matching module. If we specified a file with no arch, and then modified the file and loaded it again, it would not match on subsequent searches if the arch was invalid since it would compare an invalid architecture to the one that was found or selected within the shared library or executable. This was causing stale modules to stay around in the global module list when they should have been removed. Removed deprecated functions from the DynamicLoaderMacOSXDYLD class. Modified "ProcessGDBRemote::IsAlive" to check if we are connected to a gdb server and also make sure our process hasn't exited. llvm-svn: 121236
* More reverting of the EOF stuff as the API was changed which we don't want toGreg Clayton2010-12-041-8/+2
| | | | | | | | | | do. Closing on EOF is an option that can be set on the lldb_private::Communication or the lldb::SBCommunication objects after they are created. Of course the EOF support isn't hooked up, so they don't do anything at the moment, but they are left in so when the code is fixed, it will be easy to get working again. llvm-svn: 120885
* Reverted the close on EOF stuff again as it was crashing Xcode.Greg Clayton2010-12-041-10/+2
| | | | llvm-svn: 120883
* Add proper EOF handling to Communication & Connection classes:Caroline Tice2010-12-021-4/+18
| | | | | | | | | | Add bool member to Communication class indicating whether the Connection should be closed on receiving an EOF or not. Update the Connection read to return an EOF status when appropriate. Modify the Communication class to pass the EOF along or not, and to close the Connection or not, as appropriate. llvm-svn: 120723
* Revert the End of file stuff that was added as it was causing read threadsGreg Clayton2010-11-201-6/+2
| | | | | | | to hang around and take a ton of CPU time. Caroline will fix this when she gets back from vacation. llvm-svn: 119877
* Add the ability to catch and do the right thing with Interrupts (often ↵Caroline Tice2010-11-191-3/+8
| | | | | | | | control-c) and end-of-file (often control-d). llvm-svn: 119837
* Modified all logging calls to hand out shared pointers to make sure weGreg Clayton2010-11-061-2/+3
| | | | | | | | | | | don't crash if we disable logging when some code already has a copy of the logger. Prior to this fix, logs were handed out as pointers and if they were held onto while a log got disabled, then it could cause a crash. Now all logs are handed out as shared pointers so this problem shouldn't happen anymore. We are also using our new shared pointers that put the shared pointer count and the object into the same allocation for a tad better performance. llvm-svn: 118319
* Add the ability to disable individual log categories, ratherCaroline Tice2010-10-291-0/+1
| | | | | | | | | than just the entire log channel. Add checks, where appropriate, to make sure a log channel/category has not been disabled before attempting to write to it. llvm-svn: 117715
* First pass at adding logging capabilities for the API functions. At the momentCaroline Tice2010-10-261-0/+17
| | | | | | | | | | | | | | | | | | it logs the function calls, their arguments and the return values. This is not complete or polished, but I am committing it now, at the request of someone who really wants to use it, even though it's not really done. It currently does not attempt to log all the functions, just the most important ones. I will be making further adjustments to the API logging code over the next few days/weeks. (Suggestions for improvements are welcome). Update the Python build scripts to re-build the swig C++ file whenever the python-extensions.swig file is modified. Correct the help for 'log enable' command (give it the correct number & type of arguments). llvm-svn: 117349
* Fixed a race condition that was sometimes stopping our command line Greg Clayton2010-09-151-1/+3
| | | | | | | | | | | | interpreter from working. The communication read thread could startup and immediately exit if m_read_thread_enabled was checked in the thread function before it was set by the thread that spawns the read thread. Now m_read_thread_enabled is set to true prior to spawning the read thread to avoid this issue. Hopefully this will clear up the sporatic failures in our test suite. llvm-svn: 113947
* Remove a premature invalidation of a threads pthread_t handle, thus avoidingGreg Clayton2010-07-231-3/+3
| | | | | | | | | a segfault when calling pthread_cancel. Also, sets m_read_thread_enabled if the thread is actually spawned. Patch from Stephen Wilson. llvm-svn: 109227
* Remove use of STL collection class use of the "data()" method since it isn'tGreg Clayton2010-07-201-1/+1
| | | | | | | part of C++'98. Most of these were "std::vector<T>::data()" and "std::string::data()". llvm-svn: 108957
* Misc warning fixes.Eli Friedman2010-07-091-4/+4
| | | | llvm-svn: 108029
* Add missing includes.Eli Friedman2010-06-091-0/+1
| | | | llvm-svn: 105712
* Initial checkin of lldb code from internal Apple repo.Chris Lattner2010-06-081-0/+363
llvm-svn: 105619
OpenPOWER on IntegriCloud