to the DoHalt down in ProcessGDBRemote. I also moved the functionality that
was in ProcessGDBRemote::DoHalt up into Process::Halt so not every class has
to implement a tricky halt/resume on the internal state thread. The
functionality is the same as it was before with two changes:
- when we eat the event we now just reuse the event we consume when the private
state thread is paused and set the interrupted bool on the event if needed
- we also properly update the Process::m_public_state with the state of the
event we consume.
Prior to this, if you issued a "process halt" it would eat the event, not
update the process state, and then produce a new event with the interrupted
bit set and send it. Anyone listening to the event would get the stopped event
with a process that whose state was set to "running".
Fixed debugserver to not have to be spawned with the architecture of the
inferior process. This worked fine for launching processes, but when attaching
to processes by name or pid without a file in lldb, it would fail.
Now debugserver can support multiple architectures for a native debug session
on the current host. This currently means i386 and x86_64 are supported in
the same binary and a x86_64 debugserver can attach to a i386 executable.
This change involved a lot of changes to make sure we dynamically detect the
correct registers for the inferior process.
llvm-svn: 119680
thread basic info state and not realize that a thread was already suspended
or if a thread was starting up and not ready to be displayed to the user
(in an uninterruptable state). If it is not user ready yet, we don't add it
to our list of threads that can be played with.
llvm-svn: 118866
pseudoterminal to pass to the inferior for the inferior's I/O
(to allow direct writing, rather than passing all the I/O around
via packets).
llvm-svn: 118308
ptrace thread update that was replying to the SIGSTOP was also causing the
process to not really be sigstop'd any more so then the call to ptrace
detach was failing, and when debugserver exited the attached process
was being killed. Now the ptrace thread update does not disturb the sigstop
state of the thread, so the detach works properly.
llvm-svn: 118018
all of the calls inlined in the header file for better performance.
Fixed the summary for C string types (array of chars (with any combo if
modifiers), and pointers to chars) work in all cases.
Fixed an issue where a forward declaration to a clang type could cause itself
to resolve itself more than once if, during the resolving of the type itself
it caused something to try and resolve itself again. We now remove the clang
type from the forward declaration map in the DWARF parser when we start to
resolve it and avoid this additional call. This should stop any duplicate
members from appearing and throwing all the alignment of structs, unions and
classes.
llvm-svn: 117437
but something is still killing our inferior.
Fixed an issue with darwin-debug where it wasn't passing all needed arguments
to the inferior.
Fixed a race condition with the attach to named process code.
llvm-svn: 116697
"vAttachName;<PROCNAME>" packet, and wait for a new process by name to launch
with the "vAttachWait;<PROCNAME>".
Fixed a few issues with attaching where if DoAttach() returned no error, yet
there was no valid process ID, we would deadlock waiting for an event that
would never happen.
Added a new "process launch" option "--tty" that will launch the process
in a new terminal if the Host layer supports the "Host::LaunchInNewTerminal(...)"
function. This currently works on MacOSX and will allow the debugging of
terminal applications that do complex operations with the terminal.
Cleaned up the output when the process resumes, stops and halts to be
consistent with the output format.
llvm-svn: 116693
static bool
Host::GetLLDBPath (lldb::PathType path_type, FileSpec &file_spec);
This will fill in "file_spec" with an appropriate path that is appropriate
for the current Host OS. MacOSX will return paths within the LLDB.framework,
and other unixes will return the paths they want. The current PathType
enums are:
typedef enum PathType
{
ePathTypeLLDBShlibDir, // The directory where the lldb.so (unix) or LLDB mach-o file in LLDB.framework (MacOSX) exists
ePathTypeSupportExecutableDir, // Find LLDB support executable directory (debugserver, etc)
ePathTypeHeaderDir, // Find LLDB header file directory
ePathTypePythonDir // Find Python modules (PYTHONPATH) directory
} PathType;
All places that were finding executables are and python paths are now updated
to use this Host call.
Added another new host call to launch the inferior in a terminal. This ability
will be very host specific and doesn't need to be supported on all systems.
MacOSX currently will create a new .command file and tell Terminal.app to open
the .command file. It also uses the new "darwin-debug" app which is a small
app that uses posix to exec (no fork) and stop at the entry point of the
program. The GDB remote plug-in is almost able launch a process and attach to
it, it currently will spawn the process, but it won't attach to it just yet.
This will let LLDB not have to share the terminal with another process and a
new terminal window will pop up when you launch. This won't get hooked up
until we work out all of the kinks. The new Host function is:
static lldb::pid_t
Host::LaunchInNewTerminal (
const char **argv, // argv[0] is executable
const char **envp,
const ArchSpec *arch_spec,
bool stop_at_entry,
bool disable_aslr);
Cleaned up FileSpec::GetPath to not use strncpy() as it was always zero
filling the entire path buffer.
Fixed an issue with the dynamic checker function where I missed a '$' prefix
that should have been added.
llvm-svn: 116690
suspended, we would call "int ::task_resume (task_t task);" as many times as
it took to resume the task which isn't what we want to do.
llvm-svn: 116674
ScriptInterpreterPython class and made a simple callback function that
ScriptInterpreterPython::BreakpointCallbackFunction() now calls so we don't
include any internal API stuff into the cpp file that is generated by SWIG.
Fixed a few build warnings in debugserver.
llvm-svn: 115926
Added the start of Host specific launch services, though it currently isn't
hookup up to anything. We want to be able to launch a process and use the
native launch services to launch an app like it would be launched by the
user double clicking on the app. We also eventually want to be able to run
a command line app in a newly spawned terminal to avoid terminal sharing.
Fixed an issue with the new DWARF forward type declaration stuff. A crasher
was found that was happening when trying to properly expand the forward
declarations.
llvm-svn: 115213
adding methods to C++ and objective C classes. In order to make methods, we
need the function prototype which means we need the arguments. Parsing these
could cause a circular reference that caused an assertion.
Added a new typedef for the clang opaque types which are just void pointers:
lldb::clang_type_t. This appears in lldb-types.h.
This was fixed by enabling struct, union, class, and enum types to only get
a forward declaration when we make the clang opaque qual type for these
types. When they need to actually be resolved, lldb_private::Type will call
a new function in the SymbolFile protocol to resolve a clang type when it is
not fully defined (clang::TagDecl::getDefinition() returns NULL). This allows
us to be a lot more lazy when parsing clang types and keeps down the amount
of data that gets parsed into the ASTContext for each module.
Getting the clang type from a "lldb_private::Type" object now takes a boolean
that indicates if a forward declaration is ok:
clang_type_t lldb_private::Type::GetClangType (bool forward_decl_is_ok);
So function prototypes that define parameters that are "const T&" can now just
parse the forward declaration for type 'T' and we avoid circular references in
the type system.
llvm-svn: 115012
Renamed the "dispatchqaddr" setting that was coming back for stop reply packets
to be named "qaddr" so that gdb doesn't thing it is a register number. gdb
was checking the first character and assuming "di" was a hex register number
because 'd' is a hex digit. It has been shortened so gdb can safely ignore it.
llvm-svn: 113475
launch it due to not being able to get the task port. A SIGHUP was killing us
and also an error string wasn't properly being passed along. Got rid of a
class error variable that can only lead to multi-threaded crashes.
llvm-svn: 109930
enabled LLVM make style building and made this compile LLDB on Mac OS X. We
can now iterate on this to make the build work on both linux and macosx.
llvm-svn: 108009
- fixed 3 posix spawn attributes leaks
- fixed us always leaking CXXBaseSpecifier objects when we create class
base classes. Clang apparently copies the base classes we pass in.
Fixed some code formatting in ClangASTContext.cpp.
llvm-svn: 107459