| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Python and reimplements them in C++. The Python Cocoa formatters are not shipped as part of LLDB anymore, but still exist in the source repository for user reference. Python formatters still exist for STL classes and users can still define their own Python formatters
llvm-svn: 177366
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 172647
|
|
|
|
|
|
| |
indentation for user code
llvm-svn: 171810
|
|
|
|
|
|
|
|
|
|
|
| |
Implement the ability for Python commands to be interrupted by pressing CTRL+C
Also add a new Mutex subclass that attempts to be helpful for debugging by logging actions performed on it
FYI of all interested - there is a separate deadlocking issue related to how LLDB dispatches CTRL+C that might cause LLDB to deadlock upon pressing CTRL+C while in a Python command.
This is not a regression, and was just previously masked by us not even trying to bail out of Python commands, so that it would not be clear from a user perspective whether we were
deadlocked or stuck in an inconsistent state within the Python interpreter.
llvm-svn: 170612
|
|
|
|
|
|
| |
lldb.debugger, since each script interpreter is tied to just one debugger.
llvm-svn: 169663
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
|
|
|
|
| |
from initing the lldb.target/frame/etc globals,
and only do the latter when it makes sense to.
<rdar://problem/12554049>
llvm-svn: 169614
|
|
|
|
|
|
|
|
|
| |
a file name, whether the file name had an extension
or not.
<rdar://problem/12793152>
llvm-svn: 169156
|
|
|
|
|
|
| |
"command script import" and the exception is not an ImportError
llvm-svn: 169031
|
|
|
|
|
|
|
|
| |
- use macros from inttypes.h for format strings instead of OS-specific types
Patch from Matt Kopec!
llvm-svn: 168945
|
|
|
|
|
|
| |
during command script import
llvm-svn: 167810
|
|
|
|
|
|
|
|
| |
lacking the dSYM bundle, or if the bundle has no Pythonic resources whatsoever
Solving an issue where "command script import" would fail to pick the file indicated by the user as a result of something with the same name being in an earlier position in sys.path
llvm-svn: 167570
|
|
|
|
|
|
| |
lldb-platform to not be able to link.
llvm-svn: 167253
|
|
|
|
|
|
|
|
|
|
|
| |
script import", such that the error message for the exception becomes the error for the entire import operation
and silence the backtrace printout
In the process, refactor the Execute* commands in ScriptInterpreter to take an options object, and add a new setting to not mask out errors so that the callers can handle them directly
instead of having the default behavior
llvm-svn: 167067
|
|
|
|
|
|
|
|
|
| |
does not automatically initialize the script interpreter in order to transfer its output file handle to it
This should delay initialization of Python until strictly necessary and speed-up debugger startup
Also, convert formatters for SEL and BOOL ObjC data-types from Python to C++, in order to reap more performance benefits from the above changes
llvm-svn: 166967
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit enables the new HasChildren() feature for synthetic children providers
Namely, it hooks up the required bits and pieces so that individual synthetic children providers can implement a new (optional) has_children call
Default implementations have been provided where necessary so that any existing providers continue to work and behave correctly
Next steps are:
2) writing smart implementations of has_children for our providers whenever possible
3) make a test case
llvm-svn: 166495
|
|
|
|
|
|
| |
help() pagination conflicts with our I/O management
llvm-svn: 166432
|
|
|
|
|
|
|
|
|
|
|
| |
Given our implementation of ValueObjects we could have a scenario where a ValueObject has a dynamic type of Foo* at one point, and then its dynamic type changes to Bar*
If Bar* has synthetic children enabled, by the time we figure that out, our public API is already vending SBValues wrapping a DynamicVO, instead of a SyntheticVO and there was
no trivial way for us to change the SP inside an SBValue on the fly
This checkin reimplements SBValue in terms of a wrapper, ValueImpl, that allows this substitutions on-the-fly by overriding GetSP() to do The Right Thing (TM)
As an additional bonus, GetNonSyntheticValue() now works, and we can get rid of the ForceDisableSyntheticChildren idiom in ScriptInterpreterPython
Lastly, this checkin makes sure the synthetic VOs get the correct m_value and m_data from their parents (prevented summaries from working in some cases)
llvm-svn: 166426
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
function not found error for a Python function in some cases where the function actually existed and had an empty docstring
llvm-svn: 164334
|
|
|
|
|
|
| |
the same module where the target function is defined causes the help string not to come out
llvm-svn: 164172
|
|
|
|
|
|
|
|
|
|
| |
the command line.
Added the ability for OptionValueString objects to take flags. The only flag is currently for parsing escape sequences. Not the prompt string can have escape characters translate which will allow colors in the prompt.
Added functions to Args that will parse the escape sequences in a string, and also re-encode the escape sequences for display. This was looted from other parts of LLDB (the Debugger::FormatString() function).
llvm-svn: 163043
|
|
|
|
|
|
| |
protocol.
llvm-svn: 162540
|
|
|
|
| |
llvm-svn: 162527
|
|
|
|
|
|
| |
fetch the data and convert it to C++ objects is still missing, but will come
llvm-svn: 162522
|
|
|
|
|
|
| |
functionality (still WIP)
llvm-svn: 162513
|
|
|
|
| |
llvm-svn: 162161
|
|
|
|
|
|
|
|
|
|
|
|
| |
could, during destruction,
tread on the m_embedded_thread_input_reader_sp singleton maintained by the script interpreter.
Furthermore, use two additional slots under the script interpreter to store the PseudoTerminal and
the InputReaderSP pertaining to the embedded python interpreter -- resulted from the
ScriptInterpreterPython::ExecuteInterpreterLoop() call -- to facilitate separation from what is being
used by the PythonInputReaderManager instances.
llvm-svn: 162147
|
|
|
|
|
|
| |
Add 'watchpoint command add/delete/list' to lldb, plus two .py test files.
llvm-svn: 161638
|
|
|
|
|
|
| |
parameter name for Python summary-generating functions since it is a Python keyword.
llvm-svn: 161467
|
|
|
|
| |
llvm-svn: 161054
|
|
|
|
|
|
| |
to read user input and/or display output to the user in certain situations - This fix introduces a Python InputReader manager class that mimics the behavior of the interactive interpreter in terms of access to I/O and ensures access to the input and output flows
llvm-svn: 158124
|
|
|
|
|
|
|
|
| |
Use a gentler API PyThreadState_GetDict(), instead.
rdar://problem/11292882
llvm-svn: 156200
|
|
|
|
|
|
| |
an issue that was preventing Python oneliners from executing
llvm-svn: 155563
|
|
|
|
|
|
| |
work with all of the new module paths.
llvm-svn: 155528
|
|
|
|
|
|
| |
resources - This is one of the steps towards making the data formatters work again
llvm-svn: 155526
|
|
|
|
|
|
|
|
| |
global namespace.
Enrico will follow this up with fixing the data formatter test cases that are failing.
llvm-svn: 155514
|
|
|
|
|
|
| |
while clearing out an SBDebugger which was acquiring input from the interactive interpreter
llvm-svn: 154027
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
of bug fixing for data formatter issues.
We are introducing a new Logger class on the Python side. This has the same purpose, but is unrelated, to the C++ logging facility
The Pythonic logging can be enabled by using the following scripting commands:
(lldb) script Logger._lldb_formatters_debug_level = {0,1,2,...}
0 = no logging
1 = do log
2 = flush after logging each line - slower but safer
3 or more = each time a Logger is constructed, log the function that has created it
more log levels may be added, each one being more log-active than the previous
by default, the log output will come out on your screen, to direct it to a file:
(lldb) script Logger._lldb_formatters_debug_filename = 'filename'
that will make the output go to the file - set to None to disable the file output and get screen logging back
Logging has been enabled for the C++ STL formatters and for Cocoa class NSData - more logging will follow
synthetic children providers for classes list and map (both libstdcpp and libcxx) now have internal capping for safety reasons
this will fix crashers where a malformed list or map would not ever meet our termination conditions
to set the cap to a different value:
(lldb) script {gnu_libstdcpp|libcxx}.{map|list}_capping_size = new_cap (by default, it is 255)
you can optionally disable the loop detection algorithm for lists
(lldb) script {gnu_libstdcpp|libcxx}.list_uses_loop_detector = False
llvm-svn: 153676
|
|
|
|
| |
llvm-svn: 153541
|
|
|
|
|
|
|
|
|
|
|
|
| |
SBValue is set up to always wrap a synthetic value when one is available.
A new setting enable-synthetic-value is provided on the target to disable this behavior.
There also is a new GetNonSyntheticValue() API call on SBValue to go back from synthetic to non-synthetic. There is no call to go from non-synthetic to synthetic.
The test suite has been changed accordingly.
Fallout from changes to type searching: an hack has to be played to make it possible to use maps that contain std::string due to the special name replacement operated by clang
Fixing a test case that was using libstdcpp instead of libc++ - caught as a consequence of said changes to type searching
llvm-svn: 153495
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
following the naming pattern
Changes to synthetic children:
- the update(self): function can now (optionally) return a value - if it returns boolean value True, ValueObjectSyntheticFilter will not clear its caches across stop-points
this should allow better performance for Python-based synthetic children when one can be sure that the child ValueObjects have not changed
- making a difference between a synthetic VO and a VO with a synthetic value: now a ValueObjectSyntheticFilter will not return itself as its own synthetic value, but will (correctly)
claim to itself be synthetic
- cleared up the internal synthetic children architecture to make a more consistent use of pointers and references instead of shared pointers when possible
- major cleanup of unnecessary #include, data and functions in ValueObjectSyntheticFilter itself
- removed the SyntheticValueType enum and replaced it with a plain boolean (to which it was equivalent in the first place)
Some clean ups to the summary generation code
Centralized the code that clears out user-visible strings and data in ValueObject
More efficient summaries for libc++ containers
llvm-svn: 153061
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
std::string has a summary provider
std::vector std::list and std::map have both a summary and a synthetic children provider
Given the usage of a custom namespace (std::__1::classname) for the implementation of libc++, we keep both libstdcpp and libc++ formatters enabled at the same time since that raises no conflicts and enabled for seamless transition between the two
The formatters for libc++ reside in a libcxx category, and are loaded from libcxx.py (to be found in examples/synthetic)
The formatters-stl test cases have been divided to be separate for libcxx and libstdcpp. This separation is necessary because
(a) we need different compiler flags for libc++ than for libstdcpp
(b) libc++ inlines a lot more than libstdcpp and some code changes were required to accommodate this difference
llvm-svn: 152570
|
|
|
|
|
|
|
|
|
| |
ScriptInterpreterPython::ResetOutputFileHandle().
The Locker should only perform acquire/free lock operation, but no enter/leave session
at all. Also added sanity checks for items passed to the PyDict_SetItemString() calls.
llvm-svn: 152337
|
|
|
|
|
|
|
|
|
| |
children to enhance type safety
Several places in the ScriptInterpreter interface used StringList objects where an std::string would suffice - Fixed
Refactoring calls that generated special-purposes functions in the Python interpreter to use helper functions instead of duplicating blobs of code
llvm-svn: 152164
|
|
|
|
|
|
|
|
| |
fixed a few potential NULL-pointer derefs in ValueObject
we have a way to provide docstrings for properties we add to the SWIG layer - a few of these properties have a docstring already, more will come in future commits
added a new bunch of properties to SBData to make it more natural and Python-like to access the data they contain
llvm-svn: 151962
|
|
|
|
|
|
|
|
| |
NSTimeZone and CFTimeZonRef
SEL and related types
CFGregorianDate
llvm-svn: 151866
|
|
|
|
|
|
|
|
|
| |
(b) fixes and improvements to the formatters for NSDate and NSString
(c) adding an introspection formatter for NSCountedSet
(d) making the Objective-C formatters test cases pass on both 64 and 32 bit
one of the test cases is marked as expected failure on i386 - support needs to be added to the LLDB core for it to pass
llvm-svn: 151826
|