Commit Graph

244 Commits

Author SHA1 Message Date
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