summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Value.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixed build warnings.Greg Clayton2012-10-301-0/+1
| | | | llvm-svn: 167065
* This patch fixes a bug where LLDB was incorrectly setting the address-size ↵Enrico Granata2012-04-241-1/+12
| | | | | | | | | | on a DataExtractor to be sizeof(void*) when the ValueObject came out of the expression parser This worked correctly for 64-bit targets, but broke down data formatters in i386 mode. The formatters would try to read pointers out of the frozen-dried objects, but were unable to do so because they would try fetching 8 bytes from a DataExtractor with only 4 bytes in it. This patch fixes the issue by always making the pointer-size for a DataExtractor match the target setting. llvm-svn: 155418
* Should have used the convenience function:Johnny Chen2012-02-021-12/+4
| | | | | | | | | bool lldb_private::StateIsStoppedState (StateType state, bool must_exist) instead. llvm-svn: 149637
* For processes which are not in one of the "launched and stopped" state, ↵Johnny Chen2012-02-021-1/+14
| | | | | | | | | | | | 'target variable' command should use Target::ReadMemory() call to read from the file section offset address. Also remove the @expectedFailure decorator.. 'target variable' command fails if the target program has been run rdar://problem/9763907 llvm-svn: 149629
* Add check for non-NULL Variable with a NULL Type.Jim Ingham2011-12-221-1/+6
| | | | llvm-svn: 147149
* Converted the lldb_private::Process over to use the intrusiveGreg Clayton2011-09-221-7/+7
| | | | | | | | | | | | | | | | | | | | shared pointers. Changed the ExecutionContext over to use shared pointers for the target, process, thread and frame since these objects can easily go away at any time and any object that was holding onto an ExecutionContext was running the risk of using a bad object. Now that the shared pointers for target, process, thread and frame are just a single pointer (they all use the instrusive shared pointers) the execution context is much safer and still the same size. Made the shared pointers in the the ExecutionContext class protected and made accessors for all of the various ways to get at the pointers, references, and shared pointers. llvm-svn: 140298
* Added "target variable" command that allows introspection of globalGreg Clayton2011-07-071-297/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Added support for finding and global variables in the SBTarget and SBModuleGreg Clayton2011-06-291-19/+59
| | | | | | | | | | | | | | | level in the public API. Also modified the ValueObject values to be able to display global variables without having a valid running process. The globals will read themselves from the object file section data if there is no process, and from the process if there is one. Also fixed an issue where modifications for dynamic types could cause child values of ValueObjects to not show up if the value was unable to evaluate itself (children of NULL pointer objects). llvm-svn: 134102
* Fixed the LLDB build so that we can have private types, private enums andGreg Clayton2011-03-241-4/+4
| | | | | | | | public types and public enums. This was done to keep the SWIG stuff from parsing all sorts of enums and types that weren't needed, and allows us to abstract our API better. llvm-svn: 128239
* When making a DataExtractor from a Value that's got a ClangType, set the ↵Jim Ingham2011-02-241-1/+9
| | | | | | AddressByteSize from the AST Context. llvm-svn: 126433
* Clean up a bit of the type getting code where lldb_private:Type now hasGreg Clayton2011-02-161-3/+3
| | | | | | | | | | | | | | clang_type_t GetClangFullType(); // Get a completely defined clang type clang_type_t GetClangLayoutType(); // Get a clang type that can be used for type layout clang_type_t GetClangForwardType(); // A type that can be completed if needed, but is more efficient. llvm-svn: 125691
* Made lldb_private::ArchSpec contain much more than just an architecture. ItGreg Clayton2011-02-151-4/+5
| | | | | | | | | | now, in addition to cpu type/subtype and architecture flavor, contains: - byte order (big endian, little endian) - address size in bytes - llvm::Triple for true target triple support and for more powerful plug-in selection. llvm-svn: 125602
* Endian patch from Kirk Beitz that allows better cross platform building.Greg Clayton2011-02-011-2/+2
| | | | llvm-svn: 124643
* Enabled extra warnings and fixed a bunch of small issues.Greg Clayton2011-01-251-8/+28
| | | | llvm-svn: 124250
* http://llvm.org/bugs/show_bug.cgi?id=8260Greg Clayton2011-01-251-4/+0
| | | | | | Removed incorrect enumeration from switch. llvm-svn: 124232
* Modified LLDB expressions to not have to JIT and run code just to see variableGreg Clayton2010-12-141-28/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Modified the lldb_private::Type clang type resolving code to handle threeGreg Clayton2010-11-131-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 118976
* Print better error messages when memory reads fail when displaying variableGreg Clayton2010-11-021-9/+11
| | | | | | | | | values. Always show the variable types for the top level items when dumping program variables. llvm-svn: 117999
* Fixed the forward declaration issue that was present in the DWARF parser afterGreg Clayton2010-09-291-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | adding methods to C++ and objective C classes. In order to make methods, we need the function prototype which means we need the arguments. Parsing these could cause a circular reference that caused an assertion. Added a new typedef for the clang opaque types which are just void pointers: lldb::clang_type_t. This appears in lldb-types.h. This was fixed by enabling struct, union, class, and enum types to only get a forward declaration when we make the clang opaque qual type for these types. When they need to actually be resolved, lldb_private::Type will call a new function in the SymbolFile protocol to resolve a clang type when it is not fully defined (clang::TagDecl::getDefinition() returns NULL). This allows us to be a lot more lazy when parsing clang types and keeps down the amount of data that gets parsed into the ASTContext for each module. Getting the clang type from a "lldb_private::Type" object now takes a boolean that indicates if a forward declaration is ok: clang_type_t lldb_private::Type::GetClangType (bool forward_decl_is_ok); So function prototypes that define parameters that are "const T&" can now just parse the forward declaration for type 'T' and we avoid circular references in the type system. llvm-svn: 115012
* Replace the vestigial Value::GetOpaqueCLangQualType with the more correct ↵Jim Ingham2010-09-281-14/+2
| | | | | | | | Value::GetValueOpaqueClangQualType. But mostly, move the ObjC Trampoline handling code from the MacOSX dyld plugin to the AppleObjCRuntime classes. llvm-svn: 114935
* Moved the section load list up into the target so we can use the targetGreg Clayton2010-09-141-1/+1
| | | | | | to symbolicate things without the need for a valid process subclass. llvm-svn: 113895
* Changed "Error Value::GetValueAsData (...)" to set the data extractor byte Greg Clayton2010-08-181-0/+9
| | | | | | | | | | order and address size correctly when the value comes from a file address. Values have "file" addresses when they are globals and the debug information specifies that they live in the object file at a given address (DWARF will represent this as a location "DW_OP_addr <addr>"). This causes global pointers to correctly extract their children on 64 bit programs. llvm-svn: 111380
* Added support for objective C built-in types: id, Class, and SEL. This Greg Clayton2010-08-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | involved watching for the objective C built-in types in DWARF and making sure when we convert the DWARF types into clang types that we use the appropriate ASTContext types. Added a way to find and dump types in lldb (something equivalent to gdb's "ptype" command): image lookup --type <TYPENAME> This only works for looking up types by name and won't work with variables. It also currently dumps out verbose internal information. I will modify it to dump more appropriate user level info in my next submission. Hookup up the "FindTypes()" functions in the SymbolFile and SymbolVendor so we can lookup types by name in one or more images. Fixed "image lookup --address <ADDRESS>" to be able to correctly show all symbol context information, but it will only show this extra information when the new "--verbose" flag is used. Updated to latest LLVM to get a few needed fixes. llvm-svn: 110089
* Change over to using the definitions for mach-o types and defines to theGreg Clayton2010-07-211-3/+4
| | | | | | | | | | | defines that are in "llvm/Support/MachO.h". This should allow ObjectFileMachO and ObjectContainerUniversalMachO to be able to be cross compiled in Linux. Also did some cleanup on the ASTType by renaming it to ClangASTType and renaming the header file. Moved a lot of "AST * + opaque clang type *" functionality from lldb_private::Type over into ClangASTType. llvm-svn: 109046
* Merged Eli Friedman's linux build changes where he added Makefile files thatGreg Clayton2010-07-091-1/+6
| | | | | | | enabled LLVM make style building and made this compile LLDB on Mac OS X. We can now iterate on this to make the build work on both linux and macosx. llvm-svn: 108009
* Initial checkin of lldb code from internal Apple repo.Chris Lattner2010-06-081-0/+803
llvm-svn: 105619
OpenPOWER on IntegriCloud