- Sep 15, 2011
-
-
Sean Callanan authored
to execute expressions even in the absence of a process. This allows expressions to run in situations where the target cannot run -- e.g., to perform calculations based on type information, or to inspect a binary's static data. This modification touches the following files: lldb-private-enumerations.h Introduce a new enum specifying the policy for processing an expression. Some expressions should always be JITted, for example if they are functions that will be used over and over again. Some expressions should always be interpreted, for example if the target is unsafe to run. For most, it is acceptable to JIT them, but interpretation is preferable when possible. Target.[h,cpp] Have EvaluateExpression now accept the new enum. ClangExpressionDeclMap.[cpp,h] Add support for the IR interpreter and also make the ClangExpressionDeclMap more robust in the absence of a process. ClangFunction.[cpp,h] Add support for the new enum. IRInterpreter.[cpp,h] New implementation. ClangUserExpression.[cpp,h] Add support for the new enum, and for running expressions in the absence of a process. ClangExpression.h Remove references to the old DWARF-based method of evaluating expressions, because it has been superseded for now. ClangUtilityFunction.[cpp,h] Add support for the new enum. ClangExpressionParser.[cpp,h] Add support for the new enum, remove references to DWARF, and add support for checking whether the expression could be evaluated statically. IRForTarget.[h,cpp] Add support for the new enum, and add utility functions to support the interpreter. IRToDWARF.cpp Removed CommandObjectExpression.cpp Remove references to the obsolete -i option. Process.cpp Modify calls to ClangUserExpression::Evaluate to pass the correct enum (for dlopen/dlclose) SBValue.cpp Add support for the new enum. SBFrame.cpp Add support for he new enum. BreakpointOptions.cpp Add support for the new enum. llvm-svn: 139772
-
- Sep 13, 2011
-
-
Greg Clayton authored
llvm-svn: 139582
-
Greg Clayton authored
Address ranges are now split up into two different tables: - one in DWARFDebugInfo that is compile unit specific - one in each DWARFCompileUnit that has exact function DIE offsets This helps keep the size of the aranges down since the main table will get uniqued and sorted and have consecutive ranges merged. We then only parse the compile unit one on demand once we have determined that a compile unit contains the address in question. We also now use the .debug_aranges section if there is one instead of always indexing the DWARF manually. NameToDIE now uses a UniqueCStringMap<dw_offset> map instead of a std::map. std::map is very bulky as each node has 3 pointers and the key and value types. This gets our NameToDIE entry down to 12 bytes each instead of 48 which saves us a lot of memory when we have very large DWARF. DWARFDebugAranges now has a smaller footprint for each range it contains to save on memory. llvm-svn: 139557
-
- Sep 02, 2011
-
-
Greg Clayton authored
register names when dumping variable locations and location lists. Also did some cleanup where "int" types were being used for "lldb::RegisterKind" values. llvm-svn: 138988
-
- Aug 25, 2011
-
-
Sean Callanan authored
not set if the containing function could not be found. This caused LLDB to crash later in expression parsing. llvm-svn: 138499
-
- Aug 23, 2011
-
-
Sean Callanan authored
expression parser. You can use a persistent type like this: (lldb) expr struct $foo { int a; int b; }; (lldb) struct $foo i; i.a = 2; i.b = 3; i ($foo) $0 = { (int) a = 2 (int) b = 3 } typedefs work similarly. This patch affects the following files: test/expression_command/persistent_types/* A test case for persistent types, in particular structs and typedefs. ClangForward.h Added TypeDecl, needed to declare some functions in ASTResultSynthesizer.h ClangPersistentVariables.[h,cpp] Added a list of persistent types to the persistent variable store. ASTResultSynthesizer.[h,cpp] Made the AST result synthesizer iterate across TypeDecls in the expression, and record any persistent types found. Also made a minor documentation fix. ClangUserExpression.[h,cpp] Extended the user expression class to keep the state needed to report the persistent variable store for the target to the AST result synthesizers. Also introduced a new error code for expressions that executed normally but did not return a result. CommandObjectExpression.cpp Improved output for expressions (like declarations of new persistent types) that don't return a result. This is no longer treated as an error. llvm-svn: 138383
-
- Aug 16, 2011
-
-
Sean Callanan authored
being searched for in too heavyweight a way. Now, when asking for the address of a function, the expression parser just asks for a corresponding data symbol. llvm-svn: 137731
-
- Aug 12, 2011
-
-
Greg Clayton authored
cause extra shared pointer references to one or more modules to be leaked. This would cause many object files to stay around the life of LLDB, so after a recompile and rexecution, we would keep adding more and more memory. After fixing the leak, we found many cases where leaked stack frames were still being used and causing crashes in the test suite. These are now all resolved. llvm-svn: 137516
-
Sean Callanan authored
causing problems with printing the values of persistent variables with struct types. llvm-svn: 137392
-
- Aug 10, 2011
-
-
Sean Callanan authored
of string literals ("hello"[2]). Also fixed a problem in which empty string literals were not being compiled correctly ((int)printf("") would print garbage). Added a testcase that covers both. llvm-svn: 137247
-
Greg Clayton authored
ability to dump more information about modules in "target modules list". We can now dump the shared pointer reference count for modules, the pointer to the module itself (in case performance tools can help track down who has references to said pointer), and the modification time. Added "target delete [target-idx ...]" to be able to delete targets when they are no longer needed. This will help track down memory usage issues and help to resolve when module ref counts keep getting incremented. If the command gets no arguments, the currently selected target will be deleted. If any arguments are given, they must all be valid target indexes (use the "target list" command to get the current target indexes). Took care of a bunch of "no newline at end of file" warnings. TimeValue objects can now dump their time to a lldb_private::Stream object. Modified the "target modules list --global" command to not error out if there are no targets since it doesn't require a target. Fixed an issue in the MacOSX DYLD dynamic loader plug-in where if a shared library was updated on disk, we would keep using the older one, even if it was updated. Don't allow the ModuleList::GetSharedModule(...) to return an empty module. Previously we could specify a valid path on disc to a module, and specify an architecture that wasn't contained in that module and get a shared pointer to a module that wouldn't be able to return an object file or a symbol file. We now make sure an object file can be extracted prior to adding the shared pointer to the module to get added to the shared list. llvm-svn: 137196
-
Johnny Chen authored
llvm-svn: 137173
-
Johnny Chen authored
llvm-svn: 137169
-
- Aug 09, 2011
-
-
Jim Ingham authored
Add EvaluateWithError static method. Fix a bug in handling constant expressions - we weren't setting the result even though the expression evaluation succeeded... llvm-svn: 137077
-
- Aug 06, 2011
-
-
Sean Callanan authored
variable search API rather than rolling its own, fixing one of our testcases. llvm-svn: 137004
-
Sean Callanan authored
that detects what context the current expression is meant to execute in. LLDB now properly consults the method declaration in the debug information rather than trying to hunt down the "this" or "self" pointer by name, which can be misleading. Other fixes include: - LLDB now properly detects that it is inside an inlined C++ member function. - LLDB now allows access to non-const members when in const code. - The functions in SymbolFile that locate the DeclContext containing a DIE have been renamed to reflect what they actually do. I have added new functions that find the DeclContext for the DIE itself. I have also introduced testcases for C++ and Objective-C. llvm-svn: 136999
-
- Aug 04, 2011
-
-
Sean Callanan authored
expressions that used function pointers. The problem was that IRForTarget previously only scanned the IR for the expression for call instructions; if a function was used in another context, it was ignored. Now LLDB scans the Module for functions that are only declared (not also defined -- so these are externals); it then constructs function pointers for these functions and substitutes them wherever the function is used. Also made some changes so that "expr main" works just as well as "expr &main"; they end up being the same code, but LLDB was generating the result variable in different ways. llvm-svn: 136928
-
- Aug 03, 2011
-
-
Sean Callanan authored
current context. Previously, if there was a variable called "self" available, the expression parser assumed it was inside a method. But class methods in Objective-C also take a "self" parameter, of DWARF type "id". We now detect this properly, and only assume we're in an instance method if "self" is a pointer to an Objective-C object. llvm-svn: 136784
-
- Aug 01, 2011
-
-
Sean Callanan authored
caused functions that were cast as part of the call to have that cast ignored once their addresses were resolved. Notably, in the case of objc_msgSend(), if the function was cast from something returning i8* to something returning i8, the expression parser was discarding the cast as part of its resolution. This caused crashes later on. llvm-svn: 136648
-
Sean Callanan authored
scratch AST context before attempting to parse. llvm-svn: 136631
-
Sean Callanan authored
treated as externals, causing problems when we tried to look their locations up in the debug info. For example: expr char c[] = "foo"; c[0] would terminate when trying to find c in the debug information, despite the fact that c was defined inside the expression. llvm-svn: 136629
-
- Jul 31, 2011
-
-
Peter Collingbourne authored
Fixes non-__APPLE__ build. Patch by Matt Johnson! llvm-svn: 136580
-
- Jul 30, 2011
-
-
Sean Callanan authored
completes the support in the LLDB expression parser for incomplete types. Clang now imports types lazily, and we complete those types as necessary. Changes include: - ClangASTSource now supports three APIs which it passes to ClangExpressionDeclMap. CompleteType completes a TagDecl or an ObjCInterfaceDecl when needed; FindExternalVisibleDecls finds named entities that are visible in the expression's scope; and FindExternalLexicalDecls performs a (potentially restricted) search for entities inside a lexical scope like a namespace. These changes mean that entities in namespaces should work normally. - The SymbolFileDWARF code for searching a context for a specific name is now more general, and can search arbitrary contexts. - We are continuing to adapt our calls into LLVM from interfaces that take start and end iterators when accepting multiple items to interfaces that use ArrayRef. - I have cleaned up some code, especially our use of namespaces. This change is neutral for our testsuite and greatly improves correctness for large programs (like Clang) with complicated type systems. It should also lay the groundwork for improving the expression parser's performance as we are lazier and lazier about providing type information. llvm-svn: 136555
-
- Jul 19, 2011
-
-
Johnny Chen authored
Used hand merge to apply the diffs. I did not apply the diffs for FormatManager.h and the diffs for memberwise initialization for ValueObject.cpp because they changed since. I will ask my colleague to apply them later. llvm-svn: 135508
-
Enrico Granata authored
Code cleanup: - The Format Manager implementation is now split between two files: FormatClasses.{h|cpp} where the actual formatter classes (ValueFormat, SummaryFormat, ...) are implemented and FormatManager.{h|cpp} where the infrastructure classes (FormatNavigator, FormatManager, ...) are contained. The wrapper code always remains in Debugger.{h|cpp} - Several leftover fields, methods and comments from previous design choices have been removed type category subcommands (enable, disable, delete) now can take a list of category names as input - for type category enable, saying "enable A B C" is the same as saying enable C enable B enable A (the ordering is relevant in enabling categories, and it is expected that a user typing enable A B C wants to look into category A, then into B, then into C and not the other way round) - for the other two commands, the order is not really relevant (however, the same inverted ordering is used for consistency) llvm-svn: 135494
-
- Jul 18, 2011
-
-
Sean Callanan authored
Cabecinhas. llvm-svn: 135429
-
- Jul 11, 2011
-
-
Greg Clayton authored
with the "target modules lookup --address <addr>" command. The variable ID's, names, types, location for the address, and declaration is displayed. This can really help with crash logs since we get, on MacOSX at least, the registers for the thread that crashed so it is often possible to figure out some of the variable contents. llvm-svn: 134886
-
- Jul 08, 2011
-
-
Jim Ingham authored
llvm-svn: 134717
-
Greg Clayton authored
recursive function. Also fixed ClangASTContext::IsPointerType to correctly NULL out the pointee handle if a valid one is provided. llvm-svn: 134715
-
Sean Callanan authored
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
-
Sean Callanan authored
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
-
- Jul 07, 2011
-
-
Greg Clayton authored
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
-
- Jul 06, 2011
-
-
Greg Clayton authored
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
-
- Jun 30, 2011
-
-
Greg Clayton authored
"struct ", "class ", and "union " from the start of any type names that are extracted from clang QualType objects. I had to fix test suite cases that were expecting the struct/union/class prefix to be there. llvm-svn: 134132
-
- Jun 25, 2011
-
-
Greg Clayton authored
inspection of namespaces in the expression parser. ClangExpressionDeclMap hitherto reported that namespaces had been completely imported, even though the namespaces are returned empty. To deal with this situation, ClangASTSource was recently extended with an API to complete incomplete type definitions, and, for greater efficiency, to complete these definitions partially, returning only those objects that have a given name. This commit supports these APIs on LLDB's side, and uses it to provide information on types resident in namespaces. Namespaces are now imported as they were -- that is to say, empty -- but with minimal import mode on. This means that Clang will come back and request their contents by name as needed. We now respond with information on the contained types; this will be followed soon by information on functions and variables. llvm-svn: 133852
-
Greg Clayton authored
llvm-svn: 133834
-
- Jun 23, 2011
-
-
Greg Clayton authored
llvm-svn: 133684
-
- Jun 20, 2011
-
-
Jim Ingham authored
Use the dyld_mode, image_infos & image_infos_count passed into the shared library notification function to update libraries rather than reading the whole all_imaage_infos structure every time we get notified. llvm-svn: 133448
-
- Jun 03, 2011
-
-
Peter Collingbourne authored
Currently the runtime dynamic linker lacks object file support for anything other than Mach-O. llvm-svn: 132583
-
- May 30, 2011
-
-
Greg Clayton authored
llvm-svn: 132304
-