[Lldb-commits] [PATCH] D104856: [lldb] replace gethostbyname call by getaddrinfo

2021-06-24 Thread serge via Phabricator via lldb-commits
serge-sans-paille created this revision.
serge-sans-paille requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

According to the manpage

  The gethostbyname*() and gethostbyaddr*() functions are obsolete. Applications
  should use getaddrinfo(3) and getnameinfo(3) instead.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104856

Files:
  lldb/tools/debugserver/source/RNBSocket.cpp


Index: lldb/tools/debugserver/source/RNBSocket.cpp
===
--- lldb/tools/debugserver/source/RNBSocket.cpp
+++ lldb/tools/debugserver/source/RNBSocket.cpp
@@ -50,10 +50,9 @@
 if (inet_pton_result == 1)
   return true;
 
-struct hostent *host_entry = gethostbyname(hostname);
-if (host_entry) {
-  std::string ip_str(
-  ::inet_ntoa(*(struct in_addr *)*host_entry->h_addr_list));
+struct addrinfo *addr = nullptr;
+if (getaddrinfo(hostname, nullptr, 0, &addr) == 0) {
+  std::string ip_str(::inet_ntoa(addr->ai_addr->sin_addr);
   inet_pton_result = ::inet_pton(AF_INET, ip_str.c_str(), &addr);
   if (inet_pton_result == 1)
 return true;


Index: lldb/tools/debugserver/source/RNBSocket.cpp
===
--- lldb/tools/debugserver/source/RNBSocket.cpp
+++ lldb/tools/debugserver/source/RNBSocket.cpp
@@ -50,10 +50,9 @@
 if (inet_pton_result == 1)
   return true;
 
-struct hostent *host_entry = gethostbyname(hostname);
-if (host_entry) {
-  std::string ip_str(
-  ::inet_ntoa(*(struct in_addr *)*host_entry->h_addr_list));
+struct addrinfo *addr = nullptr;
+if (getaddrinfo(hostname, nullptr, 0, &addr) == 0) {
+  std::string ip_str(::inet_ntoa(addr->ai_addr->sin_addr);
   inet_pton_result = ::inet_pton(AF_INET, ip_str.c_str(), &addr);
   if (inet_pton_result == 1)
 return true;
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D93479: [lldb] Simplify the is_finalized logic in process and make it thread safe.

2021-06-24 Thread Adam Brouwers-Harries via Phabricator via lldb-commits
aharries-upmem added a comment.

Hi all,

Apologies for being the bearer of bad news, but I believe that this patch 
breaks our[1] (downstream) lldb, by introducing a deadlock when a process is 
killed by a parent debugging process. Specifically, I believe that this patch 
causes a process to fail to exit, which causes a later deadlock when a listener 
waits for the process to exit.

I'm in the process of trying to produce some convincing output from our backend 
so that I can properly file a bug, but in the meantime I wanted to raise this 
here in case anyone has any comments or thoughts on this. Although I managed to 
narrow the issue down to this commit through a `git bisect`, I am not confident 
in this patch being the *cause* of the deadlock, as it may be the case that we 
are relying on incorrect behaviour in lldb that this patch fixes.

[1]: https://github.com/upmem/llvm-project/tree/upmem_release_120


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93479

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


[Lldb-commits] [PATCH] D104856: [lldb] replace gethostbyname call by getaddrinfo

2021-06-24 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor edited reviewers, added: jasonmolenda; removed: k8stone, beanz.
teemperor added a comment.

(Nit: this is from the Linux manpage but this code is only compiled on Darwin).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104856

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


[Lldb-commits] [PATCH] D104856: [lldb] replace gethostbyname call by getaddrinfo

2021-06-24 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil added a comment.

In D104856#2838515 , @teemperor wrote:

> (Nit: this is from the Linux manpage but this code is only compiled on 
> Darwin).

Why do you think so? I haven't tried to build it on OSX but according to GIT 
the last use of this function was removed by  Re-landing IPv6 support for LLDB 
Host 
.




Comment at: lldb/tools/debugserver/source/RNBSocket.cpp:37
 
 bool ResolveIPV4HostName(const char *hostname, in_addr_t &addr) {
   if (hostname == NULL || hostname[0] == '\0' ||

`in


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104856

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


[Lldb-commits] [lldb] e0f2744 - [lldb][AArch64] Add class for managing memory tags

2021-06-24 Thread David Spickett via lldb-commits

Author: David Spickett
Date: 2021-06-24T15:10:01+01:00
New Revision: e0f2744a115c41e8d295b93dd74b39535c852390

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

LOG: [lldb][AArch64] Add class for managing memory tags

This adds the MemoryTagManager class and a specialisation
of that class for AArch64 MTE tags. It provides a generic
interface for various tagging operations.
Adding/removing tags, diffing tagged pointers, etc.

Later patches will use this manager to handle memory tags
in generic code in both lldb and lldb-server.
Since it will be used in both, the base class header is in
lldb/Target.
(MemoryRegionInfo is another example of this pattern)

Reviewed By: omjavaid

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

Added: 
lldb/include/lldb/Target/MemoryTagManager.h
lldb/source/Plugins/Process/Utility/MemoryTagManagerAArch64MTE.cpp
lldb/source/Plugins/Process/Utility/MemoryTagManagerAArch64MTE.h
lldb/unittests/Process/Utility/MemoryTagManagerAArch64MTETest.cpp

Modified: 
lldb/source/Plugins/Process/Utility/CMakeLists.txt
lldb/unittests/Process/Utility/CMakeLists.txt

Removed: 




diff  --git a/lldb/include/lldb/Target/MemoryTagManager.h 
b/lldb/include/lldb/Target/MemoryTagManager.h
new file mode 100644
index 0..a0b94b19cebb2
--- /dev/null
+++ b/lldb/include/lldb/Target/MemoryTagManager.h
@@ -0,0 +1,86 @@
+//===-- MemoryTagManager.h --*- C++ 
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef LLDB_TARGET_MEMORYTAGMANAGER_H
+#define LLDB_TARGET_MEMORYTAGMANAGER_H
+
+#include "lldb/Utility/RangeMap.h"
+#include "lldb/lldb-private.h"
+#include "llvm/Support/Error.h"
+
+namespace lldb_private {
+
+// This interface allows high level commands to handle memory tags
+// in a generic way.
+//
+// Definitions:
+//   logical tag- the tag stored in a pointer
+//   allocation tag - the tag stored in hardware
+//(e.g. special memory, cache line bits)
+//   granule- number of bytes of memory a single tag applies to
+
+class MemoryTagManager {
+public:
+  typedef Range TagRange;
+
+  // Extract the logical tag from a pointer
+  // The tag is returned as a plain value, with any shifts removed.
+  // For example if your tags are stored in bits 56-60 then the logical tag
+  // you get will have been shifted down 56 before being returned.
+  virtual lldb::addr_t GetLogicalTag(lldb::addr_t addr) const = 0;
+
+  // Remove non address bits from a pointer
+  virtual lldb::addr_t RemoveNonAddressBits(lldb::addr_t addr) const = 0;
+
+  // Return the 
diff erence between two addresses, ignoring any logical tags they
+  // have. If your tags are just part of a larger set of ignored bits, this
+  // should ignore all those bits.
+  virtual ptr
diff _t AddressDiff(lldb::addr_t addr1,
+lldb::addr_t addr2) const = 0;
+
+  // Return the number of bytes a single tag covers
+  virtual lldb::addr_t GetGranuleSize() const = 0;
+
+  // Align an address range to granule boundaries.
+  // So that reading memory tags for the new range returns
+  // tags that will cover the original range.
+  //
+  // Say your granules are 16 bytes and you want
+  // tags for 16 bytes of memory starting from address 8.
+  // 1 granule isn't enough because it only covers addresses
+  // 0-16, we want addresses 8-24. So the range must be
+  // expanded to 2 granules.
+  virtual TagRange ExpandToGranule(TagRange range) const = 0;
+
+  // Return the type value to use in GDB protocol qMemTags packets to read
+  // allocation tags. This is named "Allocation" specifically because the spec
+  // allows for logical tags to be read the same way, though we do not use 
that.
+  //
+  // This value is unique within a given architecture. Meaning that 
diff erent
+  // tagging schemes within the same architecture should use unique values,
+  // but other architectures can overlap those values.
+  virtual int32_t GetAllocationTagType() const = 0;
+
+  // Return the number of bytes a single tag will be packed into during
+  // transport. For example an MTE tag is 4 bits but occupies 1 byte during
+  // transport.
+  virtual size_t GetTagSizeInBytes() const = 0;
+
+  // Unpack tags from their stored format (e.g. gdb qMemTags data) into 
seperate
+  // tags. Checks that each tag is within the expected value range and that the
+  // number of tags found matches the number of granules we originally asked
+  // for.
+  virtual llvm::Expected>
+  UnpackTagsD

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

2021-06-24 Thread David Spickett 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 rGe0f2744a115c: [lldb][AArch64] Add class for managing memory 
tags (authored by DavidSpickett).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97281

Files:
  lldb/include/lldb/Target/MemoryTagManager.h
  lldb/source/Plugins/Process/Utility/CMakeLists.txt
  lldb/source/Plugins/Process/Utility/MemoryTagManagerAArch64MTE.cpp
  lldb/source/Plugins/Process/Utility/MemoryTagManagerAArch64MTE.h
  lldb/unittests/Process/Utility/CMakeLists.txt
  lldb/unittests/Process/Utility/MemoryTagManagerAArch64MTETest.cpp

Index: lldb/unittests/Process/Utility/MemoryTagManagerAArch64MTETest.cpp
===
--- /dev/null
+++ lldb/unittests/Process/Utility/MemoryTagManagerAArch64MTETest.cpp
@@ -0,0 +1,120 @@
+//===-- MemoryTagManagerAArch64MTETest.cpp ===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "Plugins/Process/Utility/MemoryTagManagerAArch64MTE.h"
+#include "llvm/Testing/Support/Error.h"
+#include "gtest/gtest.h"
+
+using namespace lldb_private;
+
+TEST(MemoryTagManagerAArch64MTETest, UnpackTagsData) {
+  MemoryTagManagerAArch64MTE manager;
+
+  // Error for insufficient tag data
+  std::vector input;
+  ASSERT_THAT_EXPECTED(
+  manager.UnpackTagsData(input, 2),
+  llvm::FailedWithMessage(
+  "Packed tag data size does not match expected number of tags. "
+  "Expected 2 tag(s) for 2 granules, got 0 tag(s)."));
+
+  // This is out of the valid tag range
+  input.push_back(0x1f);
+  ASSERT_THAT_EXPECTED(
+  manager.UnpackTagsData(input, 1),
+  llvm::FailedWithMessage(
+  "Found tag 0x1f which is > max MTE tag value of 0xf."));
+
+  // MTE tags are 1 per byte
+  input.pop_back();
+  input.push_back(0xe);
+  input.push_back(0xf);
+
+  std::vector expected{0xe, 0xf};
+
+  llvm::Expected> got =
+  manager.UnpackTagsData(input, 2);
+  ASSERT_THAT_EXPECTED(got, llvm::Succeeded());
+  ASSERT_THAT(expected, testing::ContainerEq(*got));
+}
+
+TEST(MemoryTagManagerAArch64MTETest, GetLogicalTag) {
+  MemoryTagManagerAArch64MTE manager;
+
+  // Set surrounding bits to check shift is correct
+  ASSERT_EQ((lldb::addr_t)0, manager.GetLogicalTag(0xe0e0));
+  // Max tag value
+  ASSERT_EQ((lldb::addr_t)0xf, manager.GetLogicalTag(0x0f00));
+  ASSERT_EQ((lldb::addr_t)2, manager.GetLogicalTag(0x0200));
+}
+
+TEST(MemoryTagManagerAArch64MTETest, ExpandToGranule) {
+  MemoryTagManagerAArch64MTE manager;
+  // Reading nothing, no alignment needed
+  ASSERT_EQ(
+  MemoryTagManagerAArch64MTE::TagRange(0, 0),
+  manager.ExpandToGranule(MemoryTagManagerAArch64MTE::TagRange(0, 0)));
+
+  // Ranges with 0 size are unchanged even if address is non 0
+  // (normally 0x1234 would be aligned to 0x1230)
+  ASSERT_EQ(
+  MemoryTagManagerAArch64MTE::TagRange(0x1234, 0),
+  manager.ExpandToGranule(MemoryTagManagerAArch64MTE::TagRange(0x1234, 0)));
+
+  // Ranges already aligned don't change
+  ASSERT_EQ(
+  MemoryTagManagerAArch64MTE::TagRange(0x100, 64),
+  manager.ExpandToGranule(MemoryTagManagerAArch64MTE::TagRange(0x100, 64)));
+
+  // Any read of less than 1 granule is rounded up to reading 1 granule
+  ASSERT_EQ(
+  MemoryTagManagerAArch64MTE::TagRange(0, 16),
+  manager.ExpandToGranule(MemoryTagManagerAArch64MTE::TagRange(0, 1)));
+
+  // Start address is aligned down, and length modified accordingly
+  // Here bytes 8 through 24 straddle 2 granules. So the resulting range starts
+  // at 0 and covers 32 bytes.
+  ASSERT_EQ(
+  MemoryTagManagerAArch64MTE::TagRange(0, 32),
+  manager.ExpandToGranule(MemoryTagManagerAArch64MTE::TagRange(8, 16)));
+
+  // Here only the size of the range needs aligning
+  ASSERT_EQ(
+  MemoryTagManagerAArch64MTE::TagRange(16, 32),
+  manager.ExpandToGranule(MemoryTagManagerAArch64MTE::TagRange(16, 24)));
+
+  // Start and size need aligning here but we only need 1 granule to cover it
+  ASSERT_EQ(
+  MemoryTagManagerAArch64MTE::TagRange(16, 16),
+  manager.ExpandToGranule(MemoryTagManagerAArch64MTE::TagRange(18, 4)));
+}
+
+TEST(MemoryTagManagerAArch64MTETest, RemoveNonAddressBits) {
+  MemoryTagManagerAArch64MTE manager;
+
+  ASSERT_EQ(0, 0);
+  ASSERT_EQ((lldb::addr_t)0x00ffeedd11223344,
+manager.RemoveNonAddressBits(0x00ffeedd11223344));
+  ASSERT_EQ((lldb::addr_t)0x,
+manager.RemoveNonAddressBits(0xFF00));
+  ASSERT_EQ((lldb::addr_t)0x0055,
+ 

[Lldb-commits] [PATCH] D104856: [lldb] replace gethostbyname call by getaddrinfo

2021-06-24 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

In D104856#2838526 , @jankratochvil 
wrote:

> In D104856#2838515 , @teemperor 
> wrote:
>
>> (Nit: this is from the Linux manpage but this code is only compiled on 
>> Darwin).
>
> Why do you think so? I haven't tried to build it on OSX but according to GIT 
> the last use of this function was removed by  Re-landing IPv6 support for 
> LLDB Host 
> .

The file is part of `debugserver` which is Darwin exclusive and is also only 
compiled/used when you're on Darwin. It's also kind of its own thing: it isn't 
using LLVM libraries such as ADT and we usually leave it out of larger 
refactorings because it's kind of in "maintenance-only" mode IIRC.

Anyway, this patch is probably fine but I added Jason as a reviewer because he 
knows the debugserver best.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104856

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


[Lldb-commits] [PATCH] D104856: [lldb] replace gethostbyname call by getaddrinfo

2021-06-24 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil added a comment.

In D104856#2838571 , @teemperor wrote:

> The file is part of `debugserver` which is Darwin exclusive and is also only 
> compiled/used when you're on Darwin. It's also kind of its own thing: it 
> isn't using LLVM libraries such as ADT and we usually leave it out of larger 
> refactorings because it's kind of in "maintenance-only" mode IIRC.

I still do not understand what code can use this function on OSX and on OSX I 
build with `-DLLDB_USE_SYSTEM_DEBUGSERVER=ON` which probably won't build the 
new `lldb-server` then.

Besides that IMO @serge-sans-paille may not need to patch it when it is 
OSX-only function.




Comment at: lldb/tools/debugserver/source/RNBSocket.cpp:37
 
 bool ResolveIPV4HostName(const char *hostname, in_addr_t &addr) {
   if (hostname == NULL || hostname[0] == '\0' ||

jankratochvil wrote:
> `in
Here the prototype does not permit IPv6.



Comment at: lldb/tools/debugserver/source/RNBSocket.cpp:40
   strcmp(hostname, "localhost") == 0 ||
   strcmp(hostname, "127.0.0.1") == 0) {
 addr = htonl(INADDR_LOOPBACK);

This is redundant with `getaddrinfo`.



Comment at: lldb/tools/debugserver/source/RNBSocket.cpp:48
 // See if an IP address was specified as numbers
 int inet_pton_result = ::inet_pton(AF_INET, hostname, &addr);
 

This is redundant with `getaddrinfo`.



Comment at: lldb/tools/debugserver/source/RNBSocket.cpp:56
+  std::string ip_str(::inet_ntoa(addr->ai_addr->sin_addr);
   inet_pton_result = ::inet_pton(AF_INET, ip_str.c_str(), &addr);
   if (inet_pton_result == 1)

Here it should use `((sockaddr_in *)addr->ai_addr)->sin_addr` after verifying 
it is an IPv4 address - instead of the `inet_ntoa+inet_pton` calls.
Also it should iterate all the addresses by `addr->ai_next` (which is not 
possible with the `ResolveIPV4HostName` function prototype).



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104856

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


[Lldb-commits] [lldb] 8d58fbd - [lldb][AArch64] Add memory-tagging qSupported feature

2021-06-24 Thread David Spickett via lldb-commits

Author: David Spickett
Date: 2021-06-24T15:43:20+01:00
New Revision: 8d58fbd09efb443d92842a0d101348cda06d7253

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

LOG: [lldb][AArch64] Add memory-tagging qSupported feature

This feature "memory-tagging+" indicates that lldb-server
supports memory tagging packets. (added in a later patch)

We check HWCAP2_MTE to decide whether to enable this
feature for Linux.

Reviewed By: omjavaid

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

Added: 


Modified: 
lldb/include/lldb/Host/common/NativeProcessProtocol.h
lldb/include/lldb/Target/Process.h
lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
lldb/test/API/tools/lldb-server/TestLldbGdbServer.py

Removed: 




diff  --git a/lldb/include/lldb/Host/common/NativeProcessProtocol.h 
b/lldb/include/lldb/Host/common/NativeProcessProtocol.h
index a8ec6306e1d5a..fc5435cf4074f 100644
--- a/lldb/include/lldb/Host/common/NativeProcessProtocol.h
+++ b/lldb/include/lldb/Host/common/NativeProcessProtocol.h
@@ -243,8 +243,9 @@ class NativeProcessProtocol {
 pass_signals = (1u << 3),
 auxv = (1u << 4),
 libraries_svr4 = (1u << 5),
+memory_tagging = (1u << 6),
 
-LLVM_MARK_AS_BITMASK_ENUM(libraries_svr4)
+LLVM_MARK_AS_BITMASK_ENUM(memory_tagging)
   };
 
   class Factory {

diff  --git a/lldb/include/lldb/Target/Process.h 
b/lldb/include/lldb/Target/Process.h
index 65806084a7ae1..c849bd7766018 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -2721,6 +2721,13 @@ void PruneThreadPlans();
   /// false.
   bool RouteAsyncStructuredData(const StructuredData::ObjectSP object_sp);
 
+  /// Check whether the process supports memory tagging.
+  ///
+  /// \return
+  /// true if the process supports memory tagging,
+  /// false otherwise.
+  virtual bool SupportsMemoryTagging() { return false; }
+
   // Type definitions
   typedef std::map
   LanguageRuntimeCollection;

diff  --git 
a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py 
b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
index 67bffdd5931a8..b6243af54350a 100644
--- 
a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
+++ 
b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
@@ -858,6 +858,7 @@ def add_qSupported_packets(self, client_features=[]):
 "multiprocess",
 "fork-events",
 "vfork-events",
+"memory-tagging",
 ]
 
 def parse_qSupported_response(self, context):

diff  --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp 
b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
index 62c2a725779ee..2d53972b69b74 100644
--- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -53,11 +53,20 @@
 #include 
 #include 
 
+#ifdef __aarch64__
+#include 
+#include 
+#endif
+
 // Support hardware breakpoints in case it has not been defined
 #ifndef TRAP_HWBKPT
 #define TRAP_HWBKPT 4
 #endif
 
+#ifndef HWCAP2_MTE
+#define HWCAP2_MTE (1 << 18)
+#endif
+
 using namespace lldb;
 using namespace lldb_private;
 using namespace lldb_private::process_linux;
@@ -283,8 +292,17 @@ NativeProcessLinux::Factory::Attach(
 
 NativeProcessLinux::Extension
 NativeProcessLinux::Factory::GetSupportedExtensions() const {
-  return Extension::multiprocess | Extension::fork | Extension::vfork |
- Extension::pass_signals | Extension::auxv | Extension::libraries_svr4;
+  NativeProcessLinux::Extension supported =
+  Extension::multiprocess | Extension::fork | Extension::vfork |
+  Extension::pass_signals | Extension::auxv | Extension::libraries_svr4;
+
+#ifdef __aarch64__
+  // At this point we do not have a process so read auxv directly.
+  if ((getauxval(AT_HWCAP2) & HWCAP2_MTE))
+supported |= Extension::memory_tagging;
+#endif
+
+  return supported;
 }
 
 // Public Instance Methods

diff  --git 
a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 
b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index 78da9a060a754..db50afcfa33da 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-rem

[Lldb-commits] [PATCH] D97282: [lldb][AArch64] Add memory-tagging qSupported feature

2021-06-24 Thread David Spickett 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 rG8d58fbd09efb: [lldb][AArch64] Add memory-tagging qSupported 
feature (authored by DavidSpickett).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97282

Files:
  lldb/include/lldb/Host/common/NativeProcessProtocol.h
  lldb/include/lldb/Target/Process.h
  lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
  lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
  lldb/test/API/tools/lldb-server/TestLldbGdbServer.py

Index: lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
===
--- lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
+++ lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
@@ -1025,6 +1025,14 @@
 self.assertEqual(supported_dict.get('fork-events', '-'), '-')
 self.assertEqual(supported_dict.get('vfork-events', '-'), '-')
 
+# We need to be able to self.runCmd to get cpuinfo,
+# which is not possible when using a remote platform.
+@skipIfRemote
+def test_qSupported_memory_tagging(self):
+supported_dict = self.get_qSupported_dict()
+self.assertEqual(supported_dict.get("memory-tagging", '-'),
+ '+' if self.isAArch64MTE() else '-')
+
 @skipIfWindows # No pty support to test any inferior output
 def test_written_M_content_reads_back_correctly(self):
 self.build()
Index: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
===
--- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
+++ lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
@@ -235,6 +235,8 @@
   friend class GDBRemoteCommunicationClient;
   friend class GDBRemoteRegisterContext;
 
+  bool SupportsMemoryTagging() override;
+
   /// Broadcaster event bits definitions.
   enum {
 eBroadcastBitAsyncContinue = (1 << 0),
Index: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===
--- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -2767,6 +2767,10 @@
   return 0;
 }
 
+bool ProcessGDBRemote::SupportsMemoryTagging() {
+  return m_gdb_comm.GetMemoryTaggingSupported();
+}
+
 Status ProcessGDBRemote::WriteObjectFile(
 std::vector entries) {
   Status error;
Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
===
--- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
@@ -3608,6 +3608,8 @@
 ret.push_back("qXfer:auxv:read+");
   if (bool(plugin_features & Extension::libraries_svr4))
 ret.push_back("qXfer:libraries-svr4:read+");
+  if (bool(plugin_features & Extension::memory_tagging))
+ret.push_back("memory-tagging+");
 
   // check for client features
   m_extensions_supported = {};
Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
===
--- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
+++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
@@ -451,6 +451,8 @@
 
   bool GetSharedCacheInfoSupported();
 
+  bool GetMemoryTaggingSupported();
+
   /// Use qOffsets to query the offset used when relocating the target
   /// executable. If successful, the returned structure will contain at least
   /// one value in the offsets field.
@@ -558,6 +560,7 @@
   LazyBool m_supports_QPassSignals = eLazyBoolCalculate;
   LazyBool m_supports_error_string_reply = eLazyBoolCalculate;
   LazyBool m_supports_multiprocess = eLazyBoolCalculate;
+  LazyBool m_supports_memory_tagging = eLazyBoolCalculate;
 
   bool m_supports_qProcessInfoPID : 1, m_supports_qfProcessInfo : 1,
   m_supports_qUserName : 1, m_supports_qGroupName : 1,
Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
===
--- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -311,6 +311,7 @@
   m_supports_multiprocess = eLazyBoolNo;
   m_supports_qEcho = eLazyBoolNo;
   m_supports_QPassSignals

[Lldb-commits] [PATCH] D104856: [lldb] replace gethostbyname call by getaddrinfo

2021-06-24 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

In D104856#2838600 , @jankratochvil 
wrote:

> In D104856#2838571 , @teemperor 
> wrote:
>
>> The file is part of `debugserver` which is Darwin exclusive and is also only 
>> compiled/used when you're on Darwin. It's also kind of its own thing: it 
>> isn't using LLVM libraries such as ADT and we usually leave it out of larger 
>> refactorings because it's kind of in "maintenance-only" mode IIRC.
>
> I still do not understand what code can use this function on OSX and on OSX I 
> build with `-DLLDB_USE_SYSTEM_DEBUGSERVER=ON` which probably won't build the 
> new `lldb-server` then.

We build both `lldb-server` and `debugserver` on Darwin but we're only using 
`debugserver` by default there. And `LLDB_USE_SYSTEM_DEBUGSERVER` just makes us 
copy the (codesigned) system debugserver into our build directory instead of 
building our own (but we still build `lldb-server` with that option IIRC).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104856

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


[Lldb-commits] [lldb] cc05418 - [lldb][AArch64] Fix unpack tags test case

2021-06-24 Thread David Spickett via lldb-commits

Author: David Spickett
Date: 2021-06-24T15:53:23+01:00
New Revision: cc05418d98f3d232cc66f9065262200eaa4a14db

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

LOG: [lldb][AArch64] Fix unpack tags test case

Use %zu to print size_t vars.

Added: 


Modified: 
lldb/source/Plugins/Process/Utility/MemoryTagManagerAArch64MTE.cpp

Removed: 




diff  --git 
a/lldb/source/Plugins/Process/Utility/MemoryTagManagerAArch64MTE.cpp 
b/lldb/source/Plugins/Process/Utility/MemoryTagManagerAArch64MTE.cpp
index 964f0364d65e9..987a55e7e8575 100644
--- a/lldb/source/Plugins/Process/Utility/MemoryTagManagerAArch64MTE.cpp
+++ b/lldb/source/Plugins/Process/Utility/MemoryTagManagerAArch64MTE.cpp
@@ -74,8 +74,7 @@ MemoryTagManagerAArch64MTE::UnpackTagsData(const 
std::vector &tags,
 return llvm::createStringError(
 llvm::inconvertibleErrorCode(),
 "Packed tag data size does not match expected number of tags. "
-"Expected %" PRIu64 " tag(s) for %" PRIu64 " granules, got %" PRIu64
-" tag(s).",
+"Expected %zu tag(s) for %zu granules, got %zu tag(s).",
 granules, granules, num_tags);
   }
 



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


[Lldb-commits] [PATCH] D104856: [lldb] replace gethostbyname call by getaddrinfo

2021-06-24 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil added inline comments.



Comment at: lldb/tools/debugserver/source/RNBSocket.cpp:44
   } else if (strcmp(hostname, "*") == 0) {
 addr = htonl(INADDR_ANY);
 return true;

Here it should use `AI_PASSIVE` instead.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104856

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


[Lldb-commits] [lldb] da2e614 - [lldb][AArch64] Add memory tag reading to lldb-server

2021-06-24 Thread David Spickett via lldb-commits

Author: David Spickett
Date: 2021-06-24T17:02:55+01:00
New Revision: da2e614f56b196b37175e2babfac8ed7b43ab624

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

LOG: [lldb][AArch64] Add memory tag reading to lldb-server

This adds memory tag reading using the new "qMemTags"
packet and ptrace on AArch64 Linux.

This new packet is following the one used by GDB.
(https://sourceware.org/gdb/current/onlinedocs/gdb/General-Query-Packets.html)

On AArch64 Linux we use ptrace's PEEKMTETAGS to read
tags and we assume that lldb has already checked that the
memory region actually has tagging enabled.

We do not assume that lldb has expanded the requested range
to granules and expand it again to be sure.
(although lldb will be sending aligned ranges because it happens
to need them client side anyway)
Also we don't assume untagged addresses. So for AArch64 we'll
remove the top byte before using them. (the top byte includes
MTE and other non address data)

To do the ptrace read NativeProcessLinux will ask the native
register context for a memory tag manager based on the
type in the packet. This also gives you the ptrace numbers you need.
(it's called a register context but it also has non register data,
so it saves adding another per platform sub class)

The only supported platform for this is AArch64 Linux and the only
supported tag type is MTE allocation tags. Anything else will
error.

Ptrace can return a partial result but for lldb-server we will
be treating that as an error. To succeed we need to get all the tags
we expect.

(Note that the protocol leaves room for logical tags to be
read via qMemTags but this is not going to be implemented for lldb
at this time.)

Reviewed By: omjavaid

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

Added: 
lldb/test/API/tools/lldb-server/memory-tagging/Makefile
lldb/test/API/tools/lldb-server/memory-tagging/TestGdbRemoteMemoryTagging.py
lldb/test/API/tools/lldb-server/memory-tagging/main.c

Modified: 
lldb/include/lldb/Host/common/NativeProcessProtocol.h
lldb/include/lldb/Host/linux/Ptrace.h
lldb/include/lldb/Utility/StringExtractorGDBRemote.h
lldb/source/Host/common/NativeProcessProtocol.cpp
lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
lldb/source/Plugins/Process/Linux/NativeProcessLinux.h
lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.h
lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
lldb/source/Utility/StringExtractorGDBRemote.cpp

Removed: 




diff  --git a/lldb/include/lldb/Host/common/NativeProcessProtocol.h 
b/lldb/include/lldb/Host/common/NativeProcessProtocol.h
index fc5435cf4074f..0650b7f7cd253 100644
--- a/lldb/include/lldb/Host/common/NativeProcessProtocol.h
+++ b/lldb/include/lldb/Host/common/NativeProcessProtocol.h
@@ -87,6 +87,9 @@ class NativeProcessProtocol {
   Status ReadMemoryWithoutTrap(lldb::addr_t addr, void *buf, size_t size,
size_t &bytes_read);
 
+  virtual Status ReadMemoryTags(int32_t type, lldb::addr_t addr, size_t len,
+std::vector &tags);
+
   /// Reads a null terminated string from memory.
   ///
   /// Reads up to \p max_size bytes of memory until it finds a '\0'.

diff  --git a/lldb/include/lldb/Host/linux/Ptrace.h 
b/lldb/include/lldb/Host/linux/Ptrace.h
index c54b75f071121..29489d1ae4862 100644
--- a/lldb/include/lldb/Host/linux/Ptrace.h
+++ b/lldb/include/lldb/Host/linux/Ptrace.h
@@ -50,6 +50,12 @@ typedef int __ptrace_request;
 #define ARCH_GET_FS 0x1003
 #define ARCH_GET_GS 0x1004
 #endif
+#ifndef PTRACE_PEEKMTETAGS
+#define PTRACE_PEEKMTETAGS 33
+#endif
+#ifndef PTRACE_POKEMTETAGS
+#define PTRACE_POKEMTETAGS 34
+#endif
 
 #define LLDB_PTRACE_NT_ARM_TLS 0x401 // ARM TLS register
 

diff  --git a/lldb/include/lldb/Utility/StringExtractorGDBRemote.h 
b/lldb/include/lldb/Utility/StringExtractorGDBRemote.h
index d78bd3b139b9d..6ec9e93e8238e 100644
--- a/lldb/include/lldb/Utility/StringExtractorGDBRemote.h
+++ b/lldb/include/lldb/Utility/StringExtractorGDBRemote.h
@@ -167,6 +167,8 @@ class StringExtractorGDBRemote : public StringExtractor {
 eServerPacketType_jLLDBTraceStop,
 eServerPacketType_jLLDBTraceGetState,
 eServerPacketType_jLLDBTraceGetBinaryData,
+
+eServerPacketType_qMemTags,
   };
 
   ServerPacketType GetServerPacketType() const;

diff  --git a/lldb/source/Host/common/NativeProcessProtocol.cpp 
b/lldb/source/Host/common/NativeProcessProtocol.cpp
index d15bb21e8e6db..2beedd392c10a 100644
--- a/lldb/source/

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

2021-06-24 Thread David Spickett 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 rGda2e614f56b1: [lldb][AArch64] Add memory tag reading to 
lldb-server (authored by DavidSpickett).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95601

Files:
  lldb/include/lldb/Host/common/NativeProcessProtocol.h
  lldb/include/lldb/Host/linux/Ptrace.h
  lldb/include/lldb/Utility/StringExtractorGDBRemote.h
  lldb/source/Host/common/NativeProcessProtocol.cpp
  lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
  lldb/source/Plugins/Process/Linux/NativeProcessLinux.h
  lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.h
  lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
  lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
  lldb/source/Utility/StringExtractorGDBRemote.cpp
  lldb/test/API/tools/lldb-server/memory-tagging/Makefile
  lldb/test/API/tools/lldb-server/memory-tagging/TestGdbRemoteMemoryTagging.py
  lldb/test/API/tools/lldb-server/memory-tagging/main.c

Index: lldb/test/API/tools/lldb-server/memory-tagging/main.c
===
--- /dev/null
+++ lldb/test/API/tools/lldb-server/memory-tagging/main.c
@@ -0,0 +1,55 @@
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+int print_result(char *ptr) {
+  // Page size allows the test to try reading off of the end of the page
+  printf("buffer: %p page_size: 0x%x\n", ptr, sysconf(_SC_PAGESIZE));
+
+  // Exit after some time, so we don't leave a zombie process
+  // if the test framework lost track of us.
+  sleep(60);
+  return 0;
+}
+
+int main(int argc, char const *argv[]) {
+  if (prctl(PR_SET_TAGGED_ADDR_CTRL,
+PR_TAGGED_ADDR_ENABLE | PR_MTE_TCF_SYNC |
+// Allow all tags to be generated by the addg
+// instruction __arm_mte_increment_tag produces.
+(0x << PR_MTE_TAG_SHIFT),
+0, 0, 0)) {
+return print_result(NULL);
+  }
+
+  size_t page_size = sysconf(_SC_PAGESIZE);
+  char *buf = mmap(0, page_size, PROT_READ | PROT_WRITE | PROT_MTE,
+   MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+  if (buf == MAP_FAILED)
+return print_result(NULL);
+
+  // Set incrementing tags until end of the page
+  char *tagged_ptr = buf;
+  // This intrinsic treats the addresses as if they were untagged
+  while (__arm_mte_ptrdiff(tagged_ptr, buf) < page_size) {
+// This sets the allocation tag
+__arm_mte_set_tag(tagged_ptr);
+// Set the tag of the next granule (hence +16) to the next
+// tag value. Returns a new pointer with the new logical tag.
+// Tag values wrap at 0xF so it'll cycle.
+tagged_ptr = __arm_mte_increment_tag(tagged_ptr + 16, 1);
+  }
+
+  // lldb-server should be removing the top byte from addresses passed
+  // to ptrace. So put some random bits in there.
+  // ptrace expects you to remove them but it can still succeed if you
+  // don't. So this isn't proof that we're removing them, it's just a
+  // smoke test in case something didn't account for them.
+  buf = (char *)((size_t)buf | ((size_t)0xAA << 56));
+  return print_result(buf);
+}
Index: lldb/test/API/tools/lldb-server/memory-tagging/TestGdbRemoteMemoryTagging.py
===
--- /dev/null
+++ lldb/test/API/tools/lldb-server/memory-tagging/TestGdbRemoteMemoryTagging.py
@@ -0,0 +1,116 @@
+import gdbremote_testcase
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestGdbRemoteMemoryTagging(gdbremote_testcase.GdbRemoteTestCaseBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+def check_qmemtags_response(self, body, expected):
+self.test_sequence.add_log_lines(["read packet: $qMemTags:{}#00".format(body),
+  "send packet: ${}#00".format(expected),
+  ],
+ True)
+self.expect_gdbremote_sequence()
+
+@skipUnlessArch("aarch64")
+@skipUnlessPlatform(["linux"])
+@skipUnlessAArch64MTELinuxCompiler
+def test_qmemtags_packets(self):
+""" Test that qMemTags packets are parsed correctly and/or rejected. """
+
+self.build()
+self.set_inferior_startup_launch()
+procs = self.prep_debug_monitor_and_inferior()
+
+# Run the process
+self.test_sequence.add_log_lines(
+[
+# Start running after initial stop
+"read packet: $c#63",
+		# Match the address of the MTE page
+{"type": "output_ma

[Lldb-commits] [lldb] 5d34362 - [lldb][AArch64] Add MTE memory tag reading to lldb

2021-06-24 Thread David Spickett via lldb-commits

Author: David Spickett
Date: 2021-06-24T17:17:10+01:00
New Revision: 5d3436200147a999670f754288a03c4ac5a15aeb

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

LOG: [lldb][AArch64] Add MTE memory tag reading to lldb

This adds GDB client support for the qMemTags packet
which reads memory tags. Following the design
which was recently committed to GDB.

https://sourceware.org/gdb/current/onlinedocs/gdb/General-Query-Packets.html#General-Query-Packets
(look for qMemTags)

lldb commands will use the new Process methods
GetMemoryTagManager and ReadMemoryTags.

The former takes a range and checks that:
* The current process architecture has an architecture plugin
* That plugin provides a MemoryTagManager
* That the range of memory requested lies in a tagged range
  (it will expand it to granules for you)

If all that was true you get a MemoryTagManager you
can give to ReadMemoryTags.

This two step process is done to allow commands to get the
tag manager without having to read tags as well. For example
you might just want to remove a logical tag, or error early
if a range with tagged addresses is inverted.

Note that getting a MemoryTagManager doesn't mean that the process
or a specific memory range is tagged. Those are seperate checks.
Having a tag manager just means this architecture *could* have
a tagging feature enabled.

An architecture plugin has been added for AArch64 which
will return a MemoryTagManagerAArch64MTE, which was added in a
previous patch.

Reviewed By: omjavaid

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

Added: 
lldb/source/Plugins/Architecture/AArch64/ArchitectureAArch64.cpp
lldb/source/Plugins/Architecture/AArch64/ArchitectureAArch64.h
lldb/source/Plugins/Architecture/AArch64/CMakeLists.txt

Modified: 
lldb/include/lldb/Core/Architecture.h
lldb/include/lldb/Target/Process.h
lldb/source/Plugins/Architecture/CMakeLists.txt
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
lldb/source/Target/Process.cpp
lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp

Removed: 




diff  --git a/lldb/include/lldb/Core/Architecture.h 
b/lldb/include/lldb/Core/Architecture.h
index 2ea8bd31ebf41..b68bf27ae0df8 100644
--- a/lldb/include/lldb/Core/Architecture.h
+++ b/lldb/include/lldb/Core/Architecture.h
@@ -10,6 +10,7 @@
 #define LLDB_CORE_ARCHITECTURE_H
 
 #include "lldb/Core/PluginInterface.h"
+#include "lldb/Target/MemoryTagManager.h"
 
 namespace lldb_private {
 
@@ -97,6 +98,17 @@ class Architecture : public PluginInterface {
Target &target) const {
 return addr;
   }
+
+  // Returns a pointer to an object that can manage memory tags for this
+  // Architecture E.g. masking out tags, unpacking tag streams etc. Returns
+  // nullptr if the architecture does not have a memory tagging extension.
+  //
+  // The return pointer being valid does not mean that the current process has
+  // memory tagging enabled, just that a tagging technology exists for this
+  // architecture.
+  virtual const MemoryTagManager *GetMemoryTagManager() const {
+return nullptr;
+  }
 };
 
 } // namespace lldb_private

diff  --git a/lldb/include/lldb/Target/Process.h 
b/lldb/include/lldb/Target/Process.h
index c849bd7766018..ba51056b1c9e9 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -34,6 +34,7 @@
 #include "lldb/Target/ExecutionContextScope.h"
 #include "lldb/Target/InstrumentationRuntime.h"
 #include "lldb/Target/Memory.h"
+#include "lldb/Target/MemoryTagManager.h"
 #include "lldb/Target/QueueList.h"
 #include "lldb/Target/ThreadList.h"
 #include "lldb/Target/ThreadPlanStack.h"
@@ -1709,6 +1710,44 @@ class Process : public 
std::enable_shared_from_this,
   lldb::addr_t CallocateMemory(size_t size, uint32_t permissions,
Status &error);
 
+  /// If the address range given is in a memory tagged range and this
+  /// architecture and process supports memory tagging, return a tag
+  /// manager that can be used to maniupulate those memory tags.
+  /// Tags present in the addresses given are ignored.
+  ///
+  /// \param[in] addr
+  /// Start of memory range.
+  ///
+  /// \param[in] end_addr
+  /// End of the memory range. Where end is one beyond the last byte to be
+  /// included.
+  ///
+  /// \return
+  /// Either a valid pointer to a tag manager or an error describing why 
one
+  /// could not be provided.
+  llvm::Expected
+  GetMemoryTagManager(lldb::addr_t addr, lldb::

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

2021-06-24 Thread David Spickett 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 rG5d3436200147: [lldb][AArch64] Add MTE memory tag reading to 
lldb (authored by DavidSpickett).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95602

Files:
  lldb/include/lldb/Core/Architecture.h
  lldb/include/lldb/Target/Process.h
  lldb/source/Plugins/Architecture/AArch64/ArchitectureAArch64.cpp
  lldb/source/Plugins/Architecture/AArch64/ArchitectureAArch64.h
  lldb/source/Plugins/Architecture/AArch64/CMakeLists.txt
  lldb/source/Plugins/Architecture/CMakeLists.txt
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
  lldb/source/Target/Process.cpp
  lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp

Index: lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
===
--- lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
+++ lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
@@ -465,3 +465,68 @@
   EXPECT_EQ(llvm::None, GetQOffsets("TextSeg=0x1234"));
   EXPECT_EQ(llvm::None, GetQOffsets("TextSeg=12345678123456789"));
 }
+
+static void
+check_qmemtags(TestClient &client, MockServer &server, size_t read_len,
+   const char *packet, llvm::StringRef response,
+   llvm::Optional> expected_tag_data) {
+  const auto &ReadMemoryTags = [&](size_t len, const char *packet,
+   llvm::StringRef response) {
+std::future result = std::async(std::launch::async, [&] {
+  return client.ReadMemoryTags(0xDEF0, read_len, 1);
+});
+
+HandlePacket(server, packet, response);
+return result.get();
+  };
+
+  auto result = ReadMemoryTags(0, packet, response);
+  if (expected_tag_data) {
+ASSERT_TRUE(result);
+llvm::ArrayRef expected(*expected_tag_data);
+llvm::ArrayRef got = result->GetData();
+ASSERT_THAT(expected, testing::ContainerEq(got));
+  } else {
+ASSERT_FALSE(result);
+  }
+}
+
+TEST_F(GDBRemoteCommunicationClientTest, ReadMemoryTags) {
+  // Zero length reads are valid
+  check_qmemtags(client, server, 0, "qMemTags:def0,0:1", "m",
+ std::vector{});
+
+  // The client layer does not check the length of the received data.
+  // All we need is the "m" and for the decode to use all of the chars
+  check_qmemtags(client, server, 32, "qMemTags:def0,20:1", "m09",
+ std::vector{0x9});
+
+  // Zero length response is fine as long as the "m" is present
+  check_qmemtags(client, server, 0, "qMemTags:def0,0:1", "m",
+ std::vector{});
+
+  // Normal responses
+  check_qmemtags(client, server, 16, "qMemTags:def0,10:1", "m66",
+ std::vector{0x66});
+  check_qmemtags(client, server, 32, "qMemTags:def0,20:1", "m0102",
+ std::vector{0x1, 0x2});
+
+  // Empty response is an error
+  check_qmemtags(client, server, 17, "qMemTags:def0,11:1", "", llvm::None);
+  // Usual error response
+  check_qmemtags(client, server, 17, "qMemTags:def0,11:1", "E01", llvm::None);
+  // Leading m missing
+  check_qmemtags(client, server, 17, "qMemTags:def0,11:1", "01", llvm::None);
+  // Anything other than m is an error
+  check_qmemtags(client, server, 17, "qMemTags:def0,11:1", "z01", llvm::None);
+  // Decoding tag data doesn't use all the chars in the packet
+  check_qmemtags(client, server, 32, "qMemTags:def0,20:1", "m09zz", llvm::None);
+  // Data that is not hex bytes
+  check_qmemtags(client, server, 32, "qMemTags:def0,20:1", "mhello",
+ llvm::None);
+  // Data is not a complete hex char
+  check_qmemtags(client, server, 32, "qMemTags:def0,20:1", "m9", llvm::None);
+  // Data has a trailing hex char
+  check_qmemtags(client, server, 32, "qMemTags:def0,20:1", "m01020",
+ llvm::None);
+}
Index: lldb/source/Target/Process.cpp
===
--- lldb/source/Target/Process.cpp
+++ lldb/source/Target/Process.cpp
@@ -6065,3 +6065,84 @@
 
   return false;
 }
+
+llvm::Expected
+Process::GetMemoryTagManager(lldb::addr_t addr, lldb::addr_t end_addr) {
+  Architecture *arch = GetTarget().GetArchitecturePlugin();
+  const MemoryTagManager *tag_manager =
+  arch ? arch->GetMemoryTagManager() : nullptr;
+  if (!arch || !tag_manager) {
+return llvm::createStringError(
+llvm::inconvertibleErrorCode(),
+"This architecture does not support memory tagging",
+GetPluginName().GetCString());
+  }
+
+  if (!SupportsMemoryTagging()) {
+return llvm::createStringError(llvm::inconvertibleErrorCode(),
+ 

[Lldb-commits] [lldb] 31f9960 - [lldb][AArch64] Add "memory tag read" command

2021-06-24 Thread David Spickett via lldb-commits

Author: David Spickett
Date: 2021-06-24T17:35:45+01:00
New Revision: 31f9960c38529ce805edf9764535eb0ce188cadf

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

LOG: [lldb][AArch64] Add "memory tag read" command

This new command looks much like "memory read"
and mirrors its basic behaviour.

(lldb) memory tag read new_buf_ptr new_buf_ptr+32
Logical tag: 0x9
Allocation tags:
[0x900f7ffa000, 0x900f7ffa010): 0x9
[0x900f7ffa010, 0x900f7ffa020): 0x0

Important proprties:
* The end address is optional and defaults to reading
  1 tag if ommitted
* It is an error to try to read tags if the architecture
  or process doesn't support it, or if the range asked
  for is not tagged.
* It is an error to read an inverted range (end < begin)
  (logical tags are removed for this check so you can
  pass tagged addresses here)
* The range will be expanded to fit the tagging granule,
  so you can get more tags than simply (end-begin)/granule size.
  Whatever you get back will always cover the original range.

Reviewed By: omjavaid

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

Added: 
lldb/source/Commands/CommandObjectMemoryTag.cpp
lldb/source/Commands/CommandObjectMemoryTag.h
lldb/test/API/functionalities/memory/tag/Makefile
lldb/test/API/functionalities/memory/tag/TestMemoryTag.py
lldb/test/API/functionalities/memory/tag/main.cpp
lldb/test/API/linux/aarch64/mte_tag_read/Makefile
lldb/test/API/linux/aarch64/mte_tag_read/TestAArch64LinuxMTEMemoryTagRead.py
lldb/test/API/linux/aarch64/mte_tag_read/main.c

Modified: 
lldb/source/Commands/CMakeLists.txt
lldb/source/Commands/CommandObjectMemory.cpp

Removed: 




diff  --git a/lldb/source/Commands/CMakeLists.txt 
b/lldb/source/Commands/CMakeLists.txt
index 988ff894ea679..4a6d0c5fa86d2 100644
--- a/lldb/source/Commands/CMakeLists.txt
+++ b/lldb/source/Commands/CMakeLists.txt
@@ -16,6 +16,7 @@ add_lldb_library(lldbCommands
   CommandObjectLanguage.cpp
   CommandObjectLog.cpp
   CommandObjectMemory.cpp
+  CommandObjectMemoryTag.cpp
   CommandObjectMultiword.cpp
   CommandObjectPlatform.cpp
   CommandObjectPlugin.cpp

diff  --git a/lldb/source/Commands/CommandObjectMemory.cpp 
b/lldb/source/Commands/CommandObjectMemory.cpp
index addbf5878a56b..5487d94c90199 100644
--- a/lldb/source/Commands/CommandObjectMemory.cpp
+++ b/lldb/source/Commands/CommandObjectMemory.cpp
@@ -7,6 +7,7 @@
 
//===--===//
 
 #include "CommandObjectMemory.h"
+#include "CommandObjectMemoryTag.h"
 #include "lldb/Core/DumpDataExtractor.h"
 #include "lldb/Core/Section.h"
 #include "lldb/Core/ValueObjectMemory.h"
@@ -1736,6 +1737,8 @@ 
CommandObjectMemory::CommandObjectMemory(CommandInterpreter &interpreter)
  CommandObjectSP(new CommandObjectMemoryHistory(interpreter)));
   LoadSubCommand("region",
  CommandObjectSP(new CommandObjectMemoryRegion(interpreter)));
+  LoadSubCommand("tag",
+ CommandObjectSP(new CommandObjectMemoryTag(interpreter)));
 }
 
 CommandObjectMemory::~CommandObjectMemory() = default;

diff  --git a/lldb/source/Commands/CommandObjectMemoryTag.cpp 
b/lldb/source/Commands/CommandObjectMemoryTag.cpp
new file mode 100644
index 0..07dccf5c16fb0
--- /dev/null
+++ b/lldb/source/Commands/CommandObjectMemoryTag.cpp
@@ -0,0 +1,117 @@
+//===-- CommandObjectMemoryTag.cpp 
===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "CommandObjectMemoryTag.h"
+#include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Interpreter/OptionArgParser.h"
+#include "lldb/Target/Process.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+#define LLDB_OPTIONS_memory_tag_read
+#include "CommandOptions.inc"
+
+class CommandObjectMemoryTagRead : public CommandObjectParsed {
+public:
+  CommandObjectMemoryTagRead(CommandInterpreter &interpreter)
+  : CommandObjectParsed(interpreter, "tag",
+"Read memory tags for the given range of memory.",
+nullptr,
+eCommandRequiresTarget | eCommandRequiresProcess |
+eCommandProcessMustBePaused) {
+// Address
+m_arguments.push_back(
+
CommandArgumentEntry{CommandArgumentData(eArgTypeAddressOrExpression)});
+// Optional end address
+m_arguments.push_back(CommandArgumentEntry{
+CommandArgumentData(eArgTypeAddressOrExpression,

[Lldb-commits] [PATCH] D97285: [lldb][AArch64] Add "memory tag read" command

2021-06-24 Thread David Spickett 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 rG31f9960c3852: [lldb][AArch64] Add "memory tag 
read" command (authored by DavidSpickett).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97285

Files:
  lldb/source/Commands/CMakeLists.txt
  lldb/source/Commands/CommandObjectMemory.cpp
  lldb/source/Commands/CommandObjectMemoryTag.cpp
  lldb/source/Commands/CommandObjectMemoryTag.h
  lldb/test/API/functionalities/memory/tag/Makefile
  lldb/test/API/functionalities/memory/tag/TestMemoryTag.py
  lldb/test/API/functionalities/memory/tag/main.cpp
  lldb/test/API/linux/aarch64/mte_tag_read/Makefile
  lldb/test/API/linux/aarch64/mte_tag_read/TestAArch64LinuxMTEMemoryTagRead.py
  lldb/test/API/linux/aarch64/mte_tag_read/main.c

Index: lldb/test/API/linux/aarch64/mte_tag_read/main.c
===
--- /dev/null
+++ lldb/test/API/linux/aarch64/mte_tag_read/main.c
@@ -0,0 +1,77 @@
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+int main(int argc, char const *argv[]) {
+  // We assume that the test runner has checked we're on an MTE system
+
+  if (prctl(PR_SET_TAGGED_ADDR_CTRL,
+PR_TAGGED_ADDR_ENABLE | PR_MTE_TCF_SYNC |
+// Allow all tags to be generated by the addg
+// instruction __arm_mte_increment_tag produces.
+(0x << PR_MTE_TAG_SHIFT),
+0, 0, 0)) {
+return 1;
+  }
+
+  size_t page_size = sysconf(_SC_PAGESIZE);
+
+  // Allocate memory with MTE
+  // We ask for two pages. One is read only so that we get
+  // 2 mappings in /proc/.../smaps so we can check reading
+  // a range across mappings.
+  // The first allocation will start at the highest address,
+  // so we allocate buf2 first to get:
+  //  | buf | buf2 | 
+  int prot = PROT_READ | PROT_MTE;
+  int flags = MAP_PRIVATE | MAP_ANONYMOUS;
+
+  char *buf2 = mmap(0, page_size, prot, flags, -1, 0);
+  if (buf2 == MAP_FAILED)
+return 1;
+
+  // Writeable so we can set tags on it later
+  char *buf = mmap(0, page_size, prot | PROT_WRITE, flags, -1, 0);
+  if (buf == MAP_FAILED)
+return 1;
+
+  // We expect the mappings to be next to each other
+  if (buf2 - buf != page_size)
+return 1;
+
+  // And without MTE
+  char *non_mte_buf = mmap(0, page_size, PROT_READ | PROT_WRITE, flags, -1, 0);
+  if (non_mte_buf == MAP_FAILED)
+return 1;
+
+  // Set incrementing tags until end of the first page
+  char *tagged_ptr = buf;
+  // This ignores tag bits when subtracting the addresses
+  while (__arm_mte_ptrdiff(tagged_ptr, buf) < page_size) {
+// Set the allocation tag for this location
+__arm_mte_set_tag(tagged_ptr);
+// + 16 for 16 byte granules
+// Earlier we allowed all tag values, so this will give us an
+// incrementing pattern 0-0xF wrapping back to 0.
+tagged_ptr = __arm_mte_increment_tag(tagged_ptr + 16, 1);
+  }
+
+  // Tag the original pointer with 9
+  buf = __arm_mte_create_random_tag(buf, ~(1 << 9));
+  // A different tag so that buf_alt_tag > buf if you don't handle the tag
+  char *buf_alt_tag = __arm_mte_create_random_tag(buf, ~(1 << 10));
+
+  // lldb should be removing the whole top byte, not just the tags.
+  // So fill 63-60 with something non zero so we'll fail if we only remove tags.
+#define SET_TOP_NIBBLE(ptr) (char *)((size_t)(ptr) | (0xA << 60))
+  buf = SET_TOP_NIBBLE(buf);
+  buf_alt_tag = SET_TOP_NIBBLE(buf_alt_tag);
+  buf2 = SET_TOP_NIBBLE(buf2);
+
+  // Breakpoint here
+  return 0;
+}
Index: lldb/test/API/linux/aarch64/mte_tag_read/TestAArch64LinuxMTEMemoryTagRead.py
===
--- /dev/null
+++ lldb/test/API/linux/aarch64/mte_tag_read/TestAArch64LinuxMTEMemoryTagRead.py
@@ -0,0 +1,126 @@
+"""
+Test "memory tag read" command on AArch64 Linux with MTE.
+"""
+
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class AArch64LinuxMTEMemoryTagReadTestCase(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+NO_DEBUG_INFO_TESTCASE = True
+
+@skipUnlessArch("aarch64")
+@skipUnlessPlatform(["linux"])
+@skipUnlessAArch64MTELinuxCompiler
+def test_mte_tag_read(self):
+if not self.isAArch64MTE():
+self.skipTest('Target must support MTE.')
+
+self.build()
+self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
+
+lldbutil.run_break_set_by_file_and_line(self, "main.c",
+line_number('main.c', '// Breakpoint here'),
+num_expected_locations=1)
+
+self.runCmd("run", RUN_SUCCEEDED)
+
+if self.process().GetState() == lldb.eStateExited:
+self.fail("Test program failed to run.")
+
+self

Re: [Lldb-commits] [PATCH] D93479: [lldb] Simplify the is_finalized logic in process and make it thread safe.

2021-06-24 Thread Jim Ingham via lldb-commits
I wonder if instead of doing:

// Use our target to get a shared pointer to ourselves...
if (m_finalize_called && !PrivateStateThreadIsValid())
  BroadcastEvent(event_sp);
else
  m_private_state_broadcaster.BroadcastEvent(event_sp);

->

m_private_state_broadcaster.BroadcastEvent(event_sp);


we should have just replaced m_finalize_called with m_finalizing?  If you tried 
to sent the exited event to the private event broadcaster after it was shut 
down, that event would never get to the public process event queue.

That's the only part of the patch that seems a little suspect to me.

Can you try making that change and see if things go better?

Jim


> On Jun 24, 2021, at 6:36 AM, Adam Brouwers-Harries via Phabricator 
>  wrote:
> 
> aharries-upmem added a comment.
> 
> Hi all,
> 
> Apologies for being the bearer of bad news, but I believe that this patch 
> breaks our[1] (downstream) lldb, by introducing a deadlock when a process is 
> killed by a parent debugging process. Specifically, I believe that this patch 
> causes a process to fail to exit, which causes a later deadlock when a 
> listener waits for the process to exit.
> 
> I'm in the process of trying to produce some convincing output from our 
> backend so that I can properly file a bug, but in the meantime I wanted to 
> raise this here in case anyone has any comments or thoughts on this. Although 
> I managed to narrow the issue down to this commit through a `git bisect`, I 
> am not confident in this patch being the *cause* of the deadlock, as it may 
> be the case that we are relying on incorrect behaviour in lldb that this 
> patch fixes.
> 
> [1]: https://github.com/upmem/llvm-project/tree/upmem_release_120
> 
> 
> Repository:
>  rG LLVM Github Monorepo
> 
> CHANGES SINCE LAST ACTION
>  https://reviews.llvm.org/D93479/new/
> 
> https://reviews.llvm.org/D93479
> 

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


[Lldb-commits] [PATCH] D104856: [lldb] replace gethostbyname call by getaddrinfo

2021-06-24 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil added a comment.

On OSX with `-DLLDB_USE_SYSTEM_DEBUGSERVER=OFF` I have built:
-rwxr-xr-x  1 macbook  staff  689200 Jun 24 19:10 bin/debugserver
It uses `lldb/tools/debugserver/source/RNBSocket.cpp` (if I mess up the source 
file it does not build). The build does not need this `ResolveIPV4HostName` 
function.
So unless there is some more OSX magic the function can be removed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104856

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


[Lldb-commits] [PATCH] D104856: [lldb] replace gethostbyname call by getaddrinfo

2021-06-24 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

In D104856#2839256 , @jankratochvil 
wrote:

> On OSX with `-DLLDB_USE_SYSTEM_DEBUGSERVER=OFF` I have built:
> -rwxr-xr-x  1 macbook  staff  689200 Jun 24 19:10 bin/debugserver
> It uses `lldb/tools/debugserver/source/RNBSocket.cpp` (if I mess up the 
> source file it does not build). The build does not need this 
> `ResolveIPV4HostName` function.
> So unless there is some more OSX magic the function can be removed.

Sorry, I thought you meant with "this function" `gethostbyname` not 
`ResolveIPV4HostName`. You're right, this is indeed unused and it's also used 
in our downstream repo I think, so let's get rid of it. Good catch!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104856

___
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-06-24 Thread Florian Hahn via Phabricator via lldb-commits
fhahn added a comment.

It looks like this is breaking building LLDB on Green Dragon: 
https://smooshbase.apple.com/ci/job/am_github_build_tester/63476/console

please take a look and consider reverting if it takes longer to fix the issue


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] D95602: [lldb][AArch64] Add MTE memory tag reading to lldb

2021-06-24 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

In D95602#2839419 , @fhahn wrote:

> It looks like this is breaking building LLDB on Green Dragon: 
> https://smooshbase.apple.com/ci/job/am_github_build_tester/63476/console
>
> please take a look and consider reverting if it takes longer to fix the issue

I think that's the correct public CI that shows the failure: 
https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/33057/console

  
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/source/Target/Process.cpp:6098:44:
 error: no viable conversion from 'Range<[...], lldb::addr_t>' to 'Range<[...], 
size_t>'
tag_range = tag_manager->ExpandToGranule(tag_range);
 ^
  
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/include/lldb/Utility/RangeMap.h:29:42:
 note: candidate constructor (the implicit copy constructor) not viable: no 
known conversion from 'MemoryRegionInfo::RangeType' (aka 'Range') to 'const lldb_private::Range &' for 1st argument
  template  struct Range {
   ^
  
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/include/lldb/Utility/RangeMap.h:29:42:
 note: candidate constructor (the implicit move constructor) not viable: no 
known conversion from 'MemoryRegionInfo::RangeType' (aka 'Range') to 'lldb_private::Range &&' for 1st argument
  
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/include/lldb/Target/MemoryTagManager.h:58:45:
 note: passing argument to parameter 'range' here
virtual TagRange ExpandToGranule(TagRange range) const = 0;
  ^
  
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/source/Target/Process.cpp:6098:13:
 error: no viable overloaded '='
tag_range = tag_manager->ExpandToGranule(tag_range);
~ ^ ~~~
  
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/include/lldb/Utility/RangeMap.h:29:42:
 note: candidate function (the implicit copy assignment operator) not viable: 
no known conversion from 'Range<[...], size_t>' to 'const Range<[...], unsigned 
long long>' for 1st argument
  template  struct Range {
   ^
  
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/include/lldb/Utility/RangeMap.h:29:42:
 note: candidate function (the implicit move assignment operator) not viable: 
no known conversion from 'Range<[...], size_t>' to 'Range<[...], unsigned long 
long>' for 1st argument
  2 errors generated.


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] D95602: [lldb][AArch64] Add MTE memory tag reading to lldb

2021-06-24 Thread Florian Hahn via Phabricator via lldb-commits
fhahn added a comment.

In D95602#2839421 , @teemperor wrote:

> In D95602#2839419 , @fhahn wrote:
>
>> 
>
> I think that's the correct public CI that shows the failure: 
> https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/33057/console

This is the correct link, thanks!


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] [lldb] e50f9c4 - [lldb] Rename StringRef _lower() method calls to _insensitive()

2021-06-24 Thread Martin Storsjö via lldb-commits

Author: Martin Storsjö
Date: 2021-06-25T00:22:01+03:00
New Revision: e50f9c419a84d1e58c38aa660c445395ad8056e6

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

LOG: [lldb] Rename StringRef _lower() method calls to _insensitive()

Added: 


Modified: 
lldb/source/Commands/CommandObjectMultiword.cpp
lldb/source/Host/common/NativeRegisterContext.cpp
lldb/source/Host/windows/ProcessLauncherWindows.cpp
lldb/source/Initialization/SystemInitializerCommon.cpp
lldb/source/Interpreter/CommandInterpreter.cpp
lldb/source/Interpreter/CommandObject.cpp
lldb/source/Interpreter/OptionArgParser.cpp
lldb/source/Interpreter/OptionValueProperties.cpp
lldb/source/Interpreter/ScriptInterpreter.cpp
lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp
lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp
lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
lldb/source/Plugins/SymbolFile/NativePDB/CompileUnitIndex.cpp
lldb/source/Plugins/SymbolFile/NativePDB/PdbFPOProgramToDWARFExpression.cpp
lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
lldb/source/Target/Language.cpp
lldb/source/Target/RegisterContext.cpp
lldb/source/Utility/ArchSpec.cpp
lldb/source/Utility/ConstString.cpp
lldb/source/Utility/FileSpec.cpp
lldb/source/Utility/Log.cpp

Removed: 




diff  --git a/lldb/source/Commands/CommandObjectMultiword.cpp 
b/lldb/source/Commands/CommandObjectMultiword.cpp
index 3eafd00832446..a523fd0b1560c 100644
--- a/lldb/source/Commands/CommandObjectMultiword.cpp
+++ b/lldb/source/Commands/CommandObjectMultiword.cpp
@@ -98,7 +98,7 @@ bool CommandObjectMultiword::Execute(const char *args_string,
 return result.Succeeded();
   }
 
-  if (sub_command.equals_lower("help")) {
+  if (sub_command.equals_insensitive("help")) {
 this->CommandObject::GenerateHelpText(result);
 return result.Succeeded();
   }

diff  --git a/lldb/source/Host/common/NativeRegisterContext.cpp 
b/lldb/source/Host/common/NativeRegisterContext.cpp
index 9bb877fff878b..c534c7ac724b8 100644
--- a/lldb/source/Host/common/NativeRegisterContext.cpp
+++ b/lldb/source/Host/common/NativeRegisterContext.cpp
@@ -60,8 +60,8 @@ NativeRegisterContext::GetRegisterInfoByName(llvm::StringRef 
reg_name,
   for (uint32_t reg = start_idx; reg < num_registers; ++reg) {
 const RegisterInfo *reg_info = GetRegisterInfoAtIndex(reg);
 
-if (reg_name.equals_lower(reg_info->name) ||
-reg_name.equals_lower(reg_info->alt_name))
+if (reg_name.equals_insensitive(reg_info->name) ||
+reg_name.equals_insensitive(reg_info->alt_name))
   return reg_info;
   }
   return nullptr;

diff  --git a/lldb/source/Host/windows/ProcessLauncherWindows.cpp 
b/lldb/source/Host/windows/ProcessLauncherWindows.cpp
index bbfe4d0d01755..fc8da143b99fa 100644
--- a/lldb/source/Host/windows/ProcessLauncherWindows.cpp
+++ b/lldb/source/Host/windows/ProcessLauncherWindows.cpp
@@ -86,7 +86,7 @@ ProcessLauncherWindows::LaunchProcess(const ProcessLaunchInfo 
&launch_info,
   const char *hide_console_var =
   getenv("LLDB_LAUNCH_INFERIORS_WITHOUT_CONSOLE");
   if (hide_console_var &&
-  llvm::StringRef(hide_console_var).equals_lower("true")) {
+  llvm::StringRef(hide_console_var).equals_insensitive("true")) {
 startupinfo.dwFlags |= STARTF_USESHOWWINDOW;
 startupinfo.wShowWindow = SW_HIDE;
   }

diff  --git a/lldb/source/Initialization/SystemInitializerCommon.cpp 
b/lldb/source/Initialization/SystemInitializerCommon.cpp
index 004fdb120682a..f6012ed425fe4 100644
--- a/lldb/source/Initialization/SystemInitializerCommon.cpp
+++ b/lldb/source/Initialization/SystemInitializerCommon.cpp
@@ -96,7 +96,7 @@ llvm::Error SystemInitializerCommon::Initialize() {
 #if defined(_WIN32)
   const char *disable_crash_dialog_var = getenv("LLDB_DISABLE_CRASH_DIALOG");
   if (disable_crash_dialog_var &&
-  llvm::StringRef(disable_crash_dialog_var).equals_lower("true")) {
+  llvm::StringRef(disable_crash_dialog_var).equals_insensitive("true")) {
 // This will prevent Windows from displaying a dialog box requiring user
 // interaction when
 // LLDB crashes.  This is mostly useful when automating LLDB, for example

diff  --git a/lldb/source/Interpreter/CommandInterpreter.cpp 
b/lldb/source/Interpreter/CommandInterpreter.cpp
index 8a3a4092c0f61..2e07ff5703ff2 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -2675,7 +2675,7 @@ void CommandInterpreter::FindCommandsForApropos(
 const bool search_long_help = false;
 const bool search_syntax = false;
  

[Lldb-commits] [lldb] 9ca0171 - [LLDB] Fix broken LLDB build due MemoryTagManager.h

2021-06-24 Thread Muhammad Omair Javaid via lldb-commits

Author: Muhammad Omair Javaid
Date: 2021-06-25T02:37:55+05:00
New Revision: 9ca0171a9ffdef5fdb1511d197a3fd72490362de

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

LOG: [LLDB] Fix broken LLDB build due MemoryTagManager.h

Commit e0f2744a115c41e8d295b93dd74b39535c852390 broke LLDB build.
This patch fixes the build. Tested on Arm/AArch64 Linux.

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

Added: 


Modified: 
lldb/include/lldb/Target/MemoryTagManager.h

Removed: 




diff  --git a/lldb/include/lldb/Target/MemoryTagManager.h 
b/lldb/include/lldb/Target/MemoryTagManager.h
index a0b94b19cebb..f6383d82efcd 100644
--- a/lldb/include/lldb/Target/MemoryTagManager.h
+++ b/lldb/include/lldb/Target/MemoryTagManager.h
@@ -26,7 +26,7 @@ namespace lldb_private {
 
 class MemoryTagManager {
 public:
-  typedef Range TagRange;
+  typedef Range TagRange;
 
   // Extract the logical tag from a pointer
   // The tag is returned as a plain value, with any shifts removed.



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


[Lldb-commits] [PATCH] D104395: [LLDB][GUI] Add initial forms support

2021-06-24 Thread Omar Emara via Phabricator via lldb-commits
OmarEmaraDev updated this revision to Diff 354364.
OmarEmaraDev added a comment.

- Add Surface type.
- Add Pad and SubPad types.
- Implement dynamic scrolling.
- Implement per-field validation and error messages.
- Implement File field.
- Implement Directory field.
- Implement List field.
- Refactor field drawing.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104395

Files:
  lldb/source/Core/IOHandlerCursesGUI.cpp

Index: lldb/source/Core/IOHandlerCursesGUI.cpp
===
--- lldb/source/Core/IOHandlerCursesGUI.cpp
+++ lldb/source/Core/IOHandlerCursesGUI.cpp
@@ -336,93 +336,52 @@
   int m_first_visible_line;
 };
 
-class Window {
+// A surface is an abstraction for something than can be drawn on. The surface
+// have a width, a height, a cursor position, and a multitude of drawing
+// operations. This type should be sub-classed to get an actually useful ncurses
+// object, such as a Window, SubWindow, Pad, or a SubPad.
+class Surface {
 public:
-  Window(const char *name)
-  : m_name(name), m_window(nullptr), m_panel(nullptr), m_parent(nullptr),
-m_subwindows(), m_delegate_sp(), m_curr_active_window_idx(UINT32_MAX),
-m_prev_active_window_idx(UINT32_MAX), m_delete(false),
-m_needs_update(true), m_can_activate(true), m_is_subwin(false) {}
+  Surface() : m_window(nullptr) {}
 
-  Window(const char *name, WINDOW *w, bool del = true)
-  : m_name(name), m_window(nullptr), m_panel(nullptr), m_parent(nullptr),
-m_subwindows(), m_delegate_sp(), m_curr_active_window_idx(UINT32_MAX),
-m_prev_active_window_idx(UINT32_MAX), m_delete(del),
-m_needs_update(true), m_can_activate(true), m_is_subwin(false) {
-if (w)
-  Reset(w);
-  }
+  WINDOW *get() { return m_window; }
 
-  Window(const char *name, const Rect &bounds)
-  : m_name(name), m_window(nullptr), m_parent(nullptr), m_subwindows(),
-m_delegate_sp(), m_curr_active_window_idx(UINT32_MAX),
-m_prev_active_window_idx(UINT32_MAX), m_delete(true),
-m_needs_update(true), m_can_activate(true), m_is_subwin(false) {
-Reset(::newwin(bounds.size.height, bounds.size.width, bounds.origin.y,
-   bounds.origin.y));
-  }
+  operator WINDOW *() { return m_window; }
 
-  virtual ~Window() {
-RemoveSubWindows();
-Reset();
+  // Copy a region of the surface to another surface.
+  void CopyToSurface(Surface &target, Point source_origin, Point target_origin,
+ Size size) {
+::copywin(m_window, target.get(), source_origin.y, source_origin.x,
+  target_origin.y, target_origin.x,
+  target_origin.y + size.height - 1,
+  target_origin.x + size.width - 1, false);
   }
 
-  void Reset(WINDOW *w = nullptr, bool del = true) {
-if (m_window == w)
-  return;
-
-if (m_panel) {
-  ::del_panel(m_panel);
-  m_panel = nullptr;
-}
-if (m_window && m_delete) {
-  ::delwin(m_window);
-  m_window = nullptr;
-  m_delete = false;
-}
-if (w) {
-  m_window = w;
-  m_panel = ::new_panel(m_window);
-  m_delete = del;
-}
-  }
+  int GetCursorX() const { return getcurx(m_window); }
+  int GetCursorY() const { return getcury(m_window); }
+  void MoveCursor(int x, int y) { ::wmove(m_window, y, x); }
 
   void AttributeOn(attr_t attr) { ::wattron(m_window, attr); }
   void AttributeOff(attr_t attr) { ::wattroff(m_window, attr); }
-  void Box(chtype v_char = ACS_VLINE, chtype h_char = ACS_HLINE) {
-::box(m_window, v_char, h_char);
-  }
-  void Clear() { ::wclear(m_window); }
-  void Erase() { ::werase(m_window); }
-  Rect GetBounds() const {
-return Rect(GetParentOrigin(), GetSize());
-  } // Get the rectangle in our parent window
-  int GetChar() { return ::wgetch(m_window); }
-  int GetCursorX() const { return getcurx(m_window); }
-  int GetCursorY() const { return getcury(m_window); }
-  Rect GetFrame() const {
-return Rect(Point(), GetSize());
-  } // Get our rectangle in our own coordinate system
-  Point GetParentOrigin() const { return Point(GetParentX(), GetParentY()); }
-  Size GetSize() const { return Size(GetWidth(), GetHeight()); }
-  int GetParentX() const { return getparx(m_window); }
-  int GetParentY() const { return getpary(m_window); }
+
   int GetMaxX() const { return getmaxx(m_window); }
   int GetMaxY() const { return getmaxy(m_window); }
   int GetWidth() const { return GetMaxX(); }
   int GetHeight() const { return GetMaxY(); }
-  void MoveCursor(int x, int y) { ::wmove(m_window, y, x); }
-  void MoveWindow(int x, int y) { MoveWindow(Point(x, y)); }
-  void Resize(int w, int h) { ::wresize(m_window, h, w); }
-  void Resize(const Size &size) {
-::wresize(m_window, size.height, size.width);
-  }
-  void PutChar(int ch) { ::waddch(m_window, ch); }
-  void PutCString(const char *s, int len = -1) { ::

[Lldb-commits] [lldb] f1e2d58 - [OptTable] Rename PrintHelp to printHelp

2021-06-24 Thread Fangrui Song via lldb-commits

Author: Fangrui Song
Date: 2021-06-24T14:47:03-07:00
New Revision: f1e2d5851bf869685971d5acb894b39a89ea2d49

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

LOG: [OptTable] Rename PrintHelp to printHelp

To be consistent with other member functions and match the coding standard.

Added: 


Modified: 
clang/lib/Driver/Driver.cpp
clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
clang/tools/driver/cc1as_main.cpp
flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
lld/COFF/DriverUtils.cpp
lld/ELF/DriverUtils.cpp
lld/MachO/DriverUtils.cpp
lld/MinGW/Driver.cpp
lld/lib/Driver/DarwinLdDriver.cpp
lld/wasm/Driver.cpp
lldb/tools/driver/Driver.cpp
lldb/tools/lldb-server/lldb-gdbserver.cpp
lldb/tools/lldb-vscode/lldb-vscode.cpp
llvm/include/llvm/Option/OptTable.h
llvm/lib/Option/OptTable.cpp
llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
llvm/tools/dsymutil/dsymutil.cpp
llvm/tools/llvm-cvtres/llvm-cvtres.cpp
llvm/tools/llvm-lipo/llvm-lipo.cpp
llvm/tools/llvm-ml/llvm-ml.cpp
llvm/tools/llvm-mt/llvm-mt.cpp
llvm/tools/llvm-objcopy/ConfigManager.cpp
llvm/tools/llvm-objdump/llvm-objdump.cpp
llvm/tools/llvm-rc/llvm-rc.cpp
llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
llvm/unittests/Option/OptionParsingTest.cpp

Removed: 




diff  --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 1afaaba79105b..6ea6e2e47e639 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -1635,7 +1635,7 @@ void Driver::PrintHelp(bool ShowHidden) const {
 ExcludedFlagsBitmask |= options::FlangOnlyOption;
 
   std::string Usage = llvm::formatv("{0} [options] file...", Name).str();
-  getOpts().PrintHelp(llvm::outs(), Usage.c_str(), DriverTitle.c_str(),
+  getOpts().printHelp(llvm::outs(), Usage.c_str(), DriverTitle.c_str(),
   IncludedFlagsBitmask, ExcludedFlagsBitmask,
   /*ShowAllAliases=*/false);
 }

diff  --git a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp 
b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
index ac64e1708da6c..b95851e380d28 100644
--- a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
+++ b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
@@ -187,7 +187,7 @@ CreateFrontendAction(CompilerInstance &CI) {
 bool ExecuteCompilerInvocation(CompilerInstance *Clang) {
   // Honor -help.
   if (Clang->getFrontendOpts().ShowHelp) {
-driver::getDriverOptTable().PrintHelp(
+driver::getDriverOptTable().printHelp(
 llvm::outs(), "clang -cc1 [options] file...",
 "LLVM 'Clang' Compiler: http://clang.llvm.org";,
 /*Include=*/driver::options::CC1Option,

diff  --git a/clang/tools/driver/cc1as_main.cpp 
b/clang/tools/driver/cc1as_main.cpp
index 9f6a58b634b4b..086ce0ea77875 100644
--- a/clang/tools/driver/cc1as_main.cpp
+++ b/clang/tools/driver/cc1as_main.cpp
@@ -585,7 +585,7 @@ int cc1as_main(ArrayRef Argv, const char 
*Argv0, void *MainAddr) {
 return 1;
 
   if (Asm.ShowHelp) {
-getDriverOptTable().PrintHelp(
+getDriverOptTable().printHelp(
 llvm::outs(), "clang -cc1as [options] file...",
 "Clang Integrated Assembler",
 /*Include=*/driver::options::CC1AsOption, /*Exclude=*/0,

diff  --git a/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp 
b/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
index e53f652d3b2c4..243e25163dc05 100644
--- a/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
+++ b/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
@@ -103,7 +103,7 @@ std::unique_ptr 
CreateFrontendAction(CompilerInstance &ci) {
 bool ExecuteCompilerInvocation(CompilerInstance *flang) {
   // Honor -help.
   if (flang->frontendOpts().showHelp_) {
-clang::driver::getDriverOptTable().PrintHelp(llvm::outs(),
+clang::driver::getDriverOptTable().printHelp(llvm::outs(),
 "flang-new -fc1 [options] file...", "LLVM 'Flang' Compiler",
 /*Include=*/clang::driver::options::FC1Option,
 /*Exclude=*/llvm::opt::DriverFlag::HelpHidden,

diff  --git a/lld/COFF/DriverUtils.cpp b/lld/COFF/DriverUtils.cpp
index d6261209a9c1c..b5abe8b1196d9 100644
--- a/lld/COFF/DriverUtils.cpp
+++ b/lld/COFF/DriverUtils.cpp
@@ -933,7 +933,7 @@ std::vector ArgParser::tokenize(StringRef s) {
 }
 
 void printHelp(const char *argv0) {
-  optTable.PrintHelp(lld::outs(),
+  optTable.printHelp(lld::outs(),
  (std::string(argv0) + " [options] file...").c_str(),
  "LLVM Linker", false);
 }

diff  --git a/lld/ELF/DriverUtils.cpp b/lld/ELF/DriverUtils.cpp
index a3fc522c708c2..f49deb9012b28 100644
--- a/lld/ELF/DriverUtils.cpp
+++ b/lld/ELF/DriverUtils.cpp
@@ -

[Lldb-commits] [PATCH] D104395: [LLDB][GUI] Add initial forms support

2021-06-24 Thread Omar Emara via Phabricator via lldb-commits
OmarEmaraDev planned changes to this revision.
OmarEmaraDev added a comment.

Not available in this patch yet:

- Global error messages.
- Contextual scrolling.
- Action bar.
- Auto completion.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104395

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


[Lldb-commits] [lldb] 3b4aad1 - Fix typo in TestMemoryTag.py

2021-06-24 Thread Muhammad Omair Javaid via lldb-commits

Author: Muhammad Omair Javaid
Date: 2021-06-24T22:19:51Z
New Revision: 3b4aad1186e8e8e6f6c7887cb5e8d9bfd7d3ce2f

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

LOG: Fix typo in TestMemoryTag.py

TestMemoryTag.py should fail if underlying target doesnt support MTE.

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

Added: 


Modified: 
lldb/test/API/functionalities/memory/tag/TestMemoryTag.py

Removed: 




diff  --git a/lldb/test/API/functionalities/memory/tag/TestMemoryTag.py 
b/lldb/test/API/functionalities/memory/tag/TestMemoryTag.py
index 608845600c125..04bc4cc4b6a65 100644
--- a/lldb/test/API/functionalities/memory/tag/TestMemoryTag.py
+++ b/lldb/test/API/functionalities/memory/tag/TestMemoryTag.py
@@ -18,7 +18,7 @@ class MemoryTagTestCase(TestBase):
 
 def test_memory_tag_read_unsupported(self):
 """Test that "memory tag read" errors on unsupported platforms"""
-if self.isAArch64MTE():
+if not self.isAArch64MTE():
 self.skipTest("Requires a target without AArch64 MTE.")
 
 self.build()



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


[Lldb-commits] [lldb] 473a3a7 - Disable check_qmemtags unit tests

2021-06-24 Thread Muhammad Omair Javaid via lldb-commits

Author: Muhammad Omair Javaid
Date: 2021-06-24T22:36:31Z
New Revision: 473a3a773ea565612e836ae6c2093178c5a9eb72

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

LOG: Disable check_qmemtags unit tests

check_qmemtags tests are broken on Arm 32 bits. This patch disables
these tests.

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

Added: 


Modified: 
lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp

Removed: 




diff  --git 
a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp 
b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
index b9fc107527a21..91e63451d949c 100644
--- a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
+++ b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
@@ -465,7 +465,7 @@ TEST_F(GDBRemoteCommunicationClientTest, GetQOffsets) {
   EXPECT_EQ(llvm::None, GetQOffsets("TextSeg=0x1234"));
   EXPECT_EQ(llvm::None, GetQOffsets("TextSeg=12345678123456789"));
 }
-
+#if 0
 static void
 check_qmemtags(TestClient &client, MockServer &server, size_t read_len,
const char *packet, llvm::StringRef response,
@@ -530,3 +530,4 @@ TEST_F(GDBRemoteCommunicationClientTest, ReadMemoryTags) {
   check_qmemtags(client, server, 32, "qMemTags:def0,20:1", "m01020",
  llvm::None);
 }
+#endif



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


[Lldb-commits] [lldb] 975af86 - Disable TestAArch64UnwindPAC.py for non PAC targets

2021-06-24 Thread Muhammad Omair Javaid via lldb-commits

Author: Muhammad Omair Javaid
Date: 2021-06-24T22:50:36Z
New Revision: 975af861f38fe2f11f98aeb990e9b6ee9dfee9ea

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

LOG: Disable TestAArch64UnwindPAC.py for non PAC targets

TestAArch64UnwindPAC.py started failing on LLDB buildbot as underlying
hardware does not support PAC. This patch skips this test for targets
which do not support PAC feature.

Added: 


Modified: 

lldb/test/API/functionalities/unwind/aarch64_unwind_pac/TestAArch64UnwindPAC.py

Removed: 




diff  --git 
a/lldb/test/API/functionalities/unwind/aarch64_unwind_pac/TestAArch64UnwindPAC.py
 
b/lldb/test/API/functionalities/unwind/aarch64_unwind_pac/TestAArch64UnwindPAC.py
index 8f88e644b6537..9b2faf7f1e78d 100644
--- 
a/lldb/test/API/functionalities/unwind/aarch64_unwind_pac/TestAArch64UnwindPAC.py
+++ 
b/lldb/test/API/functionalities/unwind/aarch64_unwind_pac/TestAArch64UnwindPAC.py
@@ -15,6 +15,9 @@ class AArch64UnwindPAC(TestBase):
 @skipIf(oslist=no_match(['linux']))
 def test(self):
 """Test that we can backtrace correctly when AArch64 PAC is enabled"""
+if not self.isAArch64PAuth():
+self.skipTest('Target must support Pointer Authentication.')
+
 self.build()
 
 self.line = line_number('main.c', '// Frame func_c')



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


[Lldb-commits] [PATCH] D104882: makes extension contribute breakpoints using new package.json schema:https://code.visualstudio.com/updates/v1_42#_implement-a-debug-adapter-inside-an-extension

2021-06-24 Thread Chris Bond via Phabricator via lldb-commits
chrisbond created this revision.
chrisbond 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/D104882

Files:
  lldb/tools/lldb-vscode/package.json

Index: lldb/tools/lldb-vscode/package.json
===
--- lldb/tools/lldb-vscode/package.json
+++ lldb/tools/lldb-vscode/package.json
@@ -1,296 +1,327 @@
 {
-	"name": "lldb-vscode",
-	"displayName": "LLDB native Debug stub",
-	"version": "0.1.0",
-	"publisher": "llvm",
-	"repository": "llvm.org",
-	"description": "Debug adapter for LLDB which uses a C++ tool to interface directly with LLDB.",
-	"author": {
-		"name": "Greg Clayton",
-		"email": "clayb...@gmail.com"
-	},
-	"license": "LLVM",
-	"keywords": [
-		"multi-root ready"
-	],
-	"engines": {
-		"vscode": "^1.18.0",
-		"node": "^7.9.0"
-	},
-	"categories": [
-		"Debuggers"
-	],
-	"private": true,
-	"devDependencies": {
-		"@types/node": "7.0.43",
-		"@types/mocha": "2.2.45",
-		"typescript": "2.6.2",
-		"mocha": "4.0.1",
-		"vscode": "1.1.10",
-		"vscode-debugadapter-testsupport": "1.25.0",
-		"tslint": "5.8.0",
-		"vsce": "^1.36.3"
-	},
-	"contributes": {
-		"languages": [
-			{
-"id": "lldb.disassembly",
-"aliases": [
-"Disassembly"
+  "name": "lldb-vscode",
+  "displayName": "LLDB native Debug stub",
+  "version": "0.1.0",
+  "publisher": "llvm",
+  "repository": "llvm.org",
+  "description": "Debug adapter for LLDB which uses a C++ tool to interface directly with LLDB.",
+  "author": {
+"name": "Greg Clayton",
+"email": "clayb...@gmail.com"
+  },
+  "license": "LLVM",
+  "keywords": [
+"multi-root ready"
+  ],
+  "engines": {
+"vscode": "^1.18.0",
+"node": "^7.9.0"
+  },
+  "categories": [
+"Debuggers"
+  ],
+  "private": true,
+  "devDependencies": {
+"@types/node": "7.0.43",
+"@types/mocha": "2.2.45",
+"typescript": "2.6.2",
+"mocha": "4.0.1",
+"vscode": "1.1.10",
+"vscode-debugadapter-testsupport": "1.25.0",
+"tslint": "5.8.0",
+"vsce": "^1.36.3"
+  },
+  "contributes": {
+"languages": [
+  {
+"id": "lldb.disassembly",
+"aliases": [
+  "Disassembly"
+],
+"extensions": [
+  ".disasm"
+]
+  }
+],
+"grammars": [
+  {
+"language": "lldb.disassembly",
+"scopeName": "source.disassembly",
+"path": "./syntaxes/disassembly.json"
+  }
+],
+"breakpoints": [
+  {
+"language": "markdown"
+  },
+  {
+"language": "ada"
+  },
+  {
+"language": "arm"
+  },
+  {
+"language": "asm"
+  },
+  {
+"language": "c"
+  },
+  {
+"language": "cpp"
+  },
+  {
+"language": "crystal"
+  },
+  {
+"language": "d"
+  },
+  {
+"language": "fortan"
+  },
+  {
+"language": "fortran-modern"
+  },
+  {
+"language": "nim"
+  },
+  {
+"language": "objective-c"
+  },
+  {
+"language": "objectpascal"
+  },
+  {
+"language": "pascal"
+  },
+  {
+"language": "rust"
+  },
+  {
+"language": "swift"
+  }
+],
+"debuggers": [
+  {
+"type": "lldb-vscode",
+"label": "Native LLDB Debugger",
+"program": "./bin/lldb-vscode",
+"windows": {
+  "program": "./bin/lldb-vscode.exe"
+},
+"configurationAttributes": {
+  "launch": {
+"required": [
+  "program"
+],
+"properties": {
+  "program": {
+"type": "string",
+"description": "Path to the program to debug."
+  },
+  "args": {
+"type": [
+  "array",
+  "string"
+],
+"description": "Program arguments.",
+"default": []
+  },
+  "cwd": {
+"type": "string",
+"description": "Program working directory.",
+"default": "${workspaceRoot}"
+  },
+  "env": {
+"type": "array",
+"description": "Additional environment variables to set when launching the program. This is an array of strings that contains the variable name followed by an optional '=' character and the environment variable's value. Example:  [\"FOO=BAR\", \"BAZ\"]",
+"default": []
+  },
+  "stopOnEntry": {
+"type": "boolean",
+"description": "Automatically stop after launch.",
+"default": false
+  },
+  "disableASLR": {
+"type": "boolean",
+"description": "Enable or di

[Lldb-commits] [PATCH] D104882: makes extension contribute breakpoints using new package.json schema:https://code.visualstudio.com/updates/v1_42#_implement-a-debug-adapter-inside-an-extension

2021-06-24 Thread Chris Bond via Phabricator via lldb-commits
chrisbond updated this revision to Diff 354392.
chrisbond added a comment.
Herald added a subscriber: JDevlieghere.

minimize diff content


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

https://reviews.llvm.org/D104882

Files:
  lldb/tools/lldb-vscode/package.json


Index: lldb/tools/lldb-vscode/package.json
===
--- lldb/tools/lldb-vscode/package.json
+++ lldb/tools/lldb-vscode/package.json
@@ -50,29 +50,57 @@
 "path": "./syntaxes/disassembly.json"
 }
 ],
+   "breakpoints": [
+   {
+   "language": "ada"
+   },
+   {
+   "language": "arm"
+   },
+   {
+   "language": "asm"
+   },
+   {
+   "language": "c"
+   },
+   {
+   "language": "cpp"
+   },
+   {
+   "language": "crystal"
+   },
+   {
+   "language": "d"
+   },
+   {
+   "language": "fortan"
+   },
+   {
+   "language": "fortran-modern"
+   },
+   {
+   "language": "nim"
+   },
+   {
+   "language": "objective-c"
+   },
+   {
+   "language": "objectpascal"
+   },
+   {
+   "language": "pascal"
+   },
+   {
+   "language": "rust"
+   },
+   {
+   "language": "swift"
+   }
+   ],
"debuggers": [
{
"type": "lldb-vscode",
"label": "Native LLDB Debugger",
-   "enableBreakpointsFor": {
-   "languageIds": [
-   "ada",
-   "arm",
-   "asm",
-   "c",
-   "cpp",
-   "crystal",
-   "d",
-   "fortan",
-   "fortran-modern",
-   "nim",
-   "objective-c",
-   "objectpascal",
-   "pascal",
-   "rust",
-   "swift"
-   ]
-   },
"program": "./bin/lldb-vscode",
"windows": {
"program": "./bin/lldb-vscode.exe"


Index: lldb/tools/lldb-vscode/package.json
===
--- lldb/tools/lldb-vscode/package.json
+++ lldb/tools/lldb-vscode/package.json
@@ -50,29 +50,57 @@
 "path": "./syntaxes/disassembly.json"
 }
 ],
+"breakpoints": [
+	{
+		"language": "ada"
+	},
+	{
+		"language": "arm"
+	},
+	{
+		"language": "asm"
+	},
+	{
+		"language": "c"
+	},
+	{
+		"language": "cpp"
+	},
+	{
+		"language": "crystal"
+	},
+	{
+		"language": "d"
+	},
+	{

[Lldb-commits] [PATCH] D104422: [trace] Add a TraceCursor class

2021-06-24 Thread Vedant Kumar via Phabricator via lldb-commits
vsk added a comment.

FTR, I'm quite happy with the new direction. Thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104422

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


[Lldb-commits] [PATCH] D104422: [trace] Add a TraceCursor class

2021-06-24 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

In D104422#2839895 , @vsk wrote:

> FTR, I'm quite happy with the new direction. Thanks!

Thanks for your input. It helped us come up with something we thought made 
sense given all the input!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104422

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


[Lldb-commits] [PATCH] D104893: Add data formatter support for a missing NSDictionary variant

2021-06-24 Thread Jim Ingham via Phabricator via lldb-commits
jingham updated this revision to Diff 354418.
jingham added a comment.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Formatting


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104893

Files:
  lldb/source/Plugins/Language/ObjC/NSDictionary.cpp
  
lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSContainer.py
  lldb/test/API/functionalities/data-formatter/data-formatter-objc/main.m


Index: lldb/test/API/functionalities/data-formatter/data-formatter-objc/main.m
===
--- lldb/test/API/functionalities/data-formatter/data-formatter-objc/main.m
+++ lldb/test/API/functionalities/data-formatter/data-formatter-objc/main.m
@@ -476,6 +476,10 @@
   [newMutableDictionary setObject:@"foo" forKey:@"bar19"];
   [newMutableDictionary setObject:@"foo" forKey:@"bar20"];
 
+  /* Copying an NSMutableDictionary makes a different member of the
+ class cluster, so let's also make a copy of this one: */
+  NSMutableDictionary *copyDictionary = [newMutableDictionary copy];
+
   CFMutableDictionaryRef newMutableDictionaryRef = 
CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 0, newMutableDictionary);
 
   id cfKeys[4] = {@"foo", @"bar", @"baz", @"quux"};
Index: 
lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSContainer.py
===
--- 
lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSContainer.py
+++ 
lldb/test/API/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjCNSContainer.py
@@ -20,7 +20,7 @@
 
 def nscontainers_data_formatter_commands(self):
 self.expect(
-'frame variable newArray nsDictionary newDictionary nscfDictionary 
cfDictionaryRef newMutableDictionary newMutableDictionaryRef cfarray_ref 
mutable_array_ref',
+'frame variable newArray nsDictionary newDictionary nscfDictionary 
cfDictionaryRef newMutableDictionary copyDictionary newMutableDictionaryRef 
cfarray_ref mutable_array_ref',
 substrs=[
 '(NSArray *) newArray = ',
 ' @"50 elements"',
@@ -34,6 +34,8 @@
 ' 2 key/value pairs',
 '(NSDictionary *) newMutableDictionary = ',
 ' 21 key/value pairs',
+'(NSMutableDictionary *) copyDictionary = ',
+' 21 key/value pairs',
 '(CFMutableDictionaryRef) newMutableDictionaryRef = ',
 ' 21 key/value pairs',
 '(CFArrayRef) cfarray_ref = ',
@@ -42,6 +44,9 @@
 ' @"11 elements"',
 ])
 
+self.expect('frame var -d run-target copyDictionary[10]',
+substrs=['@"bar9"', '@"foo"'])
+
 self.expect(
 'frame variable -d run-target *nscfDictionary',
 patterns=[
Index: lldb/source/Plugins/Language/ObjC/NSDictionary.cpp
===
--- lldb/source/Plugins/Language/ObjC/NSDictionary.cpp
+++ lldb/source/Plugins/Language/ObjC/NSDictionary.cpp
@@ -410,6 +410,7 @@
   static const ConstString g_DictionaryM("__NSDictionaryM");
   static const ConstString g_DictionaryMLegacy("__NSDictionaryM_Legacy");
   static const ConstString g_DictionaryMImmutable("__NSDictionaryM_Immutable");
+  static const ConstString g_DictionaryMFrozen("__NSFrozenDictionaryM");
   static const ConstString g_Dictionary1("__NSSingleEntryDictionaryI");
   static const ConstString g_Dictionary0("__NSDictionary0");
   static const ConstString g_DictionaryCF("__CFDictionary");
@@ -427,7 +428,8 @@
   return false;
 
 value &= (is_64bit ? ~0xFC00UL : ~0xFC00U);
-  } else if (class_name == g_DictionaryM || class_name == g_DictionaryMLegacy) 
{
+  } else if (class_name == g_DictionaryM || class_name == g_DictionaryMLegacy 
+ || class_name == g_DictionaryMFrozen) {
 AppleObjCRuntime *apple_runtime =
 llvm::dyn_cast_or_null(runtime);
 Status error;
@@ -509,6 +511,7 @@
   static const ConstString g_DictionaryM("__NSDictionaryM");
   static const ConstString g_Dictionary1("__NSSingleEntryDictionaryI");
   static const ConstString g_DictionaryImmutable("__NSDictionaryM_Immutable");
+  static const ConstString g_DictionaryMFrozen("__NSFrozenDictionaryM");
   static const ConstString g_DictionaryMLegacy("__NSDictionaryM_Legacy");
   static const ConstString g_Dictionary0("__NSDictionary0");
   static const ConstString g_DictionaryCF("__CFDictionary");
@@ -520,7 +523,7 @@
 
   if (class_name == g_DictionaryI) {
 return (new NSDictionaryISyntheticFrontEnd(valobj_sp));
-  } else if (class_name == g_DictionaryM) {
+  } else if (class_name == g_DictionaryM || class_name == g_DictionaryMFrozen) 
{
 if (runtime->GetFoundati

[Lldb-commits] [PATCH] D104893: Add data formatter support for a missing NSDictionary variant

2021-06-24 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/D104893/new/

https://reviews.llvm.org/D104893

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


[Lldb-commits] [PATCH] D104882: makes extension contribute breakpoints using new package.json schema:https://code.visualstudio.com/updates/v1_42#_implement-a-debug-adapter-inside-an-extension

2021-06-24 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

Should we leave the old one there in case this extension is loaded in an older 
IDE?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104882

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


[Lldb-commits] [PATCH] D104882: makes extension contribute breakpoints using new package.json schema:https://code.visualstudio.com/updates/v1_42#_implement-a-debug-adapter-inside-an-extension

2021-06-24 Thread Chris Bond via Phabricator via lldb-commits
chrisbond updated this revision to Diff 354435.
chrisbond added a comment.

restore deprecated enableBreakpointsFor section to package.json to support 
older vscode releases. newer releases ignore this section.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104882

Files:
  lldb/tools/lldb-vscode/package.json


Index: lldb/tools/lldb-vscode/package.json
===
--- lldb/tools/lldb-vscode/package.json
+++ lldb/tools/lldb-vscode/package.json
@@ -49,6 +49,53 @@
 "scopeName": "source.disassembly",
 "path": "./syntaxes/disassembly.json"
 }
+],
+"breakpoints": [
+  {
+"language": "ada"
+  },
+  {
+"language": "arm"
+  },
+  {
+"language": "asm"
+  },
+  {
+"language": "c"
+  },
+  {
+"language": "cpp"
+  },
+  {
+"language": "crystal"
+  },
+  {
+"language": "d"
+  },
+  {
+"language": "fortan"
+  },
+  {
+"language": "fortran-modern"
+  },
+  {
+"language": "nim"
+  },
+  {
+"language": "objective-c"
+  },
+  {
+"language": "objectpascal"
+  },
+  {
+"language": "pascal"
+  },
+  {
+"language": "rust"
+  },
+  {
+"language": "swift"
+  }
 ],
"debuggers": [
{


Index: lldb/tools/lldb-vscode/package.json
===
--- lldb/tools/lldb-vscode/package.json
+++ lldb/tools/lldb-vscode/package.json
@@ -49,6 +49,53 @@
 "scopeName": "source.disassembly",
 "path": "./syntaxes/disassembly.json"
 }
+],
+"breakpoints": [
+  {
+"language": "ada"
+  },
+  {
+"language": "arm"
+  },
+  {
+"language": "asm"
+  },
+  {
+"language": "c"
+  },
+  {
+"language": "cpp"
+  },
+  {
+"language": "crystal"
+  },
+  {
+"language": "d"
+  },
+  {
+"language": "fortan"
+  },
+  {
+"language": "fortran-modern"
+  },
+  {
+"language": "nim"
+  },
+  {
+"language": "objective-c"
+  },
+  {
+"language": "objectpascal"
+  },
+  {
+"language": "pascal"
+  },
+  {
+"language": "rust"
+  },
+  {
+"language": "swift"
+  }
 ],
 		"debuggers": [
 			{
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits