summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectTarget.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-09-27 03:13:55 +0000
committerGreg Clayton <gclayton@apple.com>2012-09-27 03:13:55 +0000
commitc8f814d1dfec8f162c86b71973f16cea0f229aa7 (patch)
tree97e10e1c005700bb61ebf6e613c30e8d16474459 /lldb/source/Commands/CommandObjectTarget.cpp
parentc36b184fa2a8cbd083df03664da1f2c1fc264c31 (diff)
downloadbcm5719-llvm-c8f814d1dfec8f162c86b71973f16cea0f229aa7.tar.gz
bcm5719-llvm-c8f814d1dfec8f162c86b71973f16cea0f229aa7.zip
Added the ability to download a symboled executable and symbol file given a UUID.
llvm-svn: 164753
Diffstat (limited to 'lldb/source/Commands/CommandObjectTarget.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp43
1 files changed, 42 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index ee224b6f563..c1e6486f035 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -24,6 +24,7 @@
#include "lldb/Core/State.h"
#include "lldb/Core/Timer.h"
#include "lldb/Core/ValueObjectVariable.h"
+#include "lldb/Host/Symbols.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Interpreter/Options.h"
@@ -4056,7 +4057,32 @@ protected:
symfile_spec.SetFile(symfile_path, true);
ArchSpec arch;
- if (symfile_spec.Exists())
+ bool symfile_exists = symfile_spec.Exists();
+ // The code below was testing the new "Symbols::DownloadObjectAndSymbolFile"
+ // functionality. Now that it works on MacOSX, it will be enabled soon with
+ // option values (like "--uuid <UUID>" or "--file <module>", or "--frame"
+ // for the current stack frame's module). So it is commented out for now.
+// if (!symfile_exists)
+// {
+// if (sym_spec.GetUUID().SetfromCString(symfile_path))
+// {
+// // A UUID was specified, look it up via UUID
+// if (Symbols::DownloadObjectAndSymbolFile (sym_spec))
+// {
+//// printf ("UUID: %s\n", symfile_path);
+//// printf ("objfile_spec: %s/%s\n",
+//// sym_spec.GetFileSpec().GetDirectory().GetCString(),
+//// sym_spec.GetFileSpec().GetFilename().GetCString());
+//// printf ("symfile_spec: %s/%s\n",
+//// sym_spec.GetSymbolFileSpec().GetDirectory().GetCString(),
+//// sym_spec.GetSymbolFileSpec().GetFilename().GetCString());
+// symfile_spec = sym_spec.GetSymbolFileSpec();
+// symfile_exists = symfile_spec.Exists();
+// }
+// }
+// }
+
+ if (symfile_exists)
{
ModuleSP symfile_module_sp (new Module (symfile_spec, target->GetArchitecture()));
const UUID &symfile_uuid = symfile_module_sp->GetUUID();
@@ -4111,6 +4137,21 @@ protected:
}
else
{
+// sym_spec.GetSymbolFileSpec().Clear();
+// if (sym_spec.GetUUID().SetfromCString(symfile_path))
+// {
+// if (Symbols::DownloadObjectAndSymbolFile (sym_spec))
+// {
+// printf ("UUID: %s\n", symfile_path);
+// printf ("objfile_spec: %s/%s\n",
+// sym_spec.GetFileSpec().GetDirectory().GetCString(),
+// sym_spec.GetFileSpec().GetFilename().GetCString());
+// printf ("symfile_spec: %s/%s\n",
+// sym_spec.GetSymbolFileSpec().GetDirectory().GetCString(),
+// sym_spec.GetSymbolFileSpec().GetFilename().GetCString());
+// }
+// }
+
char resolved_symfile_path[PATH_MAX];
result.SetStatus (eReturnStatusFailed);
if (symfile_spec.GetPath (resolved_symfile_path, sizeof(resolved_symfile_path)))
OpenPOWER on IntegriCloud