Commit Graph

2824 Commits

Author SHA1 Message Date
Jim Ingham b8e8a5f3ee Allow reading memory from files before the target has been run.
llvm-svn: 134780
2011-07-09 00:55:34 +00:00
Greg Clayton 9e00b6a654 Added the ability to get an abstract file type (executable, object file,
shared library, etc) and strata (user/kernel) from an object file. This will
help with plug-in and platform selection when given a new binary with the
"target create <file>" command.

llvm-svn: 134779
2011-07-09 00:41:34 +00:00
Johnny Chen 02a07299b7 Missed the char_to_str_xform on the docstrings for the module level function definitions.
llvm-svn: 134775
2011-07-08 23:57:20 +00:00
Johnny Chen 628d84005a Add rdar://problem/9747668 info for "target variable g_marked_spot.y" command.
llvm-svn: 134772
2011-07-08 23:38:39 +00:00
Johnny Chen 98a5ddd006 Add test scenarios for 'target variable' command into TestGlobalVariables.py file.
llvm-svn: 134771
2011-07-08 23:33:36 +00:00
Johnny Chen 07398b5d48 Add some comment.
llvm-svn: 134769
2011-07-08 23:07:53 +00:00
Johnny Chen 3a709ac7bf o TestEvents.py:
Add a usage example of SBEvent APIs.

o SBEvent.h and SBListener.h:

Add method docstrings for SBEvent.h and SBListener.h, and example usage of SBEvent into
the class docstring of SBEvent.

o lldb.swig:

Add typemap for SBEvent::SBEvent (uint32_t event, const char *cstr, uint32_t cstr_len)
so that we can use, in Python, obj2 = lldb.SBEvent(0, "abc") to create an SBEvent.

llvm-svn: 134766
2011-07-08 23:02:33 +00:00
Greg Clayton 884fb69460 Added the ability to see global variables with a variable expression path so
you can do things like:

(lldb) target variable g_global.a
(lldb) target variable *g_global.ptr
(lldb) target variable g_global.ptr[1]

llvm-svn: 134745
2011-07-08 21:46:14 +00:00
Jim Ingham 576e96e0dc New test to check that we can call functions in static methods in ObjC.
llvm-svn: 134736
2011-07-08 20:48:47 +00:00
Jim Ingham 368c6301a2 remove errant parenthesis.
llvm-svn: 134717
2011-07-08 18:34:32 +00:00
Greg Clayton affb03b7fb Fixed a few issues where typedefs weren't passing through to the correct
recursive function.

Also fixed ClangASTContext::IsPointerType to correctly NULL out the pointee
handle if a valid one is provided.

llvm-svn: 134715
2011-07-08 18:27:39 +00:00
Jason Molenda d7298d3745 Rewrite get_kinfo_proc_for_pid() to get the kinfo_proc for
the one process we're interested in, instead of fetching all
of them and only keeping one.

(the old implementation made sense when we were doing the
initial find-this-process-by-pid-or-name by looking through
all the kinfo_procs.)

llvm-svn: 134686
2011-07-08 05:04:01 +00:00
Greg Clayton df0b7d5c31 LLDB now has a Kernel dynamic linker that can detect where kexts are
loaded. It locks onto *-apple-darwin binaries where the binary has
a "__KLD" segment. Soon I will modify the lldb_private::ObjectFile
class to return an executable type which will be an enum with values
something like:
eObjectFileTypeUserExectable,
eObjectFileTypeUserSharedLibrary,
eObjectFileTypeKernelExectable,
eObjectFileTypeKernelSharedLibrary,
eObjectFileTypeObjectFile,
eObjectFileTypeCoreFile

But for now we look at the section since a user and kernel mach-o
executable have the same mach-o file type.

llvm-svn: 134682
2011-07-08 04:11:42 +00:00
Greg Clayton 0d9fc764d2 Make the kernel able to do its initial load from target memory with the
process being preferred for all memory reads.

llvm-svn: 134681
2011-07-08 03:21:57 +00:00
Enrico Granata fc7a7f3b75 final fix for the global constructors issue
new GetValueForExpressionPath() method in ValueObject to navigate expression paths in a more bitfield vs slices aware way
changes to the varformats.html document (WIP)

llvm-svn: 134679
2011-07-08 02:51:01 +00:00
Johnny Chen f4e9a4c676 Rearranged the debug output to come before the assert for function name 'outer_inline'.
Right now clang-139 fails the test.

llvm-svn: 134673
2011-07-08 01:01:45 +00:00
Greg Clayton 7b242381b8 Added the start of the darwin dynamic loader plug-in. It isn't hooked up to
be detected yet, but most of the initial code is there and needs to be 
debugged more.

llvm-svn: 134672
2011-07-08 00:48:09 +00:00
Sean Callanan 77eaf442ce Audited the expression parser to find uninitialized
pointers.  Some of the spots are obviously initialized
later, but it's better just to NULL the pointers out
at initialization to make the code more robust when
exposed to later changes.

llvm-svn: 134670
2011-07-08 00:39:14 +00:00
Jason Molenda d9761cd466 Switch to using the S_ISDIR and S_ISREG sys/stat.h macros in
CommandCompletions.cpp and DataBufferMemoryMap.cpp.  The file type
part of the st_mode struct member is not a bitmask.

llvm-svn: 134669
2011-07-08 00:38:03 +00:00
Jason Molenda 4e0c94be76 Handle the possible case where the process launch failed
but we don't have an error message.

llvm-svn: 134662
2011-07-08 00:00:32 +00:00
Johnny Chen f4f54206d9 The Python API does not need SBEvent::BroadcasterMatchesPtr() when SBEvent::BroadcasterMatchesRef() suffices.
llvm-svn: 134659
2011-07-07 23:45:49 +00:00
Sean Callanan c6466fc9ab Added checks to the expresssion parser which make
searching for variables and symbols in the target
more robust.  These checks prevent variables from
being reported as existing if they cannot actually
be evaluated in the current context.

llvm-svn: 134656
2011-07-07 23:05:43 +00:00
Johnny Chen c182226dbc Add docstrings for SBSymbolContextList with example usage.
llvm-svn: 134652
2011-07-07 22:48:46 +00:00
Johnny Chen f8ae3c7396 Add assert to check the SBModule of SBSymbolContextList returned from SBTarget.FindFunctions().
llvm-svn: 134651
2011-07-07 22:45:54 +00:00
Johnny Chen 4bc80decfb Add test cases to exercise the SBTarget.FindFunctions() API.
llvm-svn: 134646
2011-07-07 22:22:51 +00:00
Johnny Chen b0b8be755b Add SBValue::GetID() member method call API.
llvm-svn: 134636
2011-07-07 20:46:23 +00:00
Johnny Chen 28597319fd Add docstrings for SBValueList with example usage.
llvm-svn: 134632
2011-07-07 20:23:22 +00:00
Johnny Chen c02a273ba6 Fix wording in docstring.
llvm-svn: 134623
2011-07-07 18:50:45 +00:00
Enrico Granata 7f941d95cc Fixed a warning where initializing CommandObject::g_arguments_data[] required global constructors
llvm-svn: 134613
2011-07-07 15:49:54 +00:00
Greg Clayton 1d4313b261 Stop the lldb_private::RegularExpression class from implicitly
constructing itself and causing unexpected things to happen
in LLDB.

llvm-svn: 134598
2011-07-07 04:49:07 +00:00
Greg Clayton 715c236577 Centralize the variable display prefs into a new option
group class: OptionGroupVariable. It gets initialized with
a boolean that indicates if the frame specific options are
included so that this can be used in both the "frame variable"
and "target variable" commands.

Removed the global functionality from the "frame variable" 
command. Users should switch to using the "target variable"
command.

llvm-svn: 134594
2011-07-07 04:38:25 +00:00
Jim Ingham c257270094 Typo in header doc.
llvm-svn: 134584
2011-07-07 02:22:51 +00:00
Greg Clayton 644247c1dc Added "target variable" command that allows introspection of global
variables prior to running your binary. Zero filled sections now get
section data correctly filled with zeroes when Target::ReadMemory
reads from the object file section data.

Added new option groups and option values for file lists. I still need
to hook up all of the options to "target variable" to allow more complete
introspection by file and shlib.

Added the ability for ValueObjectVariable objects to be created with
only the target as the execution context. This allows them to be read
from the object files through Target::ReadMemory(...). 

Added a "virtual Module * GetModule()" function to the ValueObject
class. By default it will look to the parent variable object and
return its module. The module is needed when we have global variables
that have file addresses (virtual addresses that are specific to
module object files) and in turn allows global variables to be displayed
prior to running.

Removed all of the unused proxy object support that bit rotted in 
lldb_private::Value.

Replaced a lot of places that used "FileSpec::Compare (lhs, rhs) == 0" code
with the more efficient "FileSpec::Equal (lhs, rhs)".

Improved logging in GDB remote plug-in.

llvm-svn: 134579
2011-07-07 01:59:51 +00:00
Enrico Granata 8f11a4ac96 new webpage describing type command
llvm-svn: 134575
2011-07-07 00:39:55 +00:00
Enrico Granata 82a7d98342 new detailed descriptions for type summary add and type format add
some changes to the help system code for better display of long help text
-p and -r flags now also work for type format add

llvm-svn: 134574
2011-07-07 00:38:40 +00:00
Johnny Chen bd68b95889 Add class docstrings with example usage for SBBreakpoint and SBBreakpointLocation.
llvm-svn: 134571
2011-07-07 00:14:13 +00:00
Johnny Chen 1630367ea6 Add class docstrings with example usage for SBFunction and SBAddress.
llvm-svn: 134560
2011-07-06 23:23:53 +00:00
Johnny Chen 194cd7eb24 SWIG doesn't need two methods of the same name 'GetDescription' but differ in
the presence of 'const'.  Ifndef the non-const one out.

llvm-svn: 134553
2011-07-06 22:23:24 +00:00
Johnny Chen f82eb4043b Add fuzz calls for SBType::IsPointerType(void *opaque_type).
llvm-svn: 134551
2011-07-06 22:11:38 +00:00
Johnny Chen 102ac765f0 Add post-processing step to transform the docstring from 'char', i.e., 'char *', to 'str', i.e., Python string.
llvm-svn: 134543
2011-07-06 21:55:45 +00:00
Greg Clayton 58f1c12756 Revert some Xcode project changes that I didn't intend to checkin.
llvm-svn: 134541
2011-07-06 21:43:20 +00:00
Greg Clayton 9432989dd3 Bumped Xcode project version for lldb-68.
llvm-svn: 134534
2011-07-06 21:01:19 +00:00
Johnny Chen e58f332b8c Add docstrings for the primordial object -- SBDebugger.
The swig "autodoc" feature to remove '*' from 'char *' will be handled by doing
post-processing on the lldb.py module.

llvm-svn: 134524
2011-07-06 19:28:33 +00:00
Enrico Granata a7187d0000 bug fix in summary strings:
- ${*var[].something} was not working as expected
options -p and -r now also work for type format add

llvm-svn: 134523
2011-07-06 19:27:11 +00:00
Johnny Chen d4deaf2677 Remove unnecessary 'import' statement.
llvm-svn: 134519
2011-07-06 19:09:25 +00:00
Greg Clayton dd0649bc5f Fixed an issue that was causing us to crash when evaluating expressions for
objective C or C++ methods when "self" or "this" were in scope, but had 
invalid locations in a DWARF location list. The lack of a valid value caused
us to use an invalid type value and then we tried to import that invalid 
value and we would crash.

llvm-svn: 134518
2011-07-06 18:55:08 +00:00
Jim Ingham 89b6109be8 Set the EvaluationPoint's m_thread_id to the RIGHT invalid define...
llvm-svn: 134505
2011-07-06 17:42:14 +00:00
Greg Clayton 262f80df5e Made the string representation for a SBValue return what "frame variable"
would return instead of a less than helpful "name: '%s'" description.

Make sure that when we ask for the error from a ValueObject object we
first update the value if needed.

Cleaned up some SB functions to use internal functions and not re-call
through the public API when possible.

llvm-svn: 134497
2011-07-06 16:49:27 +00:00
Enrico Granata e443ba736b Fixed some format names
llvm-svn: 134492
2011-07-06 15:56:06 +00:00
Greg Clayton 34132754bd Fixed some issues with ARM backtraces by not processing any push/pop
instructions if they are conditional. Also fixed issues where the PC wasn't
getting bit zero stripped for ARM targets when a stack frame was thumb. We
now properly call through the GetOpcodeLoadAddress() functions to make sure
the addresses are properly stripped for any targets that may decorate up
their addresses.

We now don't pass the SIGSTOP signals along. We can revisit this soon, but
currently this was interfering with debugging some older ARM targets that
don't have vCont support in the GDB server.

llvm-svn: 134461
2011-07-06 04:07:21 +00:00