summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Process.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Rationalize how we do Halt-ing before Destroy and Detach.Jim Ingham2013-03-291-41/+94
| | | | | | <rdar://problem/13527167> llvm-svn: 178325
* RunThreadPlan should make sure the plan passed in is valid before running it.Jim Ingham2013-03-281-1/+7
| | | | | | <rdar://problem/13485541> llvm-svn: 178202
* <rdar://problem/13521159>Greg Clayton2013-03-271-30/+30
| | | | | | | | LLDB is crashing when logging is enabled from lldb-perf-clang. This has to do with the global destructor chain as the process and its threads are being torn down. All logging channels now make one and only one instance that is kept in a global pointer which is never freed. This guarantees that logging can correctly continue as the process tears itself down. llvm-svn: 178191
* Fix ivar ordering for Process ctor to match the order they'reJason Molenda2013-03-051-2/+2
| | | | | | declared in the .h file. llvm-svn: 176473
* Move m_destroy_in_process to Process (from ProcessKDP) since it is generally ↵Jim Ingham2013-03-011-6/+25
| | | | | | | | | | | | useful, and use it to keep from doing the OS Plugin UpdateThreadList while destroying, since if that does anything that requires the API lock it may deadlock against whoever is running the Process::Destroy. <rdar://problem/13308627> llvm-svn: 176375
* Fix clang warnings related to python macro redefinition and printf format ↵Matt Kopec2013-02-211-1/+1
| | | | | | specifiers. llvm-svn: 175829
* If RunThreadPlan is called on a thread that doesn't have a selected frame, ↵Jim Ingham2013-02-191-1/+13
| | | | | | | | select frame 0. <rdar://problem/13093321> llvm-svn: 175573
* A little cleanup. {Disable/Enable}Breakpoint actually disables/enables ↵Jim Ingham2013-02-151-6/+6
| | | | | | | | | BreakpointSites not breakpoints, it is confusing to have it not named appropriately. Also in StopInfoMachException, we aren't testing for software or not software, just whether the thing is a breakpoint we set. So don't use "software"... llvm-svn: 175241
* <rdar://problem/13200878>Greg Clayton2013-02-141-2/+3
| | | | | | | | | | | | | | When launching in the shell, make sure if you specify a relative path, and if the current working directory has a space in it, that we don't hose the shell invocation. Currently if we launch with a relative path, we prepend the current working directory to the PATH using: PATH=`cwd`:$PATH a.out ... We needed to add quotes around the value for PATH to make sure if any paths in PATH contained spaces, that we don't hose the shell command. Now we do a: PATH="`cwd`:$PATH" a.out ... llvm-svn: 175135
* Reworked the way Process::RunThreadPlan and the ThreadPlanCallFunction ↵Jim Ingham2013-02-091-255/+342
| | | | | | | | | | | interoperate to fix problems where hitting auto-continue signals while running a thread plan would cause us to lose control of the debug session. <rdar://problem/12993641> llvm-svn: 174793
* <rdar://problem/13092722>Greg Clayton2013-02-011-14/+1
| | | | | | | | | | Fix in loading mach files from memory when using DynamicLoaderMacOSXDYLD. Removed the uuid mismatch warning that could be spit out and any time during debugging and removed the test case that was looking for that. Currently the "add-dsym" or "target symbols add" command will report an error when the UUID's don't match. Be more careful when checking and resolving section + offset addresses to make sure none of the base addresses are invalid. llvm-svn: 174222
* Change the default behavior for unwinding and breakpoints when running ↵Jim Ingham2013-01-311-2/+2
| | | | | | | | expressions. <rdar://problem/13121442> llvm-svn: 174082
* Add "target.process.stop-on-shared-library-events" setting, and make it work.Jim Ingham2013-01-261-2/+18
| | | | | | | | | | | Add the ability to give breakpoints a "kind" string, and have the StopInfoBreakpoint print that in the brief description if set. Also print the kind - if set - in the breakpoint listing. Give kinds to a bunch of the internal breakpoints. We were deleting the Mac OS X dynamic loader breakpoint as though the id we had stored away was a breakpoint site ID, but in fact it was a breakpoint id, so we never actually deleted it. Fixed that. llvm-svn: 173555
* <rdar://problem/13069948>Greg Clayton2013-01-251-3/+3
| | | | | | | | | | | | Major fixed to allow reading files that are over 4GB. The main problems were that the DataExtractor was using 32 bit offsets as a data cursor, and since we mmap all of our object files we could run into cases where if we had a very large core file that was over 4GB, we were running into the 4GB boundary. So I defined a new "lldb::offset_t" which should be used for all file offsets. After making this change, I enabled warnings for data loss and for enexpected implicit conversions temporarily and found a ton of things that I fixed. Any functions that take an index internally, should use "size_t" for any indexes and also should return "size_t" for any sizes of collections. llvm-svn: 173463
* <rdar://problem/13010007>Greg Clayton2013-01-181-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Added the ability for OS plug-ins to lazily populate the thread this. The python OS plug-in classes can now implement the following method: class OperatingSystemPlugin: def create_thread(self, tid, context): # Return a dictionary for a new thread to create it on demand This will add a new thread to the thread list if it doesn't already exist. The example code in lldb/examples/python/operating_system.py has been updated to show how this call us used. Cleaned up the code in PythonDataObjects.cpp/h: - renamed all classes that started with PythonData* to be Python*. - renamed PythonArray to PythonList. Cleaned up the code to use inheritance where - Centralized the code that does ref counting in the PythonObject class to a single function. - Made the "bool PythonObject::Reset(PyObject *)" function be virtual so each subclass can correctly check to ensure a PyObject is of the right type before adopting the object. - Cleaned up all APIs and added new constructors for the Python* classes to they can all construct form: - PyObject * - const PythonObject & - const lldb::ScriptInterpreterObjectSP & Cleaned up code in ScriptInterpreterPython: - Made calling python functions safer by templatizing the production of value formats. Python specifies the value formats based on built in C types (long, long long, etc), and code often uses typedefs for uint32_t, uint64_t, etc when passing arguments down to python. We will now always produce correct value formats as the templatized code will "do the right thing" all the time. - Fixed issues with the ScriptInterpreterPython::Locker where entering the session and leaving the session had a bunch of issues that could cause the "lldb" module globals lldb.debugger, lldb.target, lldb.process, lldb.thread, and lldb.frame to not be initialized. llvm-svn: 172873
* Removed unused variable.Greg Clayton2013-01-161-1/+0
| | | | llvm-svn: 172662
* <rdar://problem/13009943>Greg Clayton2013-01-161-4/+14
| | | | | | | | | | Added a unique integer identifier to processes. Some systems, like JTAG or other simulators, might always assign the same process ID (pid) to the processes that are being debugged. In order for scripts and the APIs to uniquely identify the processes, there needs to be another ID. Now the SBProcess class has: uint32_t SBProcess::GetUniqueID(); This integer ID will help to truly uniquely identify a process and help with appropriate caching that can be associated with a SBProcess object. llvm-svn: 172628
* Separated the "expr --unwind-on-error" behavior into two parts, actual ↵Jim Ingham2013-01-151-21/+89
| | | | | | | | | | | | | | | | errors (i.e. crashes) which continue to be controlled by the --unwind-on-error flag, and --ignore-breakpoint which separately controls behavior when a called function hits a breakpoint. For breakpoints, we don't unwind, we either stop, or ignore the breakpoint, which makes more sense. Also make both these behaviors globally settable through "settings set". Also handle the case where a breakpoint command calls code that ends up re-hitting the breakpoint. We were recursing and crashing. Now we just stop without calling the second command. <rdar://problem/12986644> <rdar://problem/9119325> llvm-svn: 172503
* <rdar://problem/12990038>Greg Clayton2013-01-111-1/+1
| | | | | | Fixed an issue where the platform auto select code was changing the architecture and causing the wrong architecture to be assigned to the target. llvm-svn: 172251
* <rdar://problem/12976225>Han Ming Ong2013-01-081-0/+40
| | | | | | Checking in the support for doing index ids reservation when given a thread id. llvm-svn: 171904
* Adding events when watchpoints are set or changed.Jim Ingham2012-12-181-2/+2
| | | | | | <rdar://problem/11597849> llvm-svn: 170400
* Fixed a thinko in the handling of the case where more than one thread had ↵Jim Ingham2012-12-131-5/+9
| | | | | | | | | | stopped with real stop reasons at the same time. Should be that if any of the threads wants to stop, we should stop. The opposite was what was actually happening <rdar://problem/12869725> llvm-svn: 170153
* Removed the == and != operators from ArchSpec, sinceSean Callanan2012-12-131-2/+2
| | | | | | | | | | | | equality can be strict or loose and we want code to explicitly choose one or the other. Also renamed the Compare function to IsEqualTo, to avoid confusion. <rdar://problem/12856749> llvm-svn: 170152
* More Linux warnings fixes (remove default labels as needed):Daniel Malea2012-12-071-5/+0
| | | | | | | | - as per http://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations Patch by Matt Kopec! llvm-svn: 169633
* Fix Linux build warnings due to redefinition of macros:Daniel Malea2012-12-051-0/+2
| | | | | | | | | - add new header lldb-python.h to be included before other system headers - short term fix (eventually python dependencies must be cleaned up) Patch by Matt Kopec! llvm-svn: 169341
* <rdar://problem/12649160>Greg Clayton2012-12-051-0/+19
| | | | | | Added the ability to debug through your process exec'ing itself to the same architecture. llvm-svn: 169340
* <rdar://problem/12798131> Greg Clayton2012-12-041-1/+1
| | | | | | | | | | | | Cleaned up the option parsing code to always pass around the short options as integers. Previously we cast this down to "char" and lost some information. I recently added an assert that would detect duplicate short character options which was firing during the test suite. This fix does the following: - make sure all short options are treated as "int" - make sure that short options can be non-printable values when a short option is not required or when an option group is mixed into many commands and a short option is not desired - fix the help printing to "do the right thing" in all cases. Previously if there were duplicate short character options, it would just not emit help for the duplicates - fix option parsing when there are duplicates to parse options correctly. Previously the option parsing, when done for an OptionGroup, would just start parsing options incorrectly by omitting table entries and it would end up setting the wrong option value llvm-svn: 169189
* <rdar://problem/12780259>Han Ming Ong2012-11-291-6/+9
| | | | | | | Prevent async and sync calls to get profile data from stomping on each other. At the same time, don't use '$' as end delimiter per chunk of profile data. llvm-svn: 168948
* Resolve printf formatting warnings on Linux:Daniel Malea2012-11-291-40/+40
| | | | | | | | - use macros from inttypes.h for format strings instead of OS-specific types Patch from Matt Kopec! llvm-svn: 168945
* <rdar://problem/12655594>Greg Clayton2012-11-291-1/+1
| | | | | | Be sure to resolve the file path for the "target.process.python-os-plugin-path" setting. llvm-svn: 168916
* Add an example of using the target.process.extra-startup-command to turn on ↵Jim Ingham2012-11-291-1/+2
| | | | | | | | debugserver logging since we always forget how to do this... llvm-svn: 168840
* The Function calling thread plan was replacing the stored stop info too ↵Jim Ingham2012-11-261-0/+9
| | | | | | | | | | soon, causing recursive entry into the breakpoint StopInfo's PerformAction, which is bad. Reworked this so that it is now correct. <rdar://problem/12501259> llvm-svn: 168634
* Han Ming's commit in r168228 had a bunch of 4-space tabsJason Molenda2012-11-171-1/+1
| | | | | | | in the source files. Expand to spaces. No content changes, just whitespace. llvm-svn: 168238
* Follow up on <rdar://12720514>. Removed commented out code.Han Ming Ong2012-11-171-6/+1
| | | | llvm-svn: 168232
* <rdar://problem/12720514> Sub-TLF: Provide service to profile the inferiorHan Ming Ong2012-11-171-1/+45
| | | | | | This allows client to query profiling states on the inferior. llvm-svn: 168228
* <rdar://problem/12586350>Enrico Granata2012-11-081-1/+1
| | | | | | | | | | | | | | This commit does three things: (a) introduces a new notification model for adding/removing/changing modules to a ModuleList, and applies it to the Target's ModuleList, so that we make sure to always trigger the right set of actions whenever modules come and go in a target. Certain spots in the code still need to "manually" notify the Target for several reasons, so this is a work in progress (b) adds a new capability to the Platforms: locating a scripting resources associated to a module. A scripting resource is a Python file that can load commands, formatters, ... and any other action of interest corresponding to the loading of a module. At the moment, this is only implemented on Mac OS X and only for files inside .dSYM bundles - the next step is going to be letting the frameworks themselves hold their scripting resources. Implementors of platforms for other systems are free to implement "the right thing" for their own worlds (c) hooking up items (a) and (b) so that targets auto-load the scripting resources as the corresponding modules get loaded in a target. This has a few caveats at the moment: - the user needs to manually add the .py file to the dSYM (soon, it will also work in the framework itself) - if two modules with the same name show up during the lifetime of an LLDB session, the second one won't be able to load its scripting resource, but will otherwise work just fine llvm-svn: 167569
* Carlo Kok found an issue where default parameters were causing the wrong ↵Greg Clayton2012-10-311-2/+20
| | | | | | argument to be passed. I got rid of the default args so we don't run into this. llvm-svn: 167167
* <rdar://problem/12500785>Greg Clayton2012-10-291-3/+23
| | | | | | | | I tracked down a leak that could happen when detaching from a process where the lldb_private::Process objects would stay around forever. This was caused by a eStateDetached event that was queued up on the lldb_private::Process private state thread listener. Since process events contain shared pointers to the process, this is dangerous if they don't get consume or cleared as having the lldb_private::Process class contain a collection of things that have a shared pointer to yourself is obviously bad. To fix this I modified the Process::Finalize() function to clear this list. The actual thing that was holding onto the ModuleSP and thus the static archive, was a stack frame. Since the process wasn't going away, it still had thread objects and they still had frames. I modified the Thread::Destroy() to clear the stack frames to ensure this further doesn't happen. llvm-svn: 166964
* This is a fix for the command option parser.Sean Callanan2012-10-241-5/+5
| | | | | | | | | | | | | | | | There was a generic catch-all type for path arguments called "eArgTypePath," and a specialized version called "eArgTypeFilename." It turns out all the cases where we used eArgTypePath we could have used Filename or we explicitly meant a directory. I changed Path to DirectoryName, made it use the directory completer, and rationalized the uses of Path. <rdar://problem/12559915> llvm-svn: 166533
* <rdar://problem/12491420>Greg Clayton2012-10-181-1/+17
| | | | | | | | | | Added a new setting that allows a python OS plug-in to detect threads and provide registers for memory threads. To enable this you set the setting: settings set target.process.python-os-plugin-path lldb/examples/python/operating_system.py Then run your program and see the extra threads. llvm-svn: 166244
* <rdar://problem/12462048>Greg Clayton2012-10-171-40/+61
| | | | | | | | | | | | | | | | | | | LLDB changes argv[0] when debugging a symlink. Now we have the notion of argv0 in the target settings: target.arg0 (string) = There is also the program argument that are separate from the first argument that have existed for a while: target.run-args (arguments) = When running "target create <exe>", we will place the untouched "<exe>" into target.arg0 to ensure when we run, we run with what the user typed. This has been added to the ProcessLaunchInfo and all other needed places so we always carry around the: - resolved executable path - argv0 - program args Some systems may not support separating argv0 from the resolved executable path and the ProcessLaunchInfo needs to carry all of this information along so that each platform can make that decision. llvm-svn: 166137
* Add the ability to set timeout & "run all threads" options both from the ↵Jim Ingham2012-10-161-27/+49
| | | | | | | | | | "expr" command and from the SB API's that evaluate expressions. <rdar://problem/12457211> llvm-svn: 166062
* Patch from Matt Kopec <matt.kopec@intel.com> to fix the problem that if two ↵Jim Ingham2012-10-161-2/+3
| | | | | | | | breakpoints were set on consecutive addresses, the continue from the first breakpoint would skip the second. llvm-svn: 166000
* Modified patch from Matt Kopec that makes sure the run lock is acquired when ↵Greg Clayton2012-10-121-6/+25
| | | | | | attaching and makes sure the pid is being set on linux in the process info. llvm-svn: 165804
* Ran the sources through the compiler with -Wshadow warningsJason Molenda2012-10-041-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | enabled after we'd found a few bugs that were caused by shadowed local variables; the most important issue this turned up was a common mistake of trying to obtain a mutex lock for the scope of a code block by doing Mutex::Locker(m_map_mutex); This doesn't assign the lock object to a local variable; it is a temporary that has its dtor called immediately. Instead, Mutex::Locker locker(m_map_mutex); does what is intended. For some reason -Wshadow happened to highlight these as shadowed variables. I also fixed a few obivous and easy shadowed variable issues across the code base but there are a couple dozen more that should be fixed when someone has a free minute. <rdar://problem/12437585> llvm-svn: 165269
* Add support for debugging KASLR kernels via kdp (the kernel beingJason Molenda2012-09-291-2/+2
| | | | | | | | | | | | | | | | | | loaded at a random offset). To get the kernel's UUID and load address I need to send a kdp packet so I had to implement the kernel relocation (and attempt to find the kernel if none was provided to lldb already) in ProcessKDP -- but this code really properly belongs in DynamicLoaderDarwinKernel. I also had to add an optional Stream to ConnectRemote so ProcessKDP::DoConnectRemote can print feedback about the remote kernel's UUID, load address, and notify the user if we auto-loaded the kernel via the UUID. <rdar://problem/7714201> llvm-svn: 164881
* Stop using the "%z" size_t modifier and cast all size_t values to uint64_t. ↵Greg Clayton2012-09-181-2/+2
| | | | | | Some platforms don't support this modification. llvm-svn: 164148
* <rdar://problem/11935492>Greg Clayton2012-09-111-9/+28
| | | | | | Fixed an issue where if we call "Process::Destroy()" and the process is running, if we try to stop it and get "exited" back as the stop reason, we will still deliver the exited event. llvm-svn: 163591
* Fixed a few places where we were doing:Jim Ingham2012-09-101-0/+1
| | | | | | | | | uint32_t size = ThreadList.GetSize(); for (i=0; i < size; ++i) without grabbing the thread list mutex. llvm-svn: 163541
* Include a useful bit of log output in the "step" as well as the "process" logs.Jim Ingham2012-09-061-1/+1
| | | | llvm-svn: 163340
OpenPOWER on IntegriCloud