Commit Graph

657 Commits

Author SHA1 Message Date
Greg Clayton 6ba7815115 Bug #: 8447030
Fixed an issue with ClangASTContext::GetIndexOfChildMemberWithName() 
where objective C ivars were not being found correctly if they were
the second or higher child.

llvm-svn: 114258
2010-09-18 02:11:07 +00:00
Greg Clayton a701509229 Fixed the way set/show variables were being accessed to being natively
accessed by the objects that own the settings. The previous approach wasn't
very usable and made for a lot of unnecessary code just to access variables
that were already owned by the objects.

While I fixed those things, I saw that CommandObject objects should really
have a reference to their command interpreter so they can access the terminal
with if they want to output usaage. Fixed up all CommandObjects to take
an interpreter and cleaned up the API to not need the interpreter to be
passed in.

Fixed the disassemble command to output the usage if no options are passed
down and arguments are passed (all disassebmle variants take options, there
are no "args only").

llvm-svn: 114252
2010-09-18 01:14:36 +00:00
Johnny Chen 49b415de1f Added a hook for the test driver to take an optional config file to customize
the running of the test suite.  Right now, it doesn't do anything with the
config file.

Pass "-c myConfigFile" to specify the config file.

llvm-svn: 114245
2010-09-18 00:16:47 +00:00
Johnny Chen aa90292126 Fixed a typo and supplied a more appropriate assert message.
llvm-svn: 114232
2010-09-17 22:45:27 +00:00
Johnny Chen b330786d1f Added test cases to FoundationTestCase to exercise lookup of objc data types and
to evaluate expressions.  Marked with @expectedFailure decorators for the time
being.

Enhanced the lldbtest.TestBase.expect() API to allow an additional keyword arg
named "error".  If the client passes "error=True", it signifies that an error
while running the command is expected.  The golden input is then compared
against the return object's error output.

llvm-svn: 114228
2010-09-17 22:28:51 +00:00
Johnny Chen b219d281b0 Changed test case method names.
llvm-svn: 114210
2010-09-17 21:14:02 +00:00
Johnny Chen aec0c322d3 Fixed build error of LLDBWrapPython.cpp by removing the "protected" access modifier.
llvm-svn: 114194
2010-09-17 18:39:57 +00:00
Greg Clayton e2ae97f267 We now have SBStream that mirrors the generic stream classes we
use inside lldb (lldb_private::StreamFile, and lldb_private::StreamString).

llvm-svn: 114188
2010-09-17 17:42:16 +00:00
Sean Callanan 61da09bbc8 Re-committed AddMethodToCXXRecordType, now that
the bug I introduced to ClangASTContext is
resolved.

llvm-svn: 114157
2010-09-17 02:58:26 +00:00
Sean Callanan 6fe64b528d Added a static function to get the void type for
an ASTContext; also added a function to get the
Clang-style CVR qualifiers for a type as an
unsigned int.

llvm-svn: 114152
2010-09-17 02:24:29 +00:00
Johnny Chen 2756d60563 Added extra test scenarios to break on a selector with:
(lldb) breakpoint set -S description

and a compilation unit defined instance method with:

(lldb) breakpoint set -n '-[MyString initWithNSString:]'

llvm-svn: 114134
2010-09-16 23:57:33 +00:00
Johnny Chen 4a0a048cf8 Reverted r114125, r114124, and r114123 as it broke the test suite - segfaults
when running test/class_types.

llvm-svn: 114132
2010-09-16 23:51:14 +00:00
Sean Callanan f07c52621e GetBuiltInType_void(clang::ASTContext*) should be
static.

llvm-svn: 114125
2010-09-16 22:40:36 +00:00
Sean Callanan d24a7c893b Well, it shouldn't be quite *that* obviously broken.
Quick fix to AddMethodToCXXRecordType's non-static
definition.

llvm-svn: 114124
2010-09-16 22:32:47 +00:00
Sean Callanan e44f1fbb4b Added AddMethodToCXXRecordType. This is not yet
tested, but I'm committing because it's not used
anywhere and I want to avoid conflicts.

llvm-svn: 114123
2010-09-16 22:31:19 +00:00
Johnny Chen ce65073696 Fixed wrong doc strings from cut-and-paste.
llvm-svn: 114120
2010-09-16 21:01:39 +00:00
Johnny Chen 6c17c0807e Added a simple test case to set breakpoints on objc class/instance methods.
Modified Makefile.rules to allow for overwriting the ARCH make variable.

llvm-svn: 114118
2010-09-16 20:54:06 +00:00
Sean Callanan c81256a595 Made CreateFunctionType static. Also fixed the spelling
for CreateParameterDeclaration.

llvm-svn: 114111
2010-09-16 20:40:25 +00:00
Sean Callanan 6e6a7c7160 Made AddFieldToRecordType a static method on
ClangASTContext.

llvm-svn: 114110
2010-09-16 20:01:08 +00:00
Caroline Tice 9e41c15d84 Fix issues with CreateInstanceName, a virtual function, being called
in an initializer.

llvm-svn: 114107
2010-09-16 19:05:55 +00:00
Johnny Chen 2fcc0e5555 Added a test case for the settings command which sets process.output-path and
checks that the launched process writes its standard output there.

llvm-svn: 114102
2010-09-16 18:26:06 +00:00
Johnny Chen 9b1e320c27 Undo 114084 and 114087 to unbreak the build for the time being.
llvm-svn: 114095
2010-09-16 17:37:05 +00:00
Johnny Chen df80a4cf25 Cleaned up the option processing logic and added a '-i' option to ignore the
build tree relative search path in order to locate the lldb.py module.  When
'-i' is present, the test driver relies on the PYTHONPATH environment variable
to locate the lldb.py module.

llvm-svn: 114094
2010-09-16 17:11:30 +00:00
Greg Clayton f94bddcc82 Added default more aliases to ease gdb converts:
"b" is now aliased to "regexp-break"
"p" is now aliased to "frame variable"
"print" is now aliased to "frame variable"

llvm-svn: 114092
2010-09-16 17:09:23 +00:00
Benjamin Kramer 3e9e2fcadd Turns out CreateInstanceName is duplicated in two other places. Make them static too, sigh.
llvm-svn: 114087
2010-09-16 16:23:16 +00:00
Benjamin Kramer b12ec91a3d Make this method static. Bad things(tm) happen when a non-static method is called in a constructor's initializer list.
llvm-svn: 114084
2010-09-16 16:07:31 +00:00
Benjamin Kramer 7309e6c7f1 Unbreak build, you can't take a pointer from a "register" variable. Most compilers ignore this keyword anyways.
Also remove a typedef that typedefs nothing.

llvm-svn: 114083
2010-09-16 16:07:21 +00:00
Johnny Chen e9a1ef700b Added some comments.
llvm-svn: 114081
2010-09-16 15:44:23 +00:00
Johnny Chen 1a9f4dd5a0 Provided a mechanism for the test class to cleanup after itself once it's done.
This will remove the confusion experienced when previous test runs left some
files (both intermediate or by-product as a result of the test).

lldbtest.TestBase defines a classmethod tearDownClass(cls) which invokes the
platform-specific cleanup() function as defined by the plugin; after that, it
invokes a subclass-specific function classCleanup(cls) if defined; and, finally,
it restores the old working directory.

An example of classCleanup(cls) is in settings/TestSettings.py:

    @classmethod
    def classCleanup(cls):
        system(["/bin/sh", "-c", "rm output.txt"])

where it deletes the by-product "output.txt" as a result of running a.out.

llvm-svn: 114058
2010-09-16 01:53:04 +00:00
Jim Ingham 7ce490c6b5 Step past prologues when we step into functions.
llvm-svn: 114055
2010-09-16 00:58:09 +00:00
Jim Ingham 0909e5f4df Add the ability to not resolve the name passed to FileSpec. Then don't resolve the names of compilation units found in DWARF.
llvm-svn: 114054
2010-09-16 00:57:33 +00:00
Johnny Chen f7f627104b Simplied main() and emits a message to the standard out.
llvm-svn: 114033
2010-09-15 22:48:40 +00:00
Johnny Chen d5e111c2c1 Added two test cases to TestSettings.py which exercise the lldb's:
(lldb) settings set process.run-args A B C
(lldb) settings set process.env-vars ["MY_ENV_VAR"]=YES

commands.  The main.cpp checks whether A, B, C is passed to main and whether
the $MY_ENV_VAR env variable is defined and outputs the findings to a file.

llvm-svn: 114031
2010-09-15 22:27:29 +00:00
Caroline Tice 3f12e8efc1 Remove unnecessary/inappropriate output-printing functions from
the API.

llvm-svn: 113993
2010-09-15 18:29:06 +00:00
Johnny Chen 73982b94e3 Also added BuildAndIntegration to the directories to search for an existing
lldb.py module.  The priorities to search for are Debug, Release, then
BuildAndIntegration.  You can always override this with a valid PYTHONPATH
environment variable before running the test driver.

For example:

$ PYTHONPATH=/Find/My/LLDB/Module/Here ./dotest.py -v .

Python runtime will try to locate the lldb.py module from
/Find/My/LLDB/Module/Here first before trying the Debug, Release, and then
BuildAndIntegration directories.

llvm-svn: 113991
2010-09-15 18:11:19 +00:00
Johnny Chen 9fa032173a Changed to a more informative message.
llvm-svn: 113989
2010-09-15 18:00:19 +00:00
Johnny Chen f7f0cabe9f We believed the intermittent process launch failure while running the test suite
has been fixed by r113947.  But just in case it still fails, emits a prominent
message always.

llvm-svn: 113986
2010-09-15 17:33:57 +00:00
Johnny Chen bce48fb06f Removed the @expectedFailure decorator for test_with_dwarf() test case. It has
been fixed.

llvm-svn: 113981
2010-09-15 16:59:20 +00:00
Greg Clayton d88d759a74 15-20% speed improvement when parsing DWARF. I used instruments to
find the hotspots in our code when indexing the DWARF. A combination of
using SmallVector to avoid collection allocations, using fixed form
sizes when possible, and optimizing the hot loops contributed to the
speedup.

llvm-svn: 113961
2010-09-15 08:33:30 +00:00
Caroline Tice 7d9edf670b Modify "settings list" so you can specify a particular instance setting name,
or a settings prefix, and it will list information about the subset of settings
you requested.  Also added tab-completion (now that it takes an optional argument).

llvm-svn: 113952
2010-09-15 06:56:39 +00:00
Greg Clayton 6dbd39838d Fixed a missing newline when dumping mixed disassembly.
Added a "bool show_fullpaths" to many more objects that were
previously always dumping full paths.

Fixed a few places where the DWARF was not indexed when we
we needed it to be when making queries. Also fixed an issue
where the DWARF in .o files wasn't searching all .o files
for the types.

Fixed an issue with the output from "image lookup --type <TYPENAME>"
where the name and byte size might not be resolved and might not
display. We now call the accessors so we end up seeing all of the
type info.

llvm-svn: 113951
2010-09-15 05:51:24 +00:00
Caroline Tice ded2fa3991 Remove all visible uses of "[DEFAULT]" instance name.
Add ability to rename UserSettingsInstances after they have been created
(via UserSettingsController::RenameInstanceSettings.

llvm-svn: 113950
2010-09-15 05:35:14 +00:00
Greg Clayton 86c3f345c6 Fixed a race condition that was sometimes stopping our command line
interpreter from working. The communication read thread could
startup and immediately exit if m_read_thread_enabled was
checked in the thread function before it was set by the
thread that spawns the read thread. Now m_read_thread_enabled is set
to true prior to spawning the read thread to avoid this issue.

Hopefully this will clear up the sporatic failures in our test suite.

llvm-svn: 113947
2010-09-15 05:19:45 +00:00
Greg Clayton c685f8e540 So we can't use .debug_pubtypes as it, as designed, does not tell us about
all types in all compile units. I added a new kind of accelerator table to
the DWARF that allows us to index the DWARF compile units and DIEs in a way
that doesn't require the data to stay loaded. Currently when indexing the
DWARF we check if the compile unit had parsed its DIEs and if it hasn't we
index the data and free all of the DIEs so we can reparse later when we need
to after using one of our complete accelerator tables to determine we need
to reparse some DWARF. If the DIEs had already been parsed we leave them 
loaded. The new accelerator table uses the "const char *" pointers from our
ConstString class as the keys, and NameToDIE::Info as the value. This info
contains the compile unit index and the DIE index which means we are pointed
right to the DIE we need unlike the other DWARF accelerator tables that often
just point us to the compile unit we would find our answer in. 

llvm-svn: 113933
2010-09-15 04:15:46 +00:00
Jim Ingham 3a0b9cdf47 If you have already loaded a file into the debugger, "process attach" will attach to a process with the filename, unless you specify otherwise.
llvm-svn: 113916
2010-09-15 01:34:14 +00:00
Jim Ingham 89bf5e9105 The Mangled name comparision should prefer the mangled name.
llvm-svn: 113908
2010-09-15 00:13:44 +00:00
Jim Ingham af0f17596c Adding a bit more logging.
llvm-svn: 113907
2010-09-15 00:06:51 +00:00
Johnny Chen 93f336a203 Fixed typo in the doc strings.
llvm-svn: 113906
2010-09-15 00:02:30 +00:00
Johnny Chen ae74556ff6 Added two test cases to exercise 'expr this->m_c_int' with @expectedFailure
decorators for the time being.

llvm-svn: 113905
2010-09-15 00:00:54 +00:00
Greg Clayton 17f692087a Clear the section list when a our current process is destroyed.
Add missing files that I forgot to checkin.

llvm-svn: 113902
2010-09-14 23:52:43 +00:00