This code was a temporary workaround due to the lack of a dynamic loader plugin
for the Linux platform that has bit rotted over time. Instead of replacing this
hack with another a proper plugin will be developed instead.
llvm-svn: 122837
get the argument values of the call stacks when stopped on the breakpoint.
Radar has been filed for the expected failures:
test failure: ./dotest.py -v -w -t -p TestFrames (argument values are wrong)
llvm-svn: 122460
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
scan the debugger output for program counter when it comes to the output of 'Up Stack' or 'Down Stack'
gud commands. Remove the single quotes around the argument strings for "settings set frame-format"
and "settings set thread-format" commands to avoid the single quotes which were being emitted as part
of the debugger output.
llvm-svn: 122286
a Debugger object is destroyed or re-set. (Thus making sure that, for
example, the Python interpreter finishes and exits cleanly rather than
being left in an undefined state.)
llvm-svn: 122255
table offset where the offset is within a section. Increased the section
offset for line table entries to be 32 bits (from 24 bits), giving each
section a 4G offset, and increased the section index to 32 bits (from 8 bits).
llvm-svn: 122200
a shell would interpret it. A few examples that we now handle correctly
INPUT: "Hello "world
OUTPUT: "Hello World"
INPUT: "Hello "' World'
OUTPUT: "Hello World"
INPUT: Hello" World"
OUTPUT: "Hello World"
This broke the setting of dictionary values for the "settings set" command
for things like:
(lldb) settings set target.process.env-vars ["MY_ENV_VAR"]=YES
since we would drop the quotes. I fixed the user settings controller to use
a regular expression so it can accept any of the following inputs for
dictionary setting:
settings set target.process.env-vars ["MY_ENV_VAR"]=YES
settings set target.process.env-vars [MY_ENV_VAR]=YES
settings set target.process.env-vars MY_ENV_VAR=YES
We might want to eventually drop the first two syntaxes, but I won't make
that decision right now.
This allows more natural setting of the envirorment variables:
settings set target.process.env-vars MY_ENV_VAR=YES ABC=DEF CWD=/tmp
llvm-svn: 122166
line commands can use the current thread/frame.
Fixed an issue with expressions that get sandboxed in an objective C method
where unichar wasn't being passed down.
Added a "static size_t Scalar::GetMaxByteSize();" function in case we need
to know the max supported by size of something within a Scalar object.
llvm-svn: 122027
can avoid running the code in the target if the
expression's result is known and the expression
has no side effects.
Right now this feature is quite conservative in
its guess about side effects, and it only computes
integer results, but the machinery to make it more
sophisticated is there.
llvm-svn: 121952
Extend Swig's include search path.
Cover both /usr/include and /usr/local/include. This should allow Swig to find
system headers such as stdint.h on all platforms we currently support.
llvm-svn: 121943
due to crashes while running the entire test suite with clang-126.
To reproduce:
CC=clang ./dotest.py -v -w 2> ~/Developer/Log/lldbtest.log
To skip this test case:
CC=clang ./dotest.py -b blacklist.py -v -w 2> ~/Developer/Log/lldbtest.log
llvm-svn: 121887
function and also hooked up better error reporting for when things fail.
Fixed issues with trying to display children of pointers when none are
supposed to be shown (no children for function pointers, and more like this).
This was causing child value objects to be made that were correctly firing
an assertion.
llvm-svn: 121841
a non-mangled function - we pass the non mangled string down through abi::__cxa_demangle and it
crashes. Usually passing non mangled strings to abi::__cxa_demangle works out fine but not
always, apparently.
llvm-svn: 121834
o "output1.txt" for test_pass_host_env_vars() test case
o "output2.txt" for test_run_args_and_env_vars_with_dsym() test case
o "output2.txt" for test_run_args_and_env_vars_with_dwarf() test case
and add teardown hook to test_pass_host_env_vars() in order to properly
unset the host environment variables set while running the test case.
llvm-svn: 121811
ALso add a teardown hook to the LoadUnloadTestCase.test_dyld_library_path()
test case to have it restore the DYLD_LIBRARY_PATH environment variable.
llvm-svn: 121802
linked with a dylib which has been relocated by specifying the DYLD_LIBRARY_PATH environment
variable. Test that the function name breakpoint defined in the dylib is resolved.
llvm-svn: 121796
- Make sure cmd_obj & cmd_obj_sp contain a valid objects before attempting to
dereference, in CommandObjectCommandsAlias::Execute and
CommandInterpreter::HandleCommand.
- Modify CommandInterpreter::GetCommandSPExact to properly handle
multi-word command inputs.
llvm-svn: 121779
SBValue SBFrame::LookupVar(const char *name);
To
SBValue SBFrame::FindVariable (const char *name);
Changed:
SBValue LookupVarInScope (const char *name, const char *scope);
to
SBValue FindValue (const char *name, ValueType value_type);
The latter makes it possible to not only find variables (params, locals, globals, and statics), but we can also now get register sets, registers and persistent variables using the frame as the context.
llvm-svn: 121777
values or persistent expression variables. Now if an expression consists of
a value that is a child of a variable, or of a persistent variable only, we
will create a value object for it and make a ValueObjectConstResult from it to
freeze the value (for program variables only, not persistent variables) and
avoid running JITed code. For everything else we still parse up and JIT code
and run it in the inferior.
There was also a lot of clean up in the expression code. I made the
ClangExpressionVariables be stored in collections of shared pointers instead
of in collections of objects. This will help stop a lot of copy constructors on
these large objects and also cleans up the code considerably. The persistent
clang expression variables were moved over to the Target to ensure they persist
across process executions.
Added the ability for lldb_private::Target objects to evaluate expressions.
We want to evaluate expressions at the target level in case we aren't running
yet, or we have just completed running. We still want to be able to access the
persistent expression variables between runs, and also evaluate constant
expressions.
Added extra logging to the dynamic loader plug-in for MacOSX. ModuleList objects
can now dump their contents with the UUID, arch and full paths being logged with
appropriate prefix values.
Thread hardened the Communication class a bit by making the connection auto_ptr
member into a shared pointer member and then making a local copy of the shared
pointer in each method that uses it to make sure another thread can't nuke the
connection object while it is being used by another thread.
Added a new file to the lldb/test/load_unload test that causes the test a.out file
to link to the libd.dylib file all the time. This will allow us to test using
the DYLD_LIBRARY_PATH environment variable after moving libd.dylib somewhere else.
llvm-svn: 121745
the code to pass the _cmd pointer has been improved, and _cmd
is now set to the value of _cmd for the current context, as
opposed to being simply NULL.
llvm-svn: 121739
access to the members of the Objective-C self object.
The approach we take is to generate the method as a
@category on top of the self object, and to pass the
"self" pointer to it. (_cmd is currently NULL.)
Most changes are in ClangExpressionDeclMap, but the
change that adds support to the ABIs to pass _cmd
touches a fair amount of code.
llvm-svn: 121722
very minor changes, changing how we get the target
type from a TypedefType, adding a parameter to
EnumDecl::Create(), and other minor tweaks.
llvm-svn: 121663
the lldb PyThon API SBSourceManager to display source files.
To accomodate this, the C++ SBSourceManager API has been changed to take an
lldb::SBStream as the destination for display of source lines. Modify SBStream::ctor()
so that its opaque pointer is initialized with an StreamString instance.
llvm-svn: 121605
Add an attribute __python_api_test__ (set to True) to the @python_api_test decorated
test method to distinguish them from the lldb command line tests.
llvm-svn: 121500
information. Previously, "operator[]" was not
being recognized because the detector was looking
for "operator " as a prefix. Now we handle both
cases.
llvm-svn: 121456
Example:
@python_api_test
def test_evaluate_expression_python(self):
"""Test SBFrame.EvaluateExpression() API for evaluating an expression."""
...
The opposite of Python APIs only test is an lldb command line test, which sends
commands to the lldb command interpreter. Add a '-a' option to the test driver
to skip Python API only tests.
Modify TestExprs.py to mark a test as @python_api_test and remove an @expectedFailure
decorator as the bug has been fixed.
llvm-svn: 121442
- Added new utility function to Arg, GetQuotedCommandString, which re-assembles
the args into a string, replacing quotes that were originally there.
- Modified user settings stuff to always show individual elements when printing out
arrays and dictionaries.
- Added more extensive help to 'settings set', explaining more about dictionaries
and arrays (including current dictionary syntax).
- Fixed bug in user settings where quotes were being stripped and lost, so that
sometimes array or dictionary elements that ought to have been a single element
were being split up.
llvm-svn: 121438
logic for finding the target of a method dispatch into this function, insert & call it. Gets calls to super, and all the
fixup & fixedup variants working properly. Also gets the class from the object so that we step through KVO wrapper methods
into the actual user code.
llvm-svn: 121437
not the command should take raw input, then handle & dispatch the arguments appropriately.
Also change the 'alias' command to be a command that takes raw input. This is necessary to
allow aliases to be created for other commands that take raw input and might want to include
raw input in the alias itself.
Fix a bug in the aliasing mechanism when creating aliases for commands with 3-or-more words.
Raw input should now be properly handled by all the command and alias mechanisms.
llvm-svn: 121423
Initial test case test_modify_source_file_while_debugging() in TestSourceManager.py
tests the caching mechanism of the source manager.
llvm-svn: 121389
used as the arguments for the inferior program. So for example you can do
% lldb /bin/ls /tmp ~/Documents
And "lldb" will use "/bin/ls" as the program and send arguments "/tmp" and
"~/Documents" as the launch args.
If you specify a file, then all remaining args after option parsing
will be used for program arguments:
% lldb -f /bin/ls /tmp ~/Documents
If you need to pass option values to your inferior program, just terminate
the "lldb" command line driver options with "--":
% lldb -- /bin/ls -AFl /tmp
The arguments are placed into the "settings" variable named
"target.process.run-args". This allows you to just run the program using
"process launch" and, if no args are specified on that command, the
"target.process.run-args" values will be used:
% lldb -- /bin/ls -AFl /tmp
Current executable set to '/bin/ls' (x86_64).
(lldb) settings show target.process.run-args
target.process.run-args (array):
[0]: '-AFl'
[1]: '/tmp'
(lldb)
(lldb) r
Process 56753 launched: '/bin/ls' (x86_64)
lrwxr-xr-x@ 1 root wheel 11 Nov 19 2009 /tmp@ -> private/tmp
llvm-svn: 121295
file data, so if a source file was modified, we would always show the first
cached copy of the source data. We now check file modification times when
displaying source info so we can show the update source info.
llvm-svn: 121278
way of iterating through an aggregate data structure. The added example usage
is from an actual use in test/foundation/TestSymbolTable.py:
2. Pass a container of aggregate which provides APIs to get to the size and
the element of the aggregate:
# Module is a container of symbol table
module = target.FindModule(filespec)
for symbol in lldb_iter(module, 'GetNumSymbols', 'GetSymbolAtIndex'):
name = symbol.GetName()
...
llvm-svn: 121271
have children sections).
Modified SectionLoadList to do it's own multi-threaded protected on its map.
The ThreadSafeSTLMap class was difficult to deal with and wasn't providing
much utility, it was only getting in the way.
Make sure when the communication read thread is about to exit, it clears the
thread in the main class.
Fixed the ModuleList to correctly ignore architectures and UUIDs if they aren't
valid when searching for a matching module. If we specified a file with no arch,
and then modified the file and loaded it again, it would not match on subsequent
searches if the arch was invalid since it would compare an invalid architecture
to the one that was found or selected within the shared library or executable.
This was causing stale modules to stay around in the global module list when they
should have been removed.
Removed deprecated functions from the DynamicLoaderMacOSXDYLD class.
Modified "ProcessGDBRemote::IsAlive" to check if we are connected to a gdb
server and also make sure our process hasn't exited.
llvm-svn: 121236
because the diagnostic client for one of the AST
contexts is NULL. Now we provide a form of Miranda
rights to AST contexts: they are provided with a very
simple diagnostic client if they do not have one
themselves.
llvm-svn: 121225
as the args and the envs to the launched process.
o lldbtest.py:
Forgot to check in some assertion messages changes for lldbtest.py.
o dotest.py:
Also add "api" category to the default lldb log option list.
llvm-svn: 121220
Launch the process with ['X', 'Y', 'Z'] as the args to make argc == 4 and verify that's the case,
plus some other EvaluateExpression() calls.
llvm-svn: 121218
# runCmd: command alias print_hi expression printf ("\n\tHi!")
# output:
self.runCmd('command alias print_hi expression printf ("\\n\\tHi!")')
# This fails currently.
self.runCmd('print_hi')
and modify existing test sequences to escape the escape character '\ to prevent it
from being interpreted by Python before passing on to the lldb command interpreter.
llvm-svn: 121183
- Add logging for command resolution ('log enable lldb commands')
- Fix alias resolution to properly handle commands that take raw input (resolve the alias, but
don't muck up the raw arguments).
Net result: Among other things, 'expr' command can now take strings with escaped characters and
not have the command handling & alias resolution code muck up the escaped characters. E.g.
'expr printf ("\n\n\tHello there!")' should now work properly.
Not working yet: Creating aliases with raw input for commands that take raw input. Working on that.
e.g. 'command alias print_hi expr printf ("\n\tHi!")' does not work yet.
llvm-svn: 121171
it indents and shows things correctly. When we are debugging DWARF
in .o files with debug map, we can see the remapped sections by
dumping the sections for the .o files by explicitly dumping the
module by name. For example, debugging the lldb/test/class_types
example on MacOSX without a dSYM file we can make a query that
causes the main.o file to be loaded, then we can do a:
(lldb) image dump section main.o
This will show the exact section map that is used and can help
track down when things are going wrong with DWARF in .o files with
debug map.
llvm-svn: 121154
LLDB expression execution.
We also now print the argument structure after execution,
to allow us to verify that the expression did indeed
execute correctly.
llvm-svn: 121126
if two functions had the same demangled names (constructors where
we have the in charge and not in charge version) we could end up
mixing the two up when making the function in the DWARF. This was
because we need to lookup the symbol by name and we need to use the
mangled name if there is one. This ensures we get the correct address
and that we resolve the linked addresses correctly for DWARf with debug
map.
llvm-svn: 121116
ModuleList so they don't show up in the images. Breakpoint locations that are
in shared libraries that get unloaded will persist though so that if you
have plug-ins that load/unload and you have a breakpoint set on functions
in the plug-ins, the hit counts will persist between loads/unloads.
llvm-svn: 121069
Mark NSArray_expr() and NSString_expr() as currently failing. Both are called
from dsym and dwarf builds. So that makes the num of expected failures equal 4.
----------------------------------------------------------------------
Ran 6 tests in 19.856s
OK (expected failures=4)
llvm-svn: 121068
wrongly as the target of a pointer rather than the
SEL pointer itself. This caused incorrect behavior
when dealing with Objective-C selector variables.
llvm-svn: 121048
o test_many_expr_commands()
o test_expr_commands_can_handle_quotes()
Mark test_expr_commands_can_handle_quotes()
as @expectedFailure:
# rdar://problem/8686536
# CommandInterpreter::HandleCommand is stripping \'s from input for WantsRawCommand commands
llvm-svn: 121019
do. Closing on EOF is an option that can be set on the
lldb_private::Communication or the lldb::SBCommunication objects after they
are created. Of course the EOF support isn't hooked up, so they don't do
anything at the moment, but they are left in so when the code is fixed, it
will be easy to get working again.
llvm-svn: 120885
was done as an settings variable in the process for now. We will eventually
move all environment stuff over to the target, but we will leave it with the
process for now. The default setting is for a process to inherit the host
environment. This can be disabled by setting the "inherit-env" setting to
false in the process.
llvm-svn: 120862
inferior to be launched without setting up terminal stdin/stdout for it
(leaving the lldb command line accessible while the program is executing).
Also add a user settings variable, 'target.process.disable-stdio' to allow
the user to set this globally rather than having to use the command option
each time the process is launched.
llvm-svn: 120825
an error saying the resume timed out. Previously the thread that was trying
to resume the process would eventually call ProcessGDBRemote::DoResume() which
would broadcast an event over to the async GDB remote thread which would sent the
continue packet to the remote gdb server. Right after this was sent, it would
set a predicate boolean value (protected by a mutex and condition) and then the
thread that issued the ProcessGDBRemote::DoResume() would then wait for that
condition variable to be set. If the async gdb thread was too quick though, the
predicate boolean value could have been set to true and back to false by the
time the thread that issued the ProcessGDBRemote::DoResume() checks the boolean
value. So we can't use the predicate value as a handshake. I have changed the code
over to using a Event by having the GDB remote communication object post an
event:
GDBRemoteCommunication::eBroadcastBitRunPacketSent
This allows reliable handshaking between the two threads and avoids the erroneous
ProcessGDBRemote::DoResume() errors.
Added a host backtrace service to allow in process backtraces when trying to track
down tricky issues. I need to see if LLVM has any backtracing abilities abstracted
in it already, and if so, use that, but I needed something ASAP for the current issue
I was working on. The static function is:
void
Host::Backtrace (Stream &strm, uint32_t max_frames);
And it will backtrace at most "max_frames" frames for the current thread and can be
used with any of the Stream subclasses for logging.
llvm-svn: 120793
so that it is not referring to potentially stale
state during IR execution.
This was done by introducing modular state (like
ClangExpressionVariable) where groups of state
variables have well-defined lifetimes:
- m_parser_vars are specific to parsing, and only
exist between calls to WillParse() and DidParse().
- m_struct_vars survive for the entire execution
of the ClangExpressionDeclMap because they
provide the template for a materialized set of
expression variables.
- m_material_vars are specific to a single
instance of materialization, and only exist
between calls to Materialize() and
Dematerialize().
I also removed unnecessary references to long-
lived state that really didn't need to be referred
to at all, and also introduced several assert()s
that helped me diagnose a few bugs (fixed too).
llvm-svn: 120778
Add bool member to Communication class indicating whether the
Connection should be closed on receiving an EOF or not. Update the
Connection read to return an EOF status when appropriate. Modify the
Communication class to pass the EOF along or not, and to close the
Connection or not, as appropriate.
llvm-svn: 120723
Don't overwhelm the expression mechanism. Previously, there was no delay
between successive invocations of 'expression' command. The test suite
run has experienced 'Resume timed out' or similar error messages. Now we
currently add a sleep of 1.0 second before issuing the next 'expression'
command.
llvm-svn: 120626
test classes or test cases to be excludued from the test suite.
Check in an example blacklist file: blacklist.py:
"""
'blacklist' is a Python dictionary, it stores the mapping of a string describing
either a testclass or a testcase, i.e, testclass.testmethod, to the reason (a
string) it is blacklisted.
Following is an example which states that test class IntegerTypesExprTestCase
should be skipped because 'This test class crashed' and the test case
FoundationTestCase.test_data_type_and_expr_with_dsym should be skipped because
it is 'Temporarily disabled'.
blacklist = {'IntegerTypesExprTestCase': 'This test class crashed',
'FoundationTestCase.test_data_type_and_expr_with_dsym': 'Temporarily disabled'
}
"""
blacklist = {}
An example of invoking the test driver and specifying a blacklist file:
./dotest.py -b blacklist.py -v types
This runs the tests under 'types' directory but excludes the tests specified in
balcklist.py.
llvm-svn: 120620
in C++ methods. There were two fixes involved:
- For an object whose contents are not known, the
expression should be treated as a non-member, and
"this" should have no meaning.
- For a const object, the method should be declared
const as well.
llvm-svn: 120606
copied by the copy constructor for ClangExpressionVariable.
This meant that a NULL m_register_info wouldn't be
copied, and instead the field was uninitialized, potentially
confusing the materializer.
llvm-svn: 120472
Added a ThreadPlanCallUserExpression that differs from ThreadPlanCallFunction in that it holds onto a shared pointer to its ClangUserExpression so that can't go away before the thread plan is done using it.
Fixed the stop message when you hit a breakpoint while running a user expression so it is more obvious what has happened.
llvm-svn: 120386
the process status is indeed 'stopped' before invoking 'frame variable -t val'
command to inspect the frame variable. When I run the test suite, it sometimes
emits an output like:
runCmd: frame variable -t val
runCmd failed!
error: you must be stopped in a valid stack frame to view frame variables.
The expect() statement inserted is to make sure that the process is stopped and
we have a valid frame.
llvm-svn: 120318
Increase the delta between successive test cases, enabled with the '-w' option to
the test driver, from 0.5 to 1.0 second, to arrive at a cleaner state before the
next test case.
llvm-svn: 120315
RegisterContext* - normally this is retrieved from the ExecutionContext's
StackFrame but when we need to evaluate an expression while creating
the stack frame list this can be a little tricky.
Add DW_OP_deref_size, needed for the _sigtramp FDE expression.
Add support for processing DWARF expressions in RegisterContextLLDB.
Update callers to DWARFExpression::Evaluate.
llvm-svn: 119885
perform recursive type lookups, because these are not
required for full type fidelity. We also make the
SelectorTable last for the full lifetime of the Clang
compiler; this was the source of many bugs.
llvm-svn: 119835
that the result of an expression should be coerced to
a specific type. Also made breakpoint conditions pass
in the bool type for this type.
The expression parser ignores this indication for now.
llvm-svn: 119779