[Lldb-commits] [PATCH] D112973: [lldb] make it easier to find LLDB's python

2021-11-02 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna added a comment.

@JDevlieghere

That approach would work great for my purposes, i'll update like that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112973

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D100810: Use `GNUInstallDirs` to support custom installation dirs. -- LLVM

2021-11-02 Thread Med Ismail Bennani via Phabricator via lldb-commits
mib added a comment.

I reverted this patch locally and try building with clang modules 
(`-DLLVM_ENABLE_MODULE=On`) which confirmed it was causing the build failure on 
the bots.

I had to revert your patch upstream to fix our bots. If you need some help to 
reproduce the build failure, let me know.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100810

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112973: [lldb] make it easier to find LLDB's python

2021-11-02 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment.

I would do this:

  lldb --print-script-interpreter-info python

making the interpreter the argument for this option.  That seems clearer than 
having to provide two flags.  language is overloaded anyway, because it can be 
a source language or a script interpreter language, so it might be better to 
side-step that one.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112973

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112973: [lldb] make it easier to find LLDB's python

2021-11-02 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

I was talking to Jim about this offline and one potential solution would be to 
have a flag that asks the current script interpreter for some of this relevant 
information. What that means would be different for every language, so the 
output would have to be able to define its own keys and values. (JSON could be 
a good candidate for this?) For Python, this would include the python path and 
the prefix, while for lua this might be something totally different. Both could 
include a version.

So the way I imagine this working is something like this:

  $ lldb -l python --print-script-interpreter-info
  { 
"prefix": "/foo/bar",
"path": "/baz/quux",
 "version": "3.9"
  }
  $ lldb -l lua --print-script-interpreter-info
  { 
 "version": "5.4"
  }

From an SB API perspective, this would be a function in `SBDebugger` that would 
return a string or populate a buffer. The driver would then simply print that, 
and the Python script would parse it and do the right thing.

WDYT?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112973

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112165: Cleanup a few more PR36048 skips

2021-11-02 Thread David Blaikie via Phabricator via lldb-commits
dblaikie added a comment.

In D112165#3102055 , @teemperor wrote:

> In D112165#3100929 , @dblaikie 
> wrote:
>
>> In D112165#3100608 , @teemperor 
>> wrote:
>>
>>> Small note: gmodules test are never run on Linux, so you actually have to 
>>> run them on macOS (or I think FreeBSD) to know whether the tests work.
>>
>> Yeah, I'll admit I didn't test this, but seemed consistent with the other 
>> changes/cleanup - did this cause any breakage you know of?
>>
>> Could gmodules be tested on Linux? (I had originally really hoped/tried to 
>> encourage gmodules to be implemented in a way that'd be compatible with 
>> Split DWARF but it never quite got there, unfortunately... would've made 
>> more overlap in functionality/testability/portability, I think)
>>
>> (I should setup a build environment on my Macbook Pro, but haven't got 
>> around to it as yet)
>
> There was just one test on macOS with data-formatter-cpp having defining 
> something that is also in a system header (already fixed that). Also I think 
> watching Green Dragon is enough. There would be a macOS CI if anyone actually 
> cared about Green Dragon being always green.
>
> The tests could in theory be run on Linux just fine, the problem is they just 
> won't test anything. For better or worse (actually, just for the worse), the 
> gmodules testing pretty much relies on re-running all normal API tests on 
> `-fmodules -fcxx-modules -gmodules -fimplicit-module-maps` compiled test 
> sources. But only about 5 of the 1000 API tests even define a module. So the 
> remaining 995 tests just rerun their test as-is unless they include by 
> accident a system header that has a modulemap on the system. No Linux 
> distribution I know comes with modulemaps for its libc so no gmodules 
> functionality will be exercised on the other 995 tests. So gmodules was just 
> disabled as it just made the test suite longer without any benefit. Also I 
> think there were some problems with enabling -fmodules on setups where we had 
> a libc++ module but no modularized libc on the system. I think @labath knows 
> the rationale best.

ooh, yeah - that dose sound like things could benefit from more intentional 
testing - be faster for Apple folks (rather than running the whole test suite 
over again in another config) and portable (so better for everyone)...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112165

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D113047: [lldb] update TestEchoCommands

2021-11-02 Thread Stella Stamenova via Phabricator via lldb-commits
stella.stamenova added inline comments.



Comment at: lldb/test/Shell/Settings/TestEchoCommands.test:4
 # RUN: %lldb -x -b -o 'settings set interpreter.echo-commands false' 
-s %S/Inputs/EchoCommandsTest.in | FileCheck %S/Inputs/EchoCommandsNone.out
-# RUN: %lldb -x -b --source-quietly  
-s %S/Inputs/EchoCommandsTest.in | FileCheck %S/Inputs/EchoCommandsQuiet.out
+# RUN: ( echo start ; %lldb -x -b --source-quietly -s 
%S/Inputs/EchoCommandsTest.in ; echo done ) | FileCheck  
%S/Inputs/EchoCommandsQuiet.out

The Windows buildbot is not happy with this line:

https://lab.llvm.org/buildbot/#/builders/83/builds/11630


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113047

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D113047: [lldb] update TestEchoCommands

2021-11-02 Thread Lawrence D'Anna via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG7f01f78593d6: [lldb] update TestEchoCommands (authored by 
lawrence_danna).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113047

Files:
  lldb/test/Shell/Settings/Inputs/EchoCommandsQuiet.out
  lldb/test/Shell/Settings/TestEchoCommands.test


Index: lldb/test/Shell/Settings/TestEchoCommands.test
===
--- lldb/test/Shell/Settings/TestEchoCommands.test
+++ lldb/test/Shell/Settings/TestEchoCommands.test
@@ -1,4 +1,4 @@
 # RUN: %lldb -x -b -o 'settings set interpreter.echo-comment-commands true'  
-s %S/Inputs/EchoCommandsTest.in | FileCheck %S/Inputs/EchoCommandsAll.out
 # RUN: %lldb -x -b -o 'settings set interpreter.echo-comment-commands false' 
-s %S/Inputs/EchoCommandsTest.in | FileCheck 
%S/Inputs/EchoCommandsNoComments.out
 # RUN: %lldb -x -b -o 'settings set interpreter.echo-commands false' 
-s %S/Inputs/EchoCommandsTest.in | FileCheck %S/Inputs/EchoCommandsNone.out
-# RUN: %lldb -x -b --source-quietly  
-s %S/Inputs/EchoCommandsTest.in | FileCheck %S/Inputs/EchoCommandsQuiet.out
+# RUN: ( echo start ; %lldb -x -b --source-quietly -s 
%S/Inputs/EchoCommandsTest.in ; echo done ) | FileCheck  
%S/Inputs/EchoCommandsQuiet.out
Index: lldb/test/Shell/Settings/Inputs/EchoCommandsQuiet.out
===
--- lldb/test/Shell/Settings/Inputs/EchoCommandsQuiet.out
+++ lldb/test/Shell/Settings/Inputs/EchoCommandsQuiet.out
@@ -1,2 +1,4 @@
-# CHECK: (lldb) command source -s 1 {{.*\n}}
-# CHECK-NEXT: (lldb) command source -s 1 {{.*\n}}
+CHECK: start
+CHECK-NOT: source
+CHECK-NOT: lldb
+CHECK-NEXT: done


Index: lldb/test/Shell/Settings/TestEchoCommands.test
===
--- lldb/test/Shell/Settings/TestEchoCommands.test
+++ lldb/test/Shell/Settings/TestEchoCommands.test
@@ -1,4 +1,4 @@
 # RUN: %lldb -x -b -o 'settings set interpreter.echo-comment-commands true'  -s %S/Inputs/EchoCommandsTest.in | FileCheck %S/Inputs/EchoCommandsAll.out
 # RUN: %lldb -x -b -o 'settings set interpreter.echo-comment-commands false' -s %S/Inputs/EchoCommandsTest.in | FileCheck %S/Inputs/EchoCommandsNoComments.out
 # RUN: %lldb -x -b -o 'settings set interpreter.echo-commands false' -s %S/Inputs/EchoCommandsTest.in | FileCheck %S/Inputs/EchoCommandsNone.out
-# RUN: %lldb -x -b --source-quietly  -s %S/Inputs/EchoCommandsTest.in | FileCheck %S/Inputs/EchoCommandsQuiet.out
+# RUN: ( echo start ; %lldb -x -b --source-quietly -s %S/Inputs/EchoCommandsTest.in ; echo done ) | FileCheck  %S/Inputs/EchoCommandsQuiet.out
Index: lldb/test/Shell/Settings/Inputs/EchoCommandsQuiet.out
===
--- lldb/test/Shell/Settings/Inputs/EchoCommandsQuiet.out
+++ lldb/test/Shell/Settings/Inputs/EchoCommandsQuiet.out
@@ -1,2 +1,4 @@
-# CHECK: (lldb) command source -s 1 {{.*\n}}
-# CHECK-NEXT: (lldb) command source -s 1 {{.*\n}}
+CHECK: start
+CHECK-NOT: source
+CHECK-NOT: lldb
+CHECK-NEXT: done
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 7f01f78 - [lldb] update TestEchoCommands

2021-11-02 Thread Lawrence D'Anna via lldb-commits

Author: Lawrence D'Anna
Date: 2021-11-02T14:30:08-07:00
New Revision: 7f01f78593d68741f1a26911e8cecca9805b3fa4

URL: 
https://github.com/llvm/llvm-project/commit/7f01f78593d68741f1a26911e8cecca9805b3fa4
DIFF: 
https://github.com/llvm/llvm-project/commit/7f01f78593d68741f1a26911e8cecca9805b3fa4.diff

LOG: [lldb] update TestEchoCommands

Followup to https://reviews.llvm.org/D112988

Sorry, I broke this test.   The test was verifying the bad behavior
of --source-quietly that the previous change fixed -- namely that
it still echos the initial list of startup commands while
sourcing them.

Updated the test to verify that --source-quietly is quiet, rather than
loud.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D113047

Added: 


Modified: 
lldb/test/Shell/Settings/Inputs/EchoCommandsQuiet.out
lldb/test/Shell/Settings/TestEchoCommands.test

Removed: 




diff  --git a/lldb/test/Shell/Settings/Inputs/EchoCommandsQuiet.out 
b/lldb/test/Shell/Settings/Inputs/EchoCommandsQuiet.out
index 12ad094292dea..11eee55f1f768 100644
--- a/lldb/test/Shell/Settings/Inputs/EchoCommandsQuiet.out
+++ b/lldb/test/Shell/Settings/Inputs/EchoCommandsQuiet.out
@@ -1,2 +1,4 @@
-# CHECK: (lldb) command source -s 1 {{.*\n}}
-# CHECK-NEXT: (lldb) command source -s 1 {{.*\n}}
+CHECK: start
+CHECK-NOT: source
+CHECK-NOT: lldb
+CHECK-NEXT: done

diff  --git a/lldb/test/Shell/Settings/TestEchoCommands.test 
b/lldb/test/Shell/Settings/TestEchoCommands.test
index 67547eaabf89c..a667456303573 100644
--- a/lldb/test/Shell/Settings/TestEchoCommands.test
+++ b/lldb/test/Shell/Settings/TestEchoCommands.test
@@ -1,4 +1,4 @@
 # RUN: %lldb -x -b -o 'settings set interpreter.echo-comment-commands true'  
-s %S/Inputs/EchoCommandsTest.in | FileCheck %S/Inputs/EchoCommandsAll.out
 # RUN: %lldb -x -b -o 'settings set interpreter.echo-comment-commands false' 
-s %S/Inputs/EchoCommandsTest.in | FileCheck 
%S/Inputs/EchoCommandsNoComments.out
 # RUN: %lldb -x -b -o 'settings set interpreter.echo-commands false' 
-s %S/Inputs/EchoCommandsTest.in | FileCheck %S/Inputs/EchoCommandsNone.out
-# RUN: %lldb -x -b --source-quietly  
-s %S/Inputs/EchoCommandsTest.in | FileCheck %S/Inputs/EchoCommandsQuiet.out
+# RUN: ( echo start ; %lldb -x -b --source-quietly -s 
%S/Inputs/EchoCommandsTest.in ; echo done ) | FileCheck  
%S/Inputs/EchoCommandsQuiet.out



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112945: [lldb] Improve error reporting in `lang objc tagged-pointer info`

2021-11-02 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG50b40b051890: [lldb] Improve error reporting in `lang objc 
tagged-pointer info` (authored by JDevlieghere).
Herald added a project: LLDB.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112945

Files:
  
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
  lldb/test/API/lang/objc/tagged-pointer/Makefile
  lldb/test/API/lang/objc/tagged-pointer/TestTaggedPointerCmd.py
  lldb/test/API/lang/objc/tagged-pointer/main.m

Index: lldb/test/API/lang/objc/tagged-pointer/main.m
===
--- /dev/null
+++ lldb/test/API/lang/objc/tagged-pointer/main.m
@@ -0,0 +1,6 @@
+#import 
+int main() {
+  id n1 = [NSNumber numberWithInt:1];
+  printf("%x", n1); // break here
+  return 0;
+}
Index: lldb/test/API/lang/objc/tagged-pointer/TestTaggedPointerCmd.py
===
--- /dev/null
+++ lldb/test/API/lang/objc/tagged-pointer/TestTaggedPointerCmd.py
@@ -0,0 +1,20 @@
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestTaggedPointerCommand(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+def test(self):
+self.build()
+lldbutil.run_to_source_breakpoint(self,"// break here", lldb.SBFileSpec("main.m"))
+
+self.expect("lang objc tagged-pointer info bogus", error=True,
+patterns=["could not convert 'bogus' to a valid address"])
+
+self.expect("lang objc tagged-pointer info 0x1", error=True,
+patterns=["could not get class descriptor for 0x1"])
+
Index: lldb/test/API/lang/objc/tagged-pointer/Makefile
===
--- /dev/null
+++ lldb/test/API/lang/objc/tagged-pointer/Makefile
@@ -0,0 +1,4 @@
+OBJC_SOURCES := main.m
+LD_EXTRAS := -lobjc -framework Foundation
+
+include Makefile.rules
Index: lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
===
--- lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -951,50 +951,65 @@
 
 Process *process = m_exe_ctx.GetProcessPtr();
 ExecutionContext exe_ctx(process);
+
 ObjCLanguageRuntime *objc_runtime = ObjCLanguageRuntime::Get(*process);
-if (objc_runtime) {
-  ObjCLanguageRuntime::TaggedPointerVendor *tagged_ptr_vendor =
-  objc_runtime->GetTaggedPointerVendor();
-  if (tagged_ptr_vendor) {
-for (size_t i = 0; i < command.GetArgumentCount(); i++) {
-  const char *arg_str = command.GetArgumentAtIndex(i);
-  if (!arg_str)
-continue;
-  Status error;
-  lldb::addr_t arg_addr = OptionArgParser::ToAddress(
-  _ctx, arg_str, LLDB_INVALID_ADDRESS, );
-  if (arg_addr == 0 || arg_addr == LLDB_INVALID_ADDRESS || error.Fail())
-continue;
-  auto descriptor_sp = tagged_ptr_vendor->GetClassDescriptor(arg_addr);
-  if (!descriptor_sp)
-continue;
-  uint64_t info_bits = 0;
-  uint64_t value_bits = 0;
-  uint64_t payload = 0;
-  if (descriptor_sp->GetTaggedPointerInfo(_bits, _bits,
-  )) {
-result.GetOutputStream().Printf(
-"0x%" PRIx64 " is tagged.\n\tpayload = 0x%" PRIx64
-"\n\tvalue = 0x%" PRIx64 "\n\tinfo bits = 0x%" PRIx64
-"\n\tclass = %s\n",
-(uint64_t)arg_addr, payload, value_bits, info_bits,
-descriptor_sp->GetClassName().AsCString(""));
-  } else {
-result.GetOutputStream().Printf("0x%" PRIx64 " is not tagged.\n",
-(uint64_t)arg_addr);
-  }
-}
-  } else {
-result.AppendError("current process has no tagged pointer support");
+if (!objc_runtime) {
+  result.AppendError("current process has no Objective-C runtime loaded");
+  result.SetStatus(lldb::eReturnStatusFailed);
+  return false;
+}
+
+ObjCLanguageRuntime::TaggedPointerVendor *tagged_ptr_vendor =
+objc_runtime->GetTaggedPointerVendor();
+if (!tagged_ptr_vendor) {
+  result.AppendError("current process has no tagged pointer support");
+  result.SetStatus(lldb::eReturnStatusFailed);
+  return false;
+}
+
+for (size_t i = 0; i < command.GetArgumentCount(); i++) {
+  const char *arg_str = command.GetArgumentAtIndex(i);
+  if (!arg_str)
+continue;
+
+  Status error;
+  lldb::addr_t arg_addr = 

[Lldb-commits] [lldb] 50b40b0 - [lldb] Improve error reporting in `lang objc tagged-pointer info`

2021-11-02 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2021-11-02T14:25:42-07:00
New Revision: 50b40b0518900f60ec2712384f6ce40341ed7484

URL: 
https://github.com/llvm/llvm-project/commit/50b40b0518900f60ec2712384f6ce40341ed7484
DIFF: 
https://github.com/llvm/llvm-project/commit/50b40b0518900f60ec2712384f6ce40341ed7484.diff

LOG: [lldb] Improve error reporting in `lang objc tagged-pointer info`

Improve error handling for the lang objc tagged-pointer info. Rather
than failing silently, report an error if we couldn't convert an
argument to an address or resolve the class descriptor.

  (lldb) lang objc tagged-pointer info 0xbb6404c47a587764
  error: could not get class descriptor for 0xbb6404c47a587764

  (lldb) lang objc tagged-pointer info n1
  error: could not convert 'n1' to a valid address

Differential revision: https://reviews.llvm.org/D112945

Added: 
lldb/test/API/lang/objc/tagged-pointer/Makefile
lldb/test/API/lang/objc/tagged-pointer/TestTaggedPointerCmd.py
lldb/test/API/lang/objc/tagged-pointer/main.m

Modified: 

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp

Removed: 




diff  --git 
a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
 
b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
index 240b458c21ea3..b4c517e76c49a 100644
--- 
a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ 
b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -951,50 +951,65 @@ class CommandObjectMultiwordObjC_TaggedPointer_Info
 
 Process *process = m_exe_ctx.GetProcessPtr();
 ExecutionContext exe_ctx(process);
+
 ObjCLanguageRuntime *objc_runtime = ObjCLanguageRuntime::Get(*process);
-if (objc_runtime) {
-  ObjCLanguageRuntime::TaggedPointerVendor *tagged_ptr_vendor =
-  objc_runtime->GetTaggedPointerVendor();
-  if (tagged_ptr_vendor) {
-for (size_t i = 0; i < command.GetArgumentCount(); i++) {
-  const char *arg_str = command.GetArgumentAtIndex(i);
-  if (!arg_str)
-continue;
-  Status error;
-  lldb::addr_t arg_addr = OptionArgParser::ToAddress(
-  _ctx, arg_str, LLDB_INVALID_ADDRESS, );
-  if (arg_addr == 0 || arg_addr == LLDB_INVALID_ADDRESS || 
error.Fail())
-continue;
-  auto descriptor_sp = tagged_ptr_vendor->GetClassDescriptor(arg_addr);
-  if (!descriptor_sp)
-continue;
-  uint64_t info_bits = 0;
-  uint64_t value_bits = 0;
-  uint64_t payload = 0;
-  if (descriptor_sp->GetTaggedPointerInfo(_bits, _bits,
-  )) {
-result.GetOutputStream().Printf(
-"0x%" PRIx64 " is tagged.\n\tpayload = 0x%" PRIx64
-"\n\tvalue = 0x%" PRIx64 "\n\tinfo bits = 0x%" PRIx64
-"\n\tclass = %s\n",
-(uint64_t)arg_addr, payload, value_bits, info_bits,
-descriptor_sp->GetClassName().AsCString(""));
-  } else {
-result.GetOutputStream().Printf("0x%" PRIx64 " is not tagged.\n",
-(uint64_t)arg_addr);
-  }
-}
-  } else {
-result.AppendError("current process has no tagged pointer support");
+if (!objc_runtime) {
+  result.AppendError("current process has no Objective-C runtime loaded");
+  result.SetStatus(lldb::eReturnStatusFailed);
+  return false;
+}
+
+ObjCLanguageRuntime::TaggedPointerVendor *tagged_ptr_vendor =
+objc_runtime->GetTaggedPointerVendor();
+if (!tagged_ptr_vendor) {
+  result.AppendError("current process has no tagged pointer support");
+  result.SetStatus(lldb::eReturnStatusFailed);
+  return false;
+}
+
+for (size_t i = 0; i < command.GetArgumentCount(); i++) {
+  const char *arg_str = command.GetArgumentAtIndex(i);
+  if (!arg_str)
+continue;
+
+  Status error;
+  lldb::addr_t arg_addr = OptionArgParser::ToAddress(
+  _ctx, arg_str, LLDB_INVALID_ADDRESS, );
+  if (arg_addr == 0 || arg_addr == LLDB_INVALID_ADDRESS || error.Fail()) {
+result.AppendErrorWithFormat(
+"could not convert '%s' to a valid address\n", arg_str);
 result.SetStatus(lldb::eReturnStatusFailed);
 return false;
   }
-  result.SetStatus(lldb::eReturnStatusSuccessFinishResult);
-  return true;
+
+  auto descriptor_sp = tagged_ptr_vendor->GetClassDescriptor(arg_addr);
+  if (!descriptor_sp) {
+result.AppendErrorWithFormat(
+"could not get class descriptor for 0x%" PRIx64 "\n",
+(uint64_t)arg_addr);
+result.SetStatus(lldb::eReturnStatusFailed);
+return false;
+  }
+
+  uint64_t info_bits = 0;
+  uint64_t 

[Lldb-commits] [PATCH] D113047: [lldb] update TestEchoCommands

2021-11-02 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113047

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112988: [lldb] fix --source-quietly

2021-11-02 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna added a comment.

In D112988#3103992 , 
@stella.stamenova wrote:

> It looks like some of the tests need to be updated after this change (at 
> least on Windows, the Windows LLDB bot is broken now):
>
> https://lab.llvm.org/buildbot/#/builders/83/builds/11623/steps/7/logs/stdio

sorry! Fix is here https://reviews.llvm.org/D113047


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112988

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D113047: [lldb] update TestEchoCommands

2021-11-02 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna created this revision.
lawrence_danna added reviewers: jasonmolenda, JDevlieghere, jingham, 
stella.stamenova.
lawrence_danna requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Followup to https://reviews.llvm.org/D112988

Sorry, I broke this test.   The test was verifying the bad behavior
of --source-quietly that the previous change fixed -- namely that
it still echos the initial list of startup commands while
sourcing them.

Updated the test to verify that --source-quietly is quiet, rather than
loud.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113047

Files:
  lldb/test/Shell/Settings/Inputs/EchoCommandsQuiet.out
  lldb/test/Shell/Settings/TestEchoCommands.test


Index: lldb/test/Shell/Settings/TestEchoCommands.test
===
--- lldb/test/Shell/Settings/TestEchoCommands.test
+++ lldb/test/Shell/Settings/TestEchoCommands.test
@@ -1,4 +1,4 @@
 # RUN: %lldb -x -b -o 'settings set interpreter.echo-comment-commands true'  
-s %S/Inputs/EchoCommandsTest.in | FileCheck %S/Inputs/EchoCommandsAll.out
 # RUN: %lldb -x -b -o 'settings set interpreter.echo-comment-commands false' 
-s %S/Inputs/EchoCommandsTest.in | FileCheck 
%S/Inputs/EchoCommandsNoComments.out
 # RUN: %lldb -x -b -o 'settings set interpreter.echo-commands false' 
-s %S/Inputs/EchoCommandsTest.in | FileCheck %S/Inputs/EchoCommandsNone.out
-# RUN: %lldb -x -b --source-quietly  
-s %S/Inputs/EchoCommandsTest.in | FileCheck %S/Inputs/EchoCommandsQuiet.out
+# RUN: ( echo start ; %lldb -x -b --source-quietly -s 
%S/Inputs/EchoCommandsTest.in ; echo done ) | FileCheck  
%S/Inputs/EchoCommandsQuiet.out
Index: lldb/test/Shell/Settings/Inputs/EchoCommandsQuiet.out
===
--- lldb/test/Shell/Settings/Inputs/EchoCommandsQuiet.out
+++ lldb/test/Shell/Settings/Inputs/EchoCommandsQuiet.out
@@ -1,2 +1,4 @@
-# CHECK: (lldb) command source -s 1 {{.*\n}}
-# CHECK-NEXT: (lldb) command source -s 1 {{.*\n}}
+CHECK: start
+CHECK-NOT: source
+CHECK-NOT: lldb
+CHECK-NEXT: done


Index: lldb/test/Shell/Settings/TestEchoCommands.test
===
--- lldb/test/Shell/Settings/TestEchoCommands.test
+++ lldb/test/Shell/Settings/TestEchoCommands.test
@@ -1,4 +1,4 @@
 # RUN: %lldb -x -b -o 'settings set interpreter.echo-comment-commands true'  -s %S/Inputs/EchoCommandsTest.in | FileCheck %S/Inputs/EchoCommandsAll.out
 # RUN: %lldb -x -b -o 'settings set interpreter.echo-comment-commands false' -s %S/Inputs/EchoCommandsTest.in | FileCheck %S/Inputs/EchoCommandsNoComments.out
 # RUN: %lldb -x -b -o 'settings set interpreter.echo-commands false' -s %S/Inputs/EchoCommandsTest.in | FileCheck %S/Inputs/EchoCommandsNone.out
-# RUN: %lldb -x -b --source-quietly  -s %S/Inputs/EchoCommandsTest.in | FileCheck %S/Inputs/EchoCommandsQuiet.out
+# RUN: ( echo start ; %lldb -x -b --source-quietly -s %S/Inputs/EchoCommandsTest.in ; echo done ) | FileCheck  %S/Inputs/EchoCommandsQuiet.out
Index: lldb/test/Shell/Settings/Inputs/EchoCommandsQuiet.out
===
--- lldb/test/Shell/Settings/Inputs/EchoCommandsQuiet.out
+++ lldb/test/Shell/Settings/Inputs/EchoCommandsQuiet.out
@@ -1,2 +1,4 @@
-# CHECK: (lldb) command source -s 1 {{.*\n}}
-# CHECK-NEXT: (lldb) command source -s 1 {{.*\n}}
+CHECK: start
+CHECK-NOT: source
+CHECK-NOT: lldb
+CHECK-NEXT: done
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112988: [lldb] fix --source-quietly

2021-11-02 Thread Stella Stamenova via Phabricator via lldb-commits
stella.stamenova added a comment.

It looks like some of the tests need to be updated after this change (at least 
on Windows, the Windows LLDB bot is broken now):

https://lab.llvm.org/buildbot/#/builders/83/builds/11623/steps/7/logs/stdio


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112988

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112945: [lldb] Improve error reporting in `lang objc tagged-pointer info`

2021-11-02 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl accepted this revision.
aprantl added a comment.
This revision is now accepted and ready to land.

Excellent, thanks!


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

https://reviews.llvm.org/D112945

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D113019: [lldb][NFC] Inclusive Language: rename master plan to primary plan

2021-11-02 Thread Quinn Pham via Phabricator via lldb-commits
quinnp added a comment.

In D113019#3103511 , @jingham wrote:

> I have no problem with adopting more inclusive language, but "Primary" 
> doesn't express the right concept.  The "master" plan is one that coordinates 
> other plans.  There can be many "master plans" on the stack at any one time 
> during a complex set of stepping operations, each distinguished in that it is 
> in charge of the plans that it enqueued.  So it isn't Primary in a real sense.

Absolutely, thank you for the feedback! I went with "Controlling".


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113019

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D113019: [lldb][NFC] Inclusive Language: rename master plan to primary plan

2021-11-02 Thread Quinn Pham via Phabricator via lldb-commits
quinnp updated this revision to Diff 384202.
quinnp added a comment.

Addressing feedback. Changing Primary to Controlling.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113019

Files:
  lldb/docs/use/python-reference.rst
  lldb/include/lldb/Target/Thread.h
  lldb/include/lldb/Target/ThreadPlan.h
  lldb/include/lldb/Target/ThreadPlanStack.h
  lldb/source/API/SBThread.cpp
  lldb/source/Commands/CommandObjectThread.cpp
  lldb/source/Expression/FunctionCaller.cpp
  lldb/source/Target/Process.cpp
  lldb/source/Target/StopInfo.cpp
  lldb/source/Target/Thread.cpp
  lldb/source/Target/ThreadPlan.cpp
  lldb/source/Target/ThreadPlanBase.cpp
  lldb/source/Target/ThreadPlanCallFunction.cpp
  lldb/source/Target/ThreadPlanCallOnFunctionExit.cpp
  lldb/source/Target/ThreadPlanCallUserExpression.cpp
  lldb/source/Target/ThreadPlanPython.cpp
  lldb/source/Target/ThreadPlanStack.cpp

Index: lldb/source/Target/ThreadPlanStack.cpp
===
--- lldb/source/Target/ThreadPlanStack.cpp
+++ lldb/source/Target/ThreadPlanStack.cpp
@@ -213,35 +213,35 @@
   return;
 }
 
-void ThreadPlanStack::DiscardConsultingMasterPlans() {
+void ThreadPlanStack::DiscardConsultingControllingPlans() {
   std::lock_guard guard(m_stack_mutex);
   while (true) {
-int master_plan_idx;
+int controlling_plan_idx;
 bool discard = true;
 
-// Find the first master plan, see if it wants discarding, and if yes
+// Find the first controlling plan, see if it wants discarding, and if yes
 // discard up to it.
-for (master_plan_idx = m_plans.size() - 1; master_plan_idx >= 0;
- master_plan_idx--) {
-  if (m_plans[master_plan_idx]->IsMasterPlan()) {
-discard = m_plans[master_plan_idx]->OkayToDiscard();
+for (controlling_plan_idx = m_plans.size() - 1; controlling_plan_idx >= 0;
+ controlling_plan_idx--) {
+  if (m_plans[controlling_plan_idx]->IsControllingPlan()) {
+discard = m_plans[controlling_plan_idx]->OkayToDiscard();
 break;
   }
 }
 
-// If the master plan doesn't want to get discarded, then we're done.
+// If the controlling plan doesn't want to get discarded, then we're done.
 if (!discard)
   return;
 
 // First pop all the dependent plans:
-for (int i = m_plans.size() - 1; i > master_plan_idx; i--) {
+for (int i = m_plans.size() - 1; i > controlling_plan_idx; i--) {
   DiscardPlan();
 }
 
-// Now discard the master plan itself.
+// Now discard the controlling plan itself.
 // The bottom-most plan never gets discarded.  "OkayToDiscard" for it
 // means discard it's dependent plans, but not it...
-if (master_plan_idx > 0) {
+if (controlling_plan_idx > 0) {
   DiscardPlan();
 }
   }
Index: lldb/source/Target/ThreadPlanPython.cpp
===
--- lldb/source/Target/ThreadPlanPython.cpp
+++ lldb/source/Target/ThreadPlanPython.cpp
@@ -31,7 +31,7 @@
  eVoteNoOpinion, eVoteNoOpinion),
   m_class_name(class_name), m_args_data(args_data), m_did_push(false),
   m_stop_others(false) {
-  SetIsMasterPlan(true);
+  SetIsControllingPlan(true);
   SetOkayToDiscard(true);
   SetPrivate(false);
 }
Index: lldb/source/Target/ThreadPlanCallUserExpression.cpp
===
--- lldb/source/Target/ThreadPlanCallUserExpression.cpp
+++ lldb/source/Target/ThreadPlanCallUserExpression.cpp
@@ -39,7 +39,7 @@
   m_user_expression_sp(user_expression_sp) {
   // User expressions are generally "User generated" so we should set them up
   // to stop when done.
-  SetIsMasterPlan(true);
+  SetIsControllingPlan(true);
   SetOkayToDiscard(false);
 }
 
Index: lldb/source/Target/ThreadPlanCallOnFunctionExit.cpp
===
--- lldb/source/Target/ThreadPlanCallOnFunctionExit.cpp
+++ lldb/source/Target/ThreadPlanCallOnFunctionExit.cpp
@@ -18,7 +18,7 @@
  ),
   m_callback(callback) {
   // We are not a user-generated plan.
-  SetIsMasterPlan(false);
+  SetIsControllingPlan(false);
 }
 
 void ThreadPlanCallOnFunctionExit::DidPush() {
Index: lldb/source/Target/ThreadPlanCallFunction.cpp
===
--- lldb/source/Target/ThreadPlanCallFunction.cpp
+++ lldb/source/Target/ThreadPlanCallFunction.cpp
@@ -33,7 +33,7 @@
 bool ThreadPlanCallFunction::ConstructorSetup(
 Thread , ABI *, lldb::addr_t _load_addr,
 lldb::addr_t _load_addr) {
-  SetIsMasterPlan(true);
+  SetIsControllingPlan(true);
   SetOkayToDiscard(false);
   SetPrivate(true);
 
Index: lldb/source/Target/ThreadPlanBase.cpp
===
--- lldb/source/Target/ThreadPlanBase.cpp
+++ lldb/source/Target/ThreadPlanBase.cpp

[Lldb-commits] [PATCH] D112945: [lldb] Improve error reporting in `lang objc tagged-pointer info`

2021-11-02 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 384193.
JDevlieghere added a comment.

Address code review feedback


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

https://reviews.llvm.org/D112945

Files:
  
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
  lldb/test/API/lang/objc/tagged-pointer/Makefile
  lldb/test/API/lang/objc/tagged-pointer/TestTaggedPointerCmd.py
  lldb/test/API/lang/objc/tagged-pointer/main.m

Index: lldb/test/API/lang/objc/tagged-pointer/main.m
===
--- /dev/null
+++ lldb/test/API/lang/objc/tagged-pointer/main.m
@@ -0,0 +1,6 @@
+#import 
+int main() {
+  id n1 = [NSNumber numberWithInt:1];
+  printf("%x", n1); // break here
+  return 0;
+}
Index: lldb/test/API/lang/objc/tagged-pointer/TestTaggedPointerCmd.py
===
--- /dev/null
+++ lldb/test/API/lang/objc/tagged-pointer/TestTaggedPointerCmd.py
@@ -0,0 +1,20 @@
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestTaggedPointerCommand(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+def test(self):
+self.build()
+lldbutil.run_to_source_breakpoint(self,"// break here", lldb.SBFileSpec("main.m"))
+
+self.expect("lang objc tagged-pointer info bogus", error=True,
+patterns=["could not convert 'bogus' to a valid address"])
+
+self.expect("lang objc tagged-pointer info 0x1", error=True,
+patterns=["could not get class descriptor for 0x1"])
+
Index: lldb/test/API/lang/objc/tagged-pointer/Makefile
===
--- /dev/null
+++ lldb/test/API/lang/objc/tagged-pointer/Makefile
@@ -0,0 +1,4 @@
+OBJC_SOURCES := main.m
+LD_EXTRAS := -lobjc -framework Foundation
+
+include Makefile.rules
Index: lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
===
--- lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -951,50 +951,65 @@
 
 Process *process = m_exe_ctx.GetProcessPtr();
 ExecutionContext exe_ctx(process);
+
 ObjCLanguageRuntime *objc_runtime = ObjCLanguageRuntime::Get(*process);
-if (objc_runtime) {
-  ObjCLanguageRuntime::TaggedPointerVendor *tagged_ptr_vendor =
-  objc_runtime->GetTaggedPointerVendor();
-  if (tagged_ptr_vendor) {
-for (size_t i = 0; i < command.GetArgumentCount(); i++) {
-  const char *arg_str = command.GetArgumentAtIndex(i);
-  if (!arg_str)
-continue;
-  Status error;
-  lldb::addr_t arg_addr = OptionArgParser::ToAddress(
-  _ctx, arg_str, LLDB_INVALID_ADDRESS, );
-  if (arg_addr == 0 || arg_addr == LLDB_INVALID_ADDRESS || error.Fail())
-continue;
-  auto descriptor_sp = tagged_ptr_vendor->GetClassDescriptor(arg_addr);
-  if (!descriptor_sp)
-continue;
-  uint64_t info_bits = 0;
-  uint64_t value_bits = 0;
-  uint64_t payload = 0;
-  if (descriptor_sp->GetTaggedPointerInfo(_bits, _bits,
-  )) {
-result.GetOutputStream().Printf(
-"0x%" PRIx64 " is tagged.\n\tpayload = 0x%" PRIx64
-"\n\tvalue = 0x%" PRIx64 "\n\tinfo bits = 0x%" PRIx64
-"\n\tclass = %s\n",
-(uint64_t)arg_addr, payload, value_bits, info_bits,
-descriptor_sp->GetClassName().AsCString(""));
-  } else {
-result.GetOutputStream().Printf("0x%" PRIx64 " is not tagged.\n",
-(uint64_t)arg_addr);
-  }
-}
-  } else {
-result.AppendError("current process has no tagged pointer support");
+if (!objc_runtime) {
+  result.AppendError("current process has no Objective-C runtime loaded");
+  result.SetStatus(lldb::eReturnStatusFailed);
+  return false;
+}
+
+ObjCLanguageRuntime::TaggedPointerVendor *tagged_ptr_vendor =
+objc_runtime->GetTaggedPointerVendor();
+if (!tagged_ptr_vendor) {
+  result.AppendError("current process has no tagged pointer support");
+  result.SetStatus(lldb::eReturnStatusFailed);
+  return false;
+}
+
+for (size_t i = 0; i < command.GetArgumentCount(); i++) {
+  const char *arg_str = command.GetArgumentAtIndex(i);
+  if (!arg_str)
+continue;
+
+  Status error;
+  lldb::addr_t arg_addr = OptionArgParser::ToAddress(
+  _ctx, arg_str, LLDB_INVALID_ADDRESS, );
+  if (arg_addr == 0 || arg_addr == LLDB_INVALID_ADDRESS || error.Fail()) {
+

[Lldb-commits] [PATCH] D112988: [lldb] fix --source-quietly

2021-11-02 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added inline comments.



Comment at: lldb/test/Shell/Driver/TestQuiet.test:8
+CHECK: 42
\ No newline at end of file


> No newline at end of file


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112988

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 797b50d - Revert "Use `GNUInstallDirs` to support custom installation dirs. -- LLVM"

2021-11-02 Thread Med Ismail Bennani via lldb-commits

Author: Med Ismail Bennani
Date: 2021-11-02T19:11:44+01:00
New Revision: 797b50d4be873b4662983413a06806fca544c276

URL: 
https://github.com/llvm/llvm-project/commit/797b50d4be873b4662983413a06806fca544c276
DIFF: 
https://github.com/llvm/llvm-project/commit/797b50d4be873b4662983413a06806fca544c276.diff

LOG: Revert "Use `GNUInstallDirs` to support custom installation dirs. -- LLVM"

This reverts commit 6fd2db04d0f22ea22c5317d98ce2126aa64b6a73 since it
broke GreenDragon LLDB-Incremental bot:

https://green.lab.llvm.org/green/job/lldb-cmake/37560/console

Signed-off-by: Med Ismail Bennani 

Added: 


Modified: 
clang/tools/scan-build/CMakeLists.txt
libclc/CMakeLists.txt
lldb/cmake/modules/FindLibEdit.cmake
llvm/CMakeLists.txt
llvm/cmake/modules/AddLLVM.cmake
llvm/cmake/modules/AddSphinxTarget.cmake
llvm/cmake/modules/CMakeLists.txt
llvm/cmake/modules/LLVMInstallSymlink.cmake
llvm/docs/CMake.rst
llvm/examples/Bye/CMakeLists.txt
llvm/include/llvm/CMakeLists.txt
llvm/tools/llvm-config/BuildVariables.inc.in
llvm/tools/llvm-config/llvm-config.cpp
llvm/tools/lto/CMakeLists.txt
llvm/tools/opt-viewer/CMakeLists.txt
llvm/tools/remarks-shlib/CMakeLists.txt
openmp/runtime/src/CMakeLists.txt

Removed: 




diff  --git a/clang/tools/scan-build/CMakeLists.txt 
b/clang/tools/scan-build/CMakeLists.txt
index 74334e53c9b18..ec0702d76f184 100644
--- a/clang/tools/scan-build/CMakeLists.txt
+++ b/clang/tools/scan-build/CMakeLists.txt
@@ -66,16 +66,16 @@ if(CLANG_INSTALL_SCANBUILD)
   endforeach()
 
   foreach(ManPage ${ManPages})
-add_custom_command(OUTPUT 
"${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/${ManPage}"
+add_custom_command(OUTPUT 
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/${ManPage}
COMMAND ${CMAKE_COMMAND} -E make_directory
- "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1"
+ ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1
COMMAND ${CMAKE_COMMAND} -E copy
- "${CMAKE_CURRENT_SOURCE_DIR}/man/${ManPage}"
- "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/"
+ ${CMAKE_CURRENT_SOURCE_DIR}/man/${ManPage}
+ ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/man/${ManPage})
-list(APPEND Depends 
"${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/${ManPage}")
+list(APPEND Depends 
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/${ManPage})
 install(PROGRAMS man/${ManPage}
-DESTINATION "${CMAKE_INSTALL_MANDIR}/man1"
+DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
 COMPONENT scan-build)
   endforeach()
 

diff  --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index e90e0fd852012..ec39ea63f2d02 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -183,8 +183,8 @@ endif()
 
 # pkg-config file
 configure_file( libclc.pc.in libclc.pc @ONLY )
-install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libclc.pc DESTINATION 
"${CMAKE_INSTALL_DATADIR}/pkgconfig" )
-install( DIRECTORY generic/include/clc DESTINATION 
"${CMAKE_INSTALL_INCLUDEDIR}" )
+install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libclc.pc DESTINATION 
${CMAKE_INSTALL_DATADIR}/pkgconfig )
+install( DIRECTORY generic/include/clc DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} 
)
 
 if( ENABLE_RUNTIME_SUBNORMAL )
add_library( subnormal_use_default STATIC
@@ -192,7 +192,7 @@ if( ENABLE_RUNTIME_SUBNORMAL )
add_library( subnormal_disable STATIC
generic/lib/subnormal_disable.ll )
install( TARGETS subnormal_use_default subnormal_disable ARCHIVE
-   DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" )
+   DESTINATION ${CMAKE_INSTALL_DATADIR}/clc )
 endif()
 
 find_package( Python3 REQUIRED COMPONENTS Interpreter )
@@ -343,7 +343,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
add_custom_target( "prepare-${spv_suffix}" ALL
   DEPENDS "${spv_suffix}" )
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${spv_suffix}
-DESTINATION "${CMAKE_INSTALL_DATADIR}/clc" )
+DESTINATION ${CMAKE_INSTALL_DATADIR}/clc )
else()
 
# Add prepare target
@@ -366,7 +366,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
PROPERTIES ENVIRONMENT 
"LLVM_CONFIG=${LLVM_CONFIG}" )
endif()
 
-   install( FILES 
${CMAKE_CURRENT_BINARY_DIR}/${obj_suffix} DESTINATION 
"${CMAKE_INSTALL_DATADIR}/clc" )
+   install( FILES 
${CMAKE_CURRENT_BINARY_DIR}/${obj_suffix} DESTINATION 
${CMAKE_INSTALL_DATADIR}/clc )

[Lldb-commits] [PATCH] D112988: [lldb] fix --source-quietly

2021-11-02 Thread Lawrence D'Anna via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe2a6c08bbc38: [lldb] fix --source-quietly (authored by 
lawrence_danna).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112988

Files:
  lldb/docs/man/lldb.rst
  lldb/test/Shell/Driver/TestQuiet.test
  lldb/tools/driver/Driver.cpp
  lldb/tools/driver/Options.td


Index: lldb/tools/driver/Options.td
===
--- lldb/tools/driver/Options.td
+++ lldb/tools/driver/Options.td
@@ -110,7 +110,7 @@
   Group;
 
 def source_quietly: F<"source-quietly">,
-  HelpText<"Tells the debugger to execute this one-line lldb command before 
any file has been loaded.">,
+  HelpText<"Tells the debugger not to echo commands while sourcing files or 
one-line commands provided on the command line.">,
   Group;
 def: Flag<["-"], "Q">,
   Alias,
Index: lldb/tools/driver/Driver.cpp
===
--- lldb/tools/driver/Driver.cpp
+++ lldb/tools/driver/Driver.cpp
@@ -609,6 +609,7 @@
 options.SetSpawnThread(false);
 options.SetStopOnError(true);
 options.SetStopOnCrash(m_option_data.m_batch);
+options.SetEchoCommands(!m_option_data.m_source_quietly);
 
 SBCommandInterpreterRunResult results =
 m_debugger.RunCommandInterpreter(options);
Index: lldb/test/Shell/Driver/TestQuiet.test
===
--- /dev/null
+++ lldb/test/Shell/Driver/TestQuiet.test
@@ -0,0 +1,7 @@
+RUN: %lldb -b -Q -o "expr 40 + 2" | FileCheck %s
+RUN: %lldb -b -Q -O "expr 40 + 2" | FileCheck %s
+
+CHECK-NOT: expr
+CHECK-NOT: lldb
+CHECK-NOT: source
+CHECK: 42
\ No newline at end of file
Index: lldb/docs/man/lldb.rst
===
--- lldb/docs/man/lldb.rst
+++ lldb/docs/man/lldb.rst
@@ -111,7 +111,7 @@
 
 .. option:: --source-quietly
 
- Tells the debugger to execute this one-line lldb command before any file has 
been loaded.
+ Tells the debugger not to echo commands while sourcing files or one-line 
commands provided on the command line.
 
 .. option:: --source 
 


Index: lldb/tools/driver/Options.td
===
--- lldb/tools/driver/Options.td
+++ lldb/tools/driver/Options.td
@@ -110,7 +110,7 @@
   Group;
 
 def source_quietly: F<"source-quietly">,
-  HelpText<"Tells the debugger to execute this one-line lldb command before any file has been loaded.">,
+  HelpText<"Tells the debugger not to echo commands while sourcing files or one-line commands provided on the command line.">,
   Group;
 def: Flag<["-"], "Q">,
   Alias,
Index: lldb/tools/driver/Driver.cpp
===
--- lldb/tools/driver/Driver.cpp
+++ lldb/tools/driver/Driver.cpp
@@ -609,6 +609,7 @@
 options.SetSpawnThread(false);
 options.SetStopOnError(true);
 options.SetStopOnCrash(m_option_data.m_batch);
+options.SetEchoCommands(!m_option_data.m_source_quietly);
 
 SBCommandInterpreterRunResult results =
 m_debugger.RunCommandInterpreter(options);
Index: lldb/test/Shell/Driver/TestQuiet.test
===
--- /dev/null
+++ lldb/test/Shell/Driver/TestQuiet.test
@@ -0,0 +1,7 @@
+RUN: %lldb -b -Q -o "expr 40 + 2" | FileCheck %s
+RUN: %lldb -b -Q -O "expr 40 + 2" | FileCheck %s
+
+CHECK-NOT: expr
+CHECK-NOT: lldb
+CHECK-NOT: source
+CHECK: 42
\ No newline at end of file
Index: lldb/docs/man/lldb.rst
===
--- lldb/docs/man/lldb.rst
+++ lldb/docs/man/lldb.rst
@@ -111,7 +111,7 @@
 
 .. option:: --source-quietly
 
- Tells the debugger to execute this one-line lldb command before any file has been loaded.
+ Tells the debugger not to echo commands while sourcing files or one-line commands provided on the command line.
 
 .. option:: --source 
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] e2a6c08 - [lldb] fix --source-quietly

2021-11-02 Thread Lawrence D'Anna via lldb-commits

Author: Lawrence D'Anna
Date: 2021-11-02T11:01:55-07:00
New Revision: e2a6c08bbc385b38e02f4e5d31d1cf6d4403f066

URL: 
https://github.com/llvm/llvm-project/commit/e2a6c08bbc385b38e02f4e5d31d1cf6d4403f066
DIFF: 
https://github.com/llvm/llvm-project/commit/e2a6c08bbc385b38e02f4e5d31d1cf6d4403f066.diff

LOG: [lldb] fix --source-quietly

Jim says:

lldb has a -Q or --source-quietly option, which supposedly does:

--source-quietly Tells the debugger to execute this one-line lldb 
command before any file has been loaded.

That seems like a weird description, since we don't generally use source for 
one line entries, but anyway, let's try it:

> $LLDB_LLVM/clean-mono/build/Debug/bin/lldb -Q "script print('I should be 
quiet')" a.out -O "script print('I should be before')" -o "script print('I 
should be after')"
(lldb) script print('I should be before')
I should be before
(lldb) target create "script print('I should be quiet')"
error: unable to find executable for 'script print('I should be quiet')'

That was weird.  The first real -O gets sourced but not quietly, then the 
argument to the -Q gets treated as the target.

> $LLDB_LLVM/clean-mono/build/Debug/bin/lldb -Q a.out -O "script print('I 
should be before')" -o "script print('I should be after')"
(lldb) script print('I should be before')
I should be before
(lldb) target create "a.out"
Current executable set to '/tmp/a.out' (x86_64).
(lldb) script print('I should be after')
I should be after

Well, that's a little better, but the -Q option seems to have done nothing.

---

This fixes the description of --source-quietly, as well as causing it
to actually suppress echoing while executing the initialization
commands.

Reviewed By: jingham

Differential Revision: https://reviews.llvm.org/D112988

Added: 
lldb/test/Shell/Driver/TestQuiet.test

Modified: 
lldb/docs/man/lldb.rst
lldb/tools/driver/Driver.cpp
lldb/tools/driver/Options.td

Removed: 




diff  --git a/lldb/docs/man/lldb.rst b/lldb/docs/man/lldb.rst
index b75288db380de..35db1dc68c129 100644
--- a/lldb/docs/man/lldb.rst
+++ b/lldb/docs/man/lldb.rst
@@ -111,7 +111,7 @@ COMMANDS
 
 .. option:: --source-quietly
 
- Tells the debugger to execute this one-line lldb command before any file has 
been loaded.
+ Tells the debugger not to echo commands while sourcing files or one-line 
commands provided on the command line.
 
 .. option:: --source 
 

diff  --git a/lldb/test/Shell/Driver/TestQuiet.test 
b/lldb/test/Shell/Driver/TestQuiet.test
new file mode 100644
index 0..8598792aeba07
--- /dev/null
+++ b/lldb/test/Shell/Driver/TestQuiet.test
@@ -0,0 +1,7 @@
+RUN: %lldb -b -Q -o "expr 40 + 2" | FileCheck %s
+RUN: %lldb -b -Q -O "expr 40 + 2" | FileCheck %s
+
+CHECK-NOT: expr
+CHECK-NOT: lldb
+CHECK-NOT: source
+CHECK: 42
\ No newline at end of file

diff  --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp
index a6a4a2a1b80b8..df070ebe4db8d 100644
--- a/lldb/tools/driver/Driver.cpp
+++ b/lldb/tools/driver/Driver.cpp
@@ -609,6 +609,7 @@ int Driver::MainLoop() {
 options.SetSpawnThread(false);
 options.SetStopOnError(true);
 options.SetStopOnCrash(m_option_data.m_batch);
+options.SetEchoCommands(!m_option_data.m_source_quietly);
 
 SBCommandInterpreterRunResult results =
 m_debugger.RunCommandInterpreter(options);

diff  --git a/lldb/tools/driver/Options.td b/lldb/tools/driver/Options.td
index 8bcb0e7bc52e9..be2b4bfa30044 100644
--- a/lldb/tools/driver/Options.td
+++ b/lldb/tools/driver/Options.td
@@ -110,7 +110,7 @@ def: Flag<["-"], "b">,
   Group;
 
 def source_quietly: F<"source-quietly">,
-  HelpText<"Tells the debugger to execute this one-line lldb command before 
any file has been loaded.">,
+  HelpText<"Tells the debugger not to echo commands while sourcing files or 
one-line commands provided on the command line.">,
   Group;
 def: Flag<["-"], "Q">,
   Alias,



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D113019: [lldb][NFC] Inclusive Language: rename master plan to primary plan

2021-11-02 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment.

Or Coordinating?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113019

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D100810: Use `GNUInstallDirs` to support custom installation dirs. -- LLVM

2021-11-02 Thread John Ericson via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6fd2db04d0f2: Use `GNUInstallDirs` to support custom 
installation dirs. -- LLVM (authored by Ericson2314).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100810

Files:
  clang/tools/scan-build/CMakeLists.txt
  libclc/CMakeLists.txt
  lldb/cmake/modules/FindLibEdit.cmake
  llvm/CMakeLists.txt
  llvm/cmake/modules/AddLLVM.cmake
  llvm/cmake/modules/AddSphinxTarget.cmake
  llvm/cmake/modules/CMakeLists.txt
  llvm/cmake/modules/LLVMInstallSymlink.cmake
  llvm/docs/CMake.rst
  llvm/examples/Bye/CMakeLists.txt
  llvm/include/llvm/CMakeLists.txt
  llvm/tools/llvm-config/BuildVariables.inc.in
  llvm/tools/llvm-config/llvm-config.cpp
  llvm/tools/lto/CMakeLists.txt
  llvm/tools/opt-viewer/CMakeLists.txt
  llvm/tools/remarks-shlib/CMakeLists.txt
  openmp/runtime/src/CMakeLists.txt

Index: openmp/runtime/src/CMakeLists.txt
===
--- openmp/runtime/src/CMakeLists.txt
+++ openmp/runtime/src/CMakeLists.txt
@@ -323,7 +323,7 @@
 install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${LIBOMP_LIB_FILE}\"
   \"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX}/bin)")
 install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${LIBOMP_IMP_LIB_FILE}\"
-  \"${alias}${CMAKE_STATIC_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX}/${OPENMP_INSTALL_LIBDIR})")
+  \"${alias}${CMAKE_STATIC_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${OPENMP_INSTALL_LIBDIR}\")")
   endforeach()
 else()
 
@@ -335,7 +335,7 @@
 foreach(alias IN LISTS LIBOMP_ALIASES)
   install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink \"${LIBOMP_LIB_FILE}\"
 \"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY
-\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${OPENMP_INSTALL_LIBDIR})")
+\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${OPENMP_INSTALL_LIBDIR}\")")
 endforeach()
   endif()
 endif()
Index: llvm/tools/remarks-shlib/CMakeLists.txt
===
--- llvm/tools/remarks-shlib/CMakeLists.txt
+++ llvm/tools/remarks-shlib/CMakeLists.txt
@@ -19,7 +19,7 @@
   endif()
   
   install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/Remarks.h
-DESTINATION include/llvm-c
+DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/llvm-c"
 COMPONENT Remarks)
 
   if (APPLE)
Index: llvm/tools/opt-viewer/CMakeLists.txt
===
--- llvm/tools/opt-viewer/CMakeLists.txt
+++ llvm/tools/opt-viewer/CMakeLists.txt
@@ -8,7 +8,7 @@
 
 foreach (file ${files})
   install(PROGRAMS ${file}
-DESTINATION share/opt-viewer
+DESTINATION "${CMAKE_INSTALL_DATADIR}/opt-viewer"
 COMPONENT opt-viewer)
 endforeach (file)
 
Index: llvm/tools/lto/CMakeLists.txt
===
--- llvm/tools/lto/CMakeLists.txt
+++ llvm/tools/lto/CMakeLists.txt
@@ -33,7 +33,7 @@
 ${SOURCES} DEPENDS intrinsics_gen)
 
 install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h
-  DESTINATION include/llvm-c
+  DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/llvm-c"
   COMPONENT LTO)
 
 if (APPLE)
Index: llvm/tools/llvm-config/llvm-config.cpp
===
--- llvm/tools/llvm-config/llvm-config.cpp
+++ llvm/tools/llvm-config/llvm-config.cpp
@@ -357,10 +357,16 @@
 ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include");
   } else {
 ActivePrefix = CurrentExecPrefix;
-ActiveIncludeDir = ActivePrefix + "/include";
-SmallString<256> path(LLVM_TOOLS_INSTALL_DIR);
-sys::fs::make_absolute(ActivePrefix, path);
-ActiveBinDir = std::string(path.str());
+{
+  SmallString<256> Path(LLVM_INSTALL_INCLUDEDIR);
+  sys::fs::make_absolute(ActivePrefix, Path);
+  ActiveIncludeDir = std::string(Path.str());
+}
+{
+  SmallString<256> Path(LLVM_INSTALL_BINDIR);
+  sys::fs::make_absolute(ActivePrefix, Path);
+  ActiveBinDir = std::string(Path.str());
+}
 ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
 ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
 ActiveIncludeOption = "-I" + ActiveIncludeDir;
Index: llvm/tools/llvm-config/BuildVariables.inc.in
===
--- llvm/tools/llvm-config/BuildVariables.inc.in
+++ llvm/tools/llvm-config/BuildVariables.inc.in
@@ -23,6 +23,8 @@
 #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@"
 #define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
 #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@"
+#define LLVM_INSTALL_BINDIR "@CMAKE_INSTALL_BINDIR@"
+#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@"
 #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
 #define LLVM_SYSTEM_LIBS 

[Lldb-commits] [PATCH] D100810: Use `GNUInstallDirs` to support custom installation dirs. -- LLVM

2021-11-02 Thread Med Ismail Bennani via Phabricator via lldb-commits
mib added a comment.

Hi @Ericson2314, I think this patch broke our macOS lldb-incremental bot on 
GreenDragon (https://green.lab.llvm.org/green/job/lldb-cmake/37560/console).

Could you please take a look ? Thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100810

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D100810: Use `GNUInstallDirs` to support custom installation dirs. -- LLVM

2021-11-02 Thread Saleem Abdulrasool via Phabricator via lldb-commits
compnerd accepted this revision.
compnerd added inline comments.
This revision is now accepted and ready to land.



Comment at: llvm/CMakeLists.txt:289
+set(LLVM_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE STRING
+"Path for binary subdirectory (defaults to 'bin')")
 mark_as_advanced(LLVM_TOOLS_INSTALL_DIR)





Comment at: llvm/docs/CMake.rst:270
+  Defaults to ``share/man``.
+
 .. _LLVM-related variables:

I'm kinda torn on this.  The variables here are all CMake standard and we 
should redirect users to CMake.  Although, this is following the existing 
pattern, so seems reasonable.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100810

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D100810: Use `GNUInstallDirs` to support custom installation dirs. -- LLVM

2021-11-02 Thread John Ericson via Phabricator via lldb-commits
Ericson2314 updated this revision to Diff 383961.
Ericson2314 added a comment.

Fix last comment


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100810

Files:
  clang/tools/scan-build/CMakeLists.txt
  libclc/CMakeLists.txt
  lldb/cmake/modules/FindLibEdit.cmake
  llvm/CMakeLists.txt
  llvm/cmake/modules/AddLLVM.cmake
  llvm/cmake/modules/AddSphinxTarget.cmake
  llvm/cmake/modules/CMakeLists.txt
  llvm/cmake/modules/LLVMInstallSymlink.cmake
  llvm/docs/CMake.rst
  llvm/examples/Bye/CMakeLists.txt
  llvm/include/llvm/CMakeLists.txt
  llvm/tools/llvm-config/BuildVariables.inc.in
  llvm/tools/llvm-config/llvm-config.cpp
  llvm/tools/lto/CMakeLists.txt
  llvm/tools/opt-viewer/CMakeLists.txt
  llvm/tools/remarks-shlib/CMakeLists.txt
  openmp/runtime/src/CMakeLists.txt

Index: openmp/runtime/src/CMakeLists.txt
===
--- openmp/runtime/src/CMakeLists.txt
+++ openmp/runtime/src/CMakeLists.txt
@@ -323,7 +323,7 @@
 install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${LIBOMP_LIB_FILE}\"
   \"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX}/bin)")
 install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${LIBOMP_IMP_LIB_FILE}\"
-  \"${alias}${CMAKE_STATIC_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX}/${OPENMP_INSTALL_LIBDIR})")
+  \"${alias}${CMAKE_STATIC_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${OPENMP_INSTALL_LIBDIR}\")")
   endforeach()
 else()
 
@@ -335,7 +335,7 @@
 foreach(alias IN LISTS LIBOMP_ALIASES)
   install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink \"${LIBOMP_LIB_FILE}\"
 \"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY
-\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${OPENMP_INSTALL_LIBDIR})")
+\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${OPENMP_INSTALL_LIBDIR}\")")
 endforeach()
   endif()
 endif()
Index: llvm/tools/remarks-shlib/CMakeLists.txt
===
--- llvm/tools/remarks-shlib/CMakeLists.txt
+++ llvm/tools/remarks-shlib/CMakeLists.txt
@@ -19,7 +19,7 @@
   endif()
   
   install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/Remarks.h
-DESTINATION include/llvm-c
+DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/llvm-c"
 COMPONENT Remarks)
 
   if (APPLE)
Index: llvm/tools/opt-viewer/CMakeLists.txt
===
--- llvm/tools/opt-viewer/CMakeLists.txt
+++ llvm/tools/opt-viewer/CMakeLists.txt
@@ -8,7 +8,7 @@
 
 foreach (file ${files})
   install(PROGRAMS ${file}
-DESTINATION share/opt-viewer
+DESTINATION "${CMAKE_INSTALL_DATADIR}/opt-viewer"
 COMPONENT opt-viewer)
 endforeach (file)
 
Index: llvm/tools/lto/CMakeLists.txt
===
--- llvm/tools/lto/CMakeLists.txt
+++ llvm/tools/lto/CMakeLists.txt
@@ -33,7 +33,7 @@
 ${SOURCES} DEPENDS intrinsics_gen)
 
 install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h
-  DESTINATION include/llvm-c
+  DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/llvm-c"
   COMPONENT LTO)
 
 if (APPLE)
Index: llvm/tools/llvm-config/llvm-config.cpp
===
--- llvm/tools/llvm-config/llvm-config.cpp
+++ llvm/tools/llvm-config/llvm-config.cpp
@@ -357,10 +357,16 @@
 ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include");
   } else {
 ActivePrefix = CurrentExecPrefix;
-ActiveIncludeDir = ActivePrefix + "/include";
-SmallString<256> path(LLVM_TOOLS_INSTALL_DIR);
-sys::fs::make_absolute(ActivePrefix, path);
-ActiveBinDir = std::string(path.str());
+{
+  SmallString<256> Path(LLVM_INSTALL_INCLUDEDIR);
+  sys::fs::make_absolute(ActivePrefix, Path);
+  ActiveIncludeDir = std::string(Path.str());
+}
+{
+  SmallString<256> Path(LLVM_INSTALL_BINDIR);
+  sys::fs::make_absolute(ActivePrefix, Path);
+  ActiveBinDir = std::string(Path.str());
+}
 ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
 ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
 ActiveIncludeOption = "-I" + ActiveIncludeDir;
Index: llvm/tools/llvm-config/BuildVariables.inc.in
===
--- llvm/tools/llvm-config/BuildVariables.inc.in
+++ llvm/tools/llvm-config/BuildVariables.inc.in
@@ -23,6 +23,8 @@
 #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@"
 #define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
 #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@"
+#define LLVM_INSTALL_BINDIR "@CMAKE_INSTALL_BINDIR@"
+#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@"
 #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
 #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
 #define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@"
Index: 

[Lldb-commits] [PATCH] D99484: Use `GNUInstallDirs` to support custom installation dirs.

2021-11-02 Thread John Ericson via Phabricator via lldb-commits
Ericson2314 updated this revision to Diff 383962.
Ericson2314 added a comment.

Simple rebase


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99484

Files:
  clang-tools-extra/clang-doc/tool/CMakeLists.txt
  clang-tools-extra/clang-include-fixer/find-all-symbols/tool/CMakeLists.txt
  clang-tools-extra/clang-include-fixer/tool/CMakeLists.txt
  clang-tools-extra/clang-tidy/CMakeLists.txt
  clang-tools-extra/clang-tidy/tool/CMakeLists.txt
  clang-tools-extra/modularize/CMakeLists.txt
  clang/CMakeLists.txt
  clang/cmake/modules/AddClang.cmake
  clang/tools/c-index-test/CMakeLists.txt
  clang/tools/clang-format/CMakeLists.txt
  clang/tools/clang-nvlink-wrapper/CMakeLists.txt
  clang/tools/clang-rename/CMakeLists.txt
  clang/tools/libclang/CMakeLists.txt
  clang/tools/scan-build-py/CMakeLists.txt
  clang/tools/scan-build/CMakeLists.txt
  clang/tools/scan-view/CMakeLists.txt
  clang/utils/hmaptool/CMakeLists.txt
  compiler-rt/cmake/base-config-ix.cmake
  flang/CMakeLists.txt
  flang/cmake/modules/AddFlang.cmake
  flang/tools/f18/CMakeLists.txt
  flang/tools/flang-driver/CMakeLists.txt
  libc/CMakeLists.txt
  libcxx/CMakeLists.txt
  libcxx/cmake/Modules/HandleLibCXXABI.cmake
  libcxx/include/CMakeLists.txt
  libcxxabi/CMakeLists.txt
  libunwind/CMakeLists.txt
  lld/CMakeLists.txt
  lld/cmake/modules/AddLLD.cmake
  lld/tools/lld/CMakeLists.txt
  lldb/CMakeLists.txt
  lldb/cmake/modules/AddLLDB.cmake
  lldb/cmake/modules/LLDBConfig.cmake
  mlir/CMakeLists.txt
  mlir/cmake/modules/AddMLIR.cmake
  openmp/CMakeLists.txt
  openmp/libompd/src/CMakeLists.txt
  openmp/runtime/src/CMakeLists.txt
  openmp/tools/multiplex/CMakeLists.txt
  polly/CMakeLists.txt
  polly/cmake/CMakeLists.txt
  polly/lib/External/CMakeLists.txt
  pstl/CMakeLists.txt

Index: pstl/CMakeLists.txt
===
--- pstl/CMakeLists.txt
+++ pstl/CMakeLists.txt
@@ -7,6 +7,8 @@
 #===--===##
 cmake_minimum_required(VERSION 3.13.4)
 
+include(GNUInstallDirs)
+
 set(PARALLELSTL_VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/include/pstl/internal/pstl_config.h")
 file(STRINGS "${PARALLELSTL_VERSION_FILE}" PARALLELSTL_VERSION_SOURCE REGEX "#define _PSTL_VERSION .*$")
 string(REGEX REPLACE "#define _PSTL_VERSION (.*)$" "\\1" PARALLELSTL_VERSION_SOURCE "${PARALLELSTL_VERSION_SOURCE}")
@@ -90,10 +92,10 @@
   "${CMAKE_CURRENT_BINARY_DIR}/ParallelSTLConfigVersion.cmake"
 DESTINATION lib/cmake/ParallelSTL)
 install(DIRECTORY include/
-DESTINATION include
+DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
 PATTERN "*.in" EXCLUDE)
 install(FILES "${PSTL_CONFIG_SITE_PATH}"
-DESTINATION include)
+DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
 
 add_custom_target(install-pstl
   COMMAND "${CMAKE_COMMAND}" -P "${PROJECT_BINARY_DIR}/cmake_install.cmake" -DCOMPONENT=ParallelSTL)
Index: polly/lib/External/CMakeLists.txt
===
--- polly/lib/External/CMakeLists.txt
+++ polly/lib/External/CMakeLists.txt
@@ -290,7 +290,7 @@
 install(DIRECTORY
   ${ISL_SOURCE_DIR}/include/
   ${ISL_BINARY_DIR}/include/
-  DESTINATION include/polly
+  DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/polly"
   FILES_MATCHING
   PATTERN "*.h"
   PATTERN "CMakeFiles" EXCLUDE
Index: polly/cmake/CMakeLists.txt
===
--- polly/cmake/CMakeLists.txt
+++ polly/cmake/CMakeLists.txt
@@ -83,14 +83,15 @@
 set(POLLY_CONFIG_LLVM_CMAKE_DIR "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}")
 set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}")
 set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}")
+get_filename_component(base_includedir "${CMAKE_INSTALL_INCLUDEDIR}" ABSOLUTE BASE_DIR "${POLLY_INSTALL_PREFIX}")
 if (POLLY_BUNDLED_ISL)
   set(POLLY_CONFIG_INCLUDE_DIRS
-"${POLLY_INSTALL_PREFIX}/include"
-"${POLLY_INSTALL_PREFIX}/include/polly"
+"${base_includedir}"
+"${base_includedir}/polly"
 )
 else()
   set(POLLY_CONFIG_INCLUDE_DIRS
-"${POLLY_INSTALL_PREFIX}/include"
+"${base_includedir}"
 ${ISL_INCLUDE_DIRS}
 )
 endif()
@@ -100,12 +101,12 @@
 foreach(tgt IN LISTS POLLY_CONFIG_EXPORTED_TARGETS)
   get_target_property(tgt_type ${tgt} TYPE)
   if (tgt_type STREQUAL "EXECUTABLE")
-set(tgt_prefix "bin/")
+set(tgt_prefix "${CMAKE_INSTALL_FULL_BINDIR}/")
   else()
-set(tgt_prefix "lib/")
+set(tgt_prefix "${CMAKE_INSTALL_FULL_LIBDIR}/")
   endif()
 
-  set(tgt_path "${CMAKE_INSTALL_PREFIX}/${tgt_prefix}$")
+  set(tgt_path "${tgt_prefix}$")
   file(RELATIVE_PATH tgt_path ${POLLY_CONFIG_CMAKE_DIR} ${tgt_path})
 
   if (NOT tgt_type STREQUAL "INTERFACE_LIBRARY")
Index: polly/CMakeLists.txt

[Lldb-commits] [PATCH] D100810: Use `GNUInstallDirs` to support custom installation dirs. -- LLVM

2021-11-02 Thread John Ericson via Phabricator via lldb-commits
Ericson2314 updated this revision to Diff 383602.
Ericson2314 added a comment.

Simple rebase


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100810

Files:
  clang/tools/scan-build/CMakeLists.txt
  libclc/CMakeLists.txt
  lldb/cmake/modules/FindLibEdit.cmake
  llvm/CMakeLists.txt
  llvm/cmake/modules/AddLLVM.cmake
  llvm/cmake/modules/AddSphinxTarget.cmake
  llvm/cmake/modules/CMakeLists.txt
  llvm/cmake/modules/LLVMInstallSymlink.cmake
  llvm/docs/CMake.rst
  llvm/examples/Bye/CMakeLists.txt
  llvm/include/llvm/CMakeLists.txt
  llvm/tools/llvm-config/BuildVariables.inc.in
  llvm/tools/llvm-config/llvm-config.cpp
  llvm/tools/lto/CMakeLists.txt
  llvm/tools/opt-viewer/CMakeLists.txt
  llvm/tools/remarks-shlib/CMakeLists.txt
  openmp/runtime/src/CMakeLists.txt

Index: openmp/runtime/src/CMakeLists.txt
===
--- openmp/runtime/src/CMakeLists.txt
+++ openmp/runtime/src/CMakeLists.txt
@@ -323,7 +323,7 @@
 install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${LIBOMP_LIB_FILE}\"
   \"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX}/bin)")
 install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E copy \"${LIBOMP_IMP_LIB_FILE}\"
-  \"${alias}${CMAKE_STATIC_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \${CMAKE_INSTALL_PREFIX}/${OPENMP_INSTALL_LIBDIR})")
+  \"${alias}${CMAKE_STATIC_LIBRARY_SUFFIX}\" WORKING_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${OPENMP_INSTALL_LIBDIR}\")")
   endforeach()
 else()
 
@@ -335,7 +335,7 @@
 foreach(alias IN LISTS LIBOMP_ALIASES)
   install(CODE "execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink \"${LIBOMP_LIB_FILE}\"
 \"${alias}${LIBOMP_LIBRARY_SUFFIX}\" WORKING_DIRECTORY
-\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${OPENMP_INSTALL_LIBDIR})")
+\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${OPENMP_INSTALL_LIBDIR}\")")
 endforeach()
   endif()
 endif()
Index: llvm/tools/remarks-shlib/CMakeLists.txt
===
--- llvm/tools/remarks-shlib/CMakeLists.txt
+++ llvm/tools/remarks-shlib/CMakeLists.txt
@@ -19,7 +19,7 @@
   endif()
   
   install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/Remarks.h
-DESTINATION include/llvm-c
+DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/llvm-c"
 COMPONENT Remarks)
 
   if (APPLE)
Index: llvm/tools/opt-viewer/CMakeLists.txt
===
--- llvm/tools/opt-viewer/CMakeLists.txt
+++ llvm/tools/opt-viewer/CMakeLists.txt
@@ -8,7 +8,7 @@
 
 foreach (file ${files})
   install(PROGRAMS ${file}
-DESTINATION share/opt-viewer
+DESTINATION "${CMAKE_INSTALL_DATADIR}/opt-viewer"
 COMPONENT opt-viewer)
 endforeach (file)
 
Index: llvm/tools/lto/CMakeLists.txt
===
--- llvm/tools/lto/CMakeLists.txt
+++ llvm/tools/lto/CMakeLists.txt
@@ -33,7 +33,7 @@
 ${SOURCES} DEPENDS intrinsics_gen)
 
 install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h
-  DESTINATION include/llvm-c
+  DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/llvm-c"
   COMPONENT LTO)
 
 if (APPLE)
Index: llvm/tools/llvm-config/llvm-config.cpp
===
--- llvm/tools/llvm-config/llvm-config.cpp
+++ llvm/tools/llvm-config/llvm-config.cpp
@@ -357,10 +357,16 @@
 ("-I" + ActiveIncludeDir + " " + "-I" + ActiveObjRoot + "/include");
   } else {
 ActivePrefix = CurrentExecPrefix;
-ActiveIncludeDir = ActivePrefix + "/include";
-SmallString<256> path(LLVM_TOOLS_INSTALL_DIR);
-sys::fs::make_absolute(ActivePrefix, path);
-ActiveBinDir = std::string(path.str());
+{
+  SmallString<256> Path(LLVM_INSTALL_INCLUDEDIR);
+  sys::fs::make_absolute(ActivePrefix, Path);
+  ActiveIncludeDir = std::string(Path.str());
+}
+{
+  SmallString<256> Path(LLVM_INSTALL_BINDIR);
+  sys::fs::make_absolute(ActivePrefix, Path);
+  ActiveBinDir = std::string(Path.str());
+}
 ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
 ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
 ActiveIncludeOption = "-I" + ActiveIncludeDir;
Index: llvm/tools/llvm-config/BuildVariables.inc.in
===
--- llvm/tools/llvm-config/BuildVariables.inc.in
+++ llvm/tools/llvm-config/BuildVariables.inc.in
@@ -23,6 +23,8 @@
 #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@"
 #define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
 #define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@"
+#define LLVM_INSTALL_BINDIR "@CMAKE_INSTALL_BINDIR@"
+#define LLVM_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@"
 #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
 #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
 #define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@"
Index: 

[Lldb-commits] [PATCH] D99484: Use `GNUInstallDirs` to support custom installation dirs.

2021-11-02 Thread John Ericson via Phabricator via lldb-commits
Ericson2314 updated this revision to Diff 383603.
Ericson2314 added a comment.

Rebase, and catch two more `DESTINATION bin`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99484

Files:
  clang-tools-extra/clang-doc/tool/CMakeLists.txt
  clang-tools-extra/clang-include-fixer/find-all-symbols/tool/CMakeLists.txt
  clang-tools-extra/clang-include-fixer/tool/CMakeLists.txt
  clang-tools-extra/clang-tidy/CMakeLists.txt
  clang-tools-extra/clang-tidy/tool/CMakeLists.txt
  clang-tools-extra/modularize/CMakeLists.txt
  clang/CMakeLists.txt
  clang/cmake/modules/AddClang.cmake
  clang/tools/c-index-test/CMakeLists.txt
  clang/tools/clang-format/CMakeLists.txt
  clang/tools/clang-nvlink-wrapper/CMakeLists.txt
  clang/tools/clang-rename/CMakeLists.txt
  clang/tools/libclang/CMakeLists.txt
  clang/tools/scan-build-py/CMakeLists.txt
  clang/tools/scan-build/CMakeLists.txt
  clang/tools/scan-view/CMakeLists.txt
  clang/utils/hmaptool/CMakeLists.txt
  compiler-rt/cmake/base-config-ix.cmake
  flang/CMakeLists.txt
  flang/cmake/modules/AddFlang.cmake
  flang/tools/f18/CMakeLists.txt
  flang/tools/flang-driver/CMakeLists.txt
  libc/CMakeLists.txt
  libcxx/CMakeLists.txt
  libcxx/cmake/Modules/HandleLibCXXABI.cmake
  libcxx/include/CMakeLists.txt
  libcxxabi/CMakeLists.txt
  libunwind/CMakeLists.txt
  lld/CMakeLists.txt
  lld/cmake/modules/AddLLD.cmake
  lld/tools/lld/CMakeLists.txt
  lldb/CMakeLists.txt
  lldb/cmake/modules/AddLLDB.cmake
  lldb/cmake/modules/LLDBConfig.cmake
  mlir/CMakeLists.txt
  mlir/cmake/modules/AddMLIR.cmake
  openmp/CMakeLists.txt
  openmp/libompd/src/CMakeLists.txt
  openmp/runtime/src/CMakeLists.txt
  openmp/tools/multiplex/CMakeLists.txt
  polly/CMakeLists.txt
  polly/cmake/CMakeLists.txt
  polly/lib/External/CMakeLists.txt
  pstl/CMakeLists.txt

Index: pstl/CMakeLists.txt
===
--- pstl/CMakeLists.txt
+++ pstl/CMakeLists.txt
@@ -7,6 +7,8 @@
 #===--===##
 cmake_minimum_required(VERSION 3.13.4)
 
+include(GNUInstallDirs)
+
 set(PARALLELSTL_VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/include/pstl/internal/pstl_config.h")
 file(STRINGS "${PARALLELSTL_VERSION_FILE}" PARALLELSTL_VERSION_SOURCE REGEX "#define _PSTL_VERSION .*$")
 string(REGEX REPLACE "#define _PSTL_VERSION (.*)$" "\\1" PARALLELSTL_VERSION_SOURCE "${PARALLELSTL_VERSION_SOURCE}")
@@ -90,10 +92,10 @@
   "${CMAKE_CURRENT_BINARY_DIR}/ParallelSTLConfigVersion.cmake"
 DESTINATION lib/cmake/ParallelSTL)
 install(DIRECTORY include/
-DESTINATION include
+DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
 PATTERN "*.in" EXCLUDE)
 install(FILES "${PSTL_CONFIG_SITE_PATH}"
-DESTINATION include)
+DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
 
 add_custom_target(install-pstl
   COMMAND "${CMAKE_COMMAND}" -P "${PROJECT_BINARY_DIR}/cmake_install.cmake" -DCOMPONENT=ParallelSTL)
Index: polly/lib/External/CMakeLists.txt
===
--- polly/lib/External/CMakeLists.txt
+++ polly/lib/External/CMakeLists.txt
@@ -290,7 +290,7 @@
 install(DIRECTORY
   ${ISL_SOURCE_DIR}/include/
   ${ISL_BINARY_DIR}/include/
-  DESTINATION include/polly
+  DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/polly"
   FILES_MATCHING
   PATTERN "*.h"
   PATTERN "CMakeFiles" EXCLUDE
Index: polly/cmake/CMakeLists.txt
===
--- polly/cmake/CMakeLists.txt
+++ polly/cmake/CMakeLists.txt
@@ -83,14 +83,15 @@
 set(POLLY_CONFIG_LLVM_CMAKE_DIR "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}")
 set(POLLY_CONFIG_CMAKE_DIR "${POLLY_INSTALL_PREFIX}/${POLLY_INSTALL_PACKAGE_DIR}")
 set(POLLY_CONFIG_LIBRARY_DIRS "${POLLY_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}")
+get_filename_component(base_includedir "${CMAKE_INSTALL_INCLUDEDIR}" ABSOLUTE BASE_DIR "${POLLY_INSTALL_PREFIX}")
 if (POLLY_BUNDLED_ISL)
   set(POLLY_CONFIG_INCLUDE_DIRS
-"${POLLY_INSTALL_PREFIX}/include"
-"${POLLY_INSTALL_PREFIX}/include/polly"
+"${base_includedir}"
+"${base_includedir}/polly"
 )
 else()
   set(POLLY_CONFIG_INCLUDE_DIRS
-"${POLLY_INSTALL_PREFIX}/include"
+"${base_includedir}"
 ${ISL_INCLUDE_DIRS}
 )
 endif()
@@ -100,12 +101,12 @@
 foreach(tgt IN LISTS POLLY_CONFIG_EXPORTED_TARGETS)
   get_target_property(tgt_type ${tgt} TYPE)
   if (tgt_type STREQUAL "EXECUTABLE")
-set(tgt_prefix "bin/")
+set(tgt_prefix "${CMAKE_INSTALL_FULL_BINDIR}/")
   else()
-set(tgt_prefix "lib/")
+set(tgt_prefix "${CMAKE_INSTALL_FULL_LIBDIR}/")
   endif()
 
-  set(tgt_path "${CMAKE_INSTALL_PREFIX}/${tgt_prefix}$")
+  set(tgt_path "${tgt_prefix}$")
   file(RELATIVE_PATH tgt_path ${POLLY_CONFIG_CMAKE_DIR} ${tgt_path})
 
   if (NOT tgt_type STREQUAL "INTERFACE_LIBRARY")
Index: 

[Lldb-commits] [PATCH] D106339: Add support to generate Sphinx DOCX documentation

2021-11-02 Thread Louis Dionne via Phabricator via lldb-commits
ldionne added a comment.
Herald added a project: Flang.

If there is no plan to move forward with generating `.docx` documentation, can 
we please abandon this review? I'm trying to clean up libc++'s review queue.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106339

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112988: [lldb] fix --source-quietly

2021-11-02 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna added a comment.

In D112988#3103574 , @jingham wrote:

> Ha!  It was apparently so easy to add the test that it wasn't noticeable (at 
> least by me!).
>
> This isn't directly relevant to your patch, since this wasn't behavior you 
> changed, but it seems weird to me to suppress the commands but print their 
> output?  Is that really the behavior we want for -Q?

I hadn't actually thought about it, as what i care about is getting `lldb -Q -o 
'script print(...)' ` to work without any extra output, but now that you 
mention it the behavior here is inconsistent.   For sourcing files, all 
output is suppressed, but for onelines only echo is suppressed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112988

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112988: [lldb] fix --source-quietly

2021-11-02 Thread Jim Ingham via Phabricator via lldb-commits
jingham accepted this revision.
jingham added a comment.
This revision is now accepted and ready to land.

Ha!  It was apparently so easy to add the test that it wasn't noticeable (at 
least by me!).

This isn't directly relevant to your patch, since this wasn't behavior you 
changed, but it seems weird to me to suppress the commands but print their 
output?  Is that really the behavior we want for -Q?

Anyway, that's more fuel for thought than something you need to address in this 
patch, where you're just making existing behavior work.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112988

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112988: [lldb] fix --source-quietly

2021-11-02 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna marked an inline comment as done.
lawrence_danna added a comment.

In D112988#3103463 , @jingham wrote:

> There was one typo I pointed out, and it would be good to add a test.  I'm 
> sure this worked at some point, but wasn't tested so it was broken without 
> anybody noticing.  We want to make sure that doesn't happen again... It 
> should be easy to write a Shell test case that just runs an lldb with the -Q 
> option, sources a file and checks that you don't see output from it.

I did, it's `TestQuiet.test`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112988

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112988: [lldb] fix --source-quietly

2021-11-02 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna updated this revision to Diff 384155.
lawrence_danna added a comment.

fix typo


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112988

Files:
  lldb/docs/man/lldb.rst
  lldb/test/Shell/Driver/TestQuiet.test
  lldb/tools/driver/Driver.cpp
  lldb/tools/driver/Options.td


Index: lldb/tools/driver/Options.td
===
--- lldb/tools/driver/Options.td
+++ lldb/tools/driver/Options.td
@@ -114,7 +114,7 @@
   Group;
 
 def source_quietly: F<"source-quietly">,
-  HelpText<"Tells the debugger to execute this one-line lldb command before 
any file has been loaded.">,
+  HelpText<"Tells the debugger not to echo commands while sourcing files or 
one-line commands provided on the command line.">,
   Group;
 def: Flag<["-"], "Q">,
   Alias,
Index: lldb/tools/driver/Driver.cpp
===
--- lldb/tools/driver/Driver.cpp
+++ lldb/tools/driver/Driver.cpp
@@ -627,6 +627,7 @@
 options.SetSpawnThread(false);
 options.SetStopOnError(true);
 options.SetStopOnCrash(m_option_data.m_batch);
+options.SetEchoCommands(!m_option_data.m_source_quietly);
 
 SBCommandInterpreterRunResult results =
 m_debugger.RunCommandInterpreter(options);
Index: lldb/test/Shell/Driver/TestQuiet.test
===
--- /dev/null
+++ lldb/test/Shell/Driver/TestQuiet.test
@@ -0,0 +1,7 @@
+RUN: %lldb -b -Q -o "expr 40 + 2" | FileCheck %s
+RUN: %lldb -b -Q -O "expr 40 + 2" | FileCheck %s
+
+CHECK-NOT: expr
+CHECK-NOT: lldb
+CHECK-NOT: source
+CHECK: 42
\ No newline at end of file
Index: lldb/docs/man/lldb.rst
===
--- lldb/docs/man/lldb.rst
+++ lldb/docs/man/lldb.rst
@@ -111,7 +111,7 @@
 
 .. option:: --source-quietly
 
- Tells the debugger to execute this one-line lldb command before any file has 
been loaded.
+ Tells the debugger not to echo commands while sourcing files or one-line 
commands provided on the command line.
 
 .. option:: --source 
 


Index: lldb/tools/driver/Options.td
===
--- lldb/tools/driver/Options.td
+++ lldb/tools/driver/Options.td
@@ -114,7 +114,7 @@
   Group;
 
 def source_quietly: F<"source-quietly">,
-  HelpText<"Tells the debugger to execute this one-line lldb command before any file has been loaded.">,
+  HelpText<"Tells the debugger not to echo commands while sourcing files or one-line commands provided on the command line.">,
   Group;
 def: Flag<["-"], "Q">,
   Alias,
Index: lldb/tools/driver/Driver.cpp
===
--- lldb/tools/driver/Driver.cpp
+++ lldb/tools/driver/Driver.cpp
@@ -627,6 +627,7 @@
 options.SetSpawnThread(false);
 options.SetStopOnError(true);
 options.SetStopOnCrash(m_option_data.m_batch);
+options.SetEchoCommands(!m_option_data.m_source_quietly);
 
 SBCommandInterpreterRunResult results =
 m_debugger.RunCommandInterpreter(options);
Index: lldb/test/Shell/Driver/TestQuiet.test
===
--- /dev/null
+++ lldb/test/Shell/Driver/TestQuiet.test
@@ -0,0 +1,7 @@
+RUN: %lldb -b -Q -o "expr 40 + 2" | FileCheck %s
+RUN: %lldb -b -Q -O "expr 40 + 2" | FileCheck %s
+
+CHECK-NOT: expr
+CHECK-NOT: lldb
+CHECK-NOT: source
+CHECK: 42
\ No newline at end of file
Index: lldb/docs/man/lldb.rst
===
--- lldb/docs/man/lldb.rst
+++ lldb/docs/man/lldb.rst
@@ -111,7 +111,7 @@
 
 .. option:: --source-quietly
 
- Tells the debugger to execute this one-line lldb command before any file has been loaded.
+ Tells the debugger not to echo commands while sourcing files or one-line commands provided on the command line.
 
 .. option:: --source 
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D113019: [lldb][NFC] Inclusive Language: rename master plan to primary plan

2021-11-02 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment.

Maybe "Controlling" plan would be better?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113019

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D113019: [lldb][NFC] Inclusive Language: rename master plan to primary plan

2021-11-02 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment.

I have no problem with adopting more inclusive language, but "Primary" doesn't 
express the right concept.  The "master" plan is one that coordinates other 
plans.  There can be many "master plans" on the stack at any one time during a 
complex set of stepping operations, each distinguished in that it is in charge 
of the plans that it enqueued.  So it isn't Primary in a real sense.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113019

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112988: [lldb] fix --source-quietly

2021-11-02 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment.

This is great, thanks!

There was one typo I pointed out, and it would be good to add a test.  I'm sure 
this worked at some point, but wasn't tested so it was broken without anybody 
noticing.  We want to make sure that doesn't happen again... It should be easy 
to write a Shell test case that just runs an lldb with the -Q option, sources a 
file and checks that you don't see output from it.




Comment at: lldb/tools/driver/Options.td:117
 def source_quietly: F<"source-quietly">,
-  HelpText<"Tells the debugger to execute this one-line lldb command before 
any file has been loaded.">,
+  HelpText<"Tells the debugger not to echo commands while sourcing filles or 
one-line commands provided on the command line.">,
   Group;

filles -> files


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112988

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112973: [lldb] make it easier to find LLDB's python

2021-11-02 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment.

I still don't think adding python specific ways of getting at generic 
ScriptInterpreter features (e.g. the path to the lldb module for that script 
interpreter - not your fault but... - and the path to the script's native 
script runner binary) with language specific affordances isn't one we should 
continue...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112973

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112931: Fix mixed disassembly showing source lines for "line 0"

2021-11-02 Thread Ted Woodward via Phabricator via lldb-commits
ted added inline comments.



Comment at: lldb/test/Shell/Commands/command-disassemble-mixed.c:11-18
+int main(int argc, char **argv)
+{
+  int i;
+
+  for (i=0; i < 10; ++i) ;
+
+  return 0;

labath wrote:
> ted wrote:
> > labath wrote:
> > > ted wrote:
> > > > clayborg wrote:
> > > > > are we guaranteed to get some debug info with line zero in it with 
> > > > > this example?
> > > > I tried this with x86 Linux clang 12.0 and our internal Hexagon clang; 
> > > > both gave me a line zero.
> > > > 
> > > > I ran this test on Ubuntu 18 using x86 Linux clang 12.0 and the test 
> > > > failed without the change and passed with it.
> > > Nonetheless, it would be better to test this via a .s file with some 
> > > explicit .line directives. That way you could check for the actual 
> > > command output instead of the absence of some string.
> > > 
> > > (Negative tests like this are very brittle, as they can be rendered 
> > > ineffective by a change in the capitalization of the error message.)
> > The test is specifically "the first line of the source file is not 
> > displayed when we do dis -m". The only way I can think of testing this is a 
> > negative test.  If anyone can think of a better way, I'm happy to do that.
> > Fortunately, the message we're testing against is contained in the test, so 
> > it avoids the brittleness of changes to text in the tool.
> I missed the fact that this is a string coming from the test. That makes it 
> better indeed, though I'd still recommend a .s file, as that also removes the 
> dependence on the compiler producing a particular debug_line sequence.
> 
> Regarding the negative test, that's easy to avoid with a .s file, as you can 
> assert exact command output. Something like this ought to do it (the test 
> input should be alright, the assertions are made up).
> ```
> # RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux %s -o %t
> # RUN: lldb %t -o "disassemble -m -n main" | FileCheck %s
> 
> # CHECK: disassemble -m -n main
> # CHECK-NEXT: first line of disassembly
> # CHECK-NEXT: second line of disassembly
> # CHECK-NEXT: etc.
> 
> .text
> .globl  main
> .type   main,@function
> main:
> .file   1 "" "mytest.s"
> .loc1 10
> nop
> .loc1 0
> nop
> .loc1 20
> nop
> .Lfunc_end0:
> .size   main, .Lfunc_end0-main
> # -- End function
> .section.debug_abbrev,"",@progbits
> .byte   1   # Abbreviation Code
> .byte   17  # DW_TAG_compile_unit
> .byte   0   # DW_CHILDREN_no
> .byte   37  # DW_AT_producer
> .byte   8   # DW_FORM_string
> .byte   19  # DW_AT_language
> .byte   5   # DW_FORM_data2
> .byte   3   # DW_AT_name
> .byte   8   # DW_FORM_string
> .byte   16  # DW_AT_stmt_list
> .byte   23  # DW_FORM_sec_offset
> .byte   17  # DW_AT_low_pc
> .byte   1   # DW_FORM_addr
> .byte   18  # DW_AT_high_pc
> .byte   6   # DW_FORM_data4
> .byte   0   # EOM(1)
> .byte   0   # EOM(2)
> .byte   0   # EOM(3)
> .section.debug_info,"",@progbits
> .Lcu_begin0:
> .long   .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
> .Ldebug_info_start0:
> .short  4   # DWARF version number
> .long   .debug_abbrev   # Offset Into Abbrev. Section
> .byte   8   # Address Size (in bytes)
> .byte   1   # Abbrev [1] 0xb:0x1f 
> DW_TAG_compile_unit
> .asciz  "Hand-written DWARF"# DW_AT_producer
> .short  12  # DW_AT_language
> .asciz  "mytest.s"  # DW_AT_name
> .long   .Lline_table_start0 # DW_AT_stmt_list
> .quad   main# DW_AT_low_pc
> .long   .Lfunc_end0-main# DW_AT_high_pc
> .Ldebug_info_end0:
> .section.debug_line,"",@progbits
> .Lline_table_start0:
> 
My issues with the above:

  - I want to test a c source file, not an assembly file.
  - This assumes the user's toolchain supports x86-64, which many downstream 
toolchains do not. I'd rather the test be core-agnostic, which is why I didn't 
check any actual disassembly.






Repository:
  rG LLVM 

[Lldb-commits] [PATCH] D112863: [lldb][NFC] avoid unnecessary roundtrips between different string types

2021-11-02 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

Thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112863

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112931: Fix mixed disassembly showing source lines for "line 0"

2021-11-02 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: lldb/test/Shell/Commands/command-disassemble-mixed.c:11-18
+int main(int argc, char **argv)
+{
+  int i;
+
+  for (i=0; i < 10; ++i) ;
+
+  return 0;

ted wrote:
> labath wrote:
> > ted wrote:
> > > clayborg wrote:
> > > > are we guaranteed to get some debug info with line zero in it with this 
> > > > example?
> > > I tried this with x86 Linux clang 12.0 and our internal Hexagon clang; 
> > > both gave me a line zero.
> > > 
> > > I ran this test on Ubuntu 18 using x86 Linux clang 12.0 and the test 
> > > failed without the change and passed with it.
> > Nonetheless, it would be better to test this via a .s file with some 
> > explicit .line directives. That way you could check for the actual command 
> > output instead of the absence of some string.
> > 
> > (Negative tests like this are very brittle, as they can be rendered 
> > ineffective by a change in the capitalization of the error message.)
> The test is specifically "the first line of the source file is not displayed 
> when we do dis -m". The only way I can think of testing this is a negative 
> test.  If anyone can think of a better way, I'm happy to do that.
> Fortunately, the message we're testing against is contained in the test, so 
> it avoids the brittleness of changes to text in the tool.
I missed the fact that this is a string coming from the test. That makes it 
better indeed, though I'd still recommend a .s file, as that also removes the 
dependence on the compiler producing a particular debug_line sequence.

Regarding the negative test, that's easy to avoid with a .s file, as you can 
assert exact command output. Something like this ought to do it (the test input 
should be alright, the assertions are made up).
```
# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux %s -o %t
# RUN: lldb %t -o "disassemble -m -n main" | FileCheck %s

# CHECK: disassemble -m -n main
# CHECK-NEXT: first line of disassembly
# CHECK-NEXT: second line of disassembly
# CHECK-NEXT: etc.

.text
.globl  main
.type   main,@function
main:
.file   1 "" "mytest.s"
.loc1 10
nop
.loc1 0
nop
.loc1 20
nop
.Lfunc_end0:
.size   main, .Lfunc_end0-main
# -- End function
.section.debug_abbrev,"",@progbits
.byte   1   # Abbreviation Code
.byte   17  # DW_TAG_compile_unit
.byte   0   # DW_CHILDREN_no
.byte   37  # DW_AT_producer
.byte   8   # DW_FORM_string
.byte   19  # DW_AT_language
.byte   5   # DW_FORM_data2
.byte   3   # DW_AT_name
.byte   8   # DW_FORM_string
.byte   16  # DW_AT_stmt_list
.byte   23  # DW_FORM_sec_offset
.byte   17  # DW_AT_low_pc
.byte   1   # DW_FORM_addr
.byte   18  # DW_AT_high_pc
.byte   6   # DW_FORM_data4
.byte   0   # EOM(1)
.byte   0   # EOM(2)
.byte   0   # EOM(3)
.section.debug_info,"",@progbits
.Lcu_begin0:
.long   .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit
.Ldebug_info_start0:
.short  4   # DWARF version number
.long   .debug_abbrev   # Offset Into Abbrev. Section
.byte   8   # Address Size (in bytes)
.byte   1   # Abbrev [1] 0xb:0x1f 
DW_TAG_compile_unit
.asciz  "Hand-written DWARF"# DW_AT_producer
.short  12  # DW_AT_language
.asciz  "mytest.s"  # DW_AT_name
.long   .Lline_table_start0 # DW_AT_stmt_list
.quad   main# DW_AT_low_pc
.long   .Lfunc_end0-main# DW_AT_high_pc
.Ldebug_info_end0:
.section.debug_line,"",@progbits
.Lline_table_start0:



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112931

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] adf5e9c - [lldb] Remove ConstString from TypeSystem and REPL plugin names

2021-11-02 Thread Pavel Labath via lldb-commits

Author: Pavel Labath
Date: 2021-11-02T16:13:52+01:00
New Revision: adf5e9c9b67a60727e02a4e83a3d7a9373579574

URL: 
https://github.com/llvm/llvm-project/commit/adf5e9c9b67a60727e02a4e83a3d7a9373579574
DIFF: 
https://github.com/llvm/llvm-project/commit/adf5e9c9b67a60727e02a4e83a3d7a9373579574.diff

LOG: [lldb] Remove ConstString from TypeSystem and REPL plugin names

Added: 


Modified: 
lldb/include/lldb/Core/PluginManager.h
lldb/source/Core/PluginManager.cpp
lldb/source/Plugins/REPL/Clang/ClangREPL.h
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h

Removed: 




diff  --git a/lldb/include/lldb/Core/PluginManager.h 
b/lldb/include/lldb/Core/PluginManager.h
index cd720d5a9d0fc..7dc99bf3e7558 100644
--- a/lldb/include/lldb/Core/PluginManager.h
+++ b/lldb/include/lldb/Core/PluginManager.h
@@ -426,7 +426,7 @@ class PluginManager {
   GetInstrumentationRuntimeCreateCallbackAtIndex(uint32_t idx);
 
   // TypeSystem
-  static bool RegisterPlugin(ConstString name, const char *description,
+  static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
  TypeSystemCreateInstance create_callback,
  LanguageSet supported_languages_for_types,
  LanguageSet supported_languages_for_expressions);
@@ -441,7 +441,7 @@ class PluginManager {
   static LanguageSet GetAllTypeSystemSupportedLanguagesForExpressions();
 
   // REPL
-  static bool RegisterPlugin(ConstString name, const char *description,
+  static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
  REPLCreateInstance create_callback,
  LanguageSet supported_languages);
 

diff  --git a/lldb/source/Core/PluginManager.cpp 
b/lldb/source/Core/PluginManager.cpp
index 5ba427a24ed45..90b1a626bd1ae 100644
--- a/lldb/source/Core/PluginManager.cpp
+++ b/lldb/source/Core/PluginManager.cpp
@@ -1291,13 +1291,13 @@ static TypeSystemInstances () {
 }
 
 bool PluginManager::RegisterPlugin(
-ConstString name, const char *description,
+llvm::StringRef name, llvm::StringRef description,
 TypeSystemCreateInstance create_callback,
 LanguageSet supported_languages_for_types,
 LanguageSet supported_languages_for_expressions) {
   return GetTypeSystemInstances().RegisterPlugin(
-  name, description, create_callback, supported_languages_for_types,
-  supported_languages_for_expressions);
+  ConstString(name), description.str().c_str(), create_callback,
+  supported_languages_for_types, supported_languages_for_expressions);
 }
 
 bool PluginManager::UnregisterPlugin(TypeSystemCreateInstance create_callback) 
{
@@ -1344,11 +1344,12 @@ static REPLInstances () {
   return g_instances;
 }
 
-bool PluginManager::RegisterPlugin(ConstString name, const char *description,
+bool PluginManager::RegisterPlugin(llvm::StringRef name, llvm::StringRef 
description,
REPLCreateInstance create_callback,
LanguageSet supported_languages) {
-  return GetREPLInstances().RegisterPlugin(name, description, create_callback,
-   supported_languages);
+  return GetREPLInstances().RegisterPlugin(
+  ConstString(name), description.str().c_str(), create_callback,
+  supported_languages);
 }
 
 bool PluginManager::UnregisterPlugin(REPLCreateInstance create_callback) {

diff  --git a/lldb/source/Plugins/REPL/Clang/ClangREPL.h 
b/lldb/source/Plugins/REPL/Clang/ClangREPL.h
index 3666a53a2ce39..07b7f73b1fafb 100644
--- a/lldb/source/Plugins/REPL/Clang/ClangREPL.h
+++ b/lldb/source/Plugins/REPL/Clang/ClangREPL.h
@@ -28,9 +28,7 @@ class ClangREPL : public REPL {
  Debugger *debugger, Target *target,
  const char *repl_options);
 
-  static lldb_private::ConstString GetPluginNameStatic() {
-return ConstString("ClangREPL");
-  }
+  static llvm::StringRef GetPluginNameStatic() { return "ClangREPL"; }
 
 protected:
   Status DoInitialization() override;

diff  --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp 
b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index 9beccf30f94be..72b47d04b9c48 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -570,10 +570,6 @@ TypeSystemClang::TypeSystemClang(llvm::StringRef name,
 // Destructor
 TypeSystemClang::~TypeSystemClang() { Finalize(); }
 
-ConstString TypeSystemClang::GetPluginNameStatic() {
-  return ConstString("clang");
-}
-
 lldb::TypeSystemSP TypeSystemClang::CreateInstance(lldb::LanguageType language,
lldb_private::Module 
*module,
  

[Lldb-commits] [PATCH] D112931: Fix mixed disassembly showing source lines for "line 0"

2021-11-02 Thread Ted Woodward via Phabricator via lldb-commits
ted added inline comments.



Comment at: lldb/test/Shell/Commands/command-disassemble-mixed.c:11-18
+int main(int argc, char **argv)
+{
+  int i;
+
+  for (i=0; i < 10; ++i) ;
+
+  return 0;

labath wrote:
> ted wrote:
> > clayborg wrote:
> > > are we guaranteed to get some debug info with line zero in it with this 
> > > example?
> > I tried this with x86 Linux clang 12.0 and our internal Hexagon clang; both 
> > gave me a line zero.
> > 
> > I ran this test on Ubuntu 18 using x86 Linux clang 12.0 and the test failed 
> > without the change and passed with it.
> Nonetheless, it would be better to test this via a .s file with some explicit 
> .line directives. That way you could check for the actual command output 
> instead of the absence of some string.
> 
> (Negative tests like this are very brittle, as they can be rendered 
> ineffective by a change in the capitalization of the error message.)
The test is specifically "the first line of the source file is not displayed 
when we do dis -m". The only way I can think of testing this is a negative 
test.  If anyone can think of a better way, I'm happy to do that.
Fortunately, the message we're testing against is contained in the test, so it 
avoids the brittleness of changes to text in the tool.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112931

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112165: Cleanup a few more PR36048 skips

2021-11-02 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Actually, I've successfully purged most of this from my memory. However, what 
Raphael said is consistent with what little I remember.

It would be better if the gmodules tests had their own (semi-)dedicated tests 
that were independent of the system libraries. Then, they could run pretty much 
anywhere.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112165

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 6fd2db0 - Use `GNUInstallDirs` to support custom installation dirs. -- LLVM

2021-11-02 Thread John Ericson via lldb-commits

Author: John Ericson
Date: 2021-11-02T10:23:30-04:00
New Revision: 6fd2db04d0f22ea22c5317d98ce2126aa64b6a73

URL: 
https://github.com/llvm/llvm-project/commit/6fd2db04d0f22ea22c5317d98ce2126aa64b6a73
DIFF: 
https://github.com/llvm/llvm-project/commit/6fd2db04d0f22ea22c5317d98ce2126aa64b6a73.diff

LOG: Use `GNUInstallDirs` to support custom installation dirs. -- LLVM

This is a new draft of D28234. I previously did the unorthodox thing of
pushing to it when I wasn't the original author, but since this version

- Uses `GNUInstallDirs`, rather than mimics it, as the original author
  was hesitant to do but others requested.

- Is much broader, effecting many more projects than LLVM itself.

I figured it was time to make a new revision.

I am using this patch (and many back-ports) as the basis of
https://github.com/NixOS/nixpkgs/pull/111487 for my distro (NixOS). It
looked like people were generally on board in D28234, but I make note of
this here in case extra motivation is useful.

---

As pointed out in the original issue, a central tension is that LLVM
already has some partial support for these sorts of things. For example
`LLVM_LIBDIR_SUFFIX`, or `COMPILER_RT_INSTALL_PATH`. Because it's not
quite clear yet what to do about those, we are holding off on changing
libdirs and `compiler-rt`. for this initial PR.

---

On the advice of @lebedev.ri, I am splitting this up a bit per
subproject, starting with LLVM. To allow it to be more easily reviewed. This 
and the subsequent patch must be landed together, as this will not build alone. 
But the rest can be landed on their own.

Reviewed By: compnerd

Differential Revision: https://reviews.llvm.org/D100810

Added: 


Modified: 
clang/tools/scan-build/CMakeLists.txt
libclc/CMakeLists.txt
lldb/cmake/modules/FindLibEdit.cmake
llvm/CMakeLists.txt
llvm/cmake/modules/AddLLVM.cmake
llvm/cmake/modules/AddSphinxTarget.cmake
llvm/cmake/modules/CMakeLists.txt
llvm/cmake/modules/LLVMInstallSymlink.cmake
llvm/docs/CMake.rst
llvm/examples/Bye/CMakeLists.txt
llvm/include/llvm/CMakeLists.txt
llvm/tools/llvm-config/BuildVariables.inc.in
llvm/tools/llvm-config/llvm-config.cpp
llvm/tools/lto/CMakeLists.txt
llvm/tools/opt-viewer/CMakeLists.txt
llvm/tools/remarks-shlib/CMakeLists.txt
openmp/runtime/src/CMakeLists.txt

Removed: 




diff  --git a/clang/tools/scan-build/CMakeLists.txt 
b/clang/tools/scan-build/CMakeLists.txt
index ec0702d76f184..74334e53c9b18 100644
--- a/clang/tools/scan-build/CMakeLists.txt
+++ b/clang/tools/scan-build/CMakeLists.txt
@@ -66,16 +66,16 @@ if(CLANG_INSTALL_SCANBUILD)
   endforeach()
 
   foreach(ManPage ${ManPages})
-add_custom_command(OUTPUT 
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/${ManPage}
+add_custom_command(OUTPUT 
"${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/${ManPage}"
COMMAND ${CMAKE_COMMAND} -E make_directory
- ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1
+ "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1"
COMMAND ${CMAKE_COMMAND} -E copy
- ${CMAKE_CURRENT_SOURCE_DIR}/man/${ManPage}
- ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/
+ "${CMAKE_CURRENT_SOURCE_DIR}/man/${ManPage}"
+ "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/"
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/man/${ManPage})
-list(APPEND Depends 
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/${ManPage})
+list(APPEND Depends 
"${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/man1/${ManPage}")
 install(PROGRAMS man/${ManPage}
-DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
+DESTINATION "${CMAKE_INSTALL_MANDIR}/man1"
 COMPONENT scan-build)
   endforeach()
 

diff  --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index ec39ea63f2d02..e90e0fd852012 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -183,8 +183,8 @@ endif()
 
 # pkg-config file
 configure_file( libclc.pc.in libclc.pc @ONLY )
-install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libclc.pc DESTINATION 
${CMAKE_INSTALL_DATADIR}/pkgconfig )
-install( DIRECTORY generic/include/clc DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} 
)
+install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libclc.pc DESTINATION 
"${CMAKE_INSTALL_DATADIR}/pkgconfig" )
+install( DIRECTORY generic/include/clc DESTINATION 
"${CMAKE_INSTALL_INCLUDEDIR}" )
 
 if( ENABLE_RUNTIME_SUBNORMAL )
add_library( subnormal_use_default STATIC
@@ -192,7 +192,7 @@ if( ENABLE_RUNTIME_SUBNORMAL )
add_library( subnormal_disable STATIC
generic/lib/subnormal_disable.ll )
install( TARGETS subnormal_use_default subnormal_disable ARCHIVE
-   DESTINATION ${CMAKE_INSTALL_DATADIR}/clc )
+   

[Lldb-commits] [PATCH] D113019: [lldb][NFC] Inclusive Language: rename master plan to primary plan

2021-11-02 Thread Quinn Pham via Phabricator via lldb-commits
quinnp created this revision.
quinnp requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

[NFC] As part of using inclusive language within the llvm project, this patch
renames master plan to primary plan in lldb.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113019

Files:
  lldb/docs/use/python-reference.rst
  lldb/include/lldb/Target/Thread.h
  lldb/include/lldb/Target/ThreadPlan.h
  lldb/include/lldb/Target/ThreadPlanStack.h
  lldb/source/API/SBThread.cpp
  lldb/source/Commands/CommandObjectThread.cpp
  lldb/source/Expression/FunctionCaller.cpp
  lldb/source/Target/Process.cpp
  lldb/source/Target/StopInfo.cpp
  lldb/source/Target/Thread.cpp
  lldb/source/Target/ThreadPlan.cpp
  lldb/source/Target/ThreadPlanBase.cpp
  lldb/source/Target/ThreadPlanCallFunction.cpp
  lldb/source/Target/ThreadPlanCallOnFunctionExit.cpp
  lldb/source/Target/ThreadPlanCallUserExpression.cpp
  lldb/source/Target/ThreadPlanPython.cpp
  lldb/source/Target/ThreadPlanStack.cpp

Index: lldb/source/Target/ThreadPlanStack.cpp
===
--- lldb/source/Target/ThreadPlanStack.cpp
+++ lldb/source/Target/ThreadPlanStack.cpp
@@ -213,35 +213,35 @@
   return;
 }
 
-void ThreadPlanStack::DiscardConsultingMasterPlans() {
+void ThreadPlanStack::DiscardConsultingPrimaryPlans() {
   std::lock_guard guard(m_stack_mutex);
   while (true) {
-int master_plan_idx;
+int primary_plan_idx;
 bool discard = true;
 
-// Find the first master plan, see if it wants discarding, and if yes
+// Find the first primary plan, see if it wants discarding, and if yes
 // discard up to it.
-for (master_plan_idx = m_plans.size() - 1; master_plan_idx >= 0;
- master_plan_idx--) {
-  if (m_plans[master_plan_idx]->IsMasterPlan()) {
-discard = m_plans[master_plan_idx]->OkayToDiscard();
+for (primary_plan_idx = m_plans.size() - 1; primary_plan_idx >= 0;
+ primary_plan_idx--) {
+  if (m_plans[primary_plan_idx]->IsPrimaryPlan()) {
+discard = m_plans[primary_plan_idx]->OkayToDiscard();
 break;
   }
 }
 
-// If the master plan doesn't want to get discarded, then we're done.
+// If the primary plan doesn't want to get discarded, then we're done.
 if (!discard)
   return;
 
 // First pop all the dependent plans:
-for (int i = m_plans.size() - 1; i > master_plan_idx; i--) {
+for (int i = m_plans.size() - 1; i > primary_plan_idx; i--) {
   DiscardPlan();
 }
 
-// Now discard the master plan itself.
+// Now discard the primary plan itself.
 // The bottom-most plan never gets discarded.  "OkayToDiscard" for it
 // means discard it's dependent plans, but not it...
-if (master_plan_idx > 0) {
+if (primary_plan_idx > 0) {
   DiscardPlan();
 }
   }
Index: lldb/source/Target/ThreadPlanPython.cpp
===
--- lldb/source/Target/ThreadPlanPython.cpp
+++ lldb/source/Target/ThreadPlanPython.cpp
@@ -31,7 +31,7 @@
  eVoteNoOpinion, eVoteNoOpinion),
   m_class_name(class_name), m_args_data(args_data), m_did_push(false),
   m_stop_others(false) {
-  SetIsMasterPlan(true);
+  SetIsPrimaryPlan(true);
   SetOkayToDiscard(true);
   SetPrivate(false);
 }
Index: lldb/source/Target/ThreadPlanCallUserExpression.cpp
===
--- lldb/source/Target/ThreadPlanCallUserExpression.cpp
+++ lldb/source/Target/ThreadPlanCallUserExpression.cpp
@@ -39,7 +39,7 @@
   m_user_expression_sp(user_expression_sp) {
   // User expressions are generally "User generated" so we should set them up
   // to stop when done.
-  SetIsMasterPlan(true);
+  SetIsPrimaryPlan(true);
   SetOkayToDiscard(false);
 }
 
Index: lldb/source/Target/ThreadPlanCallOnFunctionExit.cpp
===
--- lldb/source/Target/ThreadPlanCallOnFunctionExit.cpp
+++ lldb/source/Target/ThreadPlanCallOnFunctionExit.cpp
@@ -18,7 +18,7 @@
  ),
   m_callback(callback) {
   // We are not a user-generated plan.
-  SetIsMasterPlan(false);
+  SetIsPrimaryPlan(false);
 }
 
 void ThreadPlanCallOnFunctionExit::DidPush() {
Index: lldb/source/Target/ThreadPlanCallFunction.cpp
===
--- lldb/source/Target/ThreadPlanCallFunction.cpp
+++ lldb/source/Target/ThreadPlanCallFunction.cpp
@@ -33,7 +33,7 @@
 bool ThreadPlanCallFunction::ConstructorSetup(
 Thread , ABI *, lldb::addr_t _load_addr,
 lldb::addr_t _load_addr) {
-  SetIsMasterPlan(true);
+  SetIsPrimaryPlan(true);
   SetOkayToDiscard(false);
   SetPrivate(true);
 
Index: lldb/source/Target/ThreadPlanBase.cpp
===
--- lldb/source/Target/ThreadPlanBase.cpp
+++ 

[Lldb-commits] [PATCH] D112931: Fix mixed disassembly showing source lines for "line 0"

2021-11-02 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: lldb/test/Shell/Commands/command-disassemble-mixed.c:11-18
+int main(int argc, char **argv)
+{
+  int i;
+
+  for (i=0; i < 10; ++i) ;
+
+  return 0;

ted wrote:
> clayborg wrote:
> > are we guaranteed to get some debug info with line zero in it with this 
> > example?
> I tried this with x86 Linux clang 12.0 and our internal Hexagon clang; both 
> gave me a line zero.
> 
> I ran this test on Ubuntu 18 using x86 Linux clang 12.0 and the test failed 
> without the change and passed with it.
Nonetheless, it would be better to test this via a .s file with some explicit 
.line directives. That way you could check for the actual command output 
instead of the absence of some string.

(Negative tests like this are very brittle, as they can be rendered ineffective 
by a change in the capitalization of the error message.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112931

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112439: normalize file path when searching the source map

2021-11-02 Thread Xu Jun via Phabricator via lldb-commits
xujuntwt95329 marked 7 inline comments as done.
xujuntwt95329 added a comment.

I have submitted a new patch here: 
https://reviews.llvm.org/D113011

Thanks


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112439

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D113011: [lldb] make the code prettier in FindFileTest.cpp

2021-11-02 Thread Xu Jun via Phabricator via lldb-commits
xujuntwt95329 added a comment.

Thanks to @teemperor's comments in https://reviews.llvm.org/D112439


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113011

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D113011: [lldb] make the code prettier in FindFileTest.cpp

2021-11-02 Thread Xu Jun via Phabricator via lldb-commits
xujuntwt95329 created this revision.
xujuntwt95329 requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113011

Files:
  lldb/unittests/Target/FindFileTest.cpp


Index: lldb/unittests/Target/FindFileTest.cpp
===
--- lldb/unittests/Target/FindFileTest.cpp
+++ lldb/unittests/Target/FindFileTest.cpp
@@ -6,6 +6,7 @@
 //
 
//===--===//
 
+#include "TestingSupport/SubsystemRAII.h"
 #include "TestingSupport/TestUtilities.h"
 #include "lldb/Host/FileSystem.h"
 #include "lldb/Host/HostInfo.h"
@@ -24,22 +25,13 @@
 namespace {
 struct Matches {
   FileSpec original;
-  llvm::StringRef remapped;
-  Matches(const char *o, const char *r) : original(o), remapped(r) {}
-  Matches(const char *o, llvm::sys::path::Style style, const char *r)
+  std::string remapped;
+  Matches(llvm::StringRef o, llvm::sys::path::Style style, llvm::StringRef r)
   : original(o, style), remapped(r) {}
 };
 
 class FindFileTest : public testing::Test {
-public:
-  void SetUp() override {
-FileSystem::Initialize();
-HostInfo::Initialize();
-  }
-  void TearDown() override {
-HostInfo::Terminate();
-FileSystem::Terminate();
-  }
+  SubsystemRAII subsystems;
 };
 } // namespace
 
@@ -53,11 +45,11 @@
 
   for (const auto  : matches) {
 SCOPED_TRACE(match.original.GetPath() + " -> " + match.remapped);
-llvm::Optional remapped;
+llvm::Optional remapped = map.FindFile(match.original);
 
-EXPECT_TRUE(bool(remapped = map.FindFile(match.original)));
-EXPECT_TRUE(FileSpec(remapped.getValue()).GetPath() ==
-ConstString(match.remapped).GetStringRef());
+EXPECT_TRUE(remapped);
+EXPECT_EQ(FileSpec(remapped.getValue()).GetPath(),
+  ConstString(match.remapped).GetStringRef());
   }
 }
 


Index: lldb/unittests/Target/FindFileTest.cpp
===
--- lldb/unittests/Target/FindFileTest.cpp
+++ lldb/unittests/Target/FindFileTest.cpp
@@ -6,6 +6,7 @@
 //
 //===--===//
 
+#include "TestingSupport/SubsystemRAII.h"
 #include "TestingSupport/TestUtilities.h"
 #include "lldb/Host/FileSystem.h"
 #include "lldb/Host/HostInfo.h"
@@ -24,22 +25,13 @@
 namespace {
 struct Matches {
   FileSpec original;
-  llvm::StringRef remapped;
-  Matches(const char *o, const char *r) : original(o), remapped(r) {}
-  Matches(const char *o, llvm::sys::path::Style style, const char *r)
+  std::string remapped;
+  Matches(llvm::StringRef o, llvm::sys::path::Style style, llvm::StringRef r)
   : original(o, style), remapped(r) {}
 };
 
 class FindFileTest : public testing::Test {
-public:
-  void SetUp() override {
-FileSystem::Initialize();
-HostInfo::Initialize();
-  }
-  void TearDown() override {
-HostInfo::Terminate();
-FileSystem::Terminate();
-  }
+  SubsystemRAII subsystems;
 };
 } // namespace
 
@@ -53,11 +45,11 @@
 
   for (const auto  : matches) {
 SCOPED_TRACE(match.original.GetPath() + " -> " + match.remapped);
-llvm::Optional remapped;
+llvm::Optional remapped = map.FindFile(match.original);
 
-EXPECT_TRUE(bool(remapped = map.FindFile(match.original)));
-EXPECT_TRUE(FileSpec(remapped.getValue()).GetPath() ==
-ConstString(match.remapped).GetStringRef());
+EXPECT_TRUE(remapped);
+EXPECT_EQ(FileSpec(remapped.getValue()).GetPath(),
+  ConstString(match.remapped).GetStringRef());
   }
 }
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112439: normalize file path when searching the source map

2021-11-02 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

In D112439#3102752 , @xujuntwt95329 
wrote:

> Thanks a lot for your comments, they are very useful and I learned a lot 
> about C++ by talking with you.
>
> I'll address these comments and submit a patch and request your review.
>
> Much appreciated!

You're very welcome. Also these comments are all just small nits and not 
urgent, so feel free to address them whenever you have time.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112439

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112439: normalize file path when searching the source map

2021-11-02 Thread Xu Jun via Phabricator via lldb-commits
xujuntwt95329 added a comment.

Thanks a lot for your comments, they are very useful and I learned a lot about 
C++ by talking with you.

I'll address these comments and submit a patch and request your review.

Much appreciated!




Comment at: lldb/unittests/Target/FindFileTest.cpp:36
+  void SetUp() override {
+FileSystem::Initialize();
+HostInfo::Initialize();

teemperor wrote:
> You can simplify this code by giving this test struct a member 
> `SubsystemRAII subsystems;`. It will automatically call 
> these functions for you in the right order on test setUp/tearDown. It also 
> automatically adds error handling for init errors to your test. So this whole 
> class can all be:
> 
> ```
> lang=c++
> struct FindFileTest : public testing::Test {
>   SubsystemRAII subsystems;
> };
> ```
> You can simplify this code by giving this test struct a member 
> `SubsystemRAII subsystems;`. It will automatically call 
> these functions for you in the right order on test setUp/tearDown. It also 
> automatically adds error handling for init errors to your test. So this whole 
> class can all be:
> 
> ```
> lang=c++
> struct FindFileTest : public testing::Test {
>   SubsystemRAII subsystems;
> };
> ```




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112439

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112439: normalize file path when searching the source map

2021-11-02 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

Fixed in 58dd658583eec9af24ca1262e1bce9f884d65487 


(Also left some nits in the test because I anyway looked over the code.)




Comment at: lldb/unittests/Target/FindFileTest.cpp:27
+  FileSpec original;
+  llvm::StringRef remapped;
+  Matches(const char *o, const char *r) : original(o), remapped(r) {}

I think this can just be a `std::string`. Right now it's relying on the caller 
to preserve the C-string storage, but that really isn't obvious to the whoever 
might update the test (and then has to debug a use-after-free).



Comment at: lldb/unittests/Target/FindFileTest.cpp:28
+  llvm::StringRef remapped;
+  Matches(const char *o, const char *r) : original(o), remapped(r) {}
+  Matches(const char *o, llvm::sys::path::Style style, const char *r)

No one is calling this IIUC?



Comment at: lldb/unittests/Target/FindFileTest.cpp:29
+  Matches(const char *o, const char *r) : original(o), remapped(r) {}
+  Matches(const char *o, llvm::sys::path::Style style, const char *r)
+  : original(o, style), remapped(r) {}

I think both of those parameters can be `StringRefs` (FileSpec anyway converts 
it back to a StringRef).



Comment at: lldb/unittests/Target/FindFileTest.cpp:36
+  void SetUp() override {
+FileSystem::Initialize();
+HostInfo::Initialize();

You can simplify this code by giving this test struct a member 
`SubsystemRAII subsystems;`. It will automatically call 
these functions for you in the right order on test setUp/tearDown. It also 
automatically adds error handling for init errors to your test. So this whole 
class can all be:

```
lang=c++
struct FindFileTest : public testing::Test {
  SubsystemRAII subsystems;
};
```



Comment at: lldb/unittests/Target/FindFileTest.cpp:58
+
+EXPECT_TRUE(bool(remapped = map.FindFile(match.original)));
+EXPECT_TRUE(FileSpec(remapped.getValue()).GetPath() ==

Couldn't `remapped` just be initialized to the FindFile value? Then you don't 
have to do the whole dance with converting to bool and avoiding the compiler 
warnings for assignments that look like comparisons.



Comment at: lldb/unittests/Target/FindFileTest.cpp:59
+EXPECT_TRUE(bool(remapped = map.FindFile(match.original)));
+EXPECT_TRUE(FileSpec(remapped.getValue()).GetPath() ==
+ConstString(match.remapped).GetStringRef());

`EXPECT_EQ` (StringRef is supported in the gtest macros)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112439

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112439: normalize file path when searching the source map

2021-11-02 Thread Xu Jun via Phabricator via lldb-commits
xujuntwt95329 added a comment.

In D112439#3102600 , @teemperor wrote:

> In D112439#3102559 , @xujuntwt95329 
> wrote:
>
>> In D112439#3102548 , @teemperor 
>> wrote:
>>
>>> In D112439#3102533 , 
>>> @xujuntwt95329 wrote:
>>>
 In D112439#3102506 , @teemperor 
 wrote:

> In D112439#3098307 , 
> @xujuntwt95329 wrote:
>
>> Seems that patch can't build by CI because it is based on this patch. In 
>> my understanding we need to merge this patch firstly and rebase that NFC 
>> patch to let CI work, right?
>
> You can set parent/child revisions in Phabricator that should handle this 
> situation (not sure if the premerge-checks are respecting that, but 
> that's how Phab usually manages unmerged dependencies).
>
> But to be clear, the premerge checks on Phabricator are *not* building or 
> testing LLDB at all. See the CI log:
>
>   INFOprojects: {'lldb'}
>   INFOall excluded projects(*) {'check-cxxabi', 'flang', 'libunwind', 
> 'compiler-rt', 'cross-project-tests', 'libcxx', 'libcxxabi', 'libc', 
> 'openmp', 'lldb'}
>   INFOeffective projects list set()

 Thanks a lot for the detailed information!

 BTW, I see there are some test failure reported by CI, but I can't 
 reproduce them in my local environment (X86_64 Ubuntu and Windows), is 
 there any docker images to simulate the CI environment?
>>>
>>> Can you try a Release + Assert build? I'm looking at the failures at the 
>>> moment too and it seems to only fail in non-Debug builds.
>>
>> Sure, I'll try the `release + assert` build. Thanks again!
>
> Actually the solution seems pretty straightforward. `ArrayRef 
> fails{ ...` is not actually extending the lifetime or copying the initializer 
> list you're passing. You have to use a std::vector or something similar to 
> actually store the FileSpecs (right now they are being destroyed before the 
> `TestFileFindings` call).
>
> I'll go ahead and push a fix that just uses a std::vector.

You are right, thanks a lot!

Interestingly, I can't reproduce this problem even with release + assert build 
in my local environment


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112439

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 58dd658 - [lldb] Fix a use-after-free in FindFileTest.cpp

2021-11-02 Thread Raphael Isemann via lldb-commits

Author: Raphael Isemann
Date: 2021-11-02T12:39:26+01:00
New Revision: 58dd658583eec9af24ca1262e1bce9f884d65487

URL: 
https://github.com/llvm/llvm-project/commit/58dd658583eec9af24ca1262e1bce9f884d65487
DIFF: 
https://github.com/llvm/llvm-project/commit/58dd658583eec9af24ca1262e1bce9f884d65487.diff

LOG: [lldb] Fix a use-after-free in FindFileTest.cpp

ArrayRef doesn't take ownership.

Added: 


Modified: 
lldb/unittests/Target/FindFileTest.cpp

Removed: 




diff  --git a/lldb/unittests/Target/FindFileTest.cpp 
b/lldb/unittests/Target/FindFileTest.cpp
index 9d7269780950a..77d374d1f498d 100644
--- a/lldb/unittests/Target/FindFileTest.cpp
+++ b/lldb/unittests/Target/FindFileTest.cpp
@@ -84,7 +84,7 @@ TEST_F(FindFileTest, FindFileTests) {
   {R"(C:\foo)", llvm::sys::path::Style::windows, DirName.c_str()},
   {R"(C:\foo\test)", llvm::sys::path::Style::windows, FileName.c_str()}};
 
-  ArrayRef fails{
+  std::vector fails{
   // path not mapped
   FileSpec("/foo", llvm::sys::path::Style::posix),
   FileSpec("/new", llvm::sys::path::Style::posix),



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112439: normalize file path when searching the source map

2021-11-02 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

In D112439#3102559 , @xujuntwt95329 
wrote:

> In D112439#3102548 , @teemperor 
> wrote:
>
>> In D112439#3102533 , 
>> @xujuntwt95329 wrote:
>>
>>> In D112439#3102506 , @teemperor 
>>> wrote:
>>>
 In D112439#3098307 , 
 @xujuntwt95329 wrote:

> Seems that patch can't build by CI because it is based on this patch. In 
> my understanding we need to merge this patch firstly and rebase that NFC 
> patch to let CI work, right?

 You can set parent/child revisions in Phabricator that should handle this 
 situation (not sure if the premerge-checks are respecting that, but that's 
 how Phab usually manages unmerged dependencies).

 But to be clear, the premerge checks on Phabricator are *not* building or 
 testing LLDB at all. See the CI log:

   INFOprojects: {'lldb'}
   INFOall excluded projects(*) {'check-cxxabi', 'flang', 'libunwind', 
 'compiler-rt', 'cross-project-tests', 'libcxx', 'libcxxabi', 'libc', 
 'openmp', 'lldb'}
   INFOeffective projects list set()
>>>
>>> Thanks a lot for the detailed information!
>>>
>>> BTW, I see there are some test failure reported by CI, but I can't 
>>> reproduce them in my local environment (X86_64 Ubuntu and Windows), is 
>>> there any docker images to simulate the CI environment?
>>
>> Can you try a Release + Assert build? I'm looking at the failures at the 
>> moment too and it seems to only fail in non-Debug builds.
>
> Sure, I'll try the `release + assert` build. Thanks again!

Actually the solution seems pretty straightforward. `ArrayRef fails{ 
...` is not actually extending the lifetime or copying the initializer list 
you're passing. You have to use a std::vector or something similar to actually 
store the FileSpecs (right now they are being destroyed before the 
`TestFileFindings` call).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112439

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112439: normalize file path when searching the source map

2021-11-02 Thread Xu Jun via Phabricator via lldb-commits
xujuntwt95329 added a comment.

In D112439#3102548 , @teemperor wrote:

> In D112439#3102533 , @xujuntwt95329 
> wrote:
>
>> In D112439#3102506 , @teemperor 
>> wrote:
>>
>>> In D112439#3098307 , 
>>> @xujuntwt95329 wrote:
>>>
 Seems that patch can't build by CI because it is based on this patch. In 
 my understanding we need to merge this patch firstly and rebase that NFC 
 patch to let CI work, right?
>>>
>>> You can set parent/child revisions in Phabricator that should handle this 
>>> situation (not sure if the premerge-checks are respecting that, but that's 
>>> how Phab usually manages unmerged dependencies).
>>>
>>> But to be clear, the premerge checks on Phabricator are *not* building or 
>>> testing LLDB at all. See the CI log:
>>>
>>>   INFOprojects: {'lldb'}
>>>   INFOall excluded projects(*) {'check-cxxabi', 'flang', 'libunwind', 
>>> 'compiler-rt', 'cross-project-tests', 'libcxx', 'libcxxabi', 'libc', 
>>> 'openmp', 'lldb'}
>>>   INFOeffective projects list set()
>>
>> Thanks a lot for the detailed information!
>>
>> BTW, I see there are some test failure reported by CI, but I can't reproduce 
>> them in my local environment (X86_64 Ubuntu and Windows), is there any 
>> docker images to simulate the CI environment?
>
> Can you try a Release + Assert build? I'm looking at the failures at the 
> moment too and it seems to only fail in non-Debug builds.

Sure, I'll try the `release + assert` build. Thanks again!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112439

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112439: normalize file path when searching the source map

2021-11-02 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

In D112439#3102533 , @xujuntwt95329 
wrote:

> In D112439#3102506 , @teemperor 
> wrote:
>
>> In D112439#3098307 , 
>> @xujuntwt95329 wrote:
>>
>>> Seems that patch can't build by CI because it is based on this patch. In my 
>>> understanding we need to merge this patch firstly and rebase that NFC patch 
>>> to let CI work, right?
>>
>> You can set parent/child revisions in Phabricator that should handle this 
>> situation (not sure if the premerge-checks are respecting that, but that's 
>> how Phab usually manages unmerged dependencies).
>>
>> But to be clear, the premerge checks on Phabricator are *not* building or 
>> testing LLDB at all. See the CI log:
>>
>>   INFOprojects: {'lldb'}
>>   INFOall excluded projects(*) {'check-cxxabi', 'flang', 'libunwind', 
>> 'compiler-rt', 'cross-project-tests', 'libcxx', 'libcxxabi', 'libc', 
>> 'openmp', 'lldb'}
>>   INFOeffective projects list set()
>
> Thanks a lot for the detailed information!
>
> BTW, I see there are some test failure reported by CI, but I can't reproduce 
> them in my local environment (X86_64 Ubuntu and Windows), is there any docker 
> images to simulate the CI environment?

Can you try a Release + Assert build? I'm looking at the failures at the moment 
too and it seems to only fail in non-Debug builds.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112439

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112439: normalize file path when searching the source map

2021-11-02 Thread Xu Jun via Phabricator via lldb-commits
xujuntwt95329 added a comment.

In D112439#3102506 , @teemperor wrote:

> In D112439#3098307 , @xujuntwt95329 
> wrote:
>
>> Seems that patch can't build by CI because it is based on this patch. In my 
>> understanding we need to merge this patch firstly and rebase that NFC patch 
>> to let CI work, right?
>
> You can set parent/child revisions in Phabricator that should handle this 
> situation (not sure if the premerge-checks are respecting that, but that's 
> how Phab usually manages unmerged dependencies).
>
> But to be clear, the premerge checks on Phabricator are *not* building or 
> testing LLDB at all. See the CI log:
>
>   INFOprojects: {'lldb'}
>   INFOall excluded projects(*) {'check-cxxabi', 'flang', 'libunwind', 
> 'compiler-rt', 'cross-project-tests', 'libcxx', 'libcxxabi', 'libc', 
> 'openmp', 'lldb'}
>   INFOeffective projects list set()

Thanks a lot for the detailed information!

BTW, I see there are some test failure reported by CI, but I can't reproduce 
them in my local environment (X86_64 Ubuntu and Windows), is there any docker 
images to simulate the CI environment?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112439

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112439: normalize file path when searching the source map

2021-11-02 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

In D112439#3098307 , @xujuntwt95329 
wrote:

> Seems that patch can't build by CI because it is based on this patch. In my 
> understanding we need to merge this patch firstly and rebase that NFC patch 
> to let CI work, right?

You can set parent/child revisions in Phabricator that should handle this 
situation (not sure if the premerge-checks are respecting that, but that's how 
Phab usually manages unmerged dependencies).

But to be clear, the premerge checks on Phabricator are *not* building or 
testing LLDB at all. See the CI log:

  INFOprojects: {'lldb'}
  INFOall excluded projects(*) {'check-cxxabi', 'flang', 'libunwind', 
'compiler-rt', 'cross-project-tests', 'libcxx', 'libcxxabi', 'libc', 'openmp', 
'lldb'}
  INFOeffective projects list set()


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112439

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] cd2e66e - [lldb][gmodules] Fix TestDataFormatterGlobals under gmodules

2021-11-02 Thread Raphael Isemann via lldb-commits

Author: Raphael Isemann
Date: 2021-11-02T10:14:11+01:00
New Revision: cd2e66efa65fd63cf6f48112f49c09489a1baac0

URL: 
https://github.com/llvm/llvm-project/commit/cd2e66efa65fd63cf6f48112f49c09489a1baac0
DIFF: 
https://github.com/llvm/llvm-project/commit/cd2e66efa65fd63cf6f48112f49c09489a1baac0.diff

LOG: [lldb][gmodules] Fix TestDataFormatterGlobals under gmodules

Same reason as in 548dbfaf447cc5fdfc26d34e60e3da08eb609531 -> macOS has a
struct called 'Point' in the libc module. Just remove the redundant includes
here.

Added: 


Modified: 
lldb/test/API/functionalities/data-formatter/data-formatter-globals/main.cpp

Removed: 




diff  --git 
a/lldb/test/API/functionalities/data-formatter/data-formatter-globals/main.cpp 
b/lldb/test/API/functionalities/data-formatter/data-formatter-globals/main.cpp
index 4e4baeda5ff8f..570c21779674d 100644
--- 
a/lldb/test/API/functionalities/data-formatter/data-formatter-globals/main.cpp
+++ 
b/lldb/test/API/functionalities/data-formatter/data-formatter-globals/main.cpp
@@ -1,7 +1,3 @@
-#include 
-#include 
-#include 
-
 struct Point {
 int x;
 int y;



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112863: [lldb][NFC] avoid unnecessary roundtrips between different string types

2021-11-02 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

I think this was just fixed by 48677f58b06cfb8715902173c5bc3d1764d7c8c6 



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112863

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112863: [lldb][NFC] avoid unnecessary roundtrips between different string types

2021-11-02 Thread Jan Svoboda via Phabricator via lldb-commits
jansvoboda11 added a comment.

This breaks our build: 
https://green.lab.llvm.org/green/job/lldb-cmake/37529/console
Can you take a look? If the fix is not obvious, please revert for now.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112863

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] 48677f5 - [lldb] Unbreak the macOS build after dfd499a61c45778b7f01458d50ccc384343f53d5

2021-11-02 Thread Raphael Isemann via lldb-commits
Thanks!

Am Di., 2. Nov. 2021 um 09:48 Uhr schrieb Benjamin Kramer via
lldb-commits :
>
>
> Author: Benjamin Kramer
> Date: 2021-11-02T09:47:44+01:00
> New Revision: 48677f58b06cfb8715902173c5bc3d1764d7c8c6
>
> URL: 
> https://github.com/llvm/llvm-project/commit/48677f58b06cfb8715902173c5bc3d1764d7c8c6
> DIFF: 
> https://github.com/llvm/llvm-project/commit/48677f58b06cfb8715902173c5bc3d1764d7c8c6.diff
>
> LOG: [lldb] Unbreak the macOS build after 
> dfd499a61c45778b7f01458d50ccc384343f53d5
>
> Added:
>
>
> Modified:
> lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
> lldb/source/Symbol/LocateSymbolFileMacOSX.cpp
>
> Removed:
>
>
>
> 
> diff  --git a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp 
> b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
> index 6e97f3d440f3f..d9f4174b19a3c 100644
> --- a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
> +++ b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
> @@ -239,7 +239,7 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP 
> _sp,
>  DBGSourcePath = 
> resolved_source_path.GetPath();
>}
>module_sp->GetSourceMappingList().Append(
> -  key, ConstString(DBGSourcePath), true);
> +  key.GetStringRef(), DBGSourcePath, true);
>// With version 2 of DBGSourcePathRemapping, we
>// can chop off the last two filename parts
>// from the source remapping and get a more
> @@ -254,8 +254,7 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP 
> _sp,
>  source_path.RemoveLastPathComponent();
>  source_path.RemoveLastPathComponent();
>  module_sp->GetSourceMappingList().Append(
> -
> ConstString(build_path.GetPath().c_str()),
> -
> ConstString(source_path.GetPath().c_str()),
> +build_path.GetPath(), 
> source_path.GetPath(),
>  true);
>}
>  }
> @@ -276,8 +275,7 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP 
> _sp,
>  DBGSourcePath = resolved_source_path.GetPath();
>}
>module_sp->GetSourceMappingList().Append(
> -  ConstString(DBGBuildSourcePath),
> -  ConstString(DBGSourcePath), true);
> +  DBGBuildSourcePath, DBGSourcePath, true);
>  }
>}
>  }
>
> diff  --git a/lldb/source/Symbol/LocateSymbolFileMacOSX.cpp 
> b/lldb/source/Symbol/LocateSymbolFileMacOSX.cpp
> index 2655e4de9063a..a13b4a7a54f2c 100644
> --- a/lldb/source/Symbol/LocateSymbolFileMacOSX.cpp
> +++ b/lldb/source/Symbol/LocateSymbolFileMacOSX.cpp
> @@ -414,9 +414,8 @@ static bool 
> GetModuleSpecInfoFromUUIDDictionary(CFDictionaryRef uuid_dict,
>  // last two filename parts from the source remapping and get a 
> more
>  // general source remapping that still works. Add this as another
>  // option in addition to the full source path remap.
> -module_spec.GetSourceMappingList().Append(
> -ConstString(DBGBuildSourcePath.c_str()),
> -ConstString(DBGSourcePath.c_str()), true);
> +module_spec.GetSourceMappingList().Append(DBGBuildSourcePath,
> +  DBGSourcePath, true);
>  if (do_truncate_remapping_names) {
>FileSpec build_path(DBGBuildSourcePath.c_str());
>FileSpec source_path(DBGSourcePath.c_str());
> @@ -425,8 +424,7 @@ static bool 
> GetModuleSpecInfoFromUUIDDictionary(CFDictionaryRef uuid_dict,
>source_path.RemoveLastPathComponent();
>source_path.RemoveLastPathComponent();
>module_spec.GetSourceMappingList().Append(
> -  ConstString(build_path.GetPath().c_str()),
> -  ConstString(source_path.GetPath().c_str()), true);
> +  build_path.GetPath(), source_path.GetPath(), true);
>  }
>}
>  }
> @@ -458,9 +456,8 @@ static bool 
> GetModuleSpecInfoFromUUIDDictionary(CFDictionaryRef uuid_dict,
>  FileSystem::Instance().Resolve(resolved_source_path);
>  DBGSourcePath = resolved_source_path.GetPath();
>}
> -  module_spec.GetSourceMappingList().Append(
> -  ConstString(DBGBuildSourcePath.c_str()),
> -  ConstString(DBGSourcePath.c_str()), true);
> +  

[Lldb-commits] [lldb] 48677f5 - [lldb] Unbreak the macOS build after dfd499a61c45778b7f01458d50ccc384343f53d5

2021-11-02 Thread Benjamin Kramer via lldb-commits

Author: Benjamin Kramer
Date: 2021-11-02T09:47:44+01:00
New Revision: 48677f58b06cfb8715902173c5bc3d1764d7c8c6

URL: 
https://github.com/llvm/llvm-project/commit/48677f58b06cfb8715902173c5bc3d1764d7c8c6
DIFF: 
https://github.com/llvm/llvm-project/commit/48677f58b06cfb8715902173c5bc3d1764d7c8c6.diff

LOG: [lldb] Unbreak the macOS build after 
dfd499a61c45778b7f01458d50ccc384343f53d5

Added: 


Modified: 
lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
lldb/source/Symbol/LocateSymbolFileMacOSX.cpp

Removed: 




diff  --git a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp 
b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
index 6e97f3d440f3f..d9f4174b19a3c 100644
--- a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
+++ b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
@@ -239,7 +239,7 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP 
_sp,
 DBGSourcePath = resolved_source_path.GetPath();
   }
   module_sp->GetSourceMappingList().Append(
-  key, ConstString(DBGSourcePath), true);
+  key.GetStringRef(), DBGSourcePath, true);
   // With version 2 of DBGSourcePathRemapping, we
   // can chop off the last two filename parts
   // from the source remapping and get a more
@@ -254,8 +254,7 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP 
_sp,
 source_path.RemoveLastPathComponent();
 source_path.RemoveLastPathComponent();
 module_sp->GetSourceMappingList().Append(
-ConstString(build_path.GetPath().c_str()),
-ConstString(source_path.GetPath().c_str()),
+build_path.GetPath(), 
source_path.GetPath(),
 true);
   }
 }
@@ -276,8 +275,7 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP 
_sp,
 DBGSourcePath = resolved_source_path.GetPath();
   }
   module_sp->GetSourceMappingList().Append(
-  ConstString(DBGBuildSourcePath),
-  ConstString(DBGSourcePath), true);
+  DBGBuildSourcePath, DBGSourcePath, true);
 }
   }
 }

diff  --git a/lldb/source/Symbol/LocateSymbolFileMacOSX.cpp 
b/lldb/source/Symbol/LocateSymbolFileMacOSX.cpp
index 2655e4de9063a..a13b4a7a54f2c 100644
--- a/lldb/source/Symbol/LocateSymbolFileMacOSX.cpp
+++ b/lldb/source/Symbol/LocateSymbolFileMacOSX.cpp
@@ -414,9 +414,8 @@ static bool 
GetModuleSpecInfoFromUUIDDictionary(CFDictionaryRef uuid_dict,
 // last two filename parts from the source remapping and get a more
 // general source remapping that still works. Add this as another
 // option in addition to the full source path remap.
-module_spec.GetSourceMappingList().Append(
-ConstString(DBGBuildSourcePath.c_str()),
-ConstString(DBGSourcePath.c_str()), true);
+module_spec.GetSourceMappingList().Append(DBGBuildSourcePath,
+  DBGSourcePath, true);
 if (do_truncate_remapping_names) {
   FileSpec build_path(DBGBuildSourcePath.c_str());
   FileSpec source_path(DBGSourcePath.c_str());
@@ -425,8 +424,7 @@ static bool 
GetModuleSpecInfoFromUUIDDictionary(CFDictionaryRef uuid_dict,
   source_path.RemoveLastPathComponent();
   source_path.RemoveLastPathComponent();
   module_spec.GetSourceMappingList().Append(
-  ConstString(build_path.GetPath().c_str()),
-  ConstString(source_path.GetPath().c_str()), true);
+  build_path.GetPath(), source_path.GetPath(), true);
 }
   }
 }
@@ -458,9 +456,8 @@ static bool 
GetModuleSpecInfoFromUUIDDictionary(CFDictionaryRef uuid_dict,
 FileSystem::Instance().Resolve(resolved_source_path);
 DBGSourcePath = resolved_source_path.GetPath();
   }
-  module_spec.GetSourceMappingList().Append(
-  ConstString(DBGBuildSourcePath.c_str()),
-  ConstString(DBGSourcePath.c_str()), true);
+  module_spec.GetSourceMappingList().Append(DBGBuildSourcePath,
+DBGSourcePath, true);
 }
   }
   return success;



___
lldb-commits mailing list
lldb-commits@lists.llvm.org

[Lldb-commits] [PATCH] D112988: [lldb] fix --source-quietly

2021-11-02 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna created this revision.
lawrence_danna added reviewers: jasonmolenda, JDevlieghere, jingham.
Herald added subscribers: dang, pengfei.
lawrence_danna requested review of this revision.
Herald added a project: LLDB.

Jim says:

lldb has a -Q or --source-quietly option, which supposedly does:

  --source-quietly Tells the debugger to execute this one-line lldb command 
before any file has been loaded.

That seems like a weird description, since we don't generally use source for 
one line entries, but anyway, let's try it:

  > $LLDB_LLVM/clean-mono/build/Debug/bin/lldb -Q "script print('I should be 
quiet')" a.out -O "script print('I should be before')" -o "script print('I 
should be after')"
  (lldb) script print('I should be before')
  I should be before
  (lldb) target create "script print('I should be quiet')"
  error: unable to find executable for 'script print('I should be quiet')'

That was weird.  The first real -O gets sourced but not quietly, then the 
argument to the -Q gets treated as the target.

  > $LLDB_LLVM/clean-mono/build/Debug/bin/lldb -Q a.out -O "script print('I 
should be before')" -o "script print('I should be after')"
  (lldb) script print('I should be before')
  I should be before
  (lldb) target create "a.out"
  Current executable set to '/tmp/a.out' (x86_64).
  (lldb) script print('I should be after')
  I should be after

Well, that's a little better, but the -Q option seems to have done nothing.

---

This fixes the description of --source-quietly, as well as causing it
to actually suppress echoing while executing the initialization
commands.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112988

Files:
  lldb/docs/man/lldb.rst
  lldb/test/Shell/Driver/TestQuiet.test
  lldb/tools/driver/Driver.cpp
  lldb/tools/driver/Options.td


Index: lldb/tools/driver/Options.td
===
--- lldb/tools/driver/Options.td
+++ lldb/tools/driver/Options.td
@@ -114,7 +114,7 @@
   Group;
 
 def source_quietly: F<"source-quietly">,
-  HelpText<"Tells the debugger to execute this one-line lldb command before 
any file has been loaded.">,
+  HelpText<"Tells the debugger not to echo commands while sourcing filles or 
one-line commands provided on the command line.">,
   Group;
 def: Flag<["-"], "Q">,
   Alias,
Index: lldb/tools/driver/Driver.cpp
===
--- lldb/tools/driver/Driver.cpp
+++ lldb/tools/driver/Driver.cpp
@@ -627,6 +627,7 @@
 options.SetSpawnThread(false);
 options.SetStopOnError(true);
 options.SetStopOnCrash(m_option_data.m_batch);
+options.SetEchoCommands(!m_option_data.m_source_quietly);
 
 SBCommandInterpreterRunResult results =
 m_debugger.RunCommandInterpreter(options);
Index: lldb/test/Shell/Driver/TestQuiet.test
===
--- /dev/null
+++ lldb/test/Shell/Driver/TestQuiet.test
@@ -0,0 +1,7 @@
+RUN: %lldb -b -Q -o "expr 40 + 2" | FileCheck %s
+RUN: %lldb -b -Q -O "expr 40 + 2" | FileCheck %s
+
+CHECK-NOT: expr
+CHECK-NOT: lldb
+CHECK-NOT: source
+CHECK: 42
\ No newline at end of file
Index: lldb/docs/man/lldb.rst
===
--- lldb/docs/man/lldb.rst
+++ lldb/docs/man/lldb.rst
@@ -111,7 +111,7 @@
 
 .. option:: --source-quietly
 
- Tells the debugger to execute this one-line lldb command before any file has 
been loaded.
+ Tells the debugger not to echo commands while sourcing filles or one-line 
commands provided on the command line.
 
 .. option:: --source 
 


Index: lldb/tools/driver/Options.td
===
--- lldb/tools/driver/Options.td
+++ lldb/tools/driver/Options.td
@@ -114,7 +114,7 @@
   Group;
 
 def source_quietly: F<"source-quietly">,
-  HelpText<"Tells the debugger to execute this one-line lldb command before any file has been loaded.">,
+  HelpText<"Tells the debugger not to echo commands while sourcing filles or one-line commands provided on the command line.">,
   Group;
 def: Flag<["-"], "Q">,
   Alias,
Index: lldb/tools/driver/Driver.cpp
===
--- lldb/tools/driver/Driver.cpp
+++ lldb/tools/driver/Driver.cpp
@@ -627,6 +627,7 @@
 options.SetSpawnThread(false);
 options.SetStopOnError(true);
 options.SetStopOnCrash(m_option_data.m_batch);
+options.SetEchoCommands(!m_option_data.m_source_quietly);
 
 SBCommandInterpreterRunResult results =
 m_debugger.RunCommandInterpreter(options);
Index: lldb/test/Shell/Driver/TestQuiet.test
===
--- /dev/null
+++ lldb/test/Shell/Driver/TestQuiet.test
@@ -0,0 +1,7 @@
+RUN: %lldb -b -Q -o "expr 40 + 2" | FileCheck %s
+RUN: %lldb -b -Q -O "expr 40 + 2" | FileCheck %s
+
+CHECK-NOT: expr
+CHECK-NOT: lldb
+CHECK-NOT: source
+CHECK: 42
\ 

[Lldb-commits] [PATCH] D112165: Cleanup a few more PR36048 skips

2021-11-02 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a subscriber: labath.
teemperor added a comment.

In D112165#3100929 , @dblaikie wrote:

> In D112165#3100608 , @teemperor 
> wrote:
>
>> Small note: gmodules test are never run on Linux, so you actually have to 
>> run them on macOS (or I think FreeBSD) to know whether the tests work.
>
> Yeah, I'll admit I didn't test this, but seemed consistent with the other 
> changes/cleanup - did this cause any breakage you know of?
>
> Could gmodules be tested on Linux? (I had originally really hoped/tried to 
> encourage gmodules to be implemented in a way that'd be compatible with Split 
> DWARF but it never quite got there, unfortunately... would've made more 
> overlap in functionality/testability/portability, I think)
>
> (I should setup a build environment on my Macbook Pro, but haven't got around 
> to it as yet)

There was just one test on macOS with data-formatter-cpp having defining 
something that is also in a system header (already fixed that). Also I think 
watching Green Dragon is enough. There would be a macOS CI if anyone actually 
cared about Green Dragon being always green.

The tests could in theory be run on Linux just fine, the problem is they just 
won't test anything. For better or worse (actually, just for the worse), the 
gmodules testing pretty much relies on re-running all normal API tests on 
`-fmodules -fcxx-modules -gmodules -fimplicit-module-maps` compiled test 
sources. But only about 5 of the 1000 API tests even define a module. So the 
remaining 995 tests just rerun their test as-is unless they include by accident 
a system header that has a modulemap on the system. No Linux distribution I 
know comes with modulemaps for its libc so no gmodules functionality will be 
exercised on the other 995 tests. So gmodules was just disabled as it just made 
the test suite longer without any benefit. Also I think there were some 
problems with enabling -fmodules on setups where we had a libc++ module but no 
modularized libc on the system. I think @labath knows the rationale best.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112165

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D112973: [lldb] make it easier to find LLDB's python

2021-11-02 Thread Lawrence D'Anna via Phabricator via lldb-commits
lawrence_danna updated this revision to Diff 383978.
lawrence_danna added a comment.

change lldb-python into a script instead of a feature of Driver.cpp


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112973

Files:
  lldb/bindings/python/CMakeLists.txt
  lldb/bindings/python/lldb-python
  lldb/docs/man/lldb.rst
  lldb/docs/python_api_enums.rst
  lldb/include/lldb/lldb-enumerations.h
  lldb/source/API/SBHostOS.cpp
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
  lldb/test/API/functionalities/paths/TestPaths.py
  lldb/test/Shell/Driver/TestHelp.test
  lldb/tools/driver/Driver.cpp
  lldb/tools/driver/Driver.h
  lldb/tools/driver/Options.td

Index: lldb/tools/driver/Options.td
===
--- lldb/tools/driver/Options.td
+++ lldb/tools/driver/Options.td
@@ -48,6 +48,10 @@
   HelpText<"Alias for --python-path">,
   Group;
 
+def python_prefix: F<"python-prefix">,
+  HelpText<"Prints out the sys.prefix for the python used by this lldb.">,
+  Group;
+
 def script_language: Separate<["--", "-"], "script-language">,
   MetaVarName<"">,
   HelpText<"Tells the debugger to use the specified scripting language for user-defined scripts.">,
Index: lldb/tools/driver/Driver.h
===
--- lldb/tools/driver/Driver.h
+++ lldb/tools/driver/Driver.h
@@ -79,6 +79,7 @@
 bool m_source_quietly = false;
 bool m_print_version = false;
 bool m_print_python_path = false;
+bool m_print_python_prefix = false;
 bool m_wait_for = false;
 bool m_repl = false;
 bool m_batch = false;
Index: lldb/tools/driver/Driver.cpp
===
--- lldb/tools/driver/Driver.cpp
+++ lldb/tools/driver/Driver.cpp
@@ -201,6 +201,9 @@
   if (args.hasArg(OPT_python_path)) {
 m_option_data.m_print_python_path = true;
   }
+  if (args.hasArg(OPT_python_prefix)) {
+m_option_data.m_print_python_prefix = true;
+  }
 
   if (args.hasArg(OPT_batch)) {
 m_option_data.m_batch = true;
@@ -398,6 +401,21 @@
 return error;
   }
 
+  if (m_option_data.m_print_python_prefix) {
+SBFileSpec python_file_spec = SBHostOS::GetLLDBPath(ePathTypePythonPrefix);
+if (python_file_spec.IsValid()) {
+  char python_path[PATH_MAX];
+  size_t num_chars = python_file_spec.GetPath(python_path, PATH_MAX);
+  if (num_chars < PATH_MAX) {
+llvm::outs() << python_path << '\n';
+  } else
+llvm::outs() << "\n";
+} else
+  llvm::outs() << "\n";
+exiting = true;
+return error;
+  }
+
   return error;
 }
 
Index: lldb/test/Shell/Driver/TestHelp.test
===
--- lldb/test/Shell/Driver/TestHelp.test
+++ lldb/test/Shell/Driver/TestHelp.test
@@ -63,5 +63,6 @@
 CHECK: SCRIPTING
 CHECK: -l
 CHECK: --python-path
+CHECK: --python-prefix
 CHECK: -P
 CHECK: --script-language
Index: lldb/test/API/functionalities/paths/TestPaths.py
===
--- lldb/test/API/functionalities/paths/TestPaths.py
+++ lldb/test/API/functionalities/paths/TestPaths.py
@@ -5,6 +5,7 @@
 
 import lldb
 import os
+import sys
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
@@ -22,10 +23,12 @@
   lldb.ePathTypeSupportExecutableDir,
   lldb.ePathTypeHeaderDir,
   lldb.ePathTypePythonDir,
+  lldb.ePathTypePythonPrefix,
   lldb.ePathTypeLLDBSystemPlugins,
   lldb.ePathTypeLLDBUserPlugins,
   lldb.ePathTypeLLDBTempSystemDir,
-  lldb.ePathTypeClangDir]
+  lldb.ePathTypeClangDir,
+  lldb.ePathTypePythonPrefix]
 
 for path_type in dir_path_types:
 f = lldb.SBHostOS.GetLLDBPath(path_type)
@@ -42,6 +45,10 @@
 self.assertTrue(any([os.path.exists(os.path.join(shlib_dir, f)) for f in
 filenames]), "shlib_dir = " + shlib_dir)
 
+@no_debug_info_test
+def test_prefix(self):
+prefix = lldb.SBHostOS.GetLLDBPath(lldb.ePathTypePythonPrefix).GetDirectory()
+self.assertEqual(os.path.realpath(sys.prefix), os.path.realpath(prefix))
 
 @no_debug_info_test
 def test_directory_doesnt_end_with_slash(self):
Index: lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
===
--- lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
+++ lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
@@ -51,6 +51,7 @@
   static