| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Reviewed by: Greg Clayton
Differential Revision: http://reviews.llvm.org/D5417
llvm-svn: 218325
|
|
|
|
|
|
| |
data instead of nothing or unprintable characters. This can easily be extended for other packets that have binary data.
llvm-svn: 218000
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
debugging.
This patch accepts environment variables of the form:
LLDB_DEBUGSERVER_EXTRA_ARG_n
where n starts with 1, and may continue nearly indefinitely (up through std::numeric_limits<uint32_t>::max()).
The code loops around, starting with 1, until it doesn't find one of the environment variables. For each one it does find defined, it appends the environment variable's contents to the end of the debugserver/llgs startup command line issued when the stub is started for local debugging.
I am using this to add arbitrary startup commands to the llgs command line for turning on additional logging. For example:
export LLDB_DEBUGSERVER_EXTRA_ARG_1="-c"
export LLDB_DEBUGSERVER_EXTRA_ARG_2="log enable -f /tmp/llgs_packets.log gdb-remote packets"
export LLDB_DEBUGSERVER_EXTRA_ARG_3="-c"
export LLDB_DEBUGSERVER_EXTRA_ARG_4="log enable -f /tmp/llgs_process.log lldb process"
llvm-svn: 216745
|
|
|
|
| |
llvm-svn: 216247
|
|
|
|
|
|
|
| |
HostInfo et al changes from Zachary. Changes suggested by Zachary
- fixes the problems I was seeing.
llvm-svn: 216243
|
|
|
|
|
|
|
|
| |
This continues the effort to get Host code moved over to HostInfo,
and removes many more instances of preprocessor defines along the
way.
llvm-svn: 216195
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
More specifically, this change can be summarized as follows:
1) Makes an lldbHostPosix library which contains code common to
all posix platforms.
2) Creates Host/FileSystem.h which defines a common FileSystem
interface.
3) Implements FileSystem.h in Host/windows and Host/posix.
4) Creates Host/FileCache.h, implemented in Host/common, which
defines a class useful for storing handles to open files needed
by the debugger.
Differential Revision: http://reviews.llvm.org/D4889
llvm-svn: 215775
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch moves the logic of many common socket operations into
its own class lldb_private::Socket. It then modifies the
ConnectionFileDescriptor class, and a few users of that class,
to use this new Socket class instead of hardcoding socket logic
directly.
Finally, this patch creates a common interface called IOObject for
any objects that support reading and writing, so that endpoints
such as sockets and files can be treated the same.
Differential Revision: http://reviews.llvm.org/D4641
Reviewed by: Todd Fiala, Greg Clayton
llvm-svn: 214984
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change enables lldb-platform for Linux. In addition, it does the following:
* fixes Host::GetLLDBPath() to work on Linux/*BSD for ePathTypeSupportExecutableDir-relative paths.
* adds more logging and comments around lldb-platform startup and remote lldb-platform usage.
* refactors lldb-platform remote-* support for Darwin and Linux into PlatformPOSIX. This, in theory, is the bulk of what is needed for *BSD to make remote connections to lldb-platform as well (although I haven't tested that yet). FreeBSD can make similar changes to their Platform* as was made here for PlatformLinux to pick up the rest of the bits.
* teaches GDBRemoteCommunication to use lldb-gdbserver for non-Apple hosts.
llvm-svn: 213707
|
|
|
|
|
|
| |
memory read packet ('x') by printing out the binary data correctly using only printable characters and removing the 0x7d escapes so the memory is readable in the packet output.
llvm-svn: 211400
|
|
|
|
|
|
|
|
|
|
|
|
| |
- CTRL+C wasn't clearing the command in lldb
- CTRL+C doesn't work in python macros in lldb
- Ctrl+C no longer interrupts the running process that you attach to
<rdar://problem/15949205>
<rdar://problem/16778652>
<rdar://problem/16774411>
llvm-svn: 207816
|
|
|
|
|
|
|
| |
This allows to use some code for mingw which was previously only
used for MSVC.
llvm-svn: 203651
|
|
|
|
|
|
|
|
| |
launch debugserver as root.
<rdar://problem/15669788>
llvm-svn: 202536
|
|
|
|
|
|
|
|
|
|
| |
MacOSX for "localhost".
Changed all "localhost" to "127.0.0.1" to prevent potentially long name lookups.
<rdar://problem/16154630>
llvm-svn: 202424
|
|
|
|
|
|
|
| |
We were not properly handling the escape character 0x7d ('}') in responses
from gdbserver which used the binary protocol.
llvm-svn: 202062
|
|
|
|
| |
llvm-svn: 201027
|
|
|
|
|
|
|
|
|
|
| |
GDBRemoteCommunication::StartDebugserverProcess
right after the space for it is allocated on the stack, instead of trying
to initialize it in all the different places in this method. It's too easy
for another uninitialized code path to sneak in as it is written right now.
llvm-svn: 200066
|
|
|
|
|
|
|
|
| |
it later in GDBRemoteCommunication::StartDebugserverProcess and report
an error.
<rdar://problem/15820813>
llvm-svn: 200047
|
|
|
|
| |
llvm-svn: 199111
|
|
|
|
|
|
|
|
| |
iOS. The sandboxing is not letting debugserver reverse connect back to lldb.
<rdar://problem/15789865>
llvm-svn: 198963
|
|
|
|
|
|
| |
debugserver's launch info was cleared unnecessarily. It has important user ID set. Reviewed by Greg Clayton.
llvm-svn: 197182
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GDBRemoteCommuncation::PacketResult enum for all packet sends/receives.
<rdar://problem/15600045>
Due to other recent changes, all connections to GDB servers that didn't support the "QStartNoAckMode" packet would cause us to fail to attach to the remote GDB server.
The problem was that SendPacket* and WaitForResponse* packets would return a size_t indicating the number of bytes sent/received. The other issue was WaitForResponse* packets would strip the leading '$' and the trailing "#CC" (checksum) bytes, so the unimplemented response packet of "$#00" would get stripped and the WaitForResponse* packets would return 0.
These new error codes give us flexibility to to more intelligent things in response to what is returned.
llvm-svn: 196610
|
|
|
|
|
|
| |
systems.
llvm-svn: 196586
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--reverse-connect option so that debugserver actually connects back to LLDB instead of LLDB connecting to debugserver.
This gets rid of our hacky "get_random_port()" which would grab a random port and tell debugserver to open that port. Now LLDB creates, binds, listens and accepts a connection by binding to port zero and sending the correctly bound port down as the host:port to connect back to.
Fixed the "ConnectionFileDescriptor" to be able to correctly listen for connections from a specified host, localhost, or any host. Prior to this fix "listen://" only accepted the following format:
listen://<port>
But now it can accept:
listen://<port> // Listen for connection from localhost on port <port>
listen://<host>:<port> // Listen for connection from <host> and <port>
listen://*:<port> // Listen for connection from any host on port <port>
llvm-svn: 196547
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
macros.
llvm-svn: 193260
|
|
|
|
| |
llvm-svn: 193159
|
|
|
|
| |
llvm-svn: 189484
|
|
|
|
|
|
| |
The change was taken from a patch by Virgile Bello.
llvm-svn: 189470
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Patch from Abid, Hafiz.
llvm-svn: 188801
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
- use macros from inttypes.h for format strings instead of OS-specific types
Patch from Matt Kopec!
llvm-svn: 168945
|
|
|
|
|
|
| |
Some platforms don't support this modification.
llvm-svn: 164148
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
it, rather
than being given the pthread_mutex_t from the Mutex and locks that. That allows us to
track ownership of the Mutex better.
Used this to switch the LLDB_CONFIGURATION_DEBUG enabled assert when we can't get the
gdb-remote sequence mutex to assert when the thread that had the mutex releases it. This
is generally more useful information than saying just who failed to get it (since the
code that had it locked often had released it by the time the assert fired.)
llvm-svn: 158240
|
|
|
|
| |
llvm-svn: 157869
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixed a case where multiple threads can be asking to send a packet to the GDB server and one of three things will happen:
1 - everything works
2 - one thread will fail to send the packet due to not being able to get the sequence mutex
3 - one thread will try and interrupt the other packet sending and fail and not send the packet
Now the flow is a bit different. Prior to this fix we did:
if (try_get_sequence_mutex()) {
send_packet()
return success;
} else {
if (async_ok) {
interrupt()
send_packet()
resume()
return success;
}
}
return fail
The issue is that the call to "try_get_sequence_mutex()" could fail if another thread was sending a packet and could cause us to just not send the packet and an error would be returned.
What we really want is to try and get the sequence mutex, and if this succeeds, send the packet. Else check if we are running and if we are, do what we used to do. The big difference is when we aren't running, we wait for the sequence mutex so we don't drop packets. Pseudo code is:
if (try_get_sequence_mutex()) {
// Safe to send the packet right away
send_packet()
return success;
} else {
if (running) {
// We are running, interrupt and send async packet if ok to do so,
// else it is ok to fail
if (async_ok) {
interrupt()
send_packet()
resume()
return success;
}
}
else {
// Not running, wait for the sequence mutex so we don't drop packets
get_sequence_mutex()
send_packet()
return success;
}
}
return fail
llvm-svn: 157751
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
No one was using it and Locker(pthread_mutex_t *) immediately asserts for
pthread_mutex_t's that don't come from a Mutex anyway. Rather than try to make
that work, we should maintain the Mutex abstraction and not pass around the
platform implementation...
Make Mutex::Locker::Lock take a Mutex & or a Mutex *, and remove the constructor
taking a pthread_mutex_t *. You no longer need to call Mutex::GetMutex to pass
your mutex to a Locker (you can't in fact, since I made it private.)
llvm-svn: 156221
|
|
|
|
|
|
|
|
|
|
| |
now always dumps to a lldb_private::Stream.
Enable logging the packet history when registers fail to read due to not getting the sequence mutex if "--verbose" is enabled on the log channel for the "gdb-remote" log category.
This will help us track down some issues.
llvm-svn: 154704
|
|
|
|
|
|
|
|
| |
plug-in.
Also fixed the ProcessLinux, ProcessPOSIX and ProcessFreeBSD to have the correct UpdateThreadList() prototype.
llvm-svn: 154603
|
|
|
|
|
|
|
|
| |
Cleaned up the Mutex::Locker and the ReadWriteLock classes a bit.
Also cleaned up the GDBRemoteCommunication class to not have so many packet functions. Used the "NoLock" versions of send/receive packet functions when possible for a bit of performance.
llvm-svn: 154458
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
safer.
The current ProcessGDBRemote function that updates the threads could end up with an empty list if any other thread had the sequence mutex. We now don't clear the thread list when we can't access it, and we also have changed how lldb_private::Process handles the return code from the:
virtual bool
Process::UpdateThreadList (lldb_private::ThreadList &old_thread_list,
lldb_private::ThreadList &new_thread_list) = 0;
A bool is now returned to indicate if the list was actually updated or not and the lldb_private::Process class will only update the stop ID of the validity of the thread list if "true" is returned.
The ProcessGDBRemote also got an extra assertion that will hopefully assert when running debug builds so we can find the source of this issue.
llvm-svn: 154365
|
|
|
|
|
|
| |
always remembering the last 512 packets that were sent/received. These packets get dumped if logging gets enabled, or when the new expr lldb::DumpProcessGDBRemotePacketHistory (void *process, const char *log_file_path) global function is called.
llvm-svn: 154354
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
lldb_private::Error objects the rules are:
- short strings that don't start with a capitol letter unless the name is a
class or anything else that is always capitolized
- no trailing newline character
- should be one line if possible
Implemented a first pass at adding "--gdb-format" support to anything that
accepts format with optional size/count.
llvm-svn: 142999
|
|
|
|
|
|
|
|
| |
stdarg formats to use __attribute__ format so the compiler can flag
incorrect uses. Fix all incorrect uses. Most of these are innocuous,
a few were resulting in crashes.
llvm-svn: 140185
|
|
|
|
|
|
|
|
|
| |
status' before
invoking the Read(...) method to read in bytes. This seems to fix the infinite looping
I was seeing on SnowLeopard while running the test suite.
llvm-svn: 135461
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
variables prior to running your binary. Zero filled sections now get
section data correctly filled with zeroes when Target::ReadMemory
reads from the object file section data.
Added new option groups and option values for file lists. I still need
to hook up all of the options to "target variable" to allow more complete
introspection by file and shlib.
Added the ability for ValueObjectVariable objects to be created with
only the target as the execution context. This allows them to be read
from the object files through Target::ReadMemory(...).
Added a "virtual Module * GetModule()" function to the ValueObject
class. By default it will look to the parent variable object and
return its module. The module is needed when we have global variables
that have file addresses (virtual addresses that are specific to
module object files) and in turn allows global variables to be displayed
prior to running.
Removed all of the unused proxy object support that bit rotted in
lldb_private::Value.
Replaced a lot of places that used "FileSpec::Compare (lhs, rhs) == 0" code
with the more efficient "FileSpec::Equal (lhs, rhs)".
Improved logging in GDB remote plug-in.
llvm-svn: 134579
|
|
|
|
|
|
|
|
|
| |
a file or socket. We now make a getsockopt call to check if the fd is a socket.
Also, the previous logic in the GDB communication needs to watch for success
with an error so we can deal with EAGAIN and other normal "retry" error codes.
llvm-svn: 134359
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
_only_ in the resulting stream, not in the error objects (lldb_private::Error).
lldb_private::Error objects should always just have an error string with no
terminating newline characters or periods.
Fixed an issue with GDB remote packet detection that could end up deadlocking
if a full packet wasn't received in one chunk. Also modified the packet
checking function to properly toss one or more bytes when it detects bad
data.
llvm-svn: 134357
|