History log of /external/lldb/source/Symbol/SymbolContext.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ac94caa68a4a5fa4bd939d7656a6a12d8fc06a33 12-Jun-2013 Greg Clayton <gclayton@apple.com> Huge performance improvements when one breakpoint contains many locations.

325,000 breakpoints for running "breakpoint set --func-regex ." on lldb itself (after hitting a breakpoint at main so that LLDB.framework is loaded) used to take up to an hour to set, now we are down under a minute. With warm file caches, we are at 40 seconds, and that is with setting 325,000 breakpoint through the GDB remote API. Linux and the native debuggers might be faster. I haven't timed what how much is debug info parsing and how much is the protocol traffic to/from GDB remote.

That there were many performance issues. Most of them were due to storing breakpoints in the wrong data structures, or using the wrong iterators to traverse the lists, traversing the lists in inefficient ways, and not optimizing certain function name lookups/symbol merges correctly.

Debugging after that is also now very efficient. There were issues with replacing the breakpoint opcodes in memory that was read, and those routines were also fixed.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@183820 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
23a51623e0e866225d959506796e3d75de3a08e3 17-May-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13217784>

"source list -n <func>" can now show more than one location that matches a function name. It will unique multiple of the same source locations so they don't get displayed. It also handles inline functions correctly.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@182067 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
97a19b21dacd9063bb5475812df7781777262198 29-Apr-2013 Greg Clayton <gclayton@apple.com> Cleanup logging to use the new "std::string FileSpec::GetPath()" function. Also added a similar function for modules:

std::string
Module::GetSpecificationDescription () const;

This returns the module as "/usr/lib/libfoo.dylib" for normal files (calls "std::string FileSpec::GetPath()" on m_file) but it also might include the object name in case the module is for a .o file in a BSD archive ("/usr/lib/libfoo.a(bar.o)"). Cleaned up necessary logging code to use it.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@180717 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
296b06d325413723f5aac5988eed977b278a7807 03-Apr-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13506727>

Symbol table function names should support lookups like symbols with debug info.

To fix this I:
- Gutted the way FindFunctions is used, there used to be way too much smarts only in the DWARF plug-in
- Made it more efficient by chopping the name up once and using simpler queries so that SymbolFile and Symtab plug-ins don't need to do as much
- Filter the results at a higher level
- Make the lldb_private::Symtab able to chop up C++ mangled names and make as much sense out of them as possible and also be able to search by basename, fullname, method name, and selector name.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178608 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
952e9dc874944fcdbbb224f3ec4fc2c859376f64 28-Mar-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13521159>

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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178191 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
a7e864cb0a450c7ef65b6f9f6c9bae839c405906 23-Feb-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13265297>

StackFrame assumes m_sc is additive, but m_sc can lose its target. So now the SymbolContext::Clear() method takes a bool that indicates if the target should be cleared. Modified all existing code to properly set the bool argument.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@175953 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
36da2aa6dc5ad9994b638ed09eb81c44cc05540b 25-Jan-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13069948>

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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@173463 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
5f35a4be95aed0e5b2cb36f7d785bcbfc67284ae 29-Nov-2012 Daniel Malea <daniel.malea@intel.com> Resolve printf formatting warnings on Linux:
- use macros from inttypes.h for format strings instead of OS-specific types

Patch from Matt Kopec!



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@168945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
49ce8969d3154e1560106cfe530444c09410f217 29-Aug-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11757916>

Make breakpoint setting by file and line much more efficient by only looking for inlined breakpoint locations if we are setting a breakpoint in anything but a source implementation file. Implementing this complex for a many reasons. Turns out that parsing compile units lazily had some issues with respect to how we need to do things with DWARF in .o files. So the fixes in the checkin for this makes these changes:
- Add a new setting called "target.inline-breakpoint-strategy" which can be set to "never", "always", or "headers". "never" will never try and set any inlined breakpoints (fastest). "always" always looks for inlined breakpoint locations (slowest, but most accurate). "headers", which is the default setting, will only look for inlined breakpoint locations if the breakpoint is set in what are consudered to be header files, which is realy defined as "not in an implementation source file".
- modify the breakpoint setting by file and line to check the current "target.inline-breakpoint-strategy" setting and act accordingly
- Modify compile units to be able to get their language and other info lazily. This allows us to create compile units from the debug map and not have to fill all of the details in, and then lazily discover this information as we go on debuggging. This is needed to avoid parsing all .o files when setting breakpoints in implementation only files (no inlines). Otherwise we would need to parse the .o file, the object file (mach-o in our case) and the symbol file (DWARF in the object file) just to see what the compile unit was.
- modify the "SymbolFileDWARFDebugMap" to subclass lldb_private::Module so that the virtual "GetObjectFile()" and "GetSymbolVendor()" functions can be intercepted when the .o file contenst are later lazilly needed. Prior to this fix, when we first instantiated the "SymbolFileDWARFDebugMap" class, we would also make modules, object files and symbol files for every .o file in the debug map because we needed to fix up the sections in the .o files with information that is in the executable debug map. Now we lazily do this in the DebugMapModule::GetObjectFile()

Cleaned up header includes a bit as well.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@162860 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
b3a1a2bba41281ba56a99fe64887a8a04760784c 14-Jul-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11870357>

Allow "frame variable" to find ivars without the need for "this->" or "self->".


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@160211 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
0fef968c843be422d6facc2e8d54d8471eee88ed 10-May-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11330621>

Fixed the DisassemblerLLVMC disassembler to parse more efficiently instead of parsing opcodes over and over. The InstructionLLVMC class now only reads the opcode in the InstructionLLVMC::Decode function. This can be done very efficiently for ARM and architectures that have fixed opcode sizes. For x64 it still calls the disassembler to get the byte size.

Moved the lldb_private::Instruction::Dump(...) function up into the lldb_private::Instruction class and it now uses the function that gets the mnemonic, operandes and comments so that all disassembly is using the same code.

Added StreamString::FillLastLineToColumn() to allow filling a line up to a column with a character (which is used by the lldb_private::Instruction::Dump(...) function).

Modified the Opcode::GetData() fucntion to "do the right thing" for thumb instructions.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@156532 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
0c31d3d3a4a1d00d53346d8a23b0519f47e55d1f 07-Mar-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/10997402>

This fix really needed to happen as a previous fix I had submitted for
calculating symbol sizes made many symbols appear to have zero size since
the function that was calculating the symbol size was calling another function
that would cause the calculation to happen again. This resulted in some symbols
having zero size when they shouldn't. This could then cause infinite stack
traces and many other side affects.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@152244 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
9f69f982142c1c6d4dbece98879eaf746e66728b 02-Mar-2012 Greg Clayton <gclayton@apple.com> Fixed Symbol objects being able to get their byte size.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
444fe998bf707bd076a70c3a779db8575533695e 26-Feb-2012 Greg Clayton <gclayton@apple.com> Made a ModuleSpec class in Module.h which can specify a module using one or
more of the local path, platform path, associated symbol file, UUID, arch,
object name and object offset. This allows many of the calls that were
GetSharedModule to reduce the number of arguments that were used in a call
to these functions. It also allows a module to be created with a ModuleSpec
which allows many things to be specified prior to any accessors being called
on the Module class itself.

I was running into problems when adding support for "target symbol add"
where you can specify a stand alone debug info file after debugging has started
where I needed to specify the associated symbol file path and if I waited until
after construction, the wrong symbol file had already been located. By using
the ModuleSpec it allows us to construct a module with as little or as much
information as needed and not have to change the parameter list.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151476 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
7dd5c51fbab8384b18f20ecc125f9a1bb3c9bcb2 06-Feb-2012 Greg Clayton <gclayton@apple.com> Removed all of the "#ifndef SWIG" from the SB header files since we are using
interface (.i) files for each class.

Changed the FindFunction class from:

uint32_t
SBTarget::FindFunctions (const char *name,
uint32_t name_type_mask,
bool append,
lldb::SBSymbolContextList& sc_list)

uint32_t
SBModule::FindFunctions (const char *name,
uint32_t name_type_mask,
bool append,
lldb::SBSymbolContextList& sc_list)

To:

lldb::SBSymbolContextList
SBTarget::FindFunctions (const char *name,
uint32_t name_type_mask = lldb::eFunctionNameTypeAny);

lldb::SBSymbolContextList
SBModule::FindFunctions (const char *name,
uint32_t name_type_mask = lldb::eFunctionNameTypeAny);

This makes the API easier to use from python. Also added the ability to
append a SBSymbolContext or a SBSymbolContextList to a SBSymbolContextList.

Exposed properties for lldb.SBSymbolContextList in python:

lldb.SBSymbolContextList.modules => list() or all lldb.SBModule objects in the list
lldb.SBSymbolContextList.compile_units => list() or all lldb.SBCompileUnits objects in the list
lldb.SBSymbolContextList.functions => list() or all lldb.SBFunction objects in the list
lldb.SBSymbolContextList.blocks => list() or all lldb.SBBlock objects in the list
lldb.SBSymbolContextList.line_entries => list() or all lldb.SBLineEntry objects in the list
lldb.SBSymbolContextList.symbols => list() or all lldb.SBSymbol objects in the list

This allows a call to the SBTarget::FindFunctions(...) and SBModule::FindFunctions(...)
and then the result can be used to extract the desired information:

sc_list = lldb.target.FindFunctions("erase")

for function in sc_list.functions:
print function
for symbol in sc_list.symbols:
print symbol

Exposed properties for the lldb.SBSymbolContext objects in python:

lldb.SBSymbolContext.module => lldb.SBModule
lldb.SBSymbolContext.compile_unit => lldb.SBCompileUnit
lldb.SBSymbolContext.function => lldb.SBFunction
lldb.SBSymbolContext.block => lldb.SBBlock
lldb.SBSymbolContext.line_entry => lldb.SBLineEntry
lldb.SBSymbolContext.symbol => lldb.SBSymbol


Exposed properties for the lldb.SBBlock objects in python:

lldb.SBBlock.parent => lldb.SBBlock for the parent block that contains
lldb.SBBlock.sibling => lldb.SBBlock for the sibling block to the current block
lldb.SBBlock.first_child => lldb.SBBlock for the first child block to the current block
lldb.SBBlock.call_site => for inline functions, return a lldb.declaration object that gives the call site file, line and column
lldb.SBBlock.name => for inline functions this is the name of the inline function that this block represents
lldb.SBBlock.inlined_block => returns the inlined function block that contains this block (might return itself if the current block is an inlined block)
lldb.SBBlock.range[int] => access the address ranges for a block by index, a list() with start and end address is returned
lldb.SBBlock.ranges => an array or all address ranges for this block
lldb.SBBlock.num_ranges => the number of address ranges for this blcok

SBFunction objects can now get the SBType and the SBBlock that represents the
top scope of the function.

SBBlock objects can now get the variable list from the current block. The value
list returned allows varaibles to be viewed prior with no process if code
wants to check the variables in a function. There are two ways to get a variable
list from a SBBlock:

lldb::SBValueList
SBBlock::GetVariables (lldb::SBFrame& frame,
bool arguments,
bool locals,
bool statics,
lldb::DynamicValueType use_dynamic);

lldb::SBValueList
SBBlock::GetVariables (lldb::SBTarget& target,
bool arguments,
bool locals,
bool statics);

When a SBFrame is used, the values returned will be locked down to the frame
and the values will be evaluated in the context of that frame.

When a SBTarget is used, global an static variables can be viewed without a
running process.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149853 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
df6dc88322f103b263092d752db4490e628a1cbd 05-Jan-2012 Greg Clayton <gclayton@apple.com> Added code in the Host layer that can report system log messages
so that we don't have "fprintf (stderr, ...)" calls sprinkled everywhere.
Changed all needed locations over to using this.

For non-darwin, we log to stderr only. On darwin, we log to stderr _and_
to ASL (Apple System Log facility). This will allow GUI apps to have a place
for these error and warning messages to go, and also allows the command line
apps to log directly to the terminal.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@147596 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
444e35b5fdf15a25a427285650f06f1390e62c75 19-Oct-2011 Greg Clayton <gclayton@apple.com> Moved lldb::user_id_t values to be 64 bit. This was going to be needed for
process IDs, and thread IDs, but was mainly needed for for the UserID's for
Types so that DWARF with debug map can work flawlessly. With DWARF in .o files
the type ID was the DIE offset in the DWARF for the .o file which is not
unique across all .o files, so now the SymbolFileDWARFDebugMap class will
make the .o file index part (the high 32 bits) of the unique type identifier
so it can uniquely identify the types.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@142534 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
b01f7a4f4793b14f88689fa48c04a11822d3a1c4 14-Oct-2011 Sean Callanan <scallanan@apple.com> Cleaned up a few functions that never get used.

Specifically, the expression parser used to use
functions attached to SymbolContext to do lookups,
but nowadays it searches a ModuleList or Module
directly instead. These functions had no
remaining clients so I removed them to prevent
bit rot.

I also removed a stray callback function from
ClangExpressionDeclMap.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141899 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
0fcec13c6639ab49216fa9447b25888b7bc9ff59 13-Oct-2011 Sean Callanan <scallanan@apple.com> Completed the glue that passes a ClangNamespaceDecl *
down through Module and SymbolVendor into SymbolFile.
Added checks to SymbolFileDWARF that restrict symbol
searches when a namespace is passed in.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141847 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
3e80cd9c9e6ae50ff54537551e2fe3ed5319b9b4 12-Oct-2011 Sean Callanan <scallanan@apple.com> Added ClangNamespaceDecl * parameters to several
core Module functions that the expression parser
will soon be using.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141766 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
8a2a4f8dd31f3228ce323cd2e3c788cbf9f2e7c1 08-Oct-2011 Jim Ingham <jingham@apple.com> Fix the last testsuite regression from the apple-names stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141468 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
8384612bdbaf624b75363c46548f5d538eaef666 07-Oct-2011 Greg Clayton <gclayton@apple.com> Removed code that was left in during testing and debugging of an issue.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141387 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
3d790bb732bd4cf014524f62e96d27356633f531 07-Oct-2011 Greg Clayton <gclayton@apple.com> Added better logging for the case where we don't find a PC in a block.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141348 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
0c463155f7c1dab6da414dafe93b4b8fd21b7a68 07-Oct-2011 Greg Clayton <gclayton@apple.com> <rdar://problem/10226227>

Fixed an assertion that was causing a crash. The bug describes a case where we have an inlined block that doesn't contain the frame PC that was used to lookup the symbol context in the first place. This really shouldn't happen, so
now we log if we run into this and don't assert.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141338 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
00db215522a0cf31082d26d7ab30d2aa30965acf 05-Oct-2011 Greg Clayton <gclayton@apple.com> Enable all the new accelerator tables if they are present and don't manually
index the DWARF. Also fixed an issue with memory accelerator tables with a
size of 1 where we would loop infinitely.

Added support for parsing the new .apple_namespaces section which gives us a
memory hash table for looking up namespaces.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141128 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
2f57db09a49f2a05a620b8163bbe1e748a46ec73 01-Oct-2011 Greg Clayton <gclayton@apple.com> Cleaned up the the code that figures out the inlined stack frames given a
symbol context that represents an inlined function. This function has been
renamed internally to:

bool
SymbolContext::GetParentOfInlinedScope (const Address &curr_frame_pc,
SymbolContext &next_frame_sc,
Address &next_frame_pc) const;

And externally to:

SBSymbolContext
SBSymbolContext::GetParentOfInlinedScope (const SBAddress &curr_frame_pc,
SBAddress &parent_frame_addr) const;

The correct blocks are now correctly calculated.

Switched the stack backtracing engine (in StackFrameList) and the address
context printing over to using the internal SymbolContext::GetParentOfInlinedScope(...)
so all inlined callstacks will match exactly.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140910 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
9a93fcd1c343560eb33770c2e73eb3bd431535d6 29-Sep-2011 Greg Clayton <gclayton@apple.com> If the new .apple_names and .apple_types DWARF accelerator tables
are available, we currently will still index the DWARF ourselves
and assert if the name lookups differ. This will help us transition
to the new accelerator tables and make sure they are workng before
we switch over entirely.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140788 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
dc90162225573319cc1bf5076059a09509b73ac7 28-Sep-2011 Jim Ingham <jingham@apple.com> Need to go to the containing inline block to get the inline name right.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
a7d8951c573b0206ab7f6cff7f9c301e2bc0e28c 27-Sep-2011 Jim Ingham <jingham@apple.com> Added an API to SymbolContext to hide the complexity of getting the
function name from a symbol context. Use that in CommandCompletions
to get the right name.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140628 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
23b8abbe214c252028f6e09f79169529c846409d 26-Sep-2011 Greg Clayton <gclayton@apple.com> Added more functionality to the public API to allow for better
symbolication. Also improved the SBInstruction API to allow
access to the instruction opcode name, mnemonics, comment and
instruction data.

Added the ability to edit SBLineEntry objects (change the file,
line and column), and also allow SBSymbolContext objects to be
modified (set module, comp unit, function, block, line entry
or symbol).

The SymbolContext and SBSymbolContext can now generate inlined
call stack infomration for symbolication much easier using the
SymbolContext::GetParentInlinedFrameInfo(...) and
SBSymbolContext::GetParentInlinedFrameInfo(...) methods.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140518 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
7e5fa7fc1f8efd24c078e063b2c4b5e13ba5be20 20-Sep-2011 Jason Molenda <jmolenda@apple.com> Update declarations for all functions/methods that accept printf-style
stdarg formats to use __attribute__ format so the compiler can flag
incorrect uses. Fix all incorrect uses. Most of these are innocuous,
a few were resulting in crashes.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140185 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
6e0101c86555a06b3bd4cb6104b35abfae0b0057 17-Sep-2011 Greg Clayton <gclayton@apple.com> Convert lldb::ModuleSP to use an instrusive ref counted pointer.
We had some cases where getting the shared pointer for a module from
the global module list was causing a performance issue when debugging
with DWARF in .o files. Now that the module uses intrusive ref counts,
we can easily convert any pointer to a shared pointer.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139983 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
7dd98df0d69447d3f42b8044b7cda2c089aea653 12-Jul-2011 Greg Clayton <gclayton@apple.com> Added the ability to _not_ skip the prologue when settings breakpoints
by name by adding an extra parameter to the lldb_private::Target breakpoint
setting functions.

Added a function in the DWARF symbol file plug-in that can dump errors
and prints out which DWARF file the error is happening in so we can track
down what used to be assertions easily.

Fixed the MacOSX kernel plug-in to properly read the kext images and set
the kext breakpoint to watch for kexts as they are loaded.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@134990 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
1a102087f54079c25c8827afac6153a44ca535da 12-Jul-2011 Enrico Granata <granata.enrico@gmail.com> named summaries:
- a new --name option for "type summary add" lets you give a name to a summary
- a new --summary option for "frame variable" lets you bind a named summary to one or more variables
${var%s} now works for printing the value of 0-terminated CStrings
type format test case now tests for cascading
- this is disabled on GCC because GCC may end up stripping typedef chains, basically breaking cascading
new design for the FormatNavigator class
new template class CleanUp2 meant to support cleanup routines with 1 additional parameter beyond resource handle

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@134943 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
fb81642e03567a3413d94cdb632b6005a0ad4273 10-Jul-2011 Greg Clayton <gclayton@apple.com> Allow the built in ValueObject summary providers for C strings
use lldb_private::Target::ReadMemory(...) to allow constant strings
to be displayed in global variables prior on in between process
execution.

Centralized the variable declaration dumping into:

bool
Variable::DumpDeclaration (Stream *s, bool show_fullpaths, bool show_module);

Fixed an issue if you used "target variable --regex <regex>" where the
variable name would not be displayed, but the regular expression would.

Fixed an issue when viewing global variables through "target variable"
might not display correctly when doing DWARF in object files.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@134878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
65ec724a14127c348da23341e9f4a440758d01c6 10-May-2011 Sean Callanan <scallanan@apple.com> Fixed a bug that caused types to be incorrectly
looked up. Queries for global types were made
too specific -- including the current module
and compile unit in the query was limiting the
search when we wanted a truly global search.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@131145 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
ff44ab42e9f5d8e4d550e11d1b69413e0bc75b71 23-Apr-2011 Greg Clayton <gclayton@apple.com> Fixed the SymbolContext::DumpStopContext() to correctly indent and dump
inline contexts when the deepest most block is not inlined.

Added source path remappings to the lldb_private::Target class that allow it
to remap paths found in debug info so we can find source files that are elsewhere
on the current system.

Fixed disassembly by function name to disassemble inline functions that are
inside other functions much better and to show enough context before the
disassembly output so you can tell where things came from.

Added the ability to get more than one address range from a SymbolContext
class for the case where a block or function has discontiguous address ranges.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@130044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
52c8b6e3205e11e90adc83521c01915fc13626de 19-Apr-2011 Greg Clayton <gclayton@apple.com> Added a new option to the "source list" command that allows us to see where
line tables specify breakpoints can be set in the source. When dumping the
source, the number of breakpoints that can be set on a source line are shown
as a prefix:

(lldb) source list -f test.c -l1 -c222 -b
1 #include <stdio.h>
2 #include <sys/fcntl.h>
3 #include <unistd.h>
4 int
5 sleep_loop (const int num_secs)
[2] 6 {
7 int i;
[1] 8 for (i=0; i<num_secs; ++i)
9 {
[1] 10 printf("%d of %i - sleep(1);\n", i, num_secs);
[1] 11 sleep(1);
12 }
13 return 0;
[1] 14 }
15
16 int
17 main (int argc, char const* argv[])
[1] 18 {
[1] 19 printf("Process: %i\n\n", getpid());
[1] 20 puts("Press any key to continue..."); getchar();
[1] 21 sleep_loop (20);
22 return 12;
[1] 23 }

Above we can see there are two breakpoints for line 6 and one breakpoint for
lines 8, 10, 11, 14, 18, 19, 20, 21 and 23. All other lines have no line table
entries for them. This helps visualize the data provided in the debug
information without having to manually dump all line tables. It also includes
all inline breakpoint that may result for a given file which can also be very
handy to see.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@129747 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
f15996eea072cdaa8a092f22d3a1212b3d95f0ec 08-Apr-2011 Greg Clayton <gclayton@apple.com> Modified the ArchSpec to take an optional "Platform *" when setting the triple.
This allows you to have a platform selected, then specify a triple using
"i386" and have the remaining triple items (vendor, os, and environment) set
automatically.

Many interpreter commands take the "--arch" option to specify an architecture
triple, so now the command options needed to be able to get to the current
platform, so the Options class now take a reference to the interpreter on
construction.

Modified the build LLVM building in the Xcode project to use the new
Xcode project level user definitions:

LLVM_BUILD_DIR - a path to the llvm build directory
LLVM_SOURCE_DIR - a path to the llvm sources for the llvm that will be used to build lldb
LLVM_CONFIGURATION - the configuration that lldb is built for (Release,
Release+Asserts, Debug, Debug+Asserts).

I also changed the LLVM build to not check if "lldb/llvm" is a symlink and
then assume it is a real llvm build directory versus the unzipped llvm.zip
package, so now you can actually have a "lldb/llvm" directory in your lldb
sources.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@129112 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
24bc5d9bfad2a1c562c27e7cf37e1c56d85c45e7 30-Mar-2011 Greg Clayton <gclayton@apple.com> Many improvements to the Platform base class and subclasses. The base Platform
class now implements the Host functionality for a lot of things that make
sense by default so that subclasses can check:

int
PlatformSubclass::Foo ()
{
if (IsHost())
return Platform::Foo (); // Let the platform base class do the host specific stuff

// Platform subclass specific code...
int result = ...
return result;
}

Added new functions to the platform:

virtual const char *Platform::GetUserName (uint32_t uid);
virtual const char *Platform::GetGroupName (uint32_t gid);

The user and group names are cached locally so that remote platforms can avoid
sending packets multiple times to resolve this information.

Added the parent process ID to the ProcessInfo class.

Added a new ProcessInfoMatch class which helps us to match processes up
and changed the Host layer over to using this new class. The new class allows
us to search for processs:
1 - by name (equal to, starts with, ends with, contains, and regex)
2 - by pid
3 - And further check for parent pid == value, uid == value, gid == value,
euid == value, egid == value, arch == value, parent == value.

This is all hookup up to the "platform process list" command which required
adding dumping routines to dump process information. If the Host class
implements the process lookup routines, you can now lists processes on
your local machine:

machine1.foo.com % lldb
(lldb) platform process list
PID PARENT USER GROUP EFF USER EFF GROUP TRIPLE NAME
====== ====== ========== ========== ========== ========== ======================== ============================
99538 1 username usergroup username usergroup x86_64-apple-darwin FileMerge
94943 1 username usergroup username usergroup x86_64-apple-darwin mdworker
94852 244 username usergroup username usergroup x86_64-apple-darwin Safari
94727 244 username usergroup username usergroup x86_64-apple-darwin Xcode
92742 92710 username usergroup username usergroup i386-apple-darwin debugserver


This of course also works remotely with the lldb-platform:

machine1.foo.com % lldb-platform --listen 1234

machine2.foo.com % lldb
(lldb) platform create remote-macosx
Platform: remote-macosx
Connected: no
(lldb) platform connect connect://localhost:1444
Platform: remote-macosx
Triple: x86_64-apple-darwin
OS Version: 10.6.7 (10J869)
Kernel: Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386
Hostname: machine1.foo.com
Connected: yes
(lldb) platform process list
PID PARENT USER GROUP EFF USER EFF GROUP TRIPLE NAME
====== ====== ========== ========== ========== ========== ======================== ============================
99556 244 username usergroup username usergroup x86_64-apple-darwin trustevaluation
99548 65539 username usergroup username usergroup x86_64-apple-darwin lldb
99538 1 username usergroup username usergroup x86_64-apple-darwin FileMerge
94943 1 username usergroup username usergroup x86_64-apple-darwin mdworker
94852 244 username usergroup username usergroup x86_64-apple-darwin Safari

The lldb-platform implements everything with the Host:: layer, so this should
"just work" for linux. I will probably be adding more stuff to the Host layer
for launching processes and attaching to processes so that this support should
eventually just work as well.

Modified the target to be able to be created with an architecture that differs
from the main executable. This is needed for iOS debugging since we can have
an "armv6" binary which can run on an "armv7" machine, so we want to be able
to do:

% lldb
(lldb) platform create remote-ios
(lldb) file --arch armv7 a.out

Where "a.out" is an armv6 executable. The platform then can correctly decide
to open all "armv7" images for all dependent shared libraries.

Modified the disassembly to show the current PC value. Example output:

(lldb) disassemble --frame
a.out`main:
0x1eb7: pushl %ebp
0x1eb8: movl %esp, %ebp
0x1eba: pushl %ebx
0x1ebb: subl $20, %esp
0x1ebe: calll 0x1ec3 ; main + 12 at test.c:18
0x1ec3: popl %ebx
-> 0x1ec4: calll 0x1f12 ; getpid
0x1ec9: movl %eax, 4(%esp)
0x1ecd: leal 199(%ebx), %eax
0x1ed3: movl %eax, (%esp)
0x1ed6: calll 0x1f18 ; printf
0x1edb: leal 213(%ebx), %eax
0x1ee1: movl %eax, (%esp)
0x1ee4: calll 0x1f1e ; puts
0x1ee9: calll 0x1f0c ; getchar
0x1eee: movl $20, (%esp)
0x1ef5: calll 0x1e6a ; sleep_loop at test.c:6
0x1efa: movl $12, %eax
0x1eff: addl $20, %esp
0x1f02: popl %ebx
0x1f03: leave
0x1f04: ret

This can be handy when dealing with the new --line options that was recently
added:

(lldb) disassemble --line
a.out`main + 13 at test.c:19
18 {
-> 19 printf("Process: %i\n\n", getpid());
20 puts("Press any key to continue..."); getchar();
-> 0x1ec4: calll 0x1f12 ; getpid
0x1ec9: movl %eax, 4(%esp)
0x1ecd: leal 199(%ebx), %eax
0x1ed3: movl %eax, (%esp)
0x1ed6: calll 0x1f18 ; printf

Modified the ModuleList to have a lookup based solely on a UUID. Since the
UUID is typically the MD5 checksum of a binary image, there is no need
to give the path and architecture when searching for a pre-existing
image in an image list.

Now that we support remote debugging a bit better, our lldb_private::Module
needs to be able to track what the original path for file was as the platform
knows it, as well as where the file is locally. The module has the two
following functions to retrieve both paths:

const FileSpec &Module::GetFileSpec () const;
const FileSpec &Module::GetPlatformFileSpec () const;





git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@128563 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
889fbd0581c24523642e0a04d659cc8f3dcdb4ed 26-Mar-2011 Greg Clayton <gclayton@apple.com> Added the ability to get the min and max instruction byte size for
an architecture into ArchSpec:

uint32_t
ArchSpec::GetMinimumOpcodeByteSize() const;

uint32_t
ArchSpec::GetMaximumOpcodeByteSize() const;

Added an AddressClass to the Instruction class in Disassembler.h.
This allows decoded instructions to know know if they are code,
code with alternate ISA (thumb), or even data which can be mixed
into code. The instruction does have an address, but it is a good
idea to cache this value so we don't have to look it up more than
once.

Fixed an issue in Opcode::SetOpcodeBytes() where the length wasn't
getting set.

Changed:

bool
SymbolContextList::AppendIfUnique (const SymbolContext& sc);

To:
bool
SymbolContextList::AppendIfUnique (const SymbolContext& sc,
bool merge_symbol_into_function);

This function was typically being used when looking up functions
and symbols. Now if you lookup a function, then find the symbol,
they can be merged into the same symbol context and not cause
multiple symbol contexts to appear in a symbol context list that
describes the same function.

Fixed the SymbolContext not equal operator which was causing mixed
mode disassembly to not work ("disassembler --mixed --name main").

Modified the disassembler classes to know about the fact we know,
for a given architecture, what the min and max opcode byte sizes
are. The InstructionList class was modified to return the max
opcode byte size for all of the instructions in its list.
These two fixes means when disassemble a list of instructions and dump
them and show the opcode bytes, we can format the output more
intelligently when showing opcode bytes. This affects any architectures
that have varying opcode byte sizes (x86_64 and i386). Knowing the max
opcode byte size also helps us to be able to disassemble N instructions
without having to re-read data if we didn't read enough bytes.

Added the ability to set the architecture for the disassemble command.
This means you can easily cross disassemble data for any supported
architecture. I also added the ability to specify "thumb" as an
architecture so that we can force disassembly into thumb mode when
needed. In GDB this was done using a hack of specifying an odd
address when disassembling. I don't want to repeat this hack in LLDB,
so the auto detection between ARM and thumb is failing, just specify
thumb when disassembling:

(lldb) disassemble --arch thumb --name main

You can also have data in say an x86_64 file executable and disassemble
data as any other supported architecture:
% lldb a.out
Current executable set to 'a.out' (x86_64).
(lldb) b main
(lldb) run
(lldb) disassemble --arch thumb --count 2 --start-address 0x0000000100001080 --bytes
0x100001080: 0xb580 push {r7, lr}
0x100001082: 0xaf00 add r7, sp, #0

Fixed Target::ReadMemory(...) to be able to deal with Address argument object
that isn't section offset. When an address object was supplied that was
out on the heap or stack, target read memory would fail. Disassembly uses
Target::ReadMemory(...), and the example above where we disassembler thumb
opcodes in an x86 binary was failing do to this bug.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@128347 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
d60d94a5126b93fda98678a68322abc2164073db 11-Mar-2011 Jim Ingham <jingham@apple.com> Add a first pass at a "stop hook" mechanism. This allows you to add commands that get run every time the debugger stops, whether due to a breakpoint, the end of a step, interrupt, etc. You can also specify in which context you want the stop hook to run, for instance only on a particular thread, or only in a particular shared library, function, file, line range within a file.

Still need to add "in methods of a class" to the specifiers, and the ability to write the stop hooks in the Scripting language as well as in the Command Language.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@127457 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
940b103224f3062578c7a7e6e76d8bf4a7956f2a 23-Feb-2011 Greg Clayton <gclayton@apple.com> Abtracted all mach-o and ELF out of ArchSpec. This patch is a modified form
of Stephen Wilson's idea (thanks for the input Stephen!). What I ended up
doing was:
- Got rid of ArchSpec::CPU (which was a generic CPU enumeration that mimics
the contents of llvm::Triple::ArchType). We now rely upon the llvm::Triple
to give us the machine type from llvm::Triple::ArchType.
- There is a new ArchSpec::Core definition which further qualifies the CPU
core we are dealing with into a single enumeration. If you need support for
a new Core and want to debug it in LLDB, it must be added to this list. In
the future we can allow for dynamic core registration, but for now it is
hard coded.
- The ArchSpec can now be initialized with a llvm::Triple or with a C string
that represents the triple (it can just be an arch still like "i386").
- The ArchSpec can still initialize itself with a architecture type -- mach-o
with cpu type and subtype, or ELF with e_machine + e_flags -- and this will
then get translated into the internal llvm::Triple::ArchSpec + ArchSpec::Core.
The mach-o cpu type and subtype can be accessed using the getter functions:

uint32_t
ArchSpec::GetMachOCPUType () const;

uint32_t
ArchSpec::GetMachOCPUSubType () const;

But these functions are just converting out internal llvm::Triple::ArchSpec
+ ArchSpec::Core back into mach-o. Same goes for ELF.

All code has been updated to deal with the changes.

This should abstract us until later when the llvm::TargetSpec stuff gets
finalized and we can then adopt it.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@126278 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
2e8cb8a7342a2ea672792067d712a794e215a3a7 19-Feb-2011 Jim Ingham <jingham@apple.com> - Changed all the places where CommandObjectReturn was exporting a StreamString to just exporting
a Stream, and then added GetOutputData & GetErrorData to get the accumulated data.
- Added a StreamTee that will tee output to two provided lldb::StreamSP's.
- Made the CommandObjectReturn use this so you can Tee the results immediately to
the debuggers output file, as well as saving up the results to return when the command
is done executing.
- HandleCommands now uses this so that if you have a set of commands that continue the target
you will see the commands come out as they are processed.
- The Driver now uses this to output the command results as you go, which makes the interface
more reactive seeming.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@126015 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
3c12604d5773abb8973e06a006ac460be9e426ea 08-Feb-2011 Greg Clayton <gclayton@apple.com> Fixed a crasher that could happen when trying to look at N_GSYM entries
in the DWARF + debug map symbol file parser.

Also cleaned up the "image lookup --address ADDR" output when we it results
in something that is in an inlined function. Now we correctly dump out the
full inlined call stack.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@125072 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
28d5fcc3158aebf543e0f3d0a3608c1746f5ef15 27-Jan-2011 Greg Clayton <gclayton@apple.com> Changed the SymbolFile::FindFunction() function calls to only return
lldb_private::Function objects. Previously the SymbolFileSymtab subclass
would return lldb_private::Symbol objects when it was asked to find functions.

The Module::FindFunctions (...) now take a boolean "bool include_symbols" so
that the module can track down functions and symbols, yet functions are found
by the SymbolFile plug-ins (through the SymbolVendor class), and symbols are
gotten through the ObjectFile plug-ins.

Fixed and issue where the DWARF parser might run into incomplete class member
function defintions which would make clang mad when we tried to make certain
member functions with invalid number of parameters (such as an operator=
operator that had no parameters). Now we just avoid and don't complete these
incomplete functions.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124359 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
6916e358c9725b75ed91f31236c147f26c9af10e 13-Nov-2010 Greg Clayton <gclayton@apple.com> Modified the lldb_private::Type clang type resolving code to handle three
cases when getting the clang type:
- need only a forward declaration
- need a clang type that can be used for layout (members and args/return types)
- need a full clang type

This allows us to partially parse the clang types and be as lazy as possible.
The first case is when we just need to declare a type and we will complete it
later. The forward declaration happens only for class/union/structs and enums.
The layout type allows us to resolve the full clang type _except_ if we have
any modifiers on a pointer or reference (both R and L value). In this case
when we are adding members or function args or return types, we only need to
know how the type will be laid out and we can defer completing the pointee
type until we later need it. The last type means we need a full definition for
the clang type.

Did some renaming of some enumerations to get rid of the old "DC" prefix (which
stands for DebugCore which is no longer around).

Modified the clang namespace support to be almost ready to be fed to the
expression parser. I made a new ClangNamespaceDecl class that can carry around
the AST and the namespace decl so we can copy it into the expression AST. I
modified the symbol vendor and symbol file plug-ins to use this new class.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118976 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
cff44fd1b87eb9e0f94a873c585e48749f42154b 30-Oct-2010 Johnny Chen <johnny.chen@apple.com> These two casts are up casts, no need to use dynamic_cast.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117725 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
68d47537c6a4bb911e6b5a0fdd19a16761571a92 27-Oct-2010 Sean Callanan <scallanan@apple.com> Removed an inappropriate function lookup path.

Also made type lookup lazy for types that are
hidden behind pointers.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117430 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
eea264007bc5fb42c8f3239726a9d28ae42e1b7b 15-Sep-2010 Greg Clayton <gclayton@apple.com> Moved the section load list up into the target so we can use the target
to symbolicate things without the need for a valid process subclass.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113895 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
2e3d6f2ebd22252b0468e95565b3b42e9fcaf008 11-Sep-2010 Greg Clayton <gclayton@apple.com> Make sure the address passed into SymbolContext::DumpStopContext() is valid before trying to calculate any offsets.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113645 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
c67b7d13cffeb2c9454635e8a11d65350bce61ad 10-Sep-2010 Greg Clayton <gclayton@apple.com> Cleaned up the output of "image lookup --address <ADDR>" which involved
cleaning up the output of many GetDescription objects that are part of a
symbol context. This fixes an issue where no ranges were being printed out
for functions, blocks and symbols.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113571 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
69aa5d9a7620a183cdc4da12cc87ea82e2ffcbf9 07-Sep-2010 Greg Clayton <gclayton@apple.com> Added more API to lldb::SBBlock to allow getting the block
parent, sibling and first child block, and access to the
inline function information.

Added an accessor the StackFrame:

Block * lldb_private::StackFrame::GetFrameBlock();

LLDB represents inline functions as lexical blocks that have
inlined function information in them. The function above allows
us to easily get the top most lexical block that defines a stack
frame. When there are no inline functions in function, the block
returned ends up being the top most block for the function. When
the PC is in an inlined funciton for a frame, this will return the
first parent block that has inlined function information. The
other accessor: StackFrame::GetBlock() will return the deepest block
that matches the frame's PC value. Since most debuggers want to display
all variables in the current frame, the Block returned by
StackFrame::GetFrameBlock can be used to retrieve all variables for
the current frame.

Fixed the lldb_private::Block::DumpStopContext(...) to properly
display inline frames a block should display all of its inlined
functions. Prior to this fix, one of the call sites was being skipped.
This is a separate code path from the current default where inlined
functions get their own frames.

Fixed an issue where a block would always grab variables for any
child inline function blocks.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113195 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
72b7158235500ae6d4b69ed378cbc36bf6e5cbe1 02-Sep-2010 Greg Clayton <gclayton@apple.com> Added a new bool parameter to many of the DumpStopContext() methods that
might dump file paths that allows the dumping of full paths or just the
basenames. Switched the stack frame dumping code to use just the basenames for
the files instead of the full path.

Modified the StackID class to no rely on needing the start PC for the current
function/symbol since we can use the SymbolContextScope to uniquely identify
that, unless there is no symbol context scope. In that case we can rely upon
the current PC value. This saves the StackID from having to calculate the
start PC when the StackFrame::GetStackID() accessor is called.

Also improved the StackID less than operator to correctly handle inlined stack
frames in the same stack.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@112867 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
b04e7a805310f2f2cc77947a8b263de9061617ae 24-Aug-2010 Greg Clayton <gclayton@apple.com> Got a lot of the kinks worked out in the inline support after debugging more
complex inlined examples.

StackFrame classes don't have a "GetPC" anymore, they have "GetFrameCodeAddress()".
This is because inlined frames will have a PC value that is the same as the
concrete frame that owns the inlined frame, yet the code locations for the
frame can be different. We also need to be able to get the real PC value for
a given frame so that variables evaluate correctly. To get the actual PC
value for a frame you can use:

addr_t pc = frame->GetRegisterContext()->GetPC();

Some issues with the StackFrame stomping on its own symbol context were
resolved which were causing the information to change for a frame when the
stack ID was calculated. Also the StackFrame will now correctly store the
symbol context resolve flags for any extra bits of information that were
looked up (if you ask for a block only and you find one, you will alwasy have
the compile unit and function).



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@111964 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
33ed170599d41fe407a4dcf5f0875c75e1ad1375 24-Aug-2010 Greg Clayton <gclayton@apple.com> Added support for inlined stack frames being represented as real stack frames
which is now on by default. Frames are gotten from the unwinder as concrete
frames, then if inline frames are to be shown, extra information to track
and reconstruct these frames is cached with each Thread and exanded as needed.

I added an inline height as part of the lldb_private::StackID class, the class
that helps us uniquely identify stack frames. This allows for two frames to
shared the same call frame address, yet differ only in inline height.

Fixed setting breakpoint by address to not require addresses to resolve.

A quick example:

% cat main.cpp

% ./build/Debug/lldb test/stl/a.out
Current executable set to 'test/stl/a.out' (x86_64).
(lldb) breakpoint set --address 0x0000000100000d31
Breakpoint created: 1: address = 0x0000000100000d31, locations = 1
(lldb) r
Launching 'a.out' (x86_64)
(lldb) Process 38031 Stopped
* thread #1: tid = 0x2e03, pc = 0x0000000100000d31, where = a.out`main [inlined] std::string::_M_data() const at /usr/include/c++/4.2.1/bits/basic_string.h:280, stop reason = breakpoint 1.1, queue = com.apple.main-thread
277
278 _CharT*
279 _M_data() const
280 -> { return _M_dataplus._M_p; }
281
282 _CharT*
283 _M_data(_CharT* __p)
(lldb) bt
thread #1: tid = 0x2e03, stop reason = breakpoint 1.1, queue = com.apple.main-thread
frame #0: pc = 0x0000000100000d31, where = a.out`main [inlined] std::string::_M_data() const at /usr/include/c++/4.2.1/bits/basic_string.h:280
frame #1: pc = 0x0000000100000d31, where = a.out`main [inlined] std::string::_M_rep() const at /usr/include/c++/4.2.1/bits/basic_string.h:288
frame #2: pc = 0x0000000100000d31, where = a.out`main [inlined] std::string::size() const at /usr/include/c++/4.2.1/bits/basic_string.h:606
frame #3: pc = 0x0000000100000d31, where = a.out`main [inlined] operator<< <char, std::char_traits<char>, std::allocator<char> > at /usr/include/c++/4.2.1/bits/basic_string.h:2414
frame #4: pc = 0x0000000100000d31, where = a.out`main + 33 at /Volumes/work/gclayton/Documents/src/lldb/test/stl/main.cpp:14
frame #5: pc = 0x0000000100000d08, where = a.out`start + 52

Each inline frame contains only the variables that they contain and each inlined
stack frame is treated as a single entity.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@111877 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
75ccf50c3371d8c8e293af25461705b86fb10a46 21-Aug-2010 Greg Clayton <gclayton@apple.com> Modified the host process monitor callback function Host::StartMonitoringChildProcess
to spawn a thread for each process that is being monitored. Previously
LLDB would spawn a single thread that would wait for any child process which
isn't ok to do as a shared library (LLDB.framework on Mac OSX, or lldb.so on
linux). The old single thread used to call wait4() with a pid of -1 which
could cause it to reap child processes that it shouldn't have.

Re-wrote the way Function blocks are handles. Previously I attempted to keep
all blocks in a single memory allocation (in a std::vector). This made the
code somewhat efficient, but hard to work with. I got rid of the old BlockList
class, and went to a straight parent with children relationship. This new
approach will allow for partial parsing of the blocks within a function.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@111706 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
93a4b1a8d6ad9a5d1e18a38b5ec55de5b7f6e724 04-Aug-2010 Sean Callanan <scallanan@apple.com> Added support for accessing members of C++ objects,
including superclass members. This involved ensuring
that access control was ignored, and ensuring that
the operands of BitCasts were properly scanned for
variables that needed importing.

Also laid the groundwork for declaring objects of
custom types; however, this functionality is disabled
for now because of a potential loop in ASTImporter.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@110174 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
0fc7358d61218ba5d5abb5c2ea489a9ef936bbf7 27-Jul-2010 Sean Callanan <scallanan@apple.com> Changed SymbolContext so when you search for functions
it returns a list of functions as a SymbolContextList.

Rewrote the clients of SymbolContext to use this
SymbolContextList.

Rewrote some of the providers of the data to SymbolContext
to make them respect preferences as to whether the list
should be cleared first; propagated that change out.

ClangExpressionDeclMap and ClangASTSource use this new
function list to properly generate function definitions -
even for functions that don't have a prototype in the
debug information.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@109476 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
704363531ee4877ccc6d35d0702876096f54c67b 01-Jul-2010 Greg Clayton <gclayton@apple.com> Centralized all disassembly into static functions in source/Core/Disassembler.cpp.

Added the ability to read memory from the target's object files when we aren't
running, so disassembling works before you run!

Cleaned up the API to lldb_private::Target::ReadMemory().

Cleaned up the API to the Disassembler to use actual "lldb_private::Address"
objects instead of just an "addr_t". This is nice because the Address objects
when resolved carry along their section and module which can get us the
object file. This allows Target::ReadMemory to be used when we are not
running.

Added a new lldb_private::Address dump style: DumpStyleDetailedSymbolContext
This will show a full breakdown of what an address points to. To see some
sample output, execute a "image lookup --address <addr>".

Fixed SymbolContext::DumpStopContext(...) to not require a live process in
order to be able to print function and symbol offsets.





git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@107350 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
12bec71b323dc520f0e985a86e09c4712559e115 28-Jun-2010 Greg Clayton <gclayton@apple.com> Added function name types to allow us to set breakpoints by name more
intelligently. The four name types we currently have are:

eFunctionNameTypeFull = (1 << 1), // The function name.
// For C this is the same as just the name of the function
// For C++ this is the demangled version of the mangled name.
// For ObjC this is the full function signature with the + or
// - and the square brackets and the class and selector
eFunctionNameTypeBase = (1 << 2), // The function name only, no namespaces or arguments and no class
// methods or selectors will be searched.
eFunctionNameTypeMethod = (1 << 3), // Find function by method name (C++) with no namespace or arguments
eFunctionNameTypeSelector = (1 << 4) // Find function by selector name (ObjC) names


this allows much more flexibility when setting breakoints:

(lldb) breakpoint set --name main --basename
(lldb) breakpoint set --name main --fullname
(lldb) breakpoint set --name main --method
(lldb) breakpoint set --name main --selector

The default:

(lldb) breakpoint set --name main

will inspect the name "main" and look for any parens, or if the name starts
with "-[" or "+[" and if any are found then a full name search will happen.
Else a basename search will be the default.

Fixed some command option structures so not all options are required when they
shouldn't be.

Cleaned up the breakpoint output summary.

Made the "image lookup --address <addr>" output much more verbose so it shows
all the important symbol context results. Added a GetDescription method to
many of the SymbolContext objects for the more verbose output.





git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@107075 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp
24943d2ee8bfaa7cf5893e4709143924157a5c1e 08-Jun-2010 Chris Lattner <sabre@nondot.org> Initial checkin of lldb code from internal Apple repo.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@105619 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Symbol/SymbolContext.cpp