Commit Graph

92 Commits

Author SHA1 Message Date
Greg Clayton 6234a5c863 Centralize the way symbol and functions are looked up by making a Module::LookupInfo class that does all of the heavy lifting.
Background: symbols and functions can be looked up by full mangled name and by basename. SymbolFile and ObjectFile are expected to be able to do the lookups based on full mangled name or by basename, so when the user types something that is incomplete, we must be able to look it up efficiently. For example the user types "a:🅱️:c" as a symbol to set a breakpoint on, we will break this down into a 'lookup "c"' and then weed out N matches down to just the ones that match "a:🅱️:c". Previously this was done manaully in many functions by calling Module::PrepareForFunctionNameLookup(...) and then doing the lookup and manually pruning the results down afterward with duplicated code. Now all places use Module::LookupInfo to do the work in one place.

This allowed me to fix the name lookups to look for "func" with eFunctionNameTypeFull as the "name_type_mask", and correctly weed the results:

"func", "func()", "func(int)", "a::func()", "b::func()", and "a:🅱️:func()" down to just "func", "func()", "func(int)". Previously we would have set 6 breakpoints, now we correctly set just 3. This also extends to the expression parser when it looks up names for functions it needs to not get multiple results so we can call the correct function.

<rdar://problem/24599697> 

llvm-svn: 275281
2016-07-13 17:12:24 +00:00
Saleem Abdulrasool bb19a13c0b second pass over removal of Mutex and Condition
llvm-svn: 270024
2016-05-19 05:13:57 +00:00
Eugene Zelenko c5dac77ad8 Fix Clang-tidy modernize-use-nullptr warnings in some files in source/Core; other minor fixes.
llvm-svn: 263289
2016-03-11 20:20:38 +00:00
Greg Clayton ae088e52f3 Now that SymbolFileDWARF supports having types in completely separate .pcm file with "-fmodules -gmodules", each SymbolFileDWARF can reference module DWARF info by looking in other DWARF files. Then if you have 1000 .o files that each reference one or more .pcm files in their debug info, a simple Module::FindTypes(...) call can end up searching the same .pcm file over and over and over. Now all internal FindTypes methods in classes (ModuleList, Module, SymbolFile) now take an extra argument:
llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files
    
Each time a SymbolFile::FindTypes() is called, it needs to check the searched_symbol_files list to make sure it hasn't already been asked to find the type and return immediately if it has been checked. This will stop circular dependencies from also crashing LLDB during type queries. 

This has proven to be an issue when debugging large applications on MacOSX that use DWARF in .o files. 

<rdar://problem/24581488>

llvm-svn: 260434
2016-02-10 21:28:13 +00:00
Jason Molenda 9c077cf33d Change ModuleList::GetSharedModule so that it will reject "stub
libraries" altogether.  On Mac/iOS, these are libraries which have
a UUID and nlist records but no text or data.  If one of these
gets into the global module list, every time we try to search
for a given filename/arch/UUID, we'll get this stub library back.
We need to prevent them from getting added to the module list
altogether.

I thought about doing this down in ObjectFileMachO -- just rejecting
the file as a valid binary file altogether -- but Greg didn't want
to take that hard line approach at this point, he wanted to keep
the ability for lldb to read one of these if someone wanted to in
the future.

<rdar://problem/23035075> 

llvm-svn: 250979
2015-10-22 03:50:28 +00:00
Jason Molenda 8825c5c9b4 Re-commit the (fixed) changes from r248985 which were reverted by Pavel
when they introduced android testsuite regressions.  Pavel has run the
testsuite against the updated patch and it completes cleanly now.

The original commit message:


Fixing a subtle issue on Mac OS X systems with dSYMs (possibly
introduced by r235737 but I didn't look into it too closely).

A dSYM can have a per-UUID plist in it which tells lldb where
to find an executable binary for the dSYM (DBGSymbolRichExecutable)
- other information can be included in this plist, like how to
remap the source file paths from their build pathnames to their
long-term storage pathnames.

This per-UUID plist is a unusual; it is used probably exclusively
inside apple with our build system.  It is not created by default
in normal dSYMs.

The problem was like this:

  1. lldb wants to find an executable, given only a UUID
     (this happens when lldb is doing cross-host debugging
      and doesn't have a copy of the target system's binaries)

  2. It eventually calls LocateMacOSXFilesUsingDebugSymbols
     which does a spotlight search for the dSYM on the local
     system, and failing that, tries the DBGShellCommands
     command to find the dSYM.

  3. It gets a dSYM.  It reads the per-UUID plist in the dSYM.
     The dSYM has a DBGSymbolRichExecutable kv pair pointing to
     the binary on a network filesystem.

  4. Using the binary on the network filesystem, lldb now goes
     to find the dSYM.

  5. It starts by looking for a dSYM next to the binary it found.

  6. lldb is now reading the dSYM over a network filesystem,
     ignoring the one it found on its local filesystem earlier.

Everything still *works* but it's much slower.

This would be a tricky one to write up in a testsuite case;
you really need the binary to not exist on the local system.
And LocateMacOSXFilesUsingDebugSymbols will only compile on
Mac OS X - even if I found a way to write up a test case, it
would not run anywhere but on a mac.

One change Greg wanted while I was touching this code was to
have LocateMacOSXFilesUsingDebugSymbols (which could be asked
to find a binary OR find a dSYM) to instead return a ModuleSpec
with the sum total of everything it could find.  This
change of passing around a ModuleSpec instead of a FileSpec
was percolated up into ModuleList::GetSharedModule.

The changes to LocateMacOSXFilesUsingDebugSymbols look larger
than they really are - there's a lot of simple whitespace changes
in there.

I ran the testsuites on mac, no new regressions introduced

<rdar://problem/21993813> 

llvm-svn: 249755
2015-10-08 21:48:35 +00:00
Pavel Labath 746ffd6980 Revert "Fixing a subtle issue on Mac OS X systems with dSYMs..."
This reverts commit r248985, as it was breaking all remote
expression-evaluating tests (on android at least).

llvm-svn: 248995
2015-10-01 09:03:33 +00:00
Jason Molenda 8b2f23d515 Fixing a subtle issue on Mac OS X systems with dSYMs (possibly
introduced by r235737 but I didn't look into it too closely).

A dSYM can have a per-UUID plist in it which tells lldb where
to find an executable binary for the dSYM (DBGSymbolRichExecutable)
- other information can be included in this plist, like how to
remap the source file paths from their build pathnames to their
long-term storage pathnames.

This per-UUID plist is a unusual; it is used probably exclusively
inside apple with our build system.  It is not created by default
in normal dSYMs.

The problem was like this:

  1. lldb wants to find an executable, given only a UUID
     (this happens when lldb is doing cross-host debugging
      and doesn't have a copy of the target system's binaries)

  2. It eventually calls LocateMacOSXFilesUsingDebugSymbols
     which does a spotlight search for the dSYM on the local
     system, and failing that, tries the DBGShellCommands
     command to find the dSYM.

  3. It gets a dSYM.  It reads the per-UUID plist in the dSYM.
     The dSYM has a DBGSymbolRichExecutable kv pair pointing to
     the binary on a network filesystem.

  4. Using the binary on the network filesystem, lldb now goes
     to find the dSYM.

  5. It starts by looking for a dSYM next to the binary it found.

  6. lldb is now reading the dSYM over a network filesystem,
     ignoring the one it found on its local filesystem earlier.

Everything still *works* but it's much slower.

This would be a tricky one to write up in a testsuite case;
you really need the binary to not exist on the local system.
And LocateMacOSXFilesUsingDebugSymbols will only compile on
Mac OS X - even if I found a way to write up a test case, it
would not run anywhere but on a mac.

One change Greg wanted while I was touching this code was to
have LocateMacOSXFilesUsingDebugSymbols (which could be asked
to find a binary OR find a dSYM) to instead return a ModuleSpec
with the sum total of everything it could find.  This
change of passing around a ModuleSpec instead of a FileSpec
was percolated up into ModuleList::GetSharedModule.

The changes to LocateMacOSXFilesUsingDebugSymbols look larger
than they really are - there's a lot of simple whitespace changes
in there.

I ran the testsuites on mac, no new regressions introduced

<rdar://problem/21993813> 

llvm-svn: 248985
2015-10-01 05:37:22 +00:00
Greg Clayton 99558cc424 Final bit of type system cleanup that abstracts declaration contexts into lldb_private::CompilerDeclContext and renames ClangType to CompilerType in many accessors and functions.
Create a new "lldb_private::CompilerDeclContext" class that will replace all direct uses of "clang::DeclContext" when used in compiler agnostic code, yet still allow for conversion to clang::DeclContext subclasses by clang specific code. This completes the abstraction of type parsing by removing all "clang::" references from the SymbolFileDWARF. The new "lldb_private::CompilerDeclContext" class abstracts decl contexts found in compiler type systems so they can be used in internal API calls. The TypeSystem is required to support CompilerDeclContexts with new pure virtual functions that start with "DeclContext" in the member function names. Converted all code that used lldb_private::ClangNamespaceDecl over to use the new CompilerDeclContext class and removed the ClangNamespaceDecl.cpp and ClangNamespaceDecl.h files.

Removed direct use of clang APIs from SBType and now use the abstract type systems to correctly explore types.

Bulk renames for things that used to return a ClangASTType which is now CompilerType:

    "Type::GetClangFullType()" to "Type::GetFullCompilerType()"
    "Type::GetClangLayoutType()" to "Type::GetLayoutCompilerType()"
    "Type::GetClangForwardType()" to "Type::GetForwardCompilerType()"
    "Value::GetClangType()" to "Value::GetCompilerType()"
    "Value::SetClangType (const CompilerType &)" to "Value::SetCompilerType (const CompilerType &)"
    "ValueObject::GetClangType ()" to "ValueObject::GetCompilerType()"
    many more renames that are similar.

llvm-svn: 245905
2015-08-24 23:46:31 +00:00
Bruce Mitchener e171da5cb7 Fix typos.
Summary: Fix a bunch of typos.

Reviewers: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D11386

llvm-svn: 242856
2015-07-22 00:16:02 +00:00
Dawn Perchik 23b1decbe7 Add support for specifying a language to use when parsing breakpoints.
Target and breakpoints options were added:
    breakpoint set --language lang --name func
    settings set target.language pascal
These specify the Language to use when interpreting the breakpoint's
expression (note: currently only implemented for breakpoints on
identifiers).  If the breakpoint language is not set, the target.language
setting is used.
This support is required by Pascal, for example, to set breakpoint at 'ns.foo'
for function 'foo' in namespace 'ns'.
Tests on the language were also added to Module::PrepareForFunctionNameLookup
for efficiency.

Reviewed by: clayborg
Subscribers: jingham, lldb-commits
Differential Revision: http://reviews.llvm.org/D11119

llvm-svn: 242844
2015-07-21 22:05:07 +00:00
Oleksiy Vyalov 933f853030 Make ModuleList::GetSharedModule to use module_search_paths parameter.
http://reviews.llvm.org/D8365

llvm-svn: 232437
2015-03-16 23:44:30 +00:00
Greg Clayton d6346e6f3e Add a ModuleList::ForEach(...) which takes the module list mutex calls the std::function argument with each module. If you return true in the callback, iteration will continue, if you return false, iteration will stop and the lock will be released.
<rdar://problem/19213054>

llvm-svn: 229008
2015-02-13 01:19:24 +00:00
Carlo Kok 0fd6fd4fd4 Adds two new functions to SBTarget FindGlobalVariables and FindGlobalFunctions that lets you search by name, by regular expression and by starts with.
llvm-svn: 218140
2014-09-19 19:38:19 +00:00
Greg Clayton 994740fb1a Don't search for module resources at all if the setting is set to "false".
llvm-svn: 215936
2014-08-18 21:08:44 +00:00
Todd Fiala af245d115b Add lldb-gdbserver support for Linux x86_64.
This change brings in lldb-gdbserver (llgs) specifically for Linux x86_64.
(More architectures coming soon).

Not every debugserver option is covered yet.  Currently
the lldb-gdbserver command line can start unattached,
start attached to a pid (process-name attach not supported yet),
or accept lldb attaching and launching a process or connecting
by process id.

The history of this large change can be found here:
https://github.com/tfiala/lldb/tree/dev-tfiala-native-protocol-linux-x86_64

Until mid/late April, I was not sharing the work and continued
to rebase it off of head (developed via id tfiala@google.com).  I switched over to
user todd.fiala@gmail.com in the middle, and once I went to github, I did
merges rather than rebasing so I could share with others.

llvm-svn: 212069
2014-06-30 21:05:18 +00:00
Saleem Abdulrasool 324a103619 sweep up -Wformat warnings from gcc
This is a purely mechanical change explicitly casting any parameters for printf
style conversion.  This cleans up the warnings emitted by gcc 4.8 on Linux.

llvm-svn: 205607
2014-04-04 04:06:10 +00:00
Greg Clayton baf6e8e4b1 Include <mutex> for std::once.
llvm-svn: 204632
2014-03-24 18:08:18 +00:00
Greg Clayton 1d77a8203b Modified patch from Piotr Rak that makes GetSharedModuleList() more thread safe and also fixed a missed member initialization on the copy contractor and also makes the assignment operator safer.
llvm-svn: 204622
2014-03-24 16:50:33 +00:00
Richard Mitton f86248d9ba Added a 'jump' command, similar to GDBs.
This allows the PC to be directly changed to a different line.
It's similar to the example python script in examples/python/jump.py, except implemented as a builtin.

Also this version will track the current function correctly even if the target line resolves to multiple addresses. (e.g. debugging a templated function)

llvm-svn: 190572
2013-09-12 02:20:34 +00:00
Greg Clayton fd814c5a64 <rdar://problem/14717184>
LLDB needs in memory module load level settings to control how much information is read from memory when loading in memory modules. This change adds a new setting:

(lldb) settings set target.memory-module-load-level [minimal|partial|complete]

minimal will load only sections (no symbols, or function bounds via function starts or EH frame)
partial will load sections + bounds
complete will load sections + bounds + symbols

llvm-svn: 188246
2013-08-13 01:42:25 +00:00
Michael Sartain cc791bbfab Fix "source list -n printf" on Linux (printf is symbol alias for __printf)
Differential Revision: http://llvm-reviews.chandlerc.com/D1109

llvm-svn: 186104
2013-07-11 16:40:56 +00:00
Enrico Granata 9730339bdf Improving the previous checkin about target.load-script-from-symbol-file
There are two settings:
target.load-script-from-symbol-file is a boolean that says load or no load (default: false)
target.warn-on-script-from-symbol-file is also a boolean, it says whether you want to be warned when a script file is not loaded due to security (default: true)

the auto loading on change for target.load-script-from-symbol-file is preserved

llvm-svn: 182336
2013-05-21 00:00:30 +00:00
Enrico Granata caa84cbc01 Forgot to check for empty error strings in the previous checkin
llvm-svn: 182325
2013-05-20 22:40:54 +00:00
Enrico Granata 84a53dfb49 <rdar://problem/13878726>
This changes the setting target.load-script-from-symbol-file to be a ternary enum value:
default (the default value) will NOT load the script files but will issue a warning suggesting workarounds
yes will load the script files
no will not load the script files AND will NOT issue any warning

if you change the setting value from default to yes, that will then cause the script files to be loaded
(the assumption is you didn't know about the setting, got a warning, and quickly want to remedy it)

if you have a settings set command for this in your lldbinit file, be sure to change "true" or "false" into an appropriate "yes" or "no" value

llvm-svn: 182323
2013-05-20 22:29:23 +00:00
Jason Molenda c16b4af0d7 Remove the UUID::GetAsCString() method which required a buffer to save the
UUID string in; added UUID::GetAsString() which returns the uuid string in
a std::string.  Updated callers to use the new method.

llvm-svn: 181078
2013-05-03 23:56:12 +00:00
Greg Clayton b5ad4ec7a3 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.

llvm-svn: 180717
2013-04-29 17:25:54 +00:00
Greg Clayton 43fe217b11 <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.

llvm-svn: 178608
2013-04-03 02:00:15 +00:00
Greg Clayton 5160ce5c72 <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.

llvm-svn: 178191
2013-03-27 23:08:40 +00:00
Greg Clayton c7bece56fa <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.

llvm-svn: 173463
2013-01-25 18:06:21 +00:00
Enrico Granata efe637d440 Minor cleanups to the new ModuleList notification APIs: passing in the ModuleList as part of the callbacks, and not copying the notifier as part of copy constructing and assigning
llvm-svn: 167592
2012-11-08 19:16:03 +00:00
Enrico Granata 1759848be0 <rdar://problem/12586350>
This commit does three things:
(a) introduces a new notification model for adding/removing/changing modules to a ModuleList, and applies it to the Target's ModuleList, so that we make sure to always trigger the right set of actions
whenever modules come and go in a target. Certain spots in the code still need to "manually" notify the Target for several reasons, so this is a work in progress
(b) adds a new capability to the Platforms: locating a scripting resources associated to a module. A scripting resource is a Python file that can load commands, formatters, ... and any other action
of interest corresponding to the loading of a module. At the moment, this is only implemented on Mac OS X and only for files inside .dSYM bundles - the next step is going to be letting
the frameworks themselves hold their scripting resources. Implementors of platforms for other systems are free to implement "the right thing" for their own worlds
(c) hooking up items (a) and (b) so that targets auto-load the scripting resources as the corresponding modules get loaded in a target. This has a few caveats at the moment:
 - the user needs to manually add the .py file to the dSYM (soon, it will also work in the framework itself)
 - if two modules with the same name show up during the lifetime of an LLDB session, the second one won't be able to load its scripting resource, but will otherwise work just fine

llvm-svn: 167569
2012-11-08 02:22:02 +00:00
Greg Clayton 3a18e31945 Added a new "module" log channel which covers module creation, deletion, and common module list actions.
Also added a new option for "log enable" which is "--stack" which will print out a stack backtrace for each log line.

This was used to track down the leaking module issue I fixed last week.

llvm-svn: 165438
2012-10-08 22:41:53 +00:00
Enrico Granata 83805259e1 <rdar://problem/12408181> Fixing a bug where we would try to look for types in a module, and then fail to look for them anywhere else because the same SymbolContext was being passed everywhere
llvm-svn: 165169
2012-10-03 21:31:35 +00:00
Greg Clayton 6f4d8af713 <rdar://problem/12125274>
Intentionally leak the module list to avoid unnecessary freeing of modules + object files + symbol files when the program is exiting.

llvm-svn: 164184
2012-09-18 23:50:22 +00:00
Greg Clayton 1f7460716b <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.

llvm-svn: 162860
2012-08-29 21:13:06 +00:00
Greg Clayton 1d60909e81 <rdar://problem/11740973>
Fixed issues that could happen when the UUID doesn't change in a binary and old stale debug info could end up being used.

llvm-svn: 160145
2012-07-12 22:51:12 +00:00
Greg Clayton 4e0fe8ab95 <rdar://problem/11791234>
Fixed a case where the python interpreter could end up holding onto a previous lldb::SBProcess (probably in lldb.process) when run under Xcode. Prior to this fix, the lldb::SBProcess held onto a shared pointer to a lldb_private::Process. This in turn could cause the process to still have a thread list with stack frames. The stack frames would have module shared pointers in the lldb_private::SymbolContext objects. 

We also had issues with things staying in the shared module list too long when we found things by UUID (we didn't remove the out of date ModuleSP from the global module cache).

Now all of this is fixed and everything goes away between runs.

llvm-svn: 160140
2012-07-12 20:32:19 +00:00
Greg Clayton 8921ce8396 Fix the copy constructor and assignement operator for ModuleList to be thread safe.
llvm-svn: 159285
2012-06-27 19:59:26 +00:00
Jim Ingham 3ee12ef26e We were accessing the ModuleList in the target without locking it for tasks like
setting breakpoints.  That's dangerous, since while we are setting a breakpoint,
the target might hit the dyld load notification, and start removing modules from
the list.  This change adds a GetMutex accessor to the ModuleList class, and
uses it whenever we are accessing the target's ModuleList (as returned by GetImages().)

<rdar://problem/11552372>

llvm-svn: 157668
2012-05-30 02:19:25 +00:00
Jim Ingham 4a94c91077 If we notice that a module with a given file path is replaced by another with the same file
path on rerunning, evict the old module from the target module list, inform the breakpoints
about this so they can do something intelligent as well.

rdar://problem/11273043

llvm-svn: 157008
2012-05-17 18:38:42 +00:00
Jim Ingham 10ebffa48a Don't expose the pthread_mutex_t underlying the Mutex & Mutex::Locker classes.
No one was using it and Locker(pthread_mutex_t *) immediately asserts for 
pthread_mutex_t's that don't come from a Mutex anyway.  Rather than try to make
that work, we should maintain the Mutex abstraction and not pass around the
platform implementation...

Make Mutex::Locker::Lock take a Mutex & or a Mutex *, and remove the constructor
taking a pthread_mutex_t *.  You no longer need to call Mutex::GetMutex to pass
your mutex to a Locker (you can't in fact, since I made it private.)

llvm-svn: 156221
2012-05-04 23:02:50 +00:00
Greg Clayton 37a0a24a5f No functionality changes, mostly cleanup.
Cleaned up the Mutex::Locker and the ReadWriteLock classes a bit.

Also cleaned up the GDBRemoteCommunication class to not have so many packet functions. Used the "NoLock" versions of send/receive packet functions when possible for a bit of performance.

llvm-svn: 154458
2012-04-11 00:24:49 +00:00
Greg Clayton 0cd7086604 <rdar://problem/11202426>
Work around a deadlocking issue where "SBDebugger::MemoryPressureDetected ()" is being called and is causing a deadlock. We now just try and get the lock when trying to trim down the unique modules so we don't deadlock debugger GUI programs until we can find the root cause.

llvm-svn: 154339
2012-04-09 20:22:01 +00:00
Greg Clayton 780af51505 Fixed ModuleList::FindTypes() so that when a symbol context is supplied that contains a valid module, it will search that module first, then if we are still looking for matches (we have found less that "max_matches"), search in all of the other modules as well.
llvm-svn: 154186
2012-04-06 18:09:43 +00:00
Greg Clayton 29399a24c6 In a prior commit, I changed the parameters around on a ModuleList::FindTypes where the old parameters that existing clients were using would have been compatible, so I renamed ModuleList::FindTypes to ModuleList::FindTypes2. Then I made fixes and verified I updated and fixed all client code, but I forgot to rename the function back to ModuleList::FindTypes(). I am doing that now and also cleaning up the C++ dynamic type code a bit.
llvm-svn: 154182
2012-04-06 17:41:13 +00:00
Greg Clayton 84db9105d2 <rdar://problem/11113279>
Fixed type lookups to "do the right thing". Prior to this fix, looking up a type using "foo::bar" would result in a type list that contains all types that had "bar" as a basename unless the symbol file was able to match fully qualified names (which our DWARF parser does not). 

This fix will allow type matches to be made based on the basename and then have the types that don't match filtered out. Types by name can be fully qualified, or partially qualified with the new "bool exact_match" parameter to the Module::FindTypes() method.

This fixes some issue that we discovered with dynamic type resolution as well as improves the overall type lookups in LLDB.

llvm-svn: 153482
2012-03-26 23:03:23 +00:00
Greg Clayton 2af282a16b Fixed the ability to load a module from a path by using just a UUID. After
the migration to ModuleSpec objects this broke and is now fixed.

Also fixed a case in the darwin kernel dynamic loader where we just need to
trust the load address of the kernel if we can't read it from memory.

llvm-svn: 153164
2012-03-21 04:25:00 +00:00
Greg Clayton 9ff1ba2546 Make sure that if a UUID was passed in, and we found a match, that should be enough for us.
llvm-svn: 153076
2012-03-20 01:31:19 +00:00
Greg Clayton d804d28556 <rdar://problem/8196933>
Use the metadata in the dSYM bundle Info.plist to remap source paths when they keys are available.

llvm-svn: 152836
2012-03-15 21:01:31 +00:00