Commit Graph

219 Commits

Author SHA1 Message Date
Jim Ingham e3ae82af89 Add code that reads the APPLE_property debug info, and makes up properties from them.
llvm-svn: 144440
2011-11-12 01:36:43 +00:00
Sean Callanan fc89c142d3 Added functionality to call Objective-C class methods
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
2011-11-01 23:38:03 +00:00
Johnny Chen 5e27d5e033 Change the expected substrings for 'frame variable' output to:
'::my_uint_t', 'anon_uint = 0'

from:

    '(my_uint_t) anon_uint = 0'

to make the test suite clean with ToT.

llvm-svn: 143474
2011-11-01 18:46:52 +00:00
Jim Ingham ce553d885a Enhanced the ObjC DynamicCheckerFunction to test for "object responds to selector" as well as
"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
2011-11-01 02:46:54 +00:00
Johnny Chen 5fede4bfba Add expectedFailure decorators.
rdar://problem/10373783

llvm-svn: 143396
2011-10-31 23:35:33 +00:00
Johnny Chen 9a1e9af2ba Add some expr evaluations for simple STL data types.
Radar to be filed soon.

llvm-svn: 143395
2011-10-31 23:28:52 +00:00
Jim Ingham 32fc9601a1 Added some simple testcases for figuring out breakpoints by name in
classes & namespaces.

llvm-svn: 141629
2011-10-11 01:43:50 +00:00
Jim Ingham de4b919d27 Turn the EvaluateExpression (..., True) tests back on.
llvm-svn: 141375
2011-10-07 18:02:54 +00:00
Jim Ingham 969795f14b Add a new breakpoint type "break by source regular expression".
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
2011-09-21 01:17:13 +00:00
Johnny Chen 848b5b9903 Fixed indentation.
llvm-svn: 139802
2011-09-15 17:36:17 +00:00
Enrico Granata 9128ee2f7a Redesign of the interaction between Python and frozen objects:
- 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
2011-09-06 19:20:51 +00:00
Johnny Chen dd6be27427 Remove skip decorator now that crash has been fixed.
Fix a compie warning for main.cpp.

llvm-svn: 138503
2011-08-24 22:30:47 +00:00
Johnny Chen 4aa4f5dc0a Skip these two cases temporarily while investigating the crash on OSX Lion with clang as the compiler.
llvm-svn: 138393
2011-08-23 22:10:17 +00:00
Johnny Chen 49996274fd Add some expected failure decorators with radar numbers.
llvm-svn: 138316
2011-08-23 01:00:14 +00:00
Sean Callanan 60dbc63a89 Restored the version of LLVM that we previously
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
2011-08-22 22:34:22 +00:00
Johnny Chen 1dc9a20c16 Modify test cases to use 'target variable' to display global variables.
llvm-svn: 138247
2011-08-22 17:58:14 +00:00
Sean Callanan a87bee84cf Refined the rollback to LLVM, picking up a newer
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
2011-08-19 06:19:25 +00:00
Johnny Chen 42f192ad17 Revert the previous addition of expectedFailure decorators, it was a mistake.
llvm-svn: 138013
2011-08-19 00:00:55 +00:00
Johnny Chen 904cb64d64 Add expectedFailure decorator.
Failed possibly due to rollback of llvm/clang.

llvm-svn: 138011
2011-08-18 23:53:03 +00:00
Johnny Chen e1cdc922b2 Take clang output into account.
llvm-svn: 137739
2011-08-16 19:59:22 +00:00
Johnny Chen 2f821a5f8f Modify the expected substrings to accomodate clang, now that rdar://problem/8516141 has been fixed.
llvm-svn: 137698
2011-08-16 00:56:41 +00:00
Johnny Chen 7687d3c116 Add radar info for self.skipTest().
llvm-svn: 137504
2011-08-12 20:41:20 +00:00
Johnny Chen 8f5ebce99c Skip the TestObjCDymaicValue.py tests for i386 due to dynamic types for ObjC V1 runtime not implemented yet.
Radar to be filed.

llvm-svn: 137503
2011-08-12 20:39:00 +00:00
Johnny Chen d5e00ba6c4 Fix the expect patterns to work for both OSX SnowLeopard and Lion.
On Lion, printf is defined in libsystem_c.dylib.

llvm-svn: 137348
2011-08-11 20:51:45 +00:00
Sean Callanan 793d6330cd Updated LLVM/Clang to to pick up fixes for a
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
2011-08-11 20:11:18 +00:00
Sean Callanan 5207a340e5 Fixed a problem that prevented access to members
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
2011-08-10 21:05:52 +00:00
Jim Ingham ae24c42fc4 Typo in the test case for i386.
llvm-svn: 137149
2011-08-09 21:27:48 +00:00
Sean Callanan 85a96b12de Fixed the Objective-C "self" test case, which
was behaving erratically because it didn't
have a return statement in -[A init].

Also made minor cosmetic changes to that test
case.

llvm-svn: 137142
2011-08-09 20:28:32 +00:00
Johnny Chen 356b818882 Silence clang warning.
llvm-svn: 137141
2011-08-09 20:22:44 +00:00
Johnny Chen 53e2edbc5c Simplify lang/objc/self/Makefile, plus it's wrong. :-)
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
2011-08-09 20:07:16 +00:00
Johnny Chen 606e049cca Add a negative self.expect() to verify that the bug has been fixed.
rdar://problem/9747668

llvm-svn: 137129
2011-08-09 17:48:29 +00:00
Sean Callanan 72e4940bd1 This is an overhaul of the expression parser code
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
2011-08-05 23:43:37 +00:00
Greg Clayton fe42ac4d0a Cleaned up the SBType.h file to not include internal headers and reorganized
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
2011-08-03 22:57:10 +00:00
Sean Callanan a789aa770e Improved the expression parser's detection of the
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
2011-08-03 16:23:08 +00:00
Enrico Granata 9910bc855d Fixed an issue where the KVO swizzled type would be returned as the dynamic type instead of the actual user-level type
- 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
2011-08-03 02:18:51 +00:00
Sean Callanan 763d72a1fd Fixed a bug in which the DWARF reader did not distinguish
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
2011-08-02 22:21:50 +00:00
Johnny Chen c96a0476cd Remove unittest.skip() as 'rdar://problem/9691614 Expression parser crashes' is fixed.
llvm-svn: 136651
2011-08-01 21:36:02 +00:00
Johnny Chen 098781b55e Remove the @expectedFailure decorator as rdar://problem/8668674 is fixed.
llvm-svn: 136650
2011-08-01 21:30:30 +00:00
Johnny Chen 342927c522 Add a reproducible test case (expression parser crashes) to the lldb test suite.
rdar://problem/9691614.

llvm-svn: 136386
2011-07-28 20:46:14 +00:00
Johnny Chen 8a815152c2 Make the test criteria more stringent with respect to rdar://problem/8668674 to prevent accidental pass.
llvm-svn: 136316
2011-07-28 00:52:23 +00:00
Johnny Chen 847f511300 Modify:
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
2011-07-27 23:17:56 +00:00
Johnny Chen 1d3e880c2c Passing in os.ctermid() as the arg for SBTarget.Launch(...) for stdin_path, stdout_path, and stderr_path
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
2011-07-11 23:38:23 +00:00
Johnny Chen 9a07aba962 The lldbtest.TestBase.DebugSBValue(self, val) method call now does not need the frame argument.
Only the val (of SBValue type) argument is needed.

llvm-svn: 134915
2011-07-11 20:06:28 +00:00
Jim Ingham 54fcc89abd Mark the test with expectedFailure for now.
llvm-svn: 134914
2011-07-11 19:47:16 +00:00
Enrico Granata e06e828d53 rolling back previous commit; double fix made it wrong again
llvm-svn: 134912
2011-07-11 19:34:11 +00:00
Enrico Granata 8b0d1777f5 Prevent the test suite from failing all the time until this bug is fixed
llvm-svn: 134911
2011-07-11 19:31:01 +00:00
Johnny Chen 38b5371184 Mark as expected failure.
rdar://problem/9745789 "expression" can't call functions in class methods

llvm-svn: 134910
2011-07-11 19:30:18 +00:00
Johnny Chen 628d84005a Add rdar://problem/9747668 info for "target variable g_marked_spot.y" command.
llvm-svn: 134772
2011-07-08 23:38:39 +00:00
Johnny Chen 98a5ddd006 Add test scenarios for 'target variable' command into TestGlobalVariables.py file.
llvm-svn: 134771
2011-07-08 23:33:36 +00:00
Jim Ingham 576e96e0dc New test to check that we can call functions in static methods in ObjC.
llvm-svn: 134736
2011-07-08 20:48:47 +00:00
Greg Clayton 715c236577 Centralize the variable display prefs into a new option
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
2011-07-07 04:38:25 +00:00
Greg Clayton 262f80df5e Made the string representation for a SBValue return what "frame variable"
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
2011-07-06 16:49:27 +00:00
Greg Clayton e305594277 Centralize all of the type name code so that we always strip the leading
"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
2011-06-30 02:28:26 +00:00
Johnny Chen 6638174378 Add @expectedFailure for TestCallStdStringFunction.py (radar was filed) and
remove @expectedFailure from TestObjCMethods.py's print_ivars_correctly()
function (it has been passing for a while).

llvm-svn: 134022
2011-06-28 19:39:19 +00:00
Johnny Chen eb5a433514 Move top level recurse dir to reside under lang/c.
llvm-svn: 133950
2011-06-27 21:57:58 +00:00
Johnny Chen 1f762d315c Move top level inlines dir to reside under lang/c.
llvm-svn: 133949
2011-06-27 21:55:59 +00:00
Johnny Chen d1a075d21a Add comments and print output for selected thread under trace mode.
llvm-svn: 133947
2011-06-27 21:52:46 +00:00
Johnny Chen 89109ed13c Add TestPrintObj.py to go with lang/objc/print-objc, which:
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
2011-06-27 20:05:23 +00:00
Johnny Chen 1e256d2ac6 Simplified Makefile.
llvm-svn: 133921
2011-06-27 18:32:19 +00:00
Johnny Chen 43730185e0 Move sample objc program to reside under lang/objc.
llvm-svn: 133920
2011-06-27 18:30:03 +00:00
Johnny Chen 8d798eb3c6 Move struct_types, stepping, and set_values dirs to now reside under lang/c.
Move stl dir to now reside under lang/cpp.

llvm-svn: 133884
2011-06-25 21:07:03 +00:00
Johnny Chen 23beac3368 Move global_variables dir to lang/c and foundation dir to lang/objc.
llvm-svn: 133883
2011-06-25 20:55:22 +00:00
Johnny Chen 04d9e8323e Move test dirs forward and function_types to now reside under lang/c.
llvm-svn: 133882
2011-06-25 20:49:06 +00:00
Johnny Chen fb8cd3712a Move some directories to now reside under lang/c or lang/cpp.
llvm-svn: 133881
2011-06-25 20:43:57 +00:00
Johnny Chen 6684b1e19a Move enum_types to now reside under lang/c.
llvm-svn: 133880
2011-06-25 20:29:41 +00:00
Johnny Chen 30a6a1e365 Move namespace directory to now reside under lang/cpp.
llvm-svn: 133879
2011-06-25 20:21:10 +00:00
Johnny Chen 91b6b77795 Move C++-related test directories to now reside under lang.
llvm-svn: 133878
2011-06-25 20:19:47 +00:00
Johnny Chen 33e89de95a Move objc-related test directories to now reside under lang/objc.
llvm-svn: 133877
2011-06-25 20:16:38 +00:00
Johnny Chen 53af50ac56 Start moving things around to have a more hierarchical directory structure.
llvm-svn: 133876
2011-06-25 20:07:20 +00:00