Commit Graph

1670 Commits

Author SHA1 Message Date
Johnny Chen b66cdadd4a Fix typo of encoding T2 (push) in the original ARM Architecture Reference Manual,
which has been corrected in the subsequent errata.

llvm-svn: 124152
2011-01-24 22:50:16 +00:00
Johnny Chen 9397fba093 Add comment about using Encoding A1 push instruction to emulate the "stmfd sp!, reg" case,
i.e., pushing one register onto the full descending stacks.

llvm-svn: 124149
2011-01-24 22:25:48 +00:00
Johnny Chen 65b58eafbe Make the assembler mnemonic lowercase.
llvm-svn: 124147
2011-01-24 22:02:46 +00:00
Johnny Chen e74e60cd50 Add Encoding T1 of the PUSH instructions to the g_arm_opcodes table.
llvm-svn: 124144
2011-01-24 20:38:45 +00:00
Johnny Chen c053cdd03d Fix typo in the instruction descriptions for Encoding T2 and T3 of PUSH.
llvm-svn: 124143
2011-01-24 20:21:01 +00:00
Johnny Chen 44a408424f Move some #define's to the ARMUtils.h header file.
llvm-svn: 124141
2011-01-24 19:50:30 +00:00
Johnny Chen d8c2a48298 Add Encoding T2 & T3 of the PUSH instructions to the g_arm_opcodes table.
Plus add an extra field ARMInstrSize to the table entry type 'ARMOpcode'.

llvm-svn: 124140
2011-01-24 19:46:32 +00:00
Johnny Chen 91027008f1 Add an ARMUtils.h file to house utility functions for the ARM/Thumb Instruction Set Architecture.
llvm-svn: 124131
2011-01-24 18:24:53 +00:00
Sean Callanan 9d2127ad3c Fixed a bug in the expression code which caused
it to interpret a "this" variable that was merely
a pointer -- that is, not a class pointer -- as
meaning that the current context was inside a C++
method.  This bug would prevent expressions from
evaluating correctly in regular C code if there
was a pointer variable named "this" in scope.

llvm-svn: 124117
2011-01-24 08:11:45 +00:00
Greg Clayton d58ac45c92 Bumped Xcode project versions: lldb-43 and debugserver-128.
llvm-svn: 124116
2011-01-24 07:16:06 +00:00
Greg Clayton 692538db26 One more thing... Resume any threads that we discover were created while we stop as
they may be in sensitive areas and we set breakpoints on the thread creation routines
if we are running expressions, so the threads should quickly get to a safe spot.

llvm-svn: 124115
2011-01-24 07:10:48 +00:00
Jim Ingham b3413c8a82 Remember to turn off the debugserver.txt hard-coded emission.
llvm-svn: 124114
2011-01-24 06:35:54 +00:00
Jim Ingham 444586b5d2 More useful STEP logging.
Be sure to clear out the base plan's m_report_run and m_report_stop each time we resume so we don't use stale values.

llvm-svn: 124113
2011-01-24 06:34:17 +00:00
Greg Clayton 2ad6670ef1 Make the logging come out all lined up and such.
llvm-svn: 124112
2011-01-24 06:30:45 +00:00
Greg Clayton 050f33cee8 Discover new threads right before we continue a process since libdispatch has
been known to make threads for us while our process/task is suspended.

llvm-svn: 124111
2011-01-24 06:22:23 +00:00
Greg Clayton 26783fea37 Added logging for threads that are spawned while we stop. We log their
existence if the "thread" log bit is enabled right before we resume.

llvm-svn: 124110
2011-01-24 06:11:50 +00:00
Greg Clayton abcbc8aca8 Fix a crasher when you have no log.
llvm-svn: 124109
2011-01-24 05:36:47 +00:00
Jim Ingham ce5798394f Some useful logging. Also don't stuff the temporary thread into a shared pointer for no apparent reason.
llvm-svn: 124108
2011-01-24 04:11:25 +00:00
Jim Ingham 9f35921baa Add a method to StreamFile to line buffer the file. Use that in "log enable -f file" to line buffer the log output.
llvm-svn: 124107
2011-01-24 04:09:25 +00:00
Jim Ingham c530be664f Linebuffer the log file.
llvm-svn: 124103
2011-01-24 03:46:59 +00:00
Jim Ingham dfac4ccdb7 A little less noise, please.
llvm-svn: 124086
2011-01-23 21:20:20 +00:00
Jim Ingham 1e7a9ee7d0 Add some more logging of broadcaster and Process. Also, protect the event broadcasting against hijacking in mid-event delivery.
llvm-svn: 124084
2011-01-23 21:14:08 +00:00
Greg Clayton b2daec9b04 Improved process logging for both lldb_private::Process and ProcessGDBRemote.
llvm-svn: 124080
2011-01-23 19:58:49 +00:00
Greg Clayton 6f907e69e9 Deprecated old forms of SBTarget::Launch. There is not just one and no
SWIG renaming done to work around deprecated APIs.

llvm-svn: 124075
2011-01-23 17:46:22 +00:00
Johnny Chen c5826824b5 Let's teach SWIG to rename the overloaded SBTarget::Launch() function which has
provision for specifying a working directory with the name LaunchWithCWD in our
target language (Python) for now.  This fixes the test suite failures due to the
overloading.

llvm-svn: 124069
2011-01-23 08:11:49 +00:00
Greg Clayton 03813a4e0d Restored some missing APIs for the test suite. Now testsuite still has some failures
due to overloaded SBTarget::Launch() calls. 

Bumping Xcode project versions: lldb-42 and debugserver-127.

llvm-svn: 124063
2011-01-23 06:21:25 +00:00
Greg Clayton bd82a5d2cc Added a new variant of SBTarget::Launch() that deprectates the old one that
takes separate file handles for stdin, stdout, and stder and also allows for
the working directory to be specified.

Added support to "process launch" to a new option: --working-dir=PATH. We
can now set the working directory. If this is not set, it defaults to that
of the process that has LLDB loaded. Added the working directory to the
host LaunchInNewTerminal function to allows the current working directory 
to be set in processes that are spawned in their own terminal. Also hooked this
up to the lldb_private::Process and all mac plug-ins. The linux plug-in had its
API changed, but nothing is making use of it yet. Modfied "debugserver" and
"darwin-debug" to also handle the current working directory options and modified
the code in LLDB that spawns these tools to pass the info along.

Fixed ProcessGDBRemote to properly pass along all file handles for stdin, stdout
and stderr. 

After clearing the default values for the stdin/out/err file handles for
process to be NULL, we had a crasher in UserSettingsController::UpdateStringVariable
which is now fixed. Also fixed the setting of boolean values to be able to
be set as "true", "yes", "on", "1" for true (case insensitive) and "false", "no",
"off", or "0" for false.

Fixed debugserver to properly handle files for STDIN, STDOUT and STDERR that are not
already opened. Previous to this fix debugserver would only correctly open and dupe
file handles for the slave side of a pseudo terminal. It now correctly handles
getting STDIN for the inferior from a file, and spitting STDOUT and STDERR out to
files. Also made sure the file handles were correctly opened with the NOCTTY flag
for terminals.

llvm-svn: 124060
2011-01-23 05:56:20 +00:00
Greg Clayton 1b03cb5d1b Watch out for NULL types in NameSearchContext::AddTypeDecl or we crash.
llvm-svn: 124051
2011-01-23 00:34:52 +00:00
Greg Clayton 61c2e57b09 Fixed a crasher that would happen when we run into malformed DWARF. It is
nice to know about the issue, but we shouldn't crash.

llvm-svn: 124050
2011-01-23 00:09:32 +00:00
Greg Clayton 6779606a7c Fixed an issue in "SBError SBProcess::Destroy ()" where it wasn't properly
checking the validity of the shared pointer prior to using it.

Fixed the GDB remote plug-in to once again watch for a reply from the "k" 
packet, and fixed the logic to make sure the thread requesting the kill
and the async thread play nice (and very quickly) by synchronizing the
packet sending and reply. I also tweaked some of the shut down packet
("k" kill, "D" detach, and the halt packet) to make sure they do the right
thing.

Fixed "StateType Process::WaitForProcessStopPrivate (...)" to correctly pass
the timeout along to WaitForStateChangedEventsPrivate() and made the function
behave correctly with respect to timing out.

Added separate STDIN, STDOUT, and STDERR support to debugserver. Also added
the start of being able to set the working directory for the inferior process.

llvm-svn: 124049
2011-01-22 23:43:18 +00:00
Greg Clayton 7ecb3a040b Avoid the race condition Stephen Wilson was worried about in revision 123465 by making a local copy. We need to be able to have the private state thread let the lldb_private::Process class that it has exited, otherwise we end up with a timeout when the process destructor or DoDestroy is called where the private state thread has already exited and then StopPrivateStateThread() will wait for the thread which has already existed to respond to it.
llvm-svn: 124038
2011-01-22 17:43:17 +00:00
Greg Clayton 6ed95945ed Sped up the shutdown time on MacOSX by quite a bit by making sure any
threads that we spawn let us know when they are going away and that we
don't timeout waiting for a message from threads that have gone away.
We also now don't expect the "k" packet (kill) to send a response. This
greatly speeds up debugger shutdown performance. The test suite now runs
quite a bit faster.

Added a fix to the variable display code that fixes the display of
base classes. We were assuming the virtual or normal base class offsets
were being given in bit sizes, but they were being given as character
sizes, so we needed to multiply the offset by 8. This wasn't affecting
the expression parser, but it was affecting the correct display of C++
class base classes and all of their children.

llvm-svn: 124024
2011-01-22 07:12:45 +00:00
Jim Ingham 1c823b43e5 Added an interface for noticing new thread creation. At this point, I only turn it on when
we are requesting a single thread to run.  May seem like a silly thing to do, but the kernel 
on MacOS X will inject new threads into a program willy-nilly, and I would like to keep them
from running if I can.

llvm-svn: 124018
2011-01-22 01:33:44 +00:00
Jim Ingham e22e88b8a8 Add more logging. Try to handle the case where "Halt" fails. This is kind of a losing game in the end, if we can't halt the target, it is not clear what we can do but keep trying...
llvm-svn: 124017
2011-01-22 01:30:53 +00:00
Jim Ingham e54defe4a3 Centralize the register reporting (might want to move this function to Thread).
llvm-svn: 124016
2011-01-22 01:28:29 +00:00
Jim Ingham 9da3683c43 Centralize the register reporting (might want to move this function to Thread).
Make sure DoTakedown gets called only once by adding a dedicated m_takedown_done bool. 
Add a little more useful logging.

llvm-svn: 124015
2011-01-22 01:27:23 +00:00
Jim Ingham e3be0c55f5 Move some of the more noisy "log enable lldb expression" output to the verbose output.
llvm-svn: 124014
2011-01-22 01:25:40 +00:00
Jim Ingham d8d148e0ee Make "log enable -v" work. We were only checking the log's stream's verbosity, not the log's verbosity...
llvm-svn: 124013
2011-01-22 01:24:30 +00:00
Jim Ingham 50646ab3e1 Add a (currently disabled) bear trap where instead of deallocating pages, we remove all permissions.
llvm-svn: 124012
2011-01-22 01:22:51 +00:00
Caroline Tice e02657b181 Add API and implementation for SBDebugger::Destroy and Debugger::Destroy.
llvm-svn: 124011
2011-01-22 01:02:07 +00:00
Johnny Chen 05a97ecc02 Add more descriptions to the g_arm_opcodes table entries.
llvm-svn: 124010
2011-01-22 00:59:07 +00:00
Johnny Chen 7aeb12b848 Pass along (ARMEncoding)encoding as the callback data, which allows us to abstract
the EmulateCallback routine without too much duplication.  Add an entry for emulating
ARM PUSH with encoding A2.

llvm-svn: 124009
2011-01-22 00:47:08 +00:00
Jim Ingham d14777a2f2 Add missing {} so we don't print the Baton address for the brief breakpoint listing.
llvm-svn: 124008
2011-01-22 00:28:04 +00:00
Johnny Chen dfeab068f5 Untabify the file.
llvm-svn: 124003
2011-01-21 22:47:25 +00:00
Sean Callanan f694a55736 Added a safeguard to ensure that the user does not create variables that override persistent result variables.
llvm-svn: 124001
2011-01-21 22:30:25 +00:00
Jim Ingham 8f3432c916 The code to check whether the number of arguments was 0 was not necessary, VerifyBreakpointIDs will turn an empty argument into the last specified breakpoint.
llvm-svn: 124000
2011-01-21 22:13:25 +00:00
Greg Clayton 6da4ca83b0 Added the start of opcode emulation for ARM instructions. This class is designed
to be fed 4 callbacks: read/write memory, and read/write registers. After this,
you can tell the object to read an instruction. This will cause the class to read
the PC, and read and instruction. Then you can emulate the instruction by calling
EvaluateInstruction. This will cause the class to figure out exactly what an opcode
does, and call the read/write mem/regs functions with actual values which allows one
to emulate an instruction without running a process, or it allows one to watch the
context information (the memory write is a pushing register 3 onto the stack at offset
12) so it can be used for generating call frame information. This way, in the future,
we will have one class that can be used to emulate instructions and generate our
unwind info from assembly.

llvm-svn: 123998
2011-01-21 22:02:52 +00:00
Johnny Chen 661ba65dd8 Add test cases for the scenario of selecting a frame index while stopped, and
then doing a thread step-out.  This should lead us to the caller frame of the
frame we just selected.

llvm-svn: 123984
2011-01-21 18:23:16 +00:00
Greg Clayton 481cef25dc Added support for stepping out of a frame. If you have 10 stack frames, and you
select frame #3, you can then do a step out and be able to go directly to the
frame above frame #3! 

Added StepOverUntil and StepOutOfFrame to the SBThread API to allow more powerful
stepping.

llvm-svn: 123970
2011-01-21 06:11:58 +00:00
Greg Clayton e221f82b40 Fixed up the SBValue::GetExpressionPath() to be more correct under more
circumstances.

llvm-svn: 123957
2011-01-21 01:59:00 +00:00