summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/macosx/Symbols.cpp
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2012-02-01 01:49:50 +0000
committerJohnny Chen <johnny.chen@apple.com>2012-02-01 01:49:50 +0000
commitfdc80a5cf7a4f62e32c42641a48ae2e249e4572e (patch)
treef1c84f0b1e89eaa9e11bc8096c5da8d2a6c38c14 /lldb/source/Host/macosx/Symbols.cpp
parent05e8d1944678f1dc07667e60be5975c127db1ced (diff)
downloadbcm5719-llvm-fdc80a5cf7a4f62e32c42641a48ae2e249e4572e.tar.gz
bcm5719-llvm-fdc80a5cf7a4f62e32c42641a48ae2e249e4572e.zip
lldb should warn when dSYM does not match the binary.
o Symbols.cpp: Emit a warning message when dSYM does not match the binary. o warnings/uuid: Added regression test case. o lldbtest.py: Modified to allow test case writer to demand that the build command does not begin with a clean first; required to make TestUUIDMismatchWanring.py work. rdar://problem/10515708 llvm-svn: 149465
Diffstat (limited to 'lldb/source/Host/macosx/Symbols.cpp')
-rw-r--r--lldb/source/Host/macosx/Symbols.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/lldb/source/Host/macosx/Symbols.cpp b/lldb/source/Host/macosx/Symbols.cpp
index acaf563907e..820126674bb 100644
--- a/lldb/source/Host/macosx/Symbols.cpp
+++ b/lldb/source/Host/macosx/Symbols.cpp
@@ -24,6 +24,7 @@
#include "lldb/Core/Timer.h"
#include "lldb/Core/UUID.h"
#include "lldb/Host/Endian.h"
+#include "lldb/Host/Host.h"
#include "lldb/Utility/CleanUp.h"
#include "Host/macosx/cfcpp/CFCBundle.h"
#include "Host/macosx/cfcpp/CFCReleaser.h"
@@ -116,7 +117,18 @@ SkinnyMachOFileContainsArchAndUUID
if (cmd == LoadCommandUUID)
{
lldb_private::UUID file_uuid (data.GetData(&data_offset, 16), 16);
- return file_uuid == *uuid;
+ if (file_uuid == *uuid)
+ return true;
+
+ // Emit some warning messages since the UUIDs do not match!
+ char path_buf[PATH_MAX];
+ path_buf[0] = '\0';
+ const char *path = file_spec.GetPath(path_buf, PATH_MAX) ? path_buf
+ : file_spec.GetFilename().AsCString();
+ Host::SystemLog (Host::eSystemLogWarning,
+ "warning: UUID mismatch detected between binary and:\n\t'%s'\n",
+ path);
+ return false;
}
data_offset = cmd_offset + cmd_size;
}
OpenPOWER on IntegriCloud