[Lldb-commits] [lldb] [lldb] Make semantics of SupportFile equivalence explicit (PR #97126)

2024-06-30 Thread Pavel Labath via lldb-commits

https://github.com/labath approved this pull request.

I like this. Thanks.

It would be nice to have a quick unit test to go along with it.

https://github.com/llvm/llvm-project/pull/97126
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Fix flake in TestZerothFrame.py (PR #96685)

2024-06-30 Thread Pavel Labath via lldb-commits

https://github.com/labath approved this pull request.

Looks good. Are you able to merge this on your own?

https://github.com/llvm/llvm-project/pull/96685
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Revert "[lldb] Parse and display register field enums" (PR #97258)

2024-06-30 Thread David Spickett via lldb-commits

https://github.com/DavidSpickett created 
https://github.com/llvm/llvm-project/pull/97258

Reverts llvm/llvm-project#95768 due to a test failure on macOS with ASAN:
https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake-sanitized/425/console

>From 7e4a2ec169290640c2f16811bae9e1ad82ba2c5f Mon Sep 17 00:00:00 2001
From: David Spickett 
Date: Mon, 1 Jul 2024 07:45:18 +0100
Subject: [PATCH] Revert "[lldb] Parse and display register field enums
 (#95768)"

This reverts commit ba60d8a11af2cdd7e80e2fd968cdf52adcabf5a1.
---
 lldb/include/lldb/Target/RegisterFlags.h  |   7 -
 lldb/source/Core/DumpRegisterInfo.cpp |   7 +-
 .../Process/gdb-remote/ProcessGDBRemote.cpp   | 198 +
 .../Process/gdb-remote/ProcessGDBRemote.h |   5 -
 .../RegisterTypeBuilderClang.cpp  |  40 +-
 lldb/source/Target/RegisterFlags.cpp  |  10 -
 .../gdb_remote_client/TestXMLRegisterFlags.py | 402 --
 lldb/unittests/Core/DumpRegisterInfoTest.cpp  |  26 --
 8 files changed, 22 insertions(+), 673 deletions(-)

diff --git a/lldb/include/lldb/Target/RegisterFlags.h 
b/lldb/include/lldb/Target/RegisterFlags.h
index 1250fd0330958..1112972cf72e1 100644
--- a/lldb/include/lldb/Target/RegisterFlags.h
+++ b/lldb/include/lldb/Target/RegisterFlags.h
@@ -32,15 +32,10 @@ class FieldEnum {
 : m_value(value), m_name(std::move(name)) {}
 
 void ToXML(Stream &strm) const;
-
-void DumpToLog(Log *log) const;
   };
 
   typedef std::vector Enumerators;
 
-  // GDB also includes a "size" that is the size of the underlying register.
-  // We will not store that here but instead use the size of the register
-  // this gets attached to when emitting XML.
   FieldEnum(std::string id, const Enumerators &enumerators);
 
   const Enumerators &GetEnumerators() const { return m_enumerators; }
@@ -49,8 +44,6 @@ class FieldEnum {
 
   void ToXML(Stream &strm, unsigned size) const;
 
-  void DumpToLog(Log *log) const;
-
 private:
   std::string m_id;
   Enumerators m_enumerators;
diff --git a/lldb/source/Core/DumpRegisterInfo.cpp 
b/lldb/source/Core/DumpRegisterInfo.cpp
index eccc6784cd497..8334795416902 100644
--- a/lldb/source/Core/DumpRegisterInfo.cpp
+++ b/lldb/source/Core/DumpRegisterInfo.cpp
@@ -111,11 +111,6 @@ void lldb_private::DoDumpRegisterInfo(
   };
   DumpList(strm, "In sets: ", in_sets, emit_set);
 
-  if (flags_type) {
+  if (flags_type)
 strm.Printf("\n\n%s", flags_type->AsTable(terminal_width).c_str());
-
-std::string enumerators = flags_type->DumpEnums(terminal_width);
-if (enumerators.size())
-  strm << "\n\n" << enumerators;
-  }
 }
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp 
b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 604c92369e9a2..060a30abee83e 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4179,134 +4179,21 @@ struct GdbServerTargetInfo {
   RegisterSetMap reg_set_map;
 };
 
-static FieldEnum::Enumerators ParseEnumEvalues(const XMLNode &enum_node) {
-  Log *log(GetLog(GDBRLog::Process));
-  // We will use the last instance of each value. Also we preserve the order
-  // of declaration in the XML, as it may not be numerical.
-  // For example, hardware may intially release with two states that softwware
-  // can read from a register field:
-  // 0 = startup, 1 = running
-  // If in a future hardware release, the designers added a pre-startup state:
-  // 0 = startup, 1 = running, 2 = pre-startup
-  // Now it makes more sense to list them in this logical order as opposed to
-  // numerical order:
-  // 2 = pre-startup, 1 = startup, 0 = startup
-  // This only matters for "register info" but let's trust what the server
-  // chose regardless.
-  std::map enumerators;
-
-  enum_node.ForEachChildElementWithName(
-  "evalue", [&enumerators, &log](const XMLNode &enumerator_node) {
-std::optional name;
-std::optional value;
-
-enumerator_node.ForEachAttribute(
-[&name, &value, &log](const llvm::StringRef &attr_name,
-  const llvm::StringRef &attr_value) {
-  if (attr_name == "name") {
-if (attr_value.size())
-  name = attr_value;
-else
-  LLDB_LOG(log, "ProcessGDBRemote::ParseEnumEvalues "
-"Ignoring empty name in evalue");
-  } else if (attr_name == "value") {
-uint64_t parsed_value = 0;
-if (llvm::to_integer(attr_value, parsed_value))
-  value = parsed_value;
-else
-  LLDB_LOG(log,
-   "ProcessGDBRemote::ParseEnumEvalues "
-   "Invalid value \"{0}\" in "
-   "evalue",
-   attr_value.data());
-  } else
-LLDB_LOG(log,
-

[Lldb-commits] [lldb] d9e659c - Revert "[lldb] Parse and display register field enums" (#97258)

2024-06-30 Thread via lldb-commits

Author: David Spickett
Date: 2024-07-01T07:46:19+01:00
New Revision: d9e659c538516036e40330b6a98160cbda4ff100

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

LOG: Revert "[lldb] Parse and display register field enums" (#97258)

Reverts llvm/llvm-project#95768 due to a test failure on macOS with
ASAN:

https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake-sanitized/425/console

Added: 


Modified: 
lldb/include/lldb/Target/RegisterFlags.h
lldb/source/Core/DumpRegisterInfo.cpp
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
lldb/source/Plugins/RegisterTypeBuilder/RegisterTypeBuilderClang.cpp
lldb/source/Target/RegisterFlags.cpp
lldb/test/API/functionalities/gdb_remote_client/TestXMLRegisterFlags.py
lldb/unittests/Core/DumpRegisterInfoTest.cpp

Removed: 




diff  --git a/lldb/include/lldb/Target/RegisterFlags.h 
b/lldb/include/lldb/Target/RegisterFlags.h
index 1250fd0330958..1112972cf72e1 100644
--- a/lldb/include/lldb/Target/RegisterFlags.h
+++ b/lldb/include/lldb/Target/RegisterFlags.h
@@ -32,15 +32,10 @@ class FieldEnum {
 : m_value(value), m_name(std::move(name)) {}
 
 void ToXML(Stream &strm) const;
-
-void DumpToLog(Log *log) const;
   };
 
   typedef std::vector Enumerators;
 
-  // GDB also includes a "size" that is the size of the underlying register.
-  // We will not store that here but instead use the size of the register
-  // this gets attached to when emitting XML.
   FieldEnum(std::string id, const Enumerators &enumerators);
 
   const Enumerators &GetEnumerators() const { return m_enumerators; }
@@ -49,8 +44,6 @@ class FieldEnum {
 
   void ToXML(Stream &strm, unsigned size) const;
 
-  void DumpToLog(Log *log) const;
-
 private:
   std::string m_id;
   Enumerators m_enumerators;

diff  --git a/lldb/source/Core/DumpRegisterInfo.cpp 
b/lldb/source/Core/DumpRegisterInfo.cpp
index eccc6784cd497..8334795416902 100644
--- a/lldb/source/Core/DumpRegisterInfo.cpp
+++ b/lldb/source/Core/DumpRegisterInfo.cpp
@@ -111,11 +111,6 @@ void lldb_private::DoDumpRegisterInfo(
   };
   DumpList(strm, "In sets: ", in_sets, emit_set);
 
-  if (flags_type) {
+  if (flags_type)
 strm.Printf("\n\n%s", flags_type->AsTable(terminal_width).c_str());
-
-std::string enumerators = flags_type->DumpEnums(terminal_width);
-if (enumerators.size())
-  strm << "\n\n" << enumerators;
-  }
 }

diff  --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp 
b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 604c92369e9a2..060a30abee83e 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4179,134 +4179,21 @@ struct GdbServerTargetInfo {
   RegisterSetMap reg_set_map;
 };
 
-static FieldEnum::Enumerators ParseEnumEvalues(const XMLNode &enum_node) {
-  Log *log(GetLog(GDBRLog::Process));
-  // We will use the last instance of each value. Also we preserve the order
-  // of declaration in the XML, as it may not be numerical.
-  // For example, hardware may intially release with two states that softwware
-  // can read from a register field:
-  // 0 = startup, 1 = running
-  // If in a future hardware release, the designers added a pre-startup state:
-  // 0 = startup, 1 = running, 2 = pre-startup
-  // Now it makes more sense to list them in this logical order as opposed to
-  // numerical order:
-  // 2 = pre-startup, 1 = startup, 0 = startup
-  // This only matters for "register info" but let's trust what the server
-  // chose regardless.
-  std::map enumerators;
-
-  enum_node.ForEachChildElementWithName(
-  "evalue", [&enumerators, &log](const XMLNode &enumerator_node) {
-std::optional name;
-std::optional value;
-
-enumerator_node.ForEachAttribute(
-[&name, &value, &log](const llvm::StringRef &attr_name,
-  const llvm::StringRef &attr_value) {
-  if (attr_name == "name") {
-if (attr_value.size())
-  name = attr_value;
-else
-  LLDB_LOG(log, "ProcessGDBRemote::ParseEnumEvalues "
-"Ignoring empty name in evalue");
-  } else if (attr_name == "value") {
-uint64_t parsed_value = 0;
-if (llvm::to_integer(attr_value, parsed_value))
-  value = parsed_value;
-else
-  LLDB_LOG(log,
-   "ProcessGDBRemote::ParseEnumEvalues "
-   "Invalid value \"{0}\" in "
-   "evalue",
-   attr_value.data

[Lldb-commits] [lldb] Revert "[lldb] Parse and display register field enums" (PR #97258)

2024-06-30 Thread David Spickett via lldb-commits

https://github.com/DavidSpickett closed 
https://github.com/llvm/llvm-project/pull/97258
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] Revert "[lldb] Parse and display register field enums" (PR #97258)

2024-06-30 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: David Spickett (DavidSpickett)


Changes

Reverts llvm/llvm-project#95768 due to a test failure on macOS with 
ASAN:
https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake-sanitized/425/console

---

Patch is 34.70 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/97258.diff


8 Files Affected:

- (modified) lldb/include/lldb/Target/RegisterFlags.h (-7) 
- (modified) lldb/source/Core/DumpRegisterInfo.cpp (+1-6) 
- (modified) lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp 
(+18-180) 
- (modified) lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h (-5) 
- (modified) 
lldb/source/Plugins/RegisterTypeBuilder/RegisterTypeBuilderClang.cpp (+3-37) 
- (modified) lldb/source/Target/RegisterFlags.cpp (-10) 
- (modified) 
lldb/test/API/functionalities/gdb_remote_client/TestXMLRegisterFlags.py (-402) 
- (modified) lldb/unittests/Core/DumpRegisterInfoTest.cpp (-26) 


``diff
diff --git a/lldb/include/lldb/Target/RegisterFlags.h 
b/lldb/include/lldb/Target/RegisterFlags.h
index 1250fd0330958..1112972cf72e1 100644
--- a/lldb/include/lldb/Target/RegisterFlags.h
+++ b/lldb/include/lldb/Target/RegisterFlags.h
@@ -32,15 +32,10 @@ class FieldEnum {
 : m_value(value), m_name(std::move(name)) {}
 
 void ToXML(Stream &strm) const;
-
-void DumpToLog(Log *log) const;
   };
 
   typedef std::vector Enumerators;
 
-  // GDB also includes a "size" that is the size of the underlying register.
-  // We will not store that here but instead use the size of the register
-  // this gets attached to when emitting XML.
   FieldEnum(std::string id, const Enumerators &enumerators);
 
   const Enumerators &GetEnumerators() const { return m_enumerators; }
@@ -49,8 +44,6 @@ class FieldEnum {
 
   void ToXML(Stream &strm, unsigned size) const;
 
-  void DumpToLog(Log *log) const;
-
 private:
   std::string m_id;
   Enumerators m_enumerators;
diff --git a/lldb/source/Core/DumpRegisterInfo.cpp 
b/lldb/source/Core/DumpRegisterInfo.cpp
index eccc6784cd497..8334795416902 100644
--- a/lldb/source/Core/DumpRegisterInfo.cpp
+++ b/lldb/source/Core/DumpRegisterInfo.cpp
@@ -111,11 +111,6 @@ void lldb_private::DoDumpRegisterInfo(
   };
   DumpList(strm, "In sets: ", in_sets, emit_set);
 
-  if (flags_type) {
+  if (flags_type)
 strm.Printf("\n\n%s", flags_type->AsTable(terminal_width).c_str());
-
-std::string enumerators = flags_type->DumpEnums(terminal_width);
-if (enumerators.size())
-  strm << "\n\n" << enumerators;
-  }
 }
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp 
b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 604c92369e9a2..060a30abee83e 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4179,134 +4179,21 @@ struct GdbServerTargetInfo {
   RegisterSetMap reg_set_map;
 };
 
-static FieldEnum::Enumerators ParseEnumEvalues(const XMLNode &enum_node) {
-  Log *log(GetLog(GDBRLog::Process));
-  // We will use the last instance of each value. Also we preserve the order
-  // of declaration in the XML, as it may not be numerical.
-  // For example, hardware may intially release with two states that softwware
-  // can read from a register field:
-  // 0 = startup, 1 = running
-  // If in a future hardware release, the designers added a pre-startup state:
-  // 0 = startup, 1 = running, 2 = pre-startup
-  // Now it makes more sense to list them in this logical order as opposed to
-  // numerical order:
-  // 2 = pre-startup, 1 = startup, 0 = startup
-  // This only matters for "register info" but let's trust what the server
-  // chose regardless.
-  std::map enumerators;
-
-  enum_node.ForEachChildElementWithName(
-  "evalue", [&enumerators, &log](const XMLNode &enumerator_node) {
-std::optional name;
-std::optional value;
-
-enumerator_node.ForEachAttribute(
-[&name, &value, &log](const llvm::StringRef &attr_name,
-  const llvm::StringRef &attr_value) {
-  if (attr_name == "name") {
-if (attr_value.size())
-  name = attr_value;
-else
-  LLDB_LOG(log, "ProcessGDBRemote::ParseEnumEvalues "
-"Ignoring empty name in evalue");
-  } else if (attr_name == "value") {
-uint64_t parsed_value = 0;
-if (llvm::to_integer(attr_value, parsed_value))
-  value = parsed_value;
-else
-  LLDB_LOG(log,
-   "ProcessGDBRemote::ParseEnumEvalues "
-   "Invalid value \"{0}\" in "
-   "evalue",
-   attr_value.data());
-  } else
-LLDB_LOG(log,
- "ProcessGDBRemote::Pa