Fixed debug map in executable + DWARF in .o debugging on Mac OS X.
Added the ability to dump any file in the global module cache using any of
the "image dump" commands. This allows us to dump the .o files that are used
with DWARF + .o since they don't belong the the target list for the current
target.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@107100 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Commands/CommandObjectImage.cpp b/source/Commands/CommandObjectImage.cpp
index cb717c4..0bf339c 100644
--- a/source/Commands/CommandObjectImage.cpp
+++ b/source/Commands/CommandObjectImage.cpp
@@ -544,8 +544,18 @@
{
FileSpec image_file(arg_cstr);
ModuleList matching_modules;
- const size_t num_matching_modules = target->GetImages().FindModules(&image_file, NULL, NULL, NULL, matching_modules);
+ size_t num_matching_modules = target->GetImages().FindModules(&image_file, NULL, NULL, NULL, matching_modules);
+ // Not found in our module list for our target, check the main
+ // shared module list in case it is a extra file used somewhere
+ // else
+ if (num_matching_modules == 0)
+ num_matching_modules = ModuleList::FindSharedModules (image_file,
+ target->GetArchitecture(),
+ NULL,
+ NULL,
+ matching_modules);
+
if (num_matching_modules > 0)
{
for (size_t i=0; i<num_matching_modules; ++i)
@@ -642,8 +652,18 @@
{
FileSpec image_file(arg_cstr);
ModuleList matching_modules;
- const size_t num_matching_modules = target->GetImages().FindModules(&image_file, NULL, NULL, NULL, matching_modules);
+ size_t num_matching_modules = target->GetImages().FindModules(&image_file, NULL, NULL, NULL, matching_modules);
+ // Not found in our module list for our target, check the main
+ // shared module list in case it is a extra file used somewhere
+ // else
+ if (num_matching_modules == 0)
+ num_matching_modules = ModuleList::FindSharedModules (image_file,
+ target->GetArchitecture(),
+ NULL,
+ NULL,
+ matching_modules);
+
if (num_matching_modules > 0)
{
for (size_t i=0; i<num_matching_modules; ++i)
@@ -739,8 +759,18 @@
{
FileSpec image_file(arg_cstr);
ModuleList matching_modules;
- const size_t num_matching_modules = target->GetImages().FindModules(&image_file, NULL, NULL, NULL, matching_modules);
+ size_t num_matching_modules = target->GetImages().FindModules(&image_file, NULL, NULL, NULL, matching_modules);
+ // Not found in our module list for our target, check the main
+ // shared module list in case it is a extra file used somewhere
+ // else
+ if (num_matching_modules == 0)
+ num_matching_modules = ModuleList::FindSharedModules (image_file,
+ target->GetArchitecture(),
+ NULL,
+ NULL,
+ matching_modules);
+
if (num_matching_modules > 0)
{
for (size_t i=0; i<num_matching_modules; ++i)
@@ -1343,8 +1373,18 @@
{
FileSpec image_file(arg_cstr);
ModuleList matching_modules;
- const size_t num_matching_modules = target->GetImages().FindModules(&image_file, NULL, NULL, NULL, matching_modules);
+ size_t num_matching_modules = target->GetImages().FindModules(&image_file, NULL, NULL, NULL, matching_modules);
+ // Not found in our module list for our target, check the main
+ // shared module list in case it is a extra file used somewhere
+ // else
+ if (num_matching_modules == 0)
+ num_matching_modules = ModuleList::FindSharedModules (image_file,
+ target->GetArchitecture(),
+ NULL,
+ NULL,
+ matching_modules);
+
if (num_matching_modules > 0)
{
for (size_t i=0; i<num_matching_modules; ++i)