Commit Graph

2407 Commits

Author SHA1 Message Date
Greg Clayton 31f1d2f535 Moved all code from ArchDefaultUnwindPlan and ArchVolatileRegs into their
respective ABI plugins as they were plug-ins that supplied ABI specfic info.

Also hookep up the UnwindAssemblyInstEmulation so that it can generate the
unwind plans for ARM.

Changed the way ABI plug-ins are handed out when you get an instance from
the plug-in manager. They used to return pointers that would be mananged
individually by each client that requested them, but now they are handed out
as shared pointers since there is no state in the ABI objects, they can be
shared.

llvm-svn: 131193
2011-05-11 18:39:18 +00:00
Caroline Tice 2b5e8504c8 Add ability to recognize/handle quotes around commands
(e.g. '"target" create'  works as well as 'target create').

llvm-svn: 131185
2011-05-11 16:07:06 +00:00
Johnny Chen e9e8689f3b Add more docstrings for get_GPRs(frame), getFPRs(frame), and get_ESRs(frame).
llvm-svn: 131168
2011-05-10 23:01:44 +00:00
Johnny Chen 40362a44c0 More string matching criterion.
llvm-svn: 131165
2011-05-10 22:46:13 +00:00
Johnny Chen 86f4f315ca Add TestObjCTypeQueryFromOtherCompileUnit.py to test that when stopped in the 'main.c'
compile unit, which has an external reference to symbols defined in foo.m, the type query:

    in this case, 'expression (NSArray*)array_token'

continues to work.

This test is to accompany http://llvm.org/viewvc/llvm-project?rev=131145&view=rev.

llvm-svn: 131154
2011-05-10 21:36:11 +00:00
Sean Callanan 019cacca48 Fixed a bug that caused types to be incorrectly
looked up.  Queries for global types were made
too specific -- including the current module
and compile unit in the query was limiting the
search when we wanted a truly global search.

llvm-svn: 131145
2011-05-10 19:47:39 +00:00
Johnny Chen 64ff7e6eee Add a utility function get_registers(frame, kind) to get the registers of a given frame and of a given kind.
Also add three convenience functions get_GPRs(frame), get_FPRs(frame), and get_ESRs(frame) to get the general
purpose registers, the floating point registers, and the exception state registers.

Add TestRegistersIterator.py to test these added functions of lldbutil.py.

llvm-svn: 131144
2011-05-10 19:21:13 +00:00
Johnny Chen 339ac4369d Add TestExprs2.py for recent check-ins related to the 'expression' subsystem.
llvm-svn: 131111
2011-05-09 23:41:06 +00:00
Caroline Tice 9088b06899 Make sure writing asynchronous output only backs up
& overwrites prompt if the IOChannel input reader is the top
input reader.

llvm-svn: 131110
2011-05-09 23:06:58 +00:00
Sean Callanan e359d9b771 Fixed a bug in which expression-local variables were
treated as being permanently resident in target
memory.  In fact, since the expression's stack frame
is deleted and potentially re-used after the
expression completes, the variables need to be treated
as being freeze-dried.

llvm-svn: 131104
2011-05-09 22:04:36 +00:00
Johnny Chen fa92ecc3e8 Add a test case test_process_info_with_no_arg(self) to 'class PlatformCommandTestCase'
for http://llvm.org/viewvc/llvm-project?rev=131089&view=rev.

llvm-svn: 131100
2011-05-09 20:51:47 +00:00
Greg Clayton b74944a829 Revert some unintended project changes from my last checkin.
llvm-svn: 131097
2011-05-09 20:23:10 +00:00
Greg Clayton 7349bd9078 While implementing unwind information using UnwindAssemblyInstEmulation I ran
into some cleanup I have been wanting to do when reading/writing registers.
Previously all RegisterContext subclasses would need to implement:

virtual bool
ReadRegisterBytes (uint32_t reg, DataExtractor &data);

virtual bool
WriteRegisterBytes (uint32_t reg, DataExtractor &data, uint32_t data_offset = 0);

There is now a new class specifically designed to hold register values: 
        lldb_private::RegisterValue
        
The new register context calls that subclasses must implement are:

virtual bool
ReadRegister (const RegisterInfo *reg_info, RegisterValue &reg_value) = 0;

virtual bool
WriteRegister (const RegisterInfo *reg_info, const RegisterValue &reg_value) = 0;

The RegisterValue class must be big enough to handle any register value. The
class contains an enumeration for the value type, and then a union for the 
data value. Any integer/float values are stored directly in an appropriate
host integer/float. Anything bigger is stored in a byte buffer that has a length
and byte order. The RegisterValue class also knows how to copy register value
bytes into in a buffer with a specified byte order which can be used to write
the register value down into memory, and this does the right thing when not
all bytes from the register values are needed (getting a uint8 from a uint32
register value..). 

All RegiterContext and other sources have been switched over to using the new
regiter value class.

llvm-svn: 131096
2011-05-09 20:18:18 +00:00
Johnny Chen 3173e27e9f Fix the wrong error message for "platform process info", i.e., with no pid(s) specified for the command.
llvm-svn: 131089
2011-05-09 19:05:46 +00:00
Greg Clayton 0e4851641f Fixed an issue with the MacOSX backchain register context where the pc was
being returned for both the PC and FP.

llvm-svn: 131081
2011-05-09 03:39:34 +00:00
Jim Ingham 1a414cfb5d Change an unconditional log to a conditional one.
llvm-svn: 131079
2011-05-09 01:06:45 +00:00
Johnny Chen 2158b97358 Fix docstring.
llvm-svn: 131072
2011-05-08 18:55:37 +00:00
Johnny Chen b21c52eac8 Add test scenario to verify 'eax' register is available when launching the i386 slice
of a universal binary and 'rax' register is available when launching the x86_64 slice.

rdar://problem/9403437

llvm-svn: 131069
2011-05-08 17:25:27 +00:00
Greg Clayton c4103b3c2f Fixed not being able to launch the i386 slice of a universal binary by adding
a new "QLaunchArch:<arch-name>" where <arch-name> is the architecture name.
This allows us to remotely launch a debugserver and then set the architecture
for the binary we will launch.

llvm-svn: 131064
2011-05-08 04:53:50 +00:00
Sean Callanan d9ca42aa4f Added support for reading untyped symbols. Right now
they are treated as pointers of type (void*).  This
allows reading of environ, for instance.

llvm-svn: 131063
2011-05-08 02:21:26 +00:00
Jim Ingham 9b70ddb305 StepUntil should check whether the target of the step until is in the current
function and if not return an error.

llvm-svn: 131061
2011-05-08 00:56:32 +00:00
Sean Callanan 63697e5025 Made expressions that are just casts of pointer
variables be evaluated statically.

Also fixed a bug that caused the results of
statically-evaluated expressions to be materialized
improperly.

This bug also removes some duplicate code.

llvm-svn: 131042
2011-05-07 01:06:41 +00:00
Jim Ingham 95496b1856 Deleted one too many characters...
llvm-svn: 131041
2011-05-07 01:03:33 +00:00
Jim Ingham 2eec4876a2 Fix an unitialized pointer in ValueObject::CreateChildAtIndex.
llvm-svn: 131039
2011-05-07 00:10:58 +00:00
Johnny Chen 32103ac2a9 Modify the test case related to "target modules search-paths" as it suffers from code rotting.
llvm-svn: 131038
2011-05-06 23:59:10 +00:00
Johnny Chen 7209d84f1c Add an API test script file for SBCommandInterpreter.
llvm-svn: 131035
2011-05-06 23:26:12 +00:00
Johnny Chen ed0443624b Fix wrong test method name due to cut-and-paste.
llvm-svn: 131033
2011-05-06 22:53:08 +00:00
Caroline Tice ca90c47eed Replace calls to HandleCommand in lldb core with more appropriate
direct function calls.  As part of this, collect code that processes
arguments & options for aliases into a single function.

llvm-svn: 131020
2011-05-06 21:37:15 +00:00
Johnny Chen 44932b6805 For a test with unexpected success status, we also dump its session info into a unique file.
llvm-svn: 131011
2011-05-06 20:30:22 +00:00
Jim Ingham dc3d8ffbe9 Make the log message & setter match for "dyld/shlib". The "ListLogCategories" output should really be auto-generated from the settings so you can't make this sort of mistake...
llvm-svn: 131003
2011-05-06 18:34:33 +00:00
Greg Clayton b2dcc36c05 Added the ability to cast pointer types to another type, no matter what the
ValueObject is, as long as the ValueObject that is being asked to be casted
is a pointer itself.

llvm-svn: 130966
2011-05-05 23:32:56 +00:00
Johnny Chen 3f620ed8ab Comment.
llvm-svn: 130965
2011-05-05 23:28:17 +00:00
Johnny Chen 87e8dd1077 Add comment for self.child_in_script_interpreter.
llvm-svn: 130963
2011-05-05 23:18:53 +00:00
Johnny Chen b79646cb2e Use standard lldb enum -- lldb.eStopReasonBreakpoint.
llvm-svn: 130960
2011-05-05 22:17:31 +00:00
Johnny Chen ae9639aeb3 Change the process iteration pattern to a more concise:
for thread in process:
        print >> output, print_stacktrace(thread, string_buffer=True)

llvm-svn: 130940
2011-05-05 18:50:56 +00:00
Greg Clayton 8f7770f8b4 Always try and lookup the address in a register if it is encoded as an
integer and the register byte size matches the size of a pointer. This removes
the "--lookup" option.

llvm-svn: 130910
2011-05-05 02:16:20 +00:00
Jim Ingham c60695a765 Fix the "target stop-hook add" input reader so that it won't say the stop hook was added if the input was interrupted.
llvm-svn: 130907
2011-05-05 01:03:36 +00:00
Johnny Chen 0bade020a0 Add a test script for verifying that the convenience variables:
o lldb.debugger
o lldb.target
o lldb.process
o lldb.thread
o lldb.frame

"just works" when we stop at a breakpoint.

llvm-svn: 130904
2011-05-05 00:36:31 +00:00
Caroline Tice 0de8d4503b Add ability to search backwards through command
history for a particular substring, using ctrl-r key.

llvm-svn: 130871
2011-05-04 21:39:02 +00:00
Johnny Chen 63cc1de58d Use '-f c' to print each element of a string as a char.
llvm-svn: 130865
2011-05-04 20:38:01 +00:00
Johnny Chen ca5942ffe3 Forgot to check in this change with r130811.
llvm-svn: 130848
2011-05-04 18:01:44 +00:00
Caroline Tice fe1bdf291f Minor cleanup: When asynchronous output comes along,
back up over and delete the prompt before writing out the
asynchronous output, rather than just going to a new line.

llvm-svn: 130843
2011-05-04 16:44:57 +00:00
Jim Ingham 2837b766f5 Change "frame var" over to using OptionGroups (and thus the OptionGroupVariableObjectDisplay).
Change the boolean "use_dynamic" over to a tri-state, no-dynamic, dynamic-w/o running target,
and dynamic with running target.

llvm-svn: 130832
2011-05-04 03:43:18 +00:00
Johnny Chen b5672c504c Make the negative test more robust in light of more than one lldb prompts being emitted
in one command invocation.

llvm-svn: 130811
2011-05-04 00:44:20 +00:00
Johnny Chen 24f3490467 Add comments about 'image' being an alias for 'target modules'.
llvm-svn: 130806
2011-05-03 23:55:05 +00:00
Johnny Chen 5aceec3319 Update the golden output strings to match against after the recent change.
llvm-svn: 130804
2011-05-03 23:18:45 +00:00
Johnny Chen fd7ff20575 Remove debug statement.
llvm-svn: 130802
2011-05-03 22:32:16 +00:00
Johnny Chen 0934268ee1 Use a more gentle way of shutting down the child process spawned during the test execution using pexpect.
Change some child.expect() to child.expect_exact() as they try to match the string, not a regular expression.

llvm-svn: 130797
2011-05-03 22:14:19 +00:00
Greg Clayton effe5c956b Added new OptionGroup classes for UInt64, UUID, File and Boolean values.
Removed the "image" command and moved it to "target modules". Added an alias
for "image" to "target modules". 

Added some new target commands to be able to add and load modules to a target:
(lldb) target modules add <path>
(lldb) target modules load [--file <path>] [--slide <offset>] [<sect-name> <sect-load-addr> ...]

So you can load individual sections without running a target:

(lldb) target modules load --file /usr/lib/libSystem.B.dylib __TEXT 0x7fccc80000 __DATA 0x1234000000

Or you can rigidly slide an entire shared library:

(lldb) target modules load --file /usr/lib/libSystem.B.dylib --slid 0x7fccc80000

This should improve bare board debugging when symbol files need to be slid around manually.

llvm-svn: 130796
2011-05-03 22:09:39 +00:00
Caroline Tice e67afe15b4 Pre-load the Python script interpreter with the following
convenience variables (from the ExecutionContext) each time
it is entered: lldb.debugger, lldb.target, lldb.process, 
lldb.thread, lldb.frame.

If a frame (or thread, process, etc) does not currently exist,
the variable contains the Python value 'None'.

llvm-svn: 130792
2011-05-03 21:21:50 +00:00