summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process
Commit message (Collapse)AuthorAgeFilesLines
* Should provide more useful context info for the emulate_ldr_rd_pc_rel() impl.Johnny Chen2011-01-281-10/+9
| | | | | | The context being that it's a PC relative load. llvm-svn: 124460
* If the user specfies one of stdin, stdout or stderr, don'tCaroline Tice2011-01-281-4/+17
| | | | | | automatically set the non-specified ones to /dev/null. llvm-svn: 124459
* Add emulate_ldr_rd_pc_rel entry to the g_thumb_opcodes table, which represents aJohnny Chen2011-01-272-4/+73
| | | | | | | PC relative immediate load into register, possibly followed by an add operation to adjust the SP. llvm-svn: 124448
* Add emulate_add_sp_rm entry to the g_thumb_opcodes table, which represents ↵Johnny Chen2011-01-271-10/+70
| | | | | | | | an operation to adjust the stack pointer by adding a register value in Rm to the SP. llvm-svn: 124400
* Finally tracked down the racy condition that would hose up our debugGreg Clayton2011-01-271-51/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sessions: When continue packet has been sent and an interrupt packet was quickly sent, it would get read at the same time: $c#00\x03 There was an error where the packet end index was always being computed incorrectly by debugserver, but it wouldn't matter if there weren't extra bytes on the end (the hex \x03 interrupt byte in this case). The first '$' last 3 bytes of the data in the packet buffer were being trimmed (trying to trim the '#' + checksum (#XX)) which made: c# And this would then be passed to the handle routine for the 'c' packet which would see an extra character at the end and assume it was going to be in the form c[addr] where "[addr]" was a hex address to resume at and this would result in a malformed packet response. This is now fixed and everything works great. Another issue was issuing async packets correctly by doing correct handshakes between the thread that wants to send the async packet, and the thread that is tracking the current run. Added a write lock to the communication class as well to make sure you never get two threads trying to write data at the same time. This wasn't happening, but it is a good idea to make sure it doesn't. llvm-svn: 124369
* Add emulate_add_rd_sp_imm (SP plus immediate) to the g_arm_opcodes and ↵Johnny Chen2011-01-272-31/+86
| | | | | | | | g_thumb_opcodes tables. Change the data type of Context.arg2 to int64_t due to possible negative values. llvm-svn: 124343
* Add emulate_vpush (stores multiple consecutive extension registers to the ↵Johnny Chen2011-01-261-3/+108
| | | | | | | | stack) entries to both the g_arm_opcodes and g_thumb_opcodes tables. llvm-svn: 124333
* Remove duplicated comments.Johnny Chen2011-01-261-2/+0
| | | | llvm-svn: 124262
* Move #define's out of ARMUtils.h and into a newly created file ARMDefines.h.Johnny Chen2011-01-263-36/+57
| | | | llvm-svn: 124261
* Move the generic instruction bits manipulation routines into a newly created ↵Johnny Chen2011-01-264-76/+91
| | | | | | | | file named InstructionUtils.h and modify some existing code to use them. llvm-svn: 124259
* Add Encoding T1 entry of emulate_sub_sp_imm to the g_thumb_opcodes table.Johnny Chen2011-01-262-1/+15
| | | | | | Update emulate_sub_sp_imm to handle Encoding T1. llvm-svn: 124253
* Enabled extra warnings and fixed a bunch of small issues.Greg Clayton2011-01-255-15/+9
| | | | llvm-svn: 124250
* Add Encoding T2 & T3 entries of emulate_sub_sp_imm to the g_thumb_opcodes table.Johnny Chen2011-01-252-11/+70
| | | | | | Update emulate_sub_sp_imm to handle Encoding T2 & T3. llvm-svn: 124248
* Add an entry to the g_arm_opcodes table named emulate_sub_sp_imm which ↵Johnny Chen2011-01-252-7/+89
| | | | | | | | corresponds to an operation to adjust the stack pointer (allocate space for local storage). llvm-svn: 124237
* Variable renaming for better readability.Johnny Chen2011-01-251-12/+12
| | | | llvm-svn: 124208
* Reverting recent thread resume changes as it was causing testing issues.Greg Clayton2011-01-251-4/+5
| | | | | | We will need to try again soon, but this change was causing instability. llvm-svn: 124180
* When we are stepping a thread, force it to resume ALL the way to 0. And of ↵Jim Ingham2011-01-251-2/+2
| | | | | | | | course, when we stop if we undid some user provided suspends, we need to re-do the suspends. llvm-svn: 124178
* One more fix to ProcessGDBRemote::DoDestroy(). This one will make sure weGreg Clayton2011-01-251-1/+11
| | | | | | parse the exit status in case we send this packet while stopped. llvm-svn: 124177
* Fixed ProcessGDBRemote to kill the process correctly when it is either runningGreg Clayton2011-01-253-91/+40
| | | | | | | | or stopped. Added support for sections to be able to state if they are encrypted or not. llvm-svn: 124171
* Add an emulate-callback function emulate_str_rt_sp() to the g_arm_opcodes table.Johnny Chen2011-01-251-8/+87
| | | | llvm-svn: 124165
* Use two opcode tables g_arm_opcodes and g_thumb_opcodes, instead of lumping ↵Johnny Chen2011-01-241-5/+10
| | | | | | arm and thumb opcodes together. llvm-svn: 124156
* Fix typo of encoding T2 (push) in the original ARM Architecture Reference ↵Johnny Chen2011-01-241-1/+1
| | | | | | | | Manual, which has been corrected in the subsequent errata. llvm-svn: 124152
* Add comment about using Encoding A1 push instruction to emulate the "stmfd ↵Johnny Chen2011-01-241-0/+3
| | | | | | | | sp!, reg" case, i.e., pushing one register onto the full descending stacks. llvm-svn: 124149
* Make the assembler mnemonic lowercase.Johnny Chen2011-01-241-5/+5
| | | | llvm-svn: 124147
* Add Encoding T1 of the PUSH instructions to the g_arm_opcodes table.Johnny Chen2011-01-241-1/+12
| | | | llvm-svn: 124144
* Fix typo in the instruction descriptions for Encoding T2 and T3 of PUSH.Johnny Chen2011-01-241-2/+2
| | | | llvm-svn: 124143
* Move some #define's to the ARMUtils.h header file.Johnny Chen2011-01-242-37/+37
| | | | llvm-svn: 124141
* Add Encoding T2 & T3 of the PUSH instructions to the g_arm_opcodes table.Johnny Chen2011-01-242-9/+47
| | | | | | Plus add an extra field ARMInstrSize to the table entry type 'ARMOpcode'. llvm-svn: 124140
* Add an ARMUtils.h file to house utility functions for the ARM/Thumb ↵Johnny Chen2011-01-242-0/+25
| | | | | | Instruction Set Architecture. llvm-svn: 124131
* Remember to turn off the debugserver.txt hard-coded emission.Jim Ingham2011-01-241-2/+2
| | | | llvm-svn: 124114
* More useful STEP logging.Jim Ingham2011-01-241-2/+2
| | | | | | 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
* Improved process logging for both lldb_private::Process and ProcessGDBRemote.Greg Clayton2011-01-231-10/+43
| | | | llvm-svn: 124080
* Added a new variant of SBTarget::Launch() that deprectates the old one thatGreg Clayton2011-01-236-18/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fixed an issue in "SBError SBProcess::Destroy ()" where it wasn't properlyGreg Clayton2011-01-224-30/+131
| | | | | | | | | | | | | | | | | | | | 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
* Sped up the shutdown time on MacOSX by quite a bit by making sure anyGreg Clayton2011-01-223-46/+50
| | | | | | | | | | | | | | | | | 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
* Added an interface for noticing new thread creation. At this point, I only ↵Jim Ingham2011-01-222-1/+103
| | | | | | | | | | 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
* Add more descriptions to the g_arm_opcodes table entries.Johnny Chen2011-01-221-3/+5
| | | | llvm-svn: 124010
* Pass along (ARMEncoding)encoding as the callback data, which allows us to ↵Johnny Chen2011-01-221-8/+20
| | | | | | | | | abstract the EmulateCallback routine without too much duplication. Add an entry for emulating ARM PUSH with encoding A2. llvm-svn: 124009
* Untabify the file.Johnny Chen2011-01-211-5/+5
| | | | llvm-svn: 124003
* Added the start of opcode emulation for ARM instructions. This class is designedGreg Clayton2011-01-214-0/+696
| | | | | | | | | | | | | | | 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
* Fixed the async packets (packets that need to be sent to the GDB server Greg Clayton2011-01-202-8/+25
| | | | | | | | | | | while the inferior is running) to be fast. The previous code would always cause the sender to timeout, yet still return success due to the way we were waiting for a value (incorrect value) to change. Now the ProcessGDBRemote plug-in has a public and private "is running" predicate. This allows things that need to send async packets to interrupt and wait for the private "is running" state to be flipped to false, and then resume quickly with no timeout. llvm-svn: 123903
* Back up both the register AND the stop state when calling functions.Jim Ingham2011-01-204-27/+20
| | | | | | | Set the thread state to "bland" before calling functions so they don't inherit the pending signals and die. llvm-svn: 123869
* Delay sync with the parent thread in ProcessLinux/ProcessMonitor.Stephen Wilson2011-01-192-5/+8
| | | | | | | This patch removes a potential race condition between a process monitor thread and its parent waiting to interrogate the success/failure of the launch. llvm-svn: 123803
* Make LinuxThread use the LLDB unwinder.Stephen Wilson2011-01-192-3/+17
| | | | llvm-svn: 123801
* Do not enable hardware stepping when resuming a step-enabled thread.Stephen Wilson2011-01-191-1/+1
| | | | | | | The previous implementation of HardwareSingleStep wrongly resumed the thread and single-stepped over the next instruction. Use the proper call to ProcessMonitor. llvm-svn: 123800
* Fix implementation of LinuxThread::HardwareSingleStep.Stephen Wilson2011-01-191-1/+22
| | | | | | | | Previous version simply resumed the associated thread to single step over a single instruction which is not the intended semantics for this method. Set the appropriate bit in the rflags register instead. llvm-svn: 123799
* Implement RegisterContextLinux_x86_64::ReadRegisterBytes.Stephen Wilson2011-01-192-10/+59
| | | | | | | Also, this patch adds a few delimiters to the register enumeration to enable efficient testing of register set inclusion. llvm-svn: 123798
* Support the reading of registers en masse via the linux ProcessMonitor.Stephen Wilson2011-01-192-0/+78
| | | | llvm-svn: 123797
* Timeout if we fail to receive a state change event when destroying an inferior.Stephen Wilson2011-01-191-4/+12
| | | | llvm-svn: 123796
* Only enqueue valid ProcessLinux messages.Stephen Wilson2011-01-191-1/+5
| | | | llvm-svn: 123795
OpenPOWER on IntegriCloud