the user level. It adds the ability to invent new stepping modes implemented by python classes,
and to view the current thread plan stack and to some extent alter it.
I haven't gotten to documentation or tests yet. But this should not cause any behavior changes
if you don't use it, so its safe to check it in now and work on it incrementally.
llvm-svn: 218642
works, as do breakpoints, run and pause, display zeroth frame.
See
http://reviews.llvm.org/D5503
for a fuller description of the changes in this commit.
llvm-svn: 218596
See http://reviews.llvm.org/D5495 for more details.
These are changes that are part of an effort to support building llgs, within the AOSP source tree, using the Android.mk
build system, when using the llvm/clang/lldb git repos from AOSP replaced with the experimental ones currently in
github.com/tfiala/aosp-{llvm,clang,lldb,compiler-rt}.
llvm-svn: 218568
Changes include:
- fix it so you can select the "host" platform using "platform select host"
- change all callbacks that create platforms to returns shared pointers
- fix TestImageListMultiArchitecture.py to restore the "host" platform by running "platform select host"
- Add a new "PlatformSP Platform::Find(const ConstString &name)" method to get a cached platform
- cache platforms that are created and re-use them instead of always creating a new one
llvm-svn: 218145
For the Objective-C case, we do not have a "function type" notion, so we actually end up wrapping the clang ObjCMethodDecl in the Impl object, and ask function-y questions of it
In general, you can always ask for return type, number of arguments, and type of each argument using the TypeMemberFunction layer - but in the C++ case, you can also acquire a Type object for the function itself, which instead you can't do in the Objective-C case
llvm-svn: 218132
There are several places where multiple threads are accessing the same variables simultaneously without any kind of protection. I propose using std::atomic<> to make it safer. I did a special build of lldb, using the google tool 'thread sanitizer' which identified many cases of multiple threads accessing the same memory. std::atomic is low overhead and does not use any locks for simple types such as int/bool.
See http://reviews.llvm.org/D5302 for more details.
Change by Shawn Best.
llvm-svn: 217818
Also, in case they don't define any, change the default from "Run Python function <blah>" into "For more information run help <blah>"
The core issue here is that Python only allows one docstring per function, so we can't really attach both a short and a long help to the same command easily
There are alternatives but this is not a pressing enough concern to go through the motions quite yet
Fixes rdar://18322737
llvm-svn: 217795
The purpose of a ProcessStructReader is to allow intelligent reading of data from the underlying process
Traditionally, the way this has been handled is to have a load_address and shuffle it around, and use Process::ReadMemory()-kind APIs
With a ProcessStructReader one can define a clang type that matches exactly the definition of the thing they are trying to ingest from the inferior process, and then just point LLDB at where the data is
Since this work is done in terms of clang types, one can honor packed/aligned attributes, sizes of types on the inferior architecture, and similar tricky caveats without having to hardcode them
llvm-svn: 217644
SetName is only used in LLDB to set a thead's own name. Move it there
to match OS X and Windows and slightly reduce the effort in any future
HostThread/ThisThread name refactoring.
llvm-svn: 217521
More work on the GetName/SetName arguments (thread_t vs tid_t) is needed
but this change should restore the build and basic operation.
llvm-svn: 217502
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
Type Validators have the purpose of looking at a ValueObject, and making sure that there is nothing semantically wrong about the object's contents
For instance, if you have a class that represents a speed, the validator might trigger if the speed value is greater than the speed of light
This first patch hooks up the moving parts in the formatters subsystem, but does not link ValueObjects to TypeValidators, nor lets the SB API be exposed to validators
It also lacks the notion of Python validators
llvm-svn: 217277
lldb's internal memory cache chunks that are read from the remote
system. For a remote connection that is especially slow, a user may
need to reduce it; reading a 512 byte chunk of memory whenever a
4-byte region is requested may not be the right decision in these
kinds of environments.
<rdar://problem/18175117>
llvm-svn: 217083
detct unwind loops but there was a code path through there (using
architecture default unwind plans) that didn't do the check, and
could end up with an infinite loop unwind. Move that code into a
separate method and call it from both places where it is needed.
Also remove the use of ABI::FunctionCallsChangeCFA in that check.
I thought about it a lot and none of the architecutres that we're
supporting today can have a looping CFA.
Since the unwinder isn't using ABI::FunctionCallsChangeCFA() and
ABI::StackUsesFrames(), and the unwinder was the only reason
those methods exists, I removed them from the ABI and all its
plugins.
<rdar://problem/17364005>
llvm-svn: 216992
See http://reviews.llvm.org/D5108 for details.
This change does the following:
* eliminates the Process::GetUnixSignals() virtual method and replaces with a fixed getter.
* replaces the Process UnixSignals storage with a shared pointer.
* adds a Process constructor variant that can be passed the UnixSignalsSP. When the constructor without the UnixSignalsSP is specified, the Host's default UnixSignals is used.
* adds a host-specific version of GetUnixSignals() that is used when we need the host's appropriate UnixSignals variant.
* replaces GetUnixSignals() overrides in PlatformElfCore, ProcessGDBRemote, ProcessFreeBSD and ProcessLinux with code that appropriately sets the Process::UnixSignals for the process.
This change also enables some future patches that will enable llgs to be used for local Linux debugging.
llvm-svn: 216748
This is a lightweight wrapper around a pid. It is intended to be
lightweight enough to serve as a replacement anywhere we currently
store a pid. It provides convenience methods and common process
operations.
This patch does not yet make use of HostProcess anywhere.
llvm-svn: 216607
LLDB had implemented its own DynamicLibrary class for plugin
support. LLVM has an equivalent mechanism, so this patch deletes
the duplicated code in LLDB and updates LLDB to reference the
mechanism provided by LLVM.
llvm-svn: 216606
Add entries to core_definitions and elf_arch_entries for
those variants. Select the subtype for the variant by parsing
the e_flags field of the elf header.
llvm-svn: 216541
We decided to use assmbly profiler instead of eh_frame for frame 0 because for compiler generated code, eh_frame is usually synchronous(a.k.a. only valid at call site); and we have no way to tell if it's asynchronous or not.
But for x86 & x86_64 compiler generated code:
1. clang & GCC describes all prologue instructions in eh_frame;
2. mid-function stack pointer altering instructions can be easily detected.
So we can grab eh_frame, and use assembly profiler to augment it into asynchronous unwind table.
This change also benefits hand-written assembly; eh_frame for hand-written assembly is often asynchronous,so we have a much better chance to successfully unwind through them.
Change by Tong Shen.
llvm-svn: 216406
with binaries in the dyld shared cache (esp on iOS) where the file
address for the executable binary (maybe from memory, maybe from
an expanded copy of the dyld shared cache) is different from the
file address in the dSYM. In that case, ObjectFileMachO replaces
the file addresses from the original binary with the dSYM file
addresses (usually 0-based) -- lldb doesn't have a notion of two
file addresses for a given module so they need to agree.
There was a cache of file addresses over in the Symtab so I added
a method to the Module and the objects within to clear any file address
caches if they exist, and added an implementation in the Symtab
module to do that.
<rdar://problem/16929569>
llvm-svn: 216258
This should bring HostInfo up to 99% completion. The remainder
of code in Host will be split into instantiatable classes
representing host processes, threads, dynamic libraries, and
process launching strategies.
llvm-svn: 216230