summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/DWARF
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixed a crasher in the DWARF log channel code.Greg Clayton2010-12-141-0/+3
| | | | llvm-svn: 121810
* Fixed an issue when debugging with DWARF in the .o files whereGreg Clayton2010-12-071-4/+4
| | | | | | | | | | | | if two functions had the same demangled names (constructors where we have the in charge and not in charge version) we could end up mixing the two up when making the function in the DWARF. This was because we need to lookup the symbol by name and we need to use the mangled name if there is one. This ensures we get the correct address and that we resolve the linked addresses correctly for DWARf with debug map. llvm-svn: 121116
* Fixes to make id work as well as well as fix minor errorsSean Callanan2010-12-061-1/+1
| | | | | | when calling built-ins. llvm-svn: 121070
* Fixed a bug in which the SEL type was being resolvedSean Callanan2010-12-061-1/+1
| | | | | | | | wrongly as the target of a pointer rather than the SEL pointer itself. This caused incorrect behavior when dealing with Objective-C selector variables. llvm-svn: 121048
* Make sure to index the DWARF if we already haven't so we can resolve forwardGreg Clayton2010-12-031-0/+3
| | | | | | declarations when they haven't been found yet. llvm-svn: 120840
* Fixed an issue that would cause an assertion to fire when an inlined ↵Greg Clayton2010-12-031-9/+41
| | | | | | function was found during a regex function find call. llvm-svn: 120814
* When we resolve a forward declaration type, be sure to put it into the ↵Greg Clayton2010-11-201-0/+6
| | | | | | m_die_to_type map so we don't assert later when someone tries to resolve the type. llvm-svn: 119910
* Change the DWARFExpression::Evaluate methods to take an optionalJason Molenda2010-11-201-0/+1
| | | | | | | | | | | | | | RegisterContext* - normally this is retrieved from the ExecutionContext's StackFrame but when we need to evaluate an expression while creating the stack frame list this can be a little tricky. Add DW_OP_deref_size, needed for the _sigtramp FDE expression. Add support for processing DWARF expressions in RegisterContextLLDB. Update callers to DWARFExpression::Evaluate. llvm-svn: 119885
* Use different qualifier enums on the request of a clang engineer.Greg Clayton2010-11-161-2/+2
| | | | llvm-svn: 119396
* First attempt and getting "const" C++ method function signatures correct.Greg Clayton2010-11-162-5/+45
| | | | | | | It currently isn't working, but it should be close. I will work on this more when I figure out what I am not doing correctly. llvm-svn: 119324
* Just like functions can have a basename and a mangled/demangled name, variableGreg Clayton2010-11-142-29/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | can too. So now the lldb_private::Variable class has support for this. Variables now have support for having a basename ("i"), and a mangled name ("_ZN12_GLOBAL__N_11iE"), and a demangled name ("(anonymous namespace)::i"). Nowwhen searching for a variable by name, users might enter the fully qualified name, or just the basename. So new test functions were added to the Variable and Mangled classes as: bool NameMatches (const ConstString &name); bool NameMatches (const RegularExpression &regex); I also modified "ClangExpressionDeclMap::FindVariableInScope" to also search for global variables that are not in the current file scope by first starting with the current module, then moving on to all modules. Fixed an issue in the DWARF parser that could cause a varaible to get parsed more than once. Now, once we have parsed a VariableSP for a DIE, we cache the result even if a variable wasn't made so we don't do any re-parsing. Some DW_TAG_variable DIEs don't have locations, or are missing vital info that stops a debugger from being able to display anything for it, we parse a NULL variable shared pointer for these DIEs so we don't keep trying to reparse it. llvm-svn: 119085
* Fixed a crasher (an assert was firing in the DWARF parser) when settingGreg Clayton2010-11-141-11/+45
| | | | | | | | | | | breakpoints on inlined functions by name. This involved fixing the DWARF parser to correctly back up and parse the concrete function when we find inlined functions by name, then grabbing any appropriate inlined blocks and returning symbol contexts with the block filled in. After this was fixed, the breakpoint by name resolver needed to correctly deal with symbol contexts that had the inlined block filled in in the symbol contexts. llvm-svn: 119017
* Fixed an issue where we might not find global variables by name when we haveGreg Clayton2010-11-132-20/+91
| | | | | | | | | | | | | | | a debug map with DWARF in the .o files due to the attemted shortcut that was being taken where the global variables were being searched for by looking in the symbol table. The problem with the symbols in the symbol table is we don't break apart the symbol names for symbols when they are mangled into basename and the fully mangled name since this would take a lot of CPU time to chop up the mangled names and try and find the basenames. The DWARF info typically has this broken up for us where the basename of the variable is in a the DW_AT_name attribute, and the mangled name is in the DW_AT_MIPS_linkage_name attribute. Now we correctly find globals by searching all OSO's for the information so we can take advantage of this split information. llvm-svn: 119012
* Modified the lldb_private::Type clang type resolving code to handle threeGreg Clayton2010-11-134-88/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Disable the debug logging I accidentally left enabled.Greg Clayton2010-11-111-1/+1
| | | | llvm-svn: 118758
* Added initial support to the lldb_private::SymbolFile for findingGreg Clayton2010-11-104-111/+198
| | | | | | | | | | | | | | | namespaces by name given an optional symbol context. I might end up dressing up the "clang::NamespaceDecl" into a lldb_private::Namespace class if we need to do more than is currenlty required of namespaces. Currently we only need to be able to lookup a namespace by name when parsing expressions, so I kept it simple for now. The idea here is even though we are passing around a "clang::NamespaceDecl *", that we always have it be an opaque pointer (it is forward declared inside of "lldb/Core/ClangForward.h") and we only use clang::NamespaceDecl implementations inside of ClangASTContext, or ClangASTType when we need to extract information from the namespace decl object. llvm-svn: 118737
* Modified lldb_private::SymboleFile to be able to override where its TypeListGreg Clayton2010-11-104-79/+193
| | | | | | | | | | | | | | | | | | | | | | | | | comes from by using a virtual function to provide it from the Module's SymbolVendor by default. This allows the DWARF parser, when being used to parse DWARF in .o files with a parent DWARF + debug map parser, to get its type list from the DWARF + debug map parser so when we go and find full definitions for types (that might come from other .o files), we can use the type list from the debug map parser. Otherwise we ended up mixing clang types from one .o file (say a const pointer to a forward declaration "class A") with the a full type from another .o file. This causes expression parsing, when copying the clang types from those parsed by the DWARF parser into the expression AST, to fail -- for good reason. Now all types are created in the same list. Also added host support for crash description strings that can be set before doing a piece of work. On MacOSX, this ties in with CrashReporter support that allows a string to be dispalyed when the app crashes and allows LLDB.framework to print a description string in the crash log. Right now this is hookup up the the CommandInterpreter::HandleCommand() where each command notes that it is about to be executed, so if we crash while trying to do this command, we should be able to see the command that caused LLDB to exit. For all other platforms, this is a nop. llvm-svn: 118672
* Did a lot of code cleanup.Greg Clayton2010-11-099-187/+77
| | | | | | | | Fixed the DWARF plug-in such that when it gets all attributes for a DIE, that it omits the DW_AT_sibling and DW_AT_declaration when getting attributes from a DW_AT_abstract_origin or DW_AT_specification DIE. llvm-svn: 118654
* Fixed an issue in the DWARF parser that was causing forward declarationsGreg Clayton2010-11-091-21/+21
| | | | | | | | | | | | to not get resolved. Fixed the "void **isa_ptr" variable inside the objective C verifier to start with a '$' character so we don't go looking for it in our program. Moved the lookup for "$__lldb_class" into the part that knows we are looking for internal types that start with a '$'. llvm-svn: 118488
* Minor comment fix.Johnny Chen2010-11-081-1/+1
| | | | llvm-svn: 118450
* Fixed some type parsing that was causing types to thing they were forwardGreg Clayton2010-11-081-27/+56
| | | | | | declarations when they should have been. llvm-svn: 118393
* Modified the DWARF parser for both the single DWARF file and for the caseGreg Clayton2010-11-074-42/+110
| | | | | | | | | | | where the DWARF is in the .o files so they can track down the actual type for a forward declaration. This was working before for just DWARF files, but not for DWARF in .o files where the actual definition was in another .o file. Modified the main thread name in the driver to be more consistent with the other LLDB thread names. llvm-svn: 118383
* Fixed globals not showing up for any but the first compile unit due to a Greg Clayton2010-11-011-3/+7
| | | | | | | mismatch: I was using the compile unit user ID (the compile unit offset in the DWARF) as the compile unit index. llvm-svn: 117948
* Added a hack that allows expressions to ignoreSean Callanan2010-10-301-0/+6
| | | | | | | | | Objective-C member accessibility restrictions. Ultimately Clang should have a flag that ignores accessibility for Objective-C like it has one for C++. llvm-svn: 117768
* Add the ability to disable individual log categories, ratherCaroline Tice2010-10-292-3/+38
| | | | | | | | | than just the entire log channel. Add checks, where appropriate, to make sure a log channel/category has not been disabled before attempting to write to it. llvm-svn: 117715
* Modified the lldb_private::TypeList to use a std::multimap for quicker lookupGreg Clayton2010-10-291-3/+2
| | | | | | | | | | by type ID (the most common type of type lookup). Changed the API logging a bit to always show the objects in the OBJECT(POINTER) format so it will be easy to locate all instances of an object or references to it when looking at logs. llvm-svn: 117641
* Fixed the "frame variable -G NAME" that would print globalGreg Clayton2010-10-281-8/+9
| | | | | | | | variables by name. It was accidentally getting all the globals for the compile unit that contained the global variable named NAME. llvm-svn: 117516
* Updated the lldb_private::Flags class to have better method names and madeGreg Clayton2010-10-274-23/+33
| | | | | | | | | | | | | | | | | all of the calls inlined in the header file for better performance. Fixed the summary for C string types (array of chars (with any combo if modifiers), and pointers to chars) work in all cases. Fixed an issue where a forward declaration to a clang type could cause itself to resolve itself more than once if, during the resolving of the type itself it caused something to try and resolve itself again. We now remove the clang type from the forward declaration map in the DWARF parser when we start to resolve it and avoid this additional call. This should stop any duplicate members from appearing and throwing all the alignment of structs, unions and classes. llvm-svn: 117437
* Fixed an issue where we were resolving paths when we should have been.Greg Clayton2010-10-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So the issue here was that we have lldb_private::FileSpec that by default was always resolving a path when using the: FileSpec::FileSpec (const char *path); and in the: void FileSpec::SetFile(const char *pathname, bool resolve = true); This isn't what we want in many many cases. One example is you have "/tmp" on your file system which is really "/private/tmp". You compile code in that directory and end up with debug info that mentions "/tmp/file.c". Then you type: (lldb) breakpoint set --file file.c --line 5 If your current working directory is "/tmp", then "file.c" would be turned into "/private/tmp/file.c" which won't match anything in the debug info. Also, it should have been just a FileSpec with no directory and a filename of "file.c" which could (and should) potentially match any instances of "file.c" in the debug info. So I removed the constructor that just takes a path: FileSpec::FileSpec (const char *path); // REMOVED You must now use the other constructor that has a "bool resolve" parameter that you must always supply: FileSpec::FileSpec (const char *path, bool resolve); I also removed the default parameter to SetFile(): void FileSpec::SetFile(const char *pathname, bool resolve); And fixed all of the code to use the right settings. llvm-svn: 116944
* Did a bit of parameter renaming.Greg Clayton2010-10-152-28/+28
| | | | llvm-svn: 116562
* Separated the DWARF index for types from that the index of the namespacesGreg Clayton2010-10-154-8/+19
| | | | | | | | | | | since we can't parse DW_TAG_namespace DIEs as types. They are only decls in clang. All of the types we handle right now have both clang "XXXType" classes to go with the "XXXDecl" classes which means they can be used within the lldb_private::Type class. I need to check to see which other decls that don't have associated type objects need to float around the debugger and possibly make a lldb_private::Decl class to manage them. llvm-svn: 116558
* Fixed C++ class clang type creation and display by making sure we omit Greg Clayton2010-10-133-122/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | artifical members (like the vtable pointer member that shows up in the DWARF). We were adding this to each class which was making all member variables be off by a pointer size. Added a test case so we can track this with "test/forward". Fixed the type name index in DWARF to include all the types after finding some types were being omitted due to the DW_AT_specification having the DW_AT_declaration attribute which was being read into the real type instances when there were forward declarations in the DWARF, causing the type to be omitted. We now check to make sure any DW_AT_declaration values are only respected when parsing types if the attribute is from the current DIE. After fixing the missing types, we ran into some issues with the expression parser finding duplicate entries for __va_list_tag since they are built in types and would result in a "duplicate __va_list_tag definition" error. We are now just ignoring this name during lookup, but we will need to see if we can get the name lookup function to not get called in these cases. Fixed an issue that would cause an assertion where DW_TAG_subroutine_types that had no children, would not properly make a clang function type of: "void (*) (void)". llvm-svn: 116392
* Fixed the Objective C method prototypes to be correct (the selectors weren'tGreg Clayton2010-10-126-15/+103
| | | | | | | | being chopped up correctly). The DWARF plug-in also keeps a map of the ObjC class names to selectors for easy parsing of all class selectors when we parse the class type. llvm-svn: 116290
* Fixed an issue where if a method funciton was asked to be parsed beforeGreg Clayton2010-10-015-80/+147
| | | | | | its containing class was parsed, we would crash. llvm-svn: 115343
* Make C++ constructors and destructors correctly within the clang types weGreg Clayton2010-10-011-3/+12
| | | | | | generate from DWARF. llvm-svn: 115268
* Fixed an issue where byte sizes were not able to be calculated for forwardGreg Clayton2010-09-301-1/+2
| | | | | | | declarations because we lost the original context which was needed to be able to figure out the byte size. llvm-svn: 115223
* Cleaned up a unused member variable in Debugger.Greg Clayton2010-09-301-20/+26
| | | | | | | | | | | | | | Added the start of Host specific launch services, though it currently isn't hookup up to anything. We want to be able to launch a process and use the native launch services to launch an app like it would be launched by the user double clicking on the app. We also eventually want to be able to run a command line app in a newly spawned terminal to avoid terminal sharing. Fixed an issue with the new DWARF forward type declaration stuff. A crasher was found that was happening when trying to properly expand the forward declarations. llvm-svn: 115213
* Fixed an LLVM/Clang assertion that would happen for C++ and ObjC methods if ↵Greg Clayton2010-09-291-62/+10
| | | | | | | | the DWARF doesn't specify the accessibility for the method. Currently gcc 4.2 and clang++ do not set the accessibility correctly on methods. We currently shouldn't default to private since public methods don't have the accessibility specified. Bottom line: we currently default to public for both C++ and ObjC if the accessibility isn't set. llvm-svn: 115016
* Fixed the forward declaration issue that was present in the DWARF parser afterGreg Clayton2010-09-294-81/+231
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Added a DIE to clang opaque type map.Greg Clayton2010-09-282-4/+6
| | | | | | Removed code that shouldn't have been checked in. llvm-svn: 114932
* Hooked up detach for ProcessGDBRemote.Greg Clayton2010-09-273-99/+53
| | | | | | | Remove the GetUserData()/SetUserData() from the DWARFDebugInfoEntry class. We now track everything with dense maps. llvm-svn: 114876
* Added the ability to create an objective C method for an objective C Greg Clayton2010-09-242-177/+144
| | | | | | | | | | | | | | | | | | | | | | | | interface in ClangASTContext. Also added two bool returning functions that indicated if an opaque clang qual type is a CXX class type, and if it is an ObjC class type. Objective C classes now will get their methods added lazily as they are encountered. The reason for this is currently, unlike C++, the DW_TAG_structure_type and owns the ivars, doesn't not also contain the member functions. This means when we parse the objective C class interface we either need to find all functions whose names start with "+[CLASS_NAME" or "-[CLASS_NAME" and add them all to the class, or when we parse each objective C function, we slowly add it to the class interface definition. Since objective C's class doesn't change internal bits according to whether it has certain types of member functions (like C++ does if it has virtual functions, or if it has user ctors/dtors), I currently chose to lazily populate the class when each functions is parsed. Another issue we run into with ObjC method declarations is the "self" and "_cmd" implicit args are not marked as artificial in the DWARF (DW_AT_artifical), so we currently have to look for the parameters by name if we are trying to omit artificial function args if the language of the compile unit is ObjC or ObjC++. llvm-svn: 114722
* Updated to latest LLVM. Major LLVM changes:Sean Callanan2010-09-231-9/+9
| | | | | | | | | | - Sema is now exported (and there was much rejoicing.) - Storage classes are now centrally defined. Also fixed some bugs that the new LLVM picked up. llvm-svn: 114622
* Added motheds to C++ classes as we parse them to keep clang happy.Greg Clayton2010-09-232-13/+136
| | | | llvm-svn: 114616
* General command line help cleanup:Greg Clayton2010-09-181-1/+1
| | | | | | | | | | - All single character options will now be printed together - Changed all options that contains underscores to contain '-' instead - Made the help come out a little flatter by showing the long and short option on the same line. - Modified the short character for "--ignore-count" options to "-i" llvm-svn: 114265
* Made CreateFunctionType static. Also fixed the spellingSean Callanan2010-09-161-1/+1
| | | | | | for CreateParameterDeclaration. llvm-svn: 114111
* Unbreak build, you can't take a pointer from a "register" variable. Most ↵Benjamin Kramer2010-09-161-1/+1
| | | | | | | | compilers ignore this keyword anyways. Also remove a typedef that typedefs nothing. llvm-svn: 114083
* Add the ability to not resolve the name passed to FileSpec. Then don't ↵Jim Ingham2010-09-162-4/+10
| | | | | | resolve the names of compilation units found in DWARF. llvm-svn: 114054
* 15-20% speed improvement when parsing DWARF. I used instruments toGreg Clayton2010-09-158-298/+528
| | | | | | | | | find the hotspots in our code when indexing the DWARF. A combination of using SmallVector to avoid collection allocations, using fixed form sizes when possible, and optimizing the hot loops contributed to the speedup. llvm-svn: 113961
* Fixed a missing newline when dumping mixed disassembly.Greg Clayton2010-09-152-5/+30
| | | | | | | | | | | | | | | | | Added a "bool show_fullpaths" to many more objects that were previously always dumping full paths. Fixed a few places where the DWARF was not indexed when we we needed it to be when making queries. Also fixed an issue where the DWARF in .o files wasn't searching all .o files for the types. Fixed an issue with the output from "image lookup --type <TYPENAME>" where the name and byte size might not be resolved and might not display. We now call the accessors so we end up seeing all of the type info. llvm-svn: 113951
OpenPOWER on IntegriCloud