JDevlieghere updated this revision to Diff 213640.
JDevlieghere retitled this revision from "[Driver] Expand the target in the 
driver." to "[Driver] Expand the executable path in the target create output".
JDevlieghere edited the summary of this revision.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65611/new/

https://reviews.llvm.org/D65611

Files:
  lldb/lit/Driver/TestTarget.test
  lldb/source/Commands/CommandObjectTarget.cpp


Index: lldb/source/Commands/CommandObjectTarget.cpp
===================================================================
--- lldb/source/Commands/CommandObjectTarget.cpp
+++ lldb/source/Commands/CommandObjectTarget.cpp
@@ -450,7 +450,8 @@
           }
         } else {
           result.AppendMessageWithFormat(
-              "Current executable set to '%s' (%s).\n", file_path,
+              "Current executable set to '%s' (%s).\n",
+              file_spec.GetPath().c_str(),
               target_sp->GetArchitecture().GetArchitectureName());
           result.SetStatus(eReturnStatusSuccessFinishNoResult);
         }
@@ -2631,7 +2632,7 @@
             if (!module_spec.GetArchitecture().IsValid())
               module_spec.GetArchitecture() = target->GetArchitecture();
             Status error;
-            ModuleSP module_sp(target->GetOrCreateModule(module_spec, 
+            ModuleSP module_sp(target->GetOrCreateModule(module_spec,
                                             true /* notify */, &error));
             if (!module_sp) {
               const char *error_cstr = error.AsCString();
@@ -4747,7 +4748,7 @@
 
         new_hook_sp->SetThreadSpecifier(thread_spec);
       }
-      
+
       new_hook_sp->SetAutoContinue(m_options.m_auto_continue);
       if (m_options.m_use_one_liner) {
         // Use one-liners.
Index: lldb/lit/Driver/TestTarget.test
===================================================================
--- /dev/null
+++ lldb/lit/Driver/TestTarget.test
@@ -0,0 +1,7 @@
+# Make sure lldb resolves the target path.
+# RUN: mkdir -p %t/foo
+# RUN: cd %t/foo
+# RUN: %clang %p/Inputs/hello.c -g -o a.out
+# RUN: %lldb -b a.out | FileCheck %s
+
+# CHECK: Current executable set to '{{.*}}foo{{[/\\\\]+}}a.out'


Index: lldb/source/Commands/CommandObjectTarget.cpp
===================================================================
--- lldb/source/Commands/CommandObjectTarget.cpp
+++ lldb/source/Commands/CommandObjectTarget.cpp
@@ -450,7 +450,8 @@
           }
         } else {
           result.AppendMessageWithFormat(
-              "Current executable set to '%s' (%s).\n", file_path,
+              "Current executable set to '%s' (%s).\n",
+              file_spec.GetPath().c_str(),
               target_sp->GetArchitecture().GetArchitectureName());
           result.SetStatus(eReturnStatusSuccessFinishNoResult);
         }
@@ -2631,7 +2632,7 @@
             if (!module_spec.GetArchitecture().IsValid())
               module_spec.GetArchitecture() = target->GetArchitecture();
             Status error;
-            ModuleSP module_sp(target->GetOrCreateModule(module_spec, 
+            ModuleSP module_sp(target->GetOrCreateModule(module_spec,
                                             true /* notify */, &error));
             if (!module_sp) {
               const char *error_cstr = error.AsCString();
@@ -4747,7 +4748,7 @@
 
         new_hook_sp->SetThreadSpecifier(thread_spec);
       }
-      
+
       new_hook_sp->SetAutoContinue(m_options.m_auto_continue);
       if (m_options.m_use_one_liner) {
         // Use one-liners.
Index: lldb/lit/Driver/TestTarget.test
===================================================================
--- /dev/null
+++ lldb/lit/Driver/TestTarget.test
@@ -0,0 +1,7 @@
+# Make sure lldb resolves the target path.
+# RUN: mkdir -p %t/foo
+# RUN: cd %t/foo
+# RUN: %clang %p/Inputs/hello.c -g -o a.out
+# RUN: %lldb -b a.out | FileCheck %s
+
+# CHECK: Current executable set to '{{.*}}foo{{[/\\\\]+}}a.out'
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to