correctly, and added a testcase to check that it works.
The main problem here is that Objective-C class method
selectors are external references stored in a special
data structure in the LLVM IR module for an expression.
I just had to extract them and ensure that the real
class object locations were properly resolved.
llvm-svn: 143520
"object borked"... Also made the error when the checker fails reflect this fact rather than
report a crash at 0x0.
Also a little cleanup:
- StopInfoMachException had a redundant copy of the description string.
- ThreadPlanCallFunction had a redundant copy of the thread, and had a
copy of the process that it didn't really need.
llvm-svn: 143419
Fix the RegularExpression class so it has a real copy constructor.
Fix the breakpoint setting with multiple shared libraries so it makes
one breakpoint not one per shared library.
Add SBFileSpecList, to be used to expose the above to the SB interface (not done yet.)
llvm-svn: 140225
- introduced two new classes ValueObjectConstResultChild and ValueObjectConstResultImpl: the first one is a ValueObjectChild obtained from
a ValueObjectConstResult, the second is a common implementation backend for VOCR and VOCRCh of method calls meant to read through pointers stored
in frozen objects ; now such reads transparently move from host to target as required
- as a consequence of the above, removed code that made target-memory copies of expression results in several places throughout LLDB, and also
removed code that enabled to recognize an expression result VO as such
- introduced a new GetPointeeData() method in ValueObject that lets you read a given amount of objects of type T from a VO
representing a T* or T[], and doing dereferences transparently
in private layer it returns a DataExtractor ; in public layer it returns an instance of a newly created lldb::SBData
- as GetPointeeData() does the right thing for both frozen and non-frozen ValueObject's, reimplemented ReadPointedString() to use it
en lieu of doing the raw read itself
- introduced a new GetData() method in ValueObject that lets you get a copy of the data that backs the ValueObject (for pointers,
this returns the address without any previous dereferencing steps ; for arrays it actually reads the whole chunk of memory)
in public layer this returns an SBData, just like GetPointeeData()
- introduced a new CreateValueFromData() method in SBValue that lets you create a new SBValue from a chunk of data wrapped in an SBData
the limitation to remember for this kind of SBValue is that they have no address: extracting the address-of for these objects (with any
of GetAddress(), GetLoadAddress() and AddressOf()) will return invalid values
- added several tests to check that "p"-ing objects (STL classes, char* and char[]) will do the right thing
Solved a bug where global pointers to global variables were not dereferenced correctly for display
New target setting "max-string-summary-length" gives the maximum number of characters to show in a string when summarizing it, instead of the hardcoded 128
Solved a bug where the summary for char[] and char* would not be shown if the ValueObject's were dumped via the "p" command
Removed m_pointers_point_to_load_addrs from ValueObject. Introduced a new m_address_type_of_children, which each ValueObject can set to tell the address type
of any pointers and/or references it creates. In the current codebase, this is load address most of the time (the only notable exception being file
addresses that generate file address children UNLESS we have a live process)
Updated help text for summary-string
Fixed an issue in STL formatters where std::stlcontainer::iterator would match the container's synthetic children providers
Edited the syntax and help for some commands to have proper argument types
llvm-svn: 139160
rolled back, and the testcase that the rollback
broke.
The new LLVM has a new ARM disassembler, which
may cause instability. Keeping the old one would
force us into a contorted position vis-a-vis the
LLVM sources we bring in, so we will address
issues on the new one rather than keeping the old
one around.
llvm-svn: 138284
revision and adding a patch that fixes an AsmParser
crash on ARM.
One feature that we unfortunately lost (for the
moment!) is the ability to cast unknown code symbols
to arbitrary function types and put the resulting
function pointer in a result variable. This feature
will be back, though.
llvm-svn: 138036
problem in which the following cast:
–
expr (int (*)(const char*, ...))printf
-
caused a crash. This had several causes:
- First, Clang did not support implicit
casts of a function of unknown type to
a function pointer.
- Second, after this was fixed, the
Clang AST importer did not support
importing function pointer types
produced by resolving these casts.
These two problems are now resolved, and
I have added a test case to verify that
they work. I also did a little bit of
build-system cleanup because we now use
libEnhancedDisassembly.a instead of the
.dylib.
llvm-svn: 137338
of string literals ("hello"[2]). Also fixed a
problem in which empty string literals were not
being compiled correctly ((int)printf("") would
print garbage).
Added a testcase that covers both.
llvm-svn: 137247
For Makefile.rules, the modification of CFLAGS (addition of -arch $(ARCH) for Darwin) needs to come before
the consuming of CFLAGS, not after.
llvm-svn: 137140
that detects what context the current expression is
meant to execute in. LLDB now properly consults
the method declaration in the debug information
rather than trying to hunt down the "this" or "self"
pointer by name, which can be misleading.
Other fixes include:
- LLDB now properly detects that it is inside
an inlined C++ member function.
- LLDB now allows access to non-const members when
in const code.
- The functions in SymbolFile that locate the
DeclContext containing a DIE have been renamed
to reflect what they actually do. I have added
new functions that find the DeclContext for the
DIE itself.
I have also introduced testcases for C++ and
Objective-C.
llvm-svn: 136999
the SBType implementation classes.
Fixed LLDB core and the test suite to not use deprecated SBValue APIs.
Added a few new APIs to SBValue:
int64_t
SBValue::GetValueAsSigned(int64_t fail_value=0);
uint64_t
SBValue::GetValueAsUnsigned(uint64_t fail_value=0)
llvm-svn: 136829
current context. Previously, if there was a variable
called "self" available, the expression parser
assumed it was inside a method. But class methods
in Objective-C also take a "self" parameter, of DWARF
type "id". We now detect this properly, and only
assume we're in an instance method if "self" is a
pointer to an Objective-C object.
llvm-svn: 136784
- see the test case in lang/objc/objc-dynamic-value for an example
Objective-C dynamic type lookup now works for every Objective-C type
- previously, true dynamic lookup was only performed for type id
llvm-svn: 136763
appropriately between C++ static methods and non-static
methods. This bug made it impossible to call most static
methods, either because Clang did not recognize that a
method could be called without providing a "this"
parameter, or because Clang did not properly mangle the
name of the method when searching for it in the target.
Also added a testcase.
llvm-svn: 136733
self.expect("expression -- '(anonymous namespace)::i'", VARIABLES_DISPLAYED_CORRECTLY,
substrs = [" = 3"])
to get rid of the '(anonymous namespace)', which is not c++ syntax, thingy fed to the expression parser.
According to rdar://problem/8668674. It is still marked expectedFailure since the bug has not been fixed.
llvm-svn: 136290
is just wrong and resulted in the inferior's output getting mixed into the GDB remote communication's
log file. Change all test cases to not pass os.ctermid() and either use SBTarget.LaunchSimple() or
SBTarget.Launch() and pass None as stdin_path/stdout_path/srderr_path to use a pseudo terminal.
rdar://problem/9716499 program output is getting mixed into the GDB remote communications
llvm-svn: 134940
group class: OptionGroupVariable. It gets initialized with
a boolean that indicates if the frame specific options are
included so that this can be used in both the "frame variable"
and "target variable" commands.
Removed the global functionality from the "frame variable"
command. Users should switch to using the "target variable"
command.
llvm-svn: 134594
would return instead of a less than helpful "name: '%s'" description.
Make sure that when we ask for the error from a ValueObject object we
first update the value if needed.
Cleaned up some SB functions to use internal functions and not re-call
through the public API when possible.
llvm-svn: 134497
"struct ", "class ", and "union " from the start of any type names that are
extracted from clang QualType objects. I had to fix test suite cases that
were expecting the struct/union/class prefix to be there.
llvm-svn: 134132
Test "print object" where another thread blocks the print object from making progress.
Set a breakpoint on the line in my_pthread_routine. Then switch threads
to the main thread, and do print the lock_me object. Since that will
try to get the lock already gotten by my_pthread_routime thread, it will
have to switch to running all threads, and that should then succeed.
llvm-svn: 133933