- Jan 26, 2011
-
-
Jim Ingham authored
Make sure that if a CallFunction thread plan crashes while running in the "run to address" mode, and it is an auto-discard thread plan, the plan stack unwinds properly. llvm-svn: 124306
-
Jim Ingham authored
llvm-svn: 124305
-
Greg Clayton authored
llvm-svn: 124250
-
- Jan 25, 2011
-
-
Greg Clayton authored
or stopped. Added support for sections to be able to state if they are encrypted or not. llvm-svn: 124171
-
Jim Ingham authored
llvm-svn: 124170
-
Greg Clayton authored
contained a valid object pointer. llvm-svn: 124155
-
- Jan 24, 2011
-
-
Greg Clayton authored
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
-
Jim Ingham authored
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
-
Greg Clayton authored
llvm-svn: 124112
-
Greg Clayton authored
llvm-svn: 124109
-
Jim Ingham authored
Some useful logging. Also don't stuff the temporary thread into a shared pointer for no apparent reason. llvm-svn: 124108
-
- Jan 23, 2011
-
-
Jim Ingham authored
Add some more logging of broadcaster and Process. Also, protect the event broadcasting against hijacking in mid-event delivery. llvm-svn: 124084
-
Greg Clayton authored
llvm-svn: 124080
-
Greg Clayton authored
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
-
Greg Clayton authored
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
-
- Jan 22, 2011
-
-
Greg Clayton authored
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
-
Greg Clayton authored
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
-
Jim Ingham authored
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
-
Jim Ingham authored
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
-
Jim Ingham authored
Make sure DoTakedown gets called only once by adding a dedicated m_takedown_done bool. Add a little more useful logging. llvm-svn: 124015
-
- Jan 21, 2011
-
-
Greg Clayton authored
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
-
- Jan 20, 2011
-
-
Greg Clayton authored
fragile ivars if requested. This was done by changing the previous second parameter to an options bitfield that can be populated by logical OR'ing the new StackFrame::ExpressionPathOption enum values together: typedef enum ExpressionPathOption { eExpressionPathOptionCheckPtrVsMember = (1u << 0), eExpressionPathOptionsNoFragileObjcIvar = (1u << 1), }; So the old function was: lldb::ValueObjectSP StackFrame::GetValueForVariableExpressionPath (const char *var_expr, bool check_ptr_vs_member, Error &error); But it is now: lldb::ValueObjectSP StackFrame::GetValueForVariableExpressionPath (const char *var_expr, uint32_t options, Error &error); This allows the expression parser in Target::EvaluateExpression(...) to avoid using simple frame variable expression paths when evaluating something that might be a fragile ivar. llvm-svn: 123938
-
Jim Ingham authored
Set the thread state to "bland" before calling functions so they don't inherit the pending signals and die. llvm-svn: 123869
-
- Jan 18, 2011
-
-
Greg Clayton authored
llvm-svn: 123780
-
Greg Clayton authored
I added support for asking if the GDB remote server supports thread suffixes for packets that should be thread specific (register read/write packets) because the way the GDB remote protocol does it right now is to have a notion of a current thread for register and memory reads/writes (set via the "$Hg%x" packet) and a current thread for running ("$Hc%x"). Now we ask the remote GDB server if it supports adding the thread ID to the register packets and we enable that feature in LLDB if supported. This stops us from having to send a bunch of packets that update the current thread ID to some value which is prone to error, or extra packets. llvm-svn: 123762
-
Jim Ingham authored
In ThreadPlanCallFunction, do the Takedown right when the thread plan gets popped. When the function call is discarded (e.g. when it crashes and discard_on_error is true) the plan gets discarded. You need to make sure that the stack gets restored right then, and not wait till you start again and the thread plan stack is cleared. llvm-svn: 123716
-
- Jan 17, 2011
-
-
Greg Clayton authored
the way LLDB lazily gets complete definitions for types within the debug info. When we run across a class/struct/union definition in the DWARF, we will only parse the full definition if we need to. This works fine for top level types that are assigned directly to variables and arguments, but when we have a variable with a class, lets say "A" for this example, that has a member: "B *m_b". Initially we don't need to hunt down a definition for this class unless we are ever asked to do something with it ("expr m_b->getDecl()" for example). With my previous approach to lazy type completion, we would be able to take a "A *a" and get a complete type for it, but we wouldn't be able to then do an "a->m_b->getDecl()" unless we always expanded all types within a class prior to handing out the type. Expanding everything is very costly and it would be great if there were a better way. A few months ago I worked with the llvm/clang folks to have the ExternalASTSource class be able to complete classes if there weren't completed yet: class ExternalASTSource { .... virtual void CompleteType (clang::TagDecl *Tag); virtual void CompleteType (clang::ObjCInterfaceDecl *Class); }; This was great, because we can now have the class that is producing the AST (SymbolFileDWARF and SymbolFileDWARFDebugMap) sign up as external AST sources and the object that creates the forward declaration types can now also complete them anywhere within the clang type system. This patch makes a few major changes: - lldb_private::Module classes now own the AST context. Previously the TypeList objects did. - The DWARF parsers now sign up as an external AST sources so they can complete types. - All of the pure clang type system wrapper code we have in LLDB (ClangASTContext, ClangASTType, and more) can now be iterating through children of any type, and if a class/union/struct type (clang::RecordType or ObjC interface) is found that is incomplete, we can ask the AST to get the definition. - The SymbolFileDWARFDebugMap class now will create and use a single AST that all child SymbolFileDWARF classes will share (much like what happens when we have a complete linked DWARF for an executable). We will need to modify some of the ClangUserExpression code to take more advantage of this completion ability in the near future. Meanwhile we should be better off now that we can be accessing any children of variables through pointers and always be able to resolve the clang type if needed. llvm-svn: 123613
-
- Jan 14, 2011
-
-
Stephen Wilson authored
Setting m_private_state_thread to an invalid value when the child thread exits results in a race condition between calls to ThreadCancel and ThreadJoin. llvm-svn: 123465
-
Stephen Wilson authored
llvm-svn: 123464
-
- Jan 13, 2011
-
-
Sean Callanan authored
by LLDB. Instead of being materialized into the input structure passed to the expression, variables are left in place and pointers to them are materialzied into the structure. Variables not resident in memory (notably, registers) get temporary memory regions allocated for them. Persistent variables are the most complex part of this, because they are made in various ways and there are different expectations about their lifetime. Persistent variables now have flags indicating their status and what the expectations for longevity are. They can be marked as residing in target memory permanently -- this is the default for result variables from expressions entered on the command line and for explicitly declared persistent variables (but more on that below). Other result variables have their memory freed. Some major improvements resulting from this include being able to properly take the address of variables, better and cleaner support for functions that return references, and cleaner C++ support in general. One problem that remains is the problem of explicitly declared persistent variables; I have not yet implemented the code that makes references to them into indirect references, so currently materialization and dematerialization of these variables is broken. llvm-svn: 123371
-
- Jan 12, 2011
-
-
Stephen Wilson authored
Previously we would be posting a "FAILED" message to the log channel even when the operation succeeded. Also, take this opportunity to add braces thus eliminating an "ambiguous else" compiler warning. llvm-svn: 123306
-
Greg Clayton authored
Added the following functions to SBThread to allow threads to be suspended when a process is resumed: bool SBThread::Suspend(); bool SBThread::Resume(); bool SBThread::IsSuspended(); llvm-svn: 123300
-
- Jan 10, 2011
-
-
Greg Clayton authored
When debugging, if an expression hits a SIGABRT, it the expression ends up completing and stopping due the the "SIGABRT". Then the next thing that runs (another expression, or continuing the program) ends up progating the SIGABRT and causing the parent processes to die. We should probably think of a different solution where we suppress any signal that resulted due to an expression, or we modifyin the UnixSignals class to contain a row for "suppress for expression". So the settings for SIGABRT are: suppress = true, stop = true, and notify = true. llvm-svn: 123157
-
- Jan 09, 2011
-
-
Greg Clayton authored
a method: void RegisterContext::InvalidateIfNeeded (bool force); Each time this function is called, when "force" is false, it will only call the pure virtual "virtual void RegisterContext::InvalideAllRegisters()" if the register context's stop ID doesn't match that of the process. When the stop ID doesn't match, or "force" is true, the base class will clear its cached registers and the RegisterContext will update its stop ID to match that of the process. This helps make it easier to correctly flush the register context (possibly from multiple locations depending on when and where new registers are availabe) without inadvertently clearing the register cache when it doesn't need to be. Modified the ProcessGDBRemote plug-in to be much more efficient when it comes to: - caching the expedited registers in the stop reply packets (we were ignoring these before and it was causing us to read at least three registers every time we stopped that were already supplied in the stop reply packet). - When a thread has no stop reason, don't keep asking for the thread stopped info. Prior to this fix we would continually send a qThreadStopInfo packet over and over when any thread stop info was requested. We now note the stop ID that the stop info was requested for and avoid multiple requests. Cleaned up some of the expression code to not look for ClangExpressionVariable objects up by name since they are now shared pointers and we can just look for the exact pointer match and avoid possible errors. Fixed an bug in the ValueObject code that would cause children to not be displayed. llvm-svn: 123127
-
- Jan 07, 2011
-
-
Greg Clayton authored
subclasses will automatically be able to take advantage of caching. The cache line size is set to 512 by default. This greatly speeds up stack backtraces on MacOSX when using the ProcessGDBRemote process plug-in since only about 6300 packets per second can be sent. Initial speedups show: Prior to caching: 10,000 stack frames took 5.2 seconds After caching: 10,000 stack frames in 240 ms! About a 20x speedup! llvm-svn: 122996
-
Greg Clayton authored
cache even when a valid process exists. Previously, Target::ReadMemory would read from the process if there was a valid one and then fallback to the object file cache. llvm-svn: 122989
-
- Jan 06, 2011
-
-
Greg Clayton authored
an issue with the way the UnwindLLDB was handing out RegisterContexts: it was making shared pointers to register contexts and then handing out just the pointers (which would get put into shared pointers in the thread and stack frame classes) and cause double free issues. MallocScribble helped to find these issues after I did some other cleanup. To help avoid any RegisterContext issue in the future, all code that deals with them now returns shared pointers to the register contexts so we don't end up with multiple deletions. Also now that the RegisterContext class doesn't require a stack frame, we patched a memory leak where a StackFrame object was being created and leaked. Made the RegisterContext class not have a pointer to a StackFrame object as one register context class can be used for N inlined stack frames so there is not a 1 - 1 mapping. Updates the ExecutionContextScope part of the RegisterContext class to never return a stack frame to indicate this when it is asked to recreate the execution context. Now register contexts point to the concrete frame using a concrete frame index. Concrete frames are all of the frames that are actually formed on the stack of a thread. These concrete frames can be turned into one or more user visible frames due to inlining. Each inlined stack frame has the exact same register context (shared via shared pointers) as any parent inlined stack frames all the way up to the concrete frame itself. So now the stack frames and the register contexts should behave much better. llvm-svn: 122976
-
- Dec 22, 2010
-
-
Jason Molenda authored
0 mid-stack, stop backtracing. SectionLoadList.cpp (ResolveLoadAddress): Don't assert on an out-of-range address, just return an invalid Address object. The unwinder may be passing in invalid addresses on the final stack frame and the assert is a problem. llvm-svn: 122386
-
- Dec 20, 2010
-
-
Greg Clayton authored
llvm-svn: 122262
-
- Dec 16, 2010
-
-
Greg Clayton authored
uint64_t Process::ReadUnsignedInteger (addr_t addr, size_t int_byte_size, Error &error); llvm-svn: 121996
-