Commit Graph

813 Commits

Author SHA1 Message Date
Sean Callanan f4b9bd3e74 Added support for (de)materializing values in registers,
so that expressions can use them.

llvm-svn: 115658
2010-10-05 20:18:48 +00:00
Johnny Chen 1d4cc2f06c Add a test class to call lldb 'disassemble -n function' command on each call frame when stopped on C's ctor.
This is not a long running test so it shall always be exercised.

llvm-svn: 115653
2010-10-05 19:34:06 +00:00
Johnny Chen 67af43f04f Make the test module with unique name instead of just the generic name TestDisassembly.
Add a utility function to lldbtest.py to get the native pointer size of the host os.

llvm-svn: 115652
2010-10-05 19:27:32 +00:00
Johnny Chen 68e37439a9 Filename renamings.
llvm-svn: 115636
2010-10-05 17:34:07 +00:00
Greg Clayton b71f384455 Added the notion that a value object can be constant by adding:
bool ValueObject::GetIsConstant() const;
    void ValueObject::SetIsConstant();

This will stop anything from being re-evaluated within the value object so
that constant result value objects can maintain their frozen values without
anything being updated or changed within the value object.

Made it so the ValueObjectConstResult can be constructed with an 
lldb_private::Error object to allow for expression results to have errors.

Since ValueObject objects contain error objects, I changed the expression
evaluation in ClangUserExpression from 

    static Error
    ClangUserExpression::Evaluate (ExecutionContext &exe_ctx, 
                                  const char *expr_cstr, 
                                  lldb::ValueObjectSP &result_valobj_sp);

to:

    static lldb::ValueObjectSP
    Evaluate (ExecutionContext &exe_ctx, const char *expr_cstr);
    
Even though expression parsing is borked right now (pending fixes coming from
Sean Callanan), I filled in the implementation for:
    
    SBValue SBFrame::EvaluateExpression (const char *expr);
    
Modified all expression code to deal with the above changes.

llvm-svn: 115589
2010-10-05 03:13:51 +00:00
Greg Clayton 0184f01936 Moved expression evaluation from CommandObjectExpression into
ClangUserExpression::Evaluate () as a public static function so anyone can
evaluate an expression.

llvm-svn: 115581
2010-10-05 00:31:29 +00:00
Johnny Chen 57e5efa2e3 Move two files to the 'attic'.
llvm-svn: 115579
2010-10-05 00:08:08 +00:00
Greg Clayton 1d3afba3a3 Added a new ValueObject type that will be used to freeze dry expression
results. The clang opaque type for the expression result will be added to the
Target's ASTContext, and the bytes will be stored in a DataBuffer inside
the new object. The class is named: ValueObjectConstResult

Now after an expression is evaluated, we can get a ValueObjectSP back that
contains a ValueObjectConstResult object.

Relocated the value object dumping code into a static function within
the ValueObject class instead of being in the CommandObjectFrame.cpp file
which is what contained the code to dump variables ("frame variables").

llvm-svn: 115578
2010-10-05 00:00:42 +00:00
Johnny Chen bb5f078ce0 Do 'disassemble -s start_addr -e end_addr' on stdc++ library function entries.
llvm-svn: 115574
2010-10-04 23:03:34 +00:00
Jim Ingham 3bcdb29cab Add an "auto-confirm" setting to the debugger so you can turn off the confirmations if you want to.
llvm-svn: 115572
2010-10-04 22:44:14 +00:00
Caroline Tice 405fe67f14 Modify existing commands with arguments to use the new argument mechanism
(for standardized argument names, argument help, etc.)

llvm-svn: 115570
2010-10-04 22:28:36 +00:00
Chris Lattner 69d23282b4 Use the LLVM Macho.h header instead of relying on the system one,
patch by Arvid Picciani!

llvm-svn: 115563
2010-10-04 21:24:01 +00:00
Jim Ingham 97a6dc7e16 Add a "Confirm" function to the CommandInterpreter so you can confirm potentially dangerous operations in a generic way.
llvm-svn: 115546
2010-10-04 19:49:29 +00:00
Jim Ingham 4b9395ca82 Have to friend SBFrame or it can't make symbols for the frame.
llvm-svn: 115543
2010-10-04 19:38:50 +00:00
Johnny Chen fe9f456291 Initial version of a test case meant to disassemble each and every function from
the stdc++ library module.  Right now, it doesn't do any disassembly at all.  It
merely locates the stdc++ library.  Also tests the SBProcess object description
and verifies it is in a 'Stopped' state.

llvm-svn: 115536
2010-10-04 18:39:14 +00:00
Greg Clayton 3b06557e4f Added GetSymbol to the frame.
llvm-svn: 115535
2010-10-04 18:37:52 +00:00
Greg Clayton 0d9c993401 Fixed and issue where we weren't seeing inlined functions anymore. We also now show the correct pc-offset within the inlined function.
llvm-svn: 115522
2010-10-04 17:26:49 +00:00
Greg Clayton cf4b9078f2 Added file and line back to the default thread format.
llvm-svn: 115519
2010-10-04 17:04:23 +00:00
Johnny Chen 262d619be7 Remove file:lineno from the expected substrings. Matching 'a_function, i.e.,
the {function.name}, is sufficient for this test case.

Plus added @expectedfailure decorator for a filed bug.

llvm-svn: 115517
2010-10-04 16:58:16 +00:00
Johnny Chen f32a446bc8 Remove file:lineno from the expected substrings. Matching 'a.out`string_not_empty', i.e.,
${module.file.basename}{`${function.name}, is sufficient for this test case.

llvm-svn: 115514
2010-10-04 16:38:12 +00:00
Johnny Chen 33e1313a01 The 'thread list' command no longer displays the file:lineno after the recent check-in.
Remove file:lineno from the expected substrings.

llvm-svn: 115512
2010-10-04 16:23:16 +00:00
Greg Clayton 7a98e5b4e5 Clarified some caveats for thread format strings.
llvm-svn: 115491
2010-10-04 03:06:05 +00:00
Greg Clayton bb562b13db Fixed an issue with the default frame format settings string where if a frame
was stopped in a module, yet had no valid function for the PC, no module would
be displayed.

llvm-svn: 115490
2010-10-04 02:44:26 +00:00
Greg Clayton 877b59dc9c Added documentation for the new frame and thread format strings.
llvm-svn: 115488
2010-10-04 02:33:45 +00:00
Greg Clayton 0603aa9dc8 There are now to new "settings set" variables that live in each debugger
instance:

settings set frame-format <string>
settings set thread-format <string>

This allows users to control the information that is seen when dumping
threads and frames. The default values are set such that they do what they
used to do prior to changing over the the user defined formats.

This allows users with terminals that can display color to make different
items different colors using the escape control codes. A few alias examples
that will colorize your thread and frame prompts are:

settings set frame-format 'frame #${frame.index}: \033[0;33m${frame.pc}\033[0m{ \033[1;4;36m${module.file.basename}\033[0;36m ${function.name}{${function.pc-offset}}\033[0m}{ \033[0;35mat \033[1;35m${line.file.basename}:${line.number}}\033[0m\n'

settings set thread-format 'thread #${thread.index}: \033[1;33mtid\033[0;33m = ${thread.id}\033[0m{, \033[0;33m${frame.pc}\033[0m}{ \033[1;4;36m${module.file.basename}\033[0;36m ${function.name}{${function.pc-offset}}\033[0m}{, \033[1;35mstop reason\033[0;35m = ${thread.stop-reason}\033[0m}{, \033[1;36mname = \033[0;36m${thread.name}\033[0m}{, \033[1;32mqueue = \033[0;32m${thread.queue}}\033[0m\n'

A quick web search for "colorize terminal output" should allow you to see what
you can do to make your output look like you want it.

The "settings set" commands above can of course be added to your ~/.lldbinit
file for permanent use.

Changed the pure virtual 
    void ExecutionContextScope::Calculate (ExecutionContext&);
To:
    void ExecutionContextScope::CalculateExecutionContext (ExecutionContext&);
    
I did this because this is a class that anything in the execution context
heirarchy inherits from and "target->Calculate (exe_ctx)" didn't always tell
you what it was really trying to do unless you look at the parameter.

llvm-svn: 115485
2010-10-04 01:05:56 +00:00
Johnny Chen 2f71831ceb Remove the @skip() and @expectedFaiure decorators, the previously affected tests
have now all passed.

rdar://problem/8502549 and rdar://problem/8493023 are fixed

llvm-svn: 115399
2010-10-02 01:46:20 +00:00
Greg Clayton 90a2acd441 One final patch for all of this class constructor, destructor, and conversion
operator naming stuff. We now get the constructor and destructor names right
after passing in the type, and we get the correct conversion operator name
after passing in the return type when getting the DeclarationNameInfo.

llvm-svn: 115398
2010-10-02 01:40:05 +00:00
Johnny Chen 1e190a552f Use a more robust regexp to search for the 'Code' symbol. Plus compile the
regexp once and use it within the for loop for some speedup.

llvm-svn: 115397
2010-10-02 01:23:40 +00:00
Sean Callanan 9c5fe130e1 Update to the latest Clang, which fixes a problem
with importing class/struct types.

llvm-svn: 115394
2010-10-02 01:07:50 +00:00
Johnny Chen 7fce877aa5 I committed too fast. Both "struct objc_selector *" and "SEL" are possible,
depending on the compiler used.  Former if gcc/llvm-gcc, and latter if clang.

llvm-svn: 115380
2010-10-01 23:34:28 +00:00
Johnny Chen 9eaa69699a Updated the expected match string when stopped on an objc instance method from:
ARG: (struct objc_selector *) _cmd

to

    ARG: (SEL) _cmd

The change most likely resulted from an update from the llvm tot with a newer clang.

llvm-svn: 115372
2010-10-01 23:21:20 +00:00
Greg Clayton a3c444ac23 Get the declaration names for C++ ctors, dtors, and operators from the
right name pools.

llvm-svn: 115371
2010-10-01 23:13:49 +00:00
Johnny Chen b781cf0022 Commented out two debug prints.
llvm-svn: 115369
2010-10-01 23:05:03 +00:00
Johnny Chen da88434b39 o Added a new feature to the test framework to skip long running tests conditionally.
To not skip long running tests, pass '-l' to the test driver (dotest.py).

  An example:

    @unittest2.skipIf(TestBase.skipLongRunningTest(), "Skip this long running test")
    def test_foundation_disasm(self):
        ...

o Added a long running disassemble test to the foundation directory, which iterates
  the code symbols from Foundation.framework and kicks off a disassemble command for
  for the named function symbol.  Found a crasher: rdar://problem/8504895.

o Plus added/updated some comments for the TestBase class.

llvm-svn: 115368
2010-10-01 22:59:49 +00:00
Caroline Tice 8d88020e92 Uncomment/fix "-f" command option for disassemble command.
llvm-svn: 115351
2010-10-01 21:34:54 +00:00
Greg Clayton c93237c991 Fixed an issue where if a method funciton was asked to be parsed before
its containing class was parsed, we would crash.

llvm-svn: 115343
2010-10-01 20:48:32 +00:00
Caroline Tice deaab2220e Modify command options to use the new arguments mechanism. Now all command option
arguments are specified in a standardized way, will have a standardized name, and
have functioning help.

The next step is to start writing useful help for all the argument types.

llvm-svn: 115335
2010-10-01 19:59:14 +00:00
Johnny Chen f14331f5c3 Only skip the test cases which are currently crashing, instead of the whole class.
Also, the break by location needs to be modified after changees made to the main.cpp source code.

llvm-svn: 115320
2010-10-01 18:08:29 +00:00
Caroline Tice e139cf2320 Add infrastructure for standardizing arguments for commands and
command options; makes it easier to ensure that the same type of
argument will have the same name everywhere, hooks up help for command
arguments, so that users can ask for help when they are confused about
what an argument should be; puts in the beginnings of the ability to
do tab-completion for certain types of arguments, allows automatic
syntax help generation for commands with arguments, and adds command
arguments into command options help correctly.

Currently only the breakpoint-id and breakpoint-id-range arguments, in
the breakpoint commands, have been hooked up to use the new mechanism.
The next steps will be to fix the command options arguments to use
this mechanism, and to fix the rest of the regular command arguments
to use this mechanism.  Most of the help text is currently missing or
dummy text; this will need to be filled in, and the existing argument
help text will need to be cleaned up a bit (it was thrown in quickly,
mostly for testing purposes).

Help command now works for all argument types, although the help may not
be very helpful yet.

Those commands that take "raw" command strings now indicate it in their
help text.

llvm-svn: 115318
2010-10-01 17:46:38 +00:00
Johnny Chen b5051dc529 Added bug number to the @skip decorator.
llvm-svn: 115317
2010-10-01 16:34:53 +00:00
Johnny Chen 179543890e These currently crash (from running 'expr' command). Disable the entire class for the time being.
llvm-svn: 115316
2010-10-01 16:26:42 +00:00
Greg Clayton 878eaf188c Added correct C++ method declarations for destructors and for conversion
operators.

llvm-svn: 115290
2010-10-01 03:45:20 +00:00
Greg Clayton f51de67640 Make C++ constructors and destructors correctly within the clang types we
generate from DWARF.

llvm-svn: 115268
2010-10-01 02:31:07 +00:00
Sean Callanan e1314273b6 Fixed handling of signed short types in expressions.
llvm-svn: 115267
2010-10-01 02:06:46 +00:00
Johnny Chen ec67219617 Add a simple test for the lldb 'disassemble' command. The initial version just
sets some breakpoints and invokes 'disassemble' when the breakpoint hits, which
just disassembles the bytes in the current function, i.e., frame #0's function.

llvm-svn: 115249
2010-10-01 00:10:17 +00:00
Johnny Chen 9ea6e21f91 Updated to remove most of the @expectedFailure decorators for:
# rdar://problem/8493023
    # test/types failures for Test*TypesExpr.py: element offset computed wrong and sign error?

Two failures remain for test_short* test cases.

llvm-svn: 115229
2010-09-30 22:49:07 +00:00
Greg Clayton 16c880f080 Fixed an issue where byte sizes were not able to be calculated for forward
declarations because we lost the original context which was needed to be
able to figure out the byte size.

llvm-svn: 115223
2010-09-30 22:25:09 +00:00
Johnny Chen c63bf9961c Modification required to test clang, gcc, and llvm-gcc.
llvm-svn: 115216
2010-09-30 22:11:33 +00:00
Greg Clayton 4957bf69e5 Cleaned up a unused member variable in Debugger.
Added the start of Host specific launch services, though it currently isn't
hookup up to anything. We want to be able to launch a process and use the
native launch services to launch an app like it would be launched by the
user double clicking on the app. We also eventually want to be able to run
a command line app in a newly spawned terminal to avoid terminal sharing.

Fixed an issue with the new DWARF forward type declaration stuff. A crasher
was found that was happening when trying to properly expand the forward
declarations.

llvm-svn: 115213
2010-09-30 21:49:03 +00:00
Jim Ingham 86103ea237 Change how we call Target::CreateBreakpoint to account for the new "name type" parameter.
llvm-svn: 115210
2010-09-30 21:21:43 +00:00