[Lldb-commits] [PATCH] D99864: [lldb] Fork/vfork support via gdb-remote protocol [WIP]

2021-04-07 Thread Michał Górny via Phabricator via lldb-commits
mgorny updated this revision to Diff 335765.
mgorny added a comment.

Added breakpoint cleanup via gdb-remote protocol. Only minimal code coverage so 
far. If this approach is okay, I guess I'll add subprocess guards to all server 
commands.


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

https://reviews.llvm.org/D99864

Files:
  lldb/bindings/interface/SBThread.i
  lldb/bindings/interface/SBThreadPlan.i
  lldb/docs/python_api_enums.rst
  lldb/examples/python/performance.py
  lldb/include/lldb/API/SBThread.h
  lldb/include/lldb/API/SBThreadPlan.h
  lldb/include/lldb/Host/Debug.h
  lldb/include/lldb/Host/common/NativeProcessProtocol.h
  lldb/include/lldb/Target/Process.h
  lldb/include/lldb/Target/StopInfo.h
  lldb/include/lldb/lldb-enumerations.h
  lldb/packages/Python/lldbsuite/test/lldbutil.py
  lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
  lldb/source/API/SBThread.cpp
  lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
  lldb/source/Plugins/Process/Linux/NativeProcessLinux.h
  lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
  lldb/source/Plugins/Process/Linux/NativeThreadLinux.h
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
  lldb/source/Target/Process.cpp
  lldb/source/Target/StackFrameList.cpp
  lldb/source/Target/StopInfo.cpp
  lldb/source/Target/Thread.cpp
  lldb/source/Utility/StringExtractorGDBRemote.cpp
  lldb/tools/lldb-vscode/JSONUtils.cpp
  lldb/tools/lldb-vscode/LLDBUtils.cpp

Index: lldb/tools/lldb-vscode/LLDBUtils.cpp
===
--- lldb/tools/lldb-vscode/LLDBUtils.cpp
+++ lldb/tools/lldb-vscode/LLDBUtils.cpp
@@ -55,6 +55,8 @@
   case lldb::eStopReasonSignal:
   case lldb::eStopReasonException:
   case lldb::eStopReasonExec:
+  case lldb::eStopReasonFork:
+  case lldb::eStopReasonVFork:
   case lldb::eStopReasonProcessorTrace:
 return true;
   case lldb::eStopReasonThreadExiting:
Index: lldb/tools/lldb-vscode/JSONUtils.cpp
===
--- lldb/tools/lldb-vscode/JSONUtils.cpp
+++ lldb/tools/lldb-vscode/JSONUtils.cpp
@@ -877,6 +877,12 @@
   case lldb::eStopReasonExec:
 body.try_emplace("reason", "entry");
 break;
+  case lldb::eStopReasonFork:
+body.try_emplace("reason", "fork");
+break;
+  case lldb::eStopReasonVFork:
+body.try_emplace("reason", "vfork");
+break;
   case lldb::eStopReasonThreadExiting:
   case lldb::eStopReasonInvalid:
   case lldb::eStopReasonNone:
Index: lldb/source/Utility/StringExtractorGDBRemote.cpp
===
--- lldb/source/Utility/StringExtractorGDBRemote.cpp
+++ lldb/source/Utility/StringExtractorGDBRemote.cpp
@@ -378,9 +378,7 @@
 return eServerPacketType_C;
 
   case 'D':
-if (packet_size == 1)
-  return eServerPacketType_D;
-break;
+return eServerPacketType_D;
 
   case 'g':
 return eServerPacketType_g;
Index: lldb/source/Target/Thread.cpp
===
--- lldb/source/Target/Thread.cpp
+++ lldb/source/Target/Thread.cpp
@@ -1679,6 +1679,10 @@
 return "exception";
   case eStopReasonExec:
 return "exec";
+  case eStopReasonFork:
+return "fork";
+  case eStopReasonVFork:
+return "vfork";
   case eStopReasonPlanComplete:
 return "plan complete";
   case eStopReasonThreadExiting:
Index: lldb/source/Target/StopInfo.cpp
===
--- lldb/source/Target/StopInfo.cpp
+++ lldb/source/Target/StopInfo.cpp
@@ -1145,6 +1145,40 @@
   bool m_performed_action;
 };
 
+// StopInfoFork
+
+class StopInfoFork : public StopInfo {
+public:
+  StopInfoFork(Thread &thread, lldb::pid_t child_pid, lldb::tid_t child_tid)
+  : StopInfo(thread, LLDB_INVALID_UID), m_performed_action(false),
+m_child_pid(child_pid), m_child_tid(child_tid) {}
+
+  ~StopInfoFork() override = default;
+
+  bool ShouldStop(Event *event_ptr) override { return false; }
+
+  StopReason GetStopReason() const override { return eStopReasonFork; }
+
+  const char *GetDescription() override { return "fork"; }
+
+protected:
+  void PerformAction(Event *event_ptr) override {
+// Only perform the action once
+if (m_performed_action)
+  return;
+m_performed_action = true;
+ThreadSP thread_sp(m_thread_wp.lock());
+if (thread_sp)
+  thread_sp->GetProcess

[Lldb-commits] [PATCH] D95601: [lldb][AArch64] Add memory tag reading to lldb-server

2021-04-07 Thread David Spickett via Phabricator via lldb-commits
DavidSpickett added a comment.

@omjavaid Current status is that a partial read of memory tags is converted 
into an error by lldb-server. I think this is justifiable given that the GDB 
protocol as it stands doesn't describe how to really communicate a partial read 
(though we could make a reasonable guess I'm sure). Plus, lldb itself will be 
looking ahead via memory regions so it won't issue things that would fail. 
(fail for reason of address range at least)

Sound good to you? I'll be applying the same logic to writing tags.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95601

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


[Lldb-commits] [PATCH] D95602: [lldb][AArch64] Add MTE memory tag reading to lldb

2021-04-07 Thread David Spickett via Phabricator via lldb-commits
DavidSpickett added inline comments.



Comment at: lldb/source/Target/Process.cpp:6024
+llvm::Expected
+Process::GetMemoryTagManager(lldb::addr_t addr, lldb::addr_t end_addr) {
+  Architecture *arch = GetTarget().GetArchitecturePlugin();

While writing "memory tag write" I realised it saves some effort if you return 
the manager and the checked range here. However it's way more useful for tag 
write so I'll leave this as is for now unless you really want to see it in this 
change.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95602

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


[Lldb-commits] [PATCH] D97281: [lldb][AArch64] Add class for managing memory tags

2021-04-07 Thread David Spickett via Phabricator via lldb-commits
DavidSpickett added a comment.

@labath Could you comment on the overall strategy that I'm going for?

I'll summarise my intention, the rest of the review stack here implements that 
if you have time/want to dig into the details.

- Tag managers provide utilities to handle tags without knowing the details of 
each tagging scheme
- lldb commands can get one by asking the current process, which looks for an 
architecture plugin, which can then provide a tag manager or not
- lldb uses the "mt" flag of memory regions to precheck reads before sending 
them
- lldb-server will ask the native register context for a manager, which can 
provide one or not based on the target and what it's being asked to do

It would be great to get agreement on those key points since it forms the basis 
of the new commands.

FWIW I have implemented "memory tag write" based on this and it works quite 
well, but I can put that up too if you feel the context would help. (another 
4/5 patches)

@omjavaid The tag manager AddressDiff is currently removing the whole top byte. 
I think eventually we'll want to go back to removing just the tag bits and let 
your non address bits handle the rest but for now it's working ok.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97281

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


[Lldb-commits] [PATCH] D95602: [lldb][AArch64] Add MTE memory tag reading to lldb

2021-04-07 Thread David Spickett via Phabricator via lldb-commits
DavidSpickett added a comment.

@omjavaid Any more comments on this?




Comment at: lldb/include/lldb/Core/Architecture.h:110
+  virtual const MemoryTagManager *GetMemoryTagManager() const {
+return nullptr;
+  }

I also had the thought that we could just return instances of MemoryTagManager, 
however we rely on virtual functions for the implementation. (incredibly 
obvious once you try it, but would have been nice to remove a bunch of pointer 
indirection)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95602

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


[Lldb-commits] [PATCH] D97786: LLDB: Use path relative to binary, not relative to debugger CWD, for finding .dwo files.

2021-04-07 Thread Caroline Tice via Phabricator via lldb-commits
cmtice added a comment.

It has taken a bit of time to get through the GDB reviews, but the change to 
GDB was accepted and committed:  
https://sourceware.org/pipermail/gdb-cvs/2021-April/050267.html

May I commit this change to LLDB now?


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

https://reviews.llvm.org/D97786

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


[Lldb-commits] [PATCH] D100048: [lldb][Editline] Fix crash when navigating through empty command history.

2021-04-07 Thread Jordan Rupprecht via Phabricator via lldb-commits
rupprecht created this revision.
rupprecht added a reviewer: JDevlieghere.
rupprecht requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

An empty history entry can happen by entering the expression evaluator an 
immediately hitting enter:

  $ lldb
  (lldb) e
  Enter expressions, then terminate with an empty line to evaluate:
1:  

The next time the user enters the expression evaluator, if they hit the up 
arrow to load the previous expression, lldb crashes. This patch treats empty 
history sessions as a single expression of zero length, instead of an empty 
list of expressions.

Fixes http://llvm.org/PR49845.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100048

Files:
  lldb/source/Host/common/Editline.cpp
  
lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py


Index: 
lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py
===
--- 
lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py
+++ 
lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py
@@ -69,3 +69,26 @@
 self.child.expect_exact("(int) $0 = 334")
 
 self.quit()
+
+@skipIfAsan
+@skipIfEditlineSupportMissing
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr48316')
+def test_nav_arrow_up_empty_pr49845(self):
+"""Tests that navigating with the up arrow doesn't crash."""
+self.launch()
+
+# Create an empty history session by only entering a newline.
+self.child.sendline("expr")
+self.child.expect_exact("terminate with an empty line to evaluate")
+self.child.send("\n")
+self.expect_prompt()
+
+# Send just the up arrow in the expression evaluator. This should 
bring up the previous empty expression.
+self.child.sendline("expr")
+self.child.expect_exact("terminate with an empty line to evaluate")
+self.child.send(self.arrow_up)
+self.child.expect_exact("1: ")
+self.child.send("\n")
+self.expect_prompt()
+
+self.quit()
Index: lldb/source/Host/common/Editline.cpp
===
--- lldb/source/Host/common/Editline.cpp
+++ lldb/source/Host/common/Editline.cpp
@@ -153,6 +153,11 @@
 result.push_back(input.substr(start, end - start));
 start = end + 1;
   }
+  // Treat an empty history session as a single command of zero-length instead
+  // of returning an empty vector.
+  if (result.empty()) {
+result.emplace_back();
+  }
   return result;
 }
 


Index: lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py
===
--- lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py
+++ lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py
@@ -69,3 +69,26 @@
 self.child.expect_exact("(int) $0 = 334")
 
 self.quit()
+
+@skipIfAsan
+@skipIfEditlineSupportMissing
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr48316')
+def test_nav_arrow_up_empty_pr49845(self):
+"""Tests that navigating with the up arrow doesn't crash."""
+self.launch()
+
+# Create an empty history session by only entering a newline.
+self.child.sendline("expr")
+self.child.expect_exact("terminate with an empty line to evaluate")
+self.child.send("\n")
+self.expect_prompt()
+
+# Send just the up arrow in the expression evaluator. This should bring up the previous empty expression.
+self.child.sendline("expr")
+self.child.expect_exact("terminate with an empty line to evaluate")
+self.child.send(self.arrow_up)
+self.child.expect_exact("1: ")
+self.child.send("\n")
+self.expect_prompt()
+
+self.quit()
Index: lldb/source/Host/common/Editline.cpp
===
--- lldb/source/Host/common/Editline.cpp
+++ lldb/source/Host/common/Editline.cpp
@@ -153,6 +153,11 @@
 result.push_back(input.substr(start, end - start));
 start = end + 1;
   }
+  // Treat an empty history session as a single command of zero-length instead
+  // of returning an empty vector.
+  if (result.empty()) {
+result.emplace_back();
+  }
   return result;
 }
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D100048: [lldb][Editline] Fix crash when navigating through empty command history.

2021-04-07 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. Thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100048

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


[Lldb-commits] [PATCH] D100053: Fixed bug issue #42017

2021-04-07 Thread Sushma Unnibhavi via Phabricator via lldb-commits
sushmaunnibhavi created this revision.
sushmaunnibhavi added reviewers: JDevlieghere, Shivamgupta1234.
sushmaunnibhavi requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Typo fix: lldb tutorial

  

Fixed typo 1, change "For instance" to "For instance,".

  

Fixed typo 2, some right parentheses have the period before them, some after.

  

Fixed typo 3, changed "an" to "a", "an" to "can".

  

Fixed typo 4, changed "Also" to "Also,".


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100053

Files:
  lldb/docs/use/tutorial.rst


Index: lldb/docs/use/tutorial.rst
===
--- lldb/docs/use/tutorial.rst
+++ lldb/docs/use/tutorial.rst
@@ -28,7 +28,7 @@
 
 Options can be placed anywhere on the command line, but if the arguments begin
 with a "-" then you have to tell lldb that you're done with options for the
-current command by adding an option termination: "--" So for instance if you
+current command by adding an option termination: "--" So for instance, if you
 want to launch a process and give the "process launch" command the
 "--stop-at-entry" option, yet you want the process you are about to launch to
 be launched with the arguments "-program_arg value", you would type:
@@ -121,7 +121,7 @@
 
 lldb also supports command completion for source file names, symbol names, file
 names, etc. Completion is initiated by a hitting a TAB. Individual options in a
-command can have different completers, so for instance the "--file "
+command can have different completers, so for instance, the "--file "
 option in "breakpoint" completes to source files, the "--shlib " option
 to currently loaded shared libraries, etc. We can even do things like if you
 specify "--shlib ", and are completing on "--file ", we will only
@@ -134,7 +134,7 @@
 for each matching command.
 
 Finally, there is a mechanism to construct aliases for commonly used commands.
-So for instance if you get annoyed typing:
+So for instance, if you get annoyed typing:
 
 ::
 
@@ -162,10 +162,10 @@
 One alias of note that we do include by popular demand is a weak emulator of
 gdb's "break" command. It doesn't try to do everything that gdb's break command
 does (for instance, it doesn't handle foo.c::bar. But it mostly works, and
-makes the transition easier. Also by popular demand, it is aliased to b. If you
+makes the transition easier. Also, by popular demand, it is aliased to b. If 
you
 actually want to learn the lldb command set natively, that means it will get in
 the way of the rest of the breakpoint commands. Fortunately, if you don't like
-one of our aliases, you an easily get rid of it by running (for example):
+one of our aliases, you can easily get rid of it by running (for example):
 
 ::
 
@@ -183,7 +183,7 @@
 options are stripped off, the rest of the command string is passed
 uninterpreted to the command. This is convenient for commands whose arguments
 might be some complex expression that would be painful to backslash protect.
-For instance the "expression" command is a "raw" command for obvious reasons.
+For instance, the "expression" command is a "raw" command for obvious reasons.
 The "help" output for a command will tell you if it is "raw" or not, so you
 know what to expect. The one thing you have to watch out for is that since raw
 commands still can have options, if your command string has dashes in it,
@@ -248,9 +248,9 @@
 
 The logical breakpoint has an integer id, and its locations have an id within
 their parent breakpoint (the two are joined by a ".", e.g. 1.1 in the example
-above.)
+above).
 
-Also the logical breakpoints remain live so that if another shared library were
+Also, the logical breakpoints remain live so that if another shared library 
were
 to be loaded that had another implementation of the "alignLeftEdges:" selector,
 the new location would be added to breakpoint 1 (e.g. a "1.2" breakpoint would
 be set on the newly loaded selector).
@@ -284,7 +284,7 @@
 
 You can delete, disable, set conditions and ignore counts either on all the
 locations generated by your logical breakpoint, or on any one of the particular
-locations your specification resolved to. For instance if we wanted to add a
+locations your specification resolved to. For instance, if we wanted to add a
 command to print a backtrace when we hit this breakpoint we could do:
 
 ::
@@ -299,7 +299,7 @@
 option. Use "--script" if you want to implement your breakpoint command using
 the Python script instead.
 
-This is an convenient point to bring up another feature of the lldb command
+This is a convenient point to bring up another feature of the lldb command
 help. Do:
 
 ::


Index: lldb/docs/use/tutorial.rst
===
--- lldb/docs/use/tutorial.rst
+++ lldb/docs/use/tutorial.rst
@@ -28,7 +28,7 @@
 
 Options can be placed anywhere on the command lin

[Lldb-commits] [lldb] f49a444 - [lldb][Editline] Fix crash when navigating through empty command history.

2021-04-07 Thread Jordan Rupprecht via lldb-commits

Author: Jordan Rupprecht
Date: 2021-04-07T10:48:47-07:00
New Revision: f49a4440d38a4123b01ded6493a02b4cbf038928

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

LOG: [lldb][Editline] Fix crash when navigating through empty command history.

An empty history entry can happen by entering the expression evaluator an 
immediately hitting enter:

```
$ lldb
(lldb) e
Enter expressions, then terminate with an empty line to evaluate:
  1:  
```

The next time the user enters the expression evaluator, if they hit the up 
arrow to load the previous expression, lldb crashes. This patch treats empty 
history sessions as a single expression of zero length, instead of an empty 
list of expressions.

Fixes http://llvm.org/PR49845.

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

Added: 


Modified: 
lldb/source/Host/common/Editline.cpp

lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py

Removed: 




diff  --git a/lldb/source/Host/common/Editline.cpp 
b/lldb/source/Host/common/Editline.cpp
index fa06bfb265833..85c62b4288a97 100644
--- a/lldb/source/Host/common/Editline.cpp
+++ b/lldb/source/Host/common/Editline.cpp
@@ -153,6 +153,11 @@ std::vector SplitLines(const 
EditLineStringType &input) {
 result.push_back(input.substr(start, end - start));
 start = end + 1;
   }
+  // Treat an empty history session as a single command of zero-length instead
+  // of returning an empty vector.
+  if (result.empty()) {
+result.emplace_back();
+  }
   return result;
 }
 

diff  --git 
a/lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py
 
b/lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py
index d95e69fc8aa5d..95ad2c8857088 100644
--- 
a/lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py
+++ 
b/lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py
@@ -69,3 +69,26 @@ def test_nav_arrow_down(self):
 self.child.expect_exact("(int) $0 = 334")
 
 self.quit()
+
+@skipIfAsan
+@skipIfEditlineSupportMissing
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr48316')
+def test_nav_arrow_up_empty_pr49845(self):
+"""Tests that navigating with the up arrow doesn't crash."""
+self.launch()
+
+# Create an empty history session by only entering a newline.
+self.child.sendline("expr")
+self.child.expect_exact("terminate with an empty line to evaluate")
+self.child.send("\n")
+self.expect_prompt()
+
+# Send just the up arrow in the expression evaluator. This should 
bring up the previous empty expression.
+self.child.sendline("expr")
+self.child.expect_exact("terminate with an empty line to evaluate")
+self.child.send(self.arrow_up)
+self.child.expect_exact("1: ")
+self.child.send("\n")
+self.expect_prompt()
+
+self.quit()



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


[Lldb-commits] [PATCH] D100048: [lldb][Editline] Fix crash when navigating through empty command history.

2021-04-07 Thread Jordan Rupprecht via Phabricator via lldb-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf49a4440d38a: [lldb][Editline] Fix crash when navigating 
through empty command history. (authored by rupprecht).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100048

Files:
  lldb/source/Host/common/Editline.cpp
  
lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py


Index: 
lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py
===
--- 
lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py
+++ 
lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py
@@ -69,3 +69,26 @@
 self.child.expect_exact("(int) $0 = 334")
 
 self.quit()
+
+@skipIfAsan
+@skipIfEditlineSupportMissing
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr48316')
+def test_nav_arrow_up_empty_pr49845(self):
+"""Tests that navigating with the up arrow doesn't crash."""
+self.launch()
+
+# Create an empty history session by only entering a newline.
+self.child.sendline("expr")
+self.child.expect_exact("terminate with an empty line to evaluate")
+self.child.send("\n")
+self.expect_prompt()
+
+# Send just the up arrow in the expression evaluator. This should 
bring up the previous empty expression.
+self.child.sendline("expr")
+self.child.expect_exact("terminate with an empty line to evaluate")
+self.child.send(self.arrow_up)
+self.child.expect_exact("1: ")
+self.child.send("\n")
+self.expect_prompt()
+
+self.quit()
Index: lldb/source/Host/common/Editline.cpp
===
--- lldb/source/Host/common/Editline.cpp
+++ lldb/source/Host/common/Editline.cpp
@@ -153,6 +153,11 @@
 result.push_back(input.substr(start, end - start));
 start = end + 1;
   }
+  // Treat an empty history session as a single command of zero-length instead
+  // of returning an empty vector.
+  if (result.empty()) {
+result.emplace_back();
+  }
   return result;
 }
 


Index: lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py
===
--- lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py
+++ lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py
@@ -69,3 +69,26 @@
 self.child.expect_exact("(int) $0 = 334")
 
 self.quit()
+
+@skipIfAsan
+@skipIfEditlineSupportMissing
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr48316')
+def test_nav_arrow_up_empty_pr49845(self):
+"""Tests that navigating with the up arrow doesn't crash."""
+self.launch()
+
+# Create an empty history session by only entering a newline.
+self.child.sendline("expr")
+self.child.expect_exact("terminate with an empty line to evaluate")
+self.child.send("\n")
+self.expect_prompt()
+
+# Send just the up arrow in the expression evaluator. This should bring up the previous empty expression.
+self.child.sendline("expr")
+self.child.expect_exact("terminate with an empty line to evaluate")
+self.child.send(self.arrow_up)
+self.child.expect_exact("1: ")
+self.child.send("\n")
+self.expect_prompt()
+
+self.quit()
Index: lldb/source/Host/common/Editline.cpp
===
--- lldb/source/Host/common/Editline.cpp
+++ lldb/source/Host/common/Editline.cpp
@@ -153,6 +153,11 @@
 result.push_back(input.substr(start, end - start));
 start = end + 1;
   }
+  // Treat an empty history session as a single command of zero-length instead
+  // of returning an empty vector.
+  if (result.empty()) {
+result.emplace_back();
+  }
   return result;
 }
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D99864: [lldb] Fork/vfork support via gdb-remote protocol [WIP]

2021-04-07 Thread Michał Górny via Phabricator via lldb-commits
mgorny added inline comments.



Comment at: 
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp:455
 
+if (::strstr(response_cstr, "fork-events+"))
+  m_supports_fork_events = eLazyBoolYes;

Kamil noticed that this will also catch `vfork-events+`. I suppose I'll rewrite 
this function to iterate over split data as well.


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

https://reviews.llvm.org/D99864

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


[Lldb-commits] [PATCH] D100053: Fixed bug issue #42017

2021-04-07 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.

Thanks. LGTM with a few nits.




Comment at: lldb/docs/use/tutorial.rst:31
 with a "-" then you have to tell lldb that you're done with options for the
-current command by adding an option termination: "--" So for instance if you
+current command by adding an option termination: "--" So for instance, if you
 want to launch a process and give the "process launch" command the





Comment at: lldb/docs/use/tutorial.rst:137
 Finally, there is a mechanism to construct aliases for commonly used commands.
-So for instance if you get annoyed typing:
+So for instance, if you get annoyed typing:
 




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100053

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


[Lldb-commits] [PATCH] D100053: Fixed bug issue #42017

2021-04-07 Thread Shivam Gupta via Phabricator via lldb-commits
xgupta added a comment.

Thanks @sushmaunnibhavi for the patch. Please update the revision as per the 
comment of @JDevlieghere.  I assume you don't have commit access to commit this 
patch so please share your email address someone else with the commit access 
will commit it on you behalf.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100053

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


[Lldb-commits] [PATCH] D99827: Clarifying the documentation for variable formatting wrt to qualifiers and adding a test that demonstrates this

2021-04-07 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik updated this revision to Diff 335929.
shafik added a comment.

Updating test to use frame var test.


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

https://reviews.llvm.org/D99827

Files:
  lldb/docs/use/variable.rst
  
lldb/test/API/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
  lldb/test/API/functionalities/data-formatter/data-formatter-advanced/main.cpp


Index: 
lldb/test/API/functionalities/data-formatter/data-formatter-advanced/main.cpp
===
--- 
lldb/test/API/functionalities/data-formatter/data-formatter-advanced/main.cpp
+++ 
lldb/test/API/functionalities/data-formatter/data-formatter-advanced/main.cpp
@@ -128,6 +128,9 @@
 {
 
 int iAmInt = 9;
+const int constInt = 42;
+volatile int volatileInt = 43;
+const volatile int constVolatileInt = 44;
 
 i_am_cool cool_boy(1,0.5,3);
 i_am_cooler cooler_boy(1,2,0.1,0.2,'A','B');
Index: 
lldb/test/API/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
===
--- 
lldb/test/API/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
+++ 
lldb/test/API/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
@@ -244,6 +244,12 @@
 self.expect("frame variable a_simple_object", matching=True,
 substrs=['x=0x0003'])
 
+self.expect_var_path("constInt", value='0x002a') 
+
+self.expect_var_path("volatileInt", value='0x002b')
+
+self.expect_var_path("constVolatileInt", value='0x002c')
+
 # check that we can correctly cap the number of children shown
 self.runCmd("settings set target.max-children-count 5")
 
Index: lldb/docs/use/variable.rst
===
--- lldb/docs/use/variable.rst
+++ lldb/docs/use/variable.rst
@@ -131,6 +131,20 @@
(C) c = {0x03 0x00 0x00 0x00}
(D) d = 4
 
+Note, that qualifiers such as const and volatile will be stripped when 
matching types for example:
+
+::
+
+   (lldb) frame var x y z
+   (int) x = 1
+   (const int) y = 2
+   (volatile int) z = 4
+   (lldb) type format add -f hex int
+   (lldb) frame var x y z
+   (int) x = 0x0001
+   (const int) y = 0x0002
+   (volatile int) z = 0x0004
+
 Two additional options that you will want to look at are --skip-pointers (-p)
 and --skip-references (-r). These two options prevent LLDB from applying a
 format for type T to values of type T* and T& respectively.


Index: lldb/test/API/functionalities/data-formatter/data-formatter-advanced/main.cpp
===
--- lldb/test/API/functionalities/data-formatter/data-formatter-advanced/main.cpp
+++ lldb/test/API/functionalities/data-formatter/data-formatter-advanced/main.cpp
@@ -128,6 +128,9 @@
 {
 
 int iAmInt = 9;
+const int constInt = 42;
+volatile int volatileInt = 43;
+const volatile int constVolatileInt = 44;
 
 i_am_cool cool_boy(1,0.5,3);
 i_am_cooler cooler_boy(1,2,0.1,0.2,'A','B');
Index: lldb/test/API/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
===
--- lldb/test/API/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
+++ lldb/test/API/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
@@ -244,6 +244,12 @@
 self.expect("frame variable a_simple_object", matching=True,
 substrs=['x=0x0003'])
 
+self.expect_var_path("constInt", value='0x002a') 
+
+self.expect_var_path("volatileInt", value='0x002b')
+
+self.expect_var_path("constVolatileInt", value='0x002c')
+
 # check that we can correctly cap the number of children shown
 self.runCmd("settings set target.max-children-count 5")
 
Index: lldb/docs/use/variable.rst
===
--- lldb/docs/use/variable.rst
+++ lldb/docs/use/variable.rst
@@ -131,6 +131,20 @@
(C) c = {0x03 0x00 0x00 0x00}
(D) d = 4
 
+Note, that qualifiers such as const and volatile will be stripped when matching types for example:
+
+::
+
+   (lldb) frame var x y z
+   (int) x = 1
+   (const int) y = 2
+   (volatile int) z = 4
+   (lldb) type format add -f hex int
+   (lldb) frame var x y z
+   (int) x = 0x0001
+   (const int) y = 0x0002
+   (volatile int) z = 0x0004
+
 Two additional options that you will want to look at are --skip-pointers (-p)
 and --skip-references (-r). These two options prevent LLDB from applying a
 format for type T to values of type T* and T& respectively.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/c

[Lldb-commits] [lldb] 79ac5bb - [LLDB] Clarifying the documentation for variable formatting wrt to qualifiers and adding a test that demonstrates this

2021-04-07 Thread Shafik Yaghmour via lldb-commits

Author: Shafik Yaghmour
Date: 2021-04-07T14:29:12-07:00
New Revision: 79ac5bbb96c46e3c6c3568a441c13aa10c087b25

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

LOG: [LLDB] Clarifying the documentation for variable formatting wrt to 
qualifiers and adding a test that demonstrates this

When looking up user specified formatters qualifiers are removed from types 
before matching,
I have added a clarifying example to the document and added an example to a 
relevant test to demonstrate this behavior.

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

Added: 


Modified: 
lldb/docs/use/variable.rst

lldb/test/API/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py

lldb/test/API/functionalities/data-formatter/data-formatter-advanced/main.cpp

Removed: 




diff  --git a/lldb/docs/use/variable.rst b/lldb/docs/use/variable.rst
index b9bcdf57cdde..b3e4de588d5e 100644
--- a/lldb/docs/use/variable.rst
+++ b/lldb/docs/use/variable.rst
@@ -131,6 +131,20 @@ which provides the desired output:
(C) c = {0x03 0x00 0x00 0x00}
(D) d = 4
 
+Note, that qualifiers such as const and volatile will be stripped when 
matching types for example:
+
+::
+
+   (lldb) frame var x y z
+   (int) x = 1
+   (const int) y = 2
+   (volatile int) z = 4
+   (lldb) type format add -f hex int
+   (lldb) frame var x y z
+   (int) x = 0x0001
+   (const int) y = 0x0002
+   (volatile int) z = 0x0004
+
 Two additional options that you will want to look at are --skip-pointers (-p)
 and --skip-references (-r). These two options prevent LLDB from applying a
 format for type T to values of type T* and T& respectively.

diff  --git 
a/lldb/test/API/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
 
b/lldb/test/API/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
index d29547bb6050..42b31a10fb2c 100644
--- 
a/lldb/test/API/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
+++ 
b/lldb/test/API/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
@@ -244,6 +244,12 @@ def cleanup():
 self.expect("frame variable a_simple_object", matching=True,
 substrs=['x=0x0003'])
 
+self.expect_var_path("constInt", value='0x002a')
+
+self.expect_var_path("volatileInt", value='0x002b')
+
+self.expect_var_path("constVolatileInt", value='0x002c')
+
 # check that we can correctly cap the number of children shown
 self.runCmd("settings set target.max-children-count 5")
 

diff  --git 
a/lldb/test/API/functionalities/data-formatter/data-formatter-advanced/main.cpp 
b/lldb/test/API/functionalities/data-formatter/data-formatter-advanced/main.cpp
index ac13113da427..857e2493e1a2 100644
--- 
a/lldb/test/API/functionalities/data-formatter/data-formatter-advanced/main.cpp
+++ 
b/lldb/test/API/functionalities/data-formatter/data-formatter-advanced/main.cpp
@@ -128,6 +128,9 @@ int main (int argc, const char * argv[])
 {
 
 int iAmInt = 9;
+const int constInt = 42;
+volatile int volatileInt = 43;
+const volatile int constVolatileInt = 44;
 
 i_am_cool cool_boy(1,0.5,3);
 i_am_cooler cooler_boy(1,2,0.1,0.2,'A','B');



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


[Lldb-commits] [PATCH] D99827: Clarifying the documentation for variable formatting wrt to qualifiers and adding a test that demonstrates this

2021-04-07 Thread Shafik Yaghmour via Phabricator via lldb-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG79ac5bbb96c4: [LLDB] Clarifying the documentation for 
variable formatting wrt to qualifiers… (authored by shafik).
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D99827?vs=335929&id=335930#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99827

Files:
  lldb/docs/use/variable.rst
  
lldb/test/API/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
  lldb/test/API/functionalities/data-formatter/data-formatter-advanced/main.cpp


Index: 
lldb/test/API/functionalities/data-formatter/data-formatter-advanced/main.cpp
===
--- 
lldb/test/API/functionalities/data-formatter/data-formatter-advanced/main.cpp
+++ 
lldb/test/API/functionalities/data-formatter/data-formatter-advanced/main.cpp
@@ -128,6 +128,9 @@
 {
 
 int iAmInt = 9;
+const int constInt = 42;
+volatile int volatileInt = 43;
+const volatile int constVolatileInt = 44;
 
 i_am_cool cool_boy(1,0.5,3);
 i_am_cooler cooler_boy(1,2,0.1,0.2,'A','B');
Index: 
lldb/test/API/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
===
--- 
lldb/test/API/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
+++ 
lldb/test/API/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
@@ -244,6 +244,12 @@
 self.expect("frame variable a_simple_object", matching=True,
 substrs=['x=0x0003'])
 
+self.expect_var_path("constInt", value='0x002a')
+
+self.expect_var_path("volatileInt", value='0x002b')
+
+self.expect_var_path("constVolatileInt", value='0x002c')
+
 # check that we can correctly cap the number of children shown
 self.runCmd("settings set target.max-children-count 5")
 
Index: lldb/docs/use/variable.rst
===
--- lldb/docs/use/variable.rst
+++ lldb/docs/use/variable.rst
@@ -131,6 +131,20 @@
(C) c = {0x03 0x00 0x00 0x00}
(D) d = 4
 
+Note, that qualifiers such as const and volatile will be stripped when 
matching types for example:
+
+::
+
+   (lldb) frame var x y z
+   (int) x = 1
+   (const int) y = 2
+   (volatile int) z = 4
+   (lldb) type format add -f hex int
+   (lldb) frame var x y z
+   (int) x = 0x0001
+   (const int) y = 0x0002
+   (volatile int) z = 0x0004
+
 Two additional options that you will want to look at are --skip-pointers (-p)
 and --skip-references (-r). These two options prevent LLDB from applying a
 format for type T to values of type T* and T& respectively.


Index: lldb/test/API/functionalities/data-formatter/data-formatter-advanced/main.cpp
===
--- lldb/test/API/functionalities/data-formatter/data-formatter-advanced/main.cpp
+++ lldb/test/API/functionalities/data-formatter/data-formatter-advanced/main.cpp
@@ -128,6 +128,9 @@
 {
 
 int iAmInt = 9;
+const int constInt = 42;
+volatile int volatileInt = 43;
+const volatile int constVolatileInt = 44;
 
 i_am_cool cool_boy(1,0.5,3);
 i_am_cooler cooler_boy(1,2,0.1,0.2,'A','B');
Index: lldb/test/API/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
===
--- lldb/test/API/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
+++ lldb/test/API/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
@@ -244,6 +244,12 @@
 self.expect("frame variable a_simple_object", matching=True,
 substrs=['x=0x0003'])
 
+self.expect_var_path("constInt", value='0x002a')
+
+self.expect_var_path("volatileInt", value='0x002b')
+
+self.expect_var_path("constVolatileInt", value='0x002c')
+
 # check that we can correctly cap the number of children shown
 self.runCmd("settings set target.max-children-count 5")
 
Index: lldb/docs/use/variable.rst
===
--- lldb/docs/use/variable.rst
+++ lldb/docs/use/variable.rst
@@ -131,6 +131,20 @@
(C) c = {0x03 0x00 0x00 0x00}
(D) d = 4
 
+Note, that qualifiers such as const and volatile will be stripped when matching types for example:
+
+::
+
+   (lldb) frame var x y z
+   (int) x = 1
+   (const int) y = 2
+   (volatile int) z = 4
+   (lldb) type format add -f hex int
+   (lldb) frame var x y z
+   (int) x = 0x0001
+   (const int) y = 0x0002
+   (volatile int) z = 0x0004
+
 Two additional options that you w

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

2021-04-07 Thread Louis Dionne via Phabricator via lldb-commits
ldionne accepted this revision as: libc++, libc++abi.
ldionne added a comment.

LGTM for libcxx and libcxxabi.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99484

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


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

2021-04-07 Thread John Ericson via Phabricator via lldb-commits
Ericson2314 updated this revision to Diff 335685.
Ericson2314 added a comment.

Fix error, remove more CMAKE_INSTALL_LIBDIR


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-rename/CMakeLists.txt
  clang/tools/libclang/CMakeLists.txt
  clang/tools/scan-build/CMakeLists.txt
  clang/tools/scan-view/CMakeLists.txt
  clang/utils/hmaptool/CMakeLists.txt
  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
  libcxx/src/CMakeLists.txt
  libcxxabi/CMakeLists.txt
  libunwind/CMakeLists.txt
  libunwind/src/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
  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
  mlir/CMakeLists.txt
  mlir/cmake/modules/AddMLIR.cmake
  openmp/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}")
@@ -86,10 +88,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
@@ -275,7 +275,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()
Index: polly/CMakeLists.txt
===
--- polly/CMakeLists.txt
+++ polly/CMakeLists.txt
@@ -2,7 +2,11 @@
 if (NOT DEFINED LLVM_MAIN_SRC_DIR)
   project(Polly)

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

2021-04-07 Thread John Ericson via Phabricator via lldb-commits
Ericson2314 added a comment.

I think with this last revision this diff might finally be ready!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99484

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