[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending RegisterFlags as XML (PR #69951)

2023-10-26 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett closed https://github.com/llvm/llvm-project/pull/69951 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending RegisterFlags as XML (PR #69951)

2023-10-25 Thread Alex Langford via lldb-commits
https://github.com/bulbazord approved this pull request. LGTM. I didn't realize lldb-server didn't use libXML, learned something new today. :) https://github.com/llvm/llvm-project/pull/69951 ___ lldb-commits mailing list lldb-commits@lists.llvm.org

[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending RegisterFlags as XML (PR #69951)

2023-10-25 Thread Greg Clayton via lldb-commits
https://github.com/clayborg approved this pull request. https://github.com/llvm/llvm-project/pull/69951 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending RegisterFlags as XML (PR #69951)

2023-10-25 Thread Greg Clayton via lldb-commits
https://github.com/clayborg edited https://github.com/llvm/llvm-project/pull/69951 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending RegisterFlags as XML (PR #69951)

2023-10-25 Thread Greg Clayton via lldb-commits
@@ -9,10 +9,16 @@ #ifndef LLDB_TARGET_REGISTERFLAGS_H #define LLDB_TARGET_REGISTERFLAGS_H -#include "lldb/Utility/Log.h" +#include +#include +#include +#include clayborg wrote: Sorry, I hadn't expanded the full file to see being used in code that

[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending RegisterFlags as XML (PR #69951)

2023-10-25 Thread David Spickett via lldb-commits
@@ -9,10 +9,16 @@ #ifndef LLDB_TARGET_REGISTERFLAGS_H #define LLDB_TARGET_REGISTERFLAGS_H -#include "lldb/Utility/Log.h" +#include DavidSpickett wrote: Moved the assert into the cpp file and removed the include in the header.

[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending RegisterFlags as XML (PR #69951)

2023-10-25 Thread David Spickett via lldb-commits
@@ -9,10 +9,16 @@ #ifndef LLDB_TARGET_REGISTERFLAGS_H #define LLDB_TARGET_REGISTERFLAGS_H -#include "lldb/Utility/Log.h" +#include +#include +#include +#include DavidSpickett wrote: string and vector are needed, presumably because RegisterFlags is a leaf

[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending RegisterFlags as XML (PR #69951)

2023-10-25 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett updated https://github.com/llvm/llvm-project/pull/69951 >From 5c8b9538e1e5646f19d5bb40ab19afaf2c68e804 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Mon, 9 Oct 2023 10:33:08 +0100 Subject: [PATCH 1/6] [lldb][lldb-server] Enable sending registerflags as

[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending RegisterFlags as XML (PR #69951)

2023-10-24 Thread Greg Clayton via lldb-commits
@@ -9,10 +9,16 @@ #ifndef LLDB_TARGET_REGISTERFLAGS_H #define LLDB_TARGET_REGISTERFLAGS_H -#include "lldb/Utility/Log.h" +#include clayborg wrote: Not needed in this header, move to .cpp if needed there? https://github.com/llvm/llvm-project/pull/69951

[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending RegisterFlags as XML (PR #69951)

2023-10-24 Thread Greg Clayton via lldb-commits
@@ -9,10 +9,16 @@ #ifndef LLDB_TARGET_REGISTERFLAGS_H #define LLDB_TARGET_REGISTERFLAGS_H -#include "lldb/Utility/Log.h" +#include +#include +#include +#include clayborg wrote: Not needed in this header, move to .cpp if needed there?

[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending RegisterFlags as XML (PR #69951)

2023-10-24 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett updated https://github.com/llvm/llvm-project/pull/69951 >From 5c8b9538e1e5646f19d5bb40ab19afaf2c68e804 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Mon, 9 Oct 2023 10:33:08 +0100 Subject: [PATCH 1/5] [lldb][lldb-server] Enable sending registerflags as

[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending RegisterFlags as XML (PR #69951)

2023-10-24 Thread David Spickett via lldb-commits
@@ -10,6 +10,7 @@ #define LLDB_TARGET_REGISTERFLAGS_H #include "lldb/Utility/Log.h" +#include "lldb/Utility/StreamString.h" DavidSpickett wrote: Done. https://github.com/llvm/llvm-project/pull/69951 ___

[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending RegisterFlags as XML (PR #69951)

2023-10-24 Thread David Spickett via lldb-commits
@@ -3113,6 +3119,10 @@ GDBRemoteCommunicationServerLLGS::BuildTargetXml() { if (!format.empty()) response << "format=\"" << format << "\" "; +if (reg_info->flags_type) { + response << "type=\"" << reg_info->flags_type->GetID() << "\" "; +}

[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending RegisterFlags as XML (PR #69951)

2023-10-24 Thread David Spickett via lldb-commits
@@ -175,3 +175,35 @@ std::string RegisterFlags::AsTable(uint32_t max_width) const { return table; } + +void RegisterFlags::ToXML(StreamString ) const { + // Example XML: + // + // + // + strm.Indent(); + strm << ""; + for (const Field : m_fields) { +//

[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending RegisterFlags as XML (PR #69951)

2023-10-24 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett updated https://github.com/llvm/llvm-project/pull/69951 >From 5c8b9538e1e5646f19d5bb40ab19afaf2c68e804 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Mon, 9 Oct 2023 10:33:08 +0100 Subject: [PATCH 1/4] [lldb][lldb-server] Enable sending registerflags as

[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending RegisterFlags as XML (PR #69951)

2023-10-24 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/69951 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending RegisterFlags as XML (PR #69951)

2023-10-24 Thread David Spickett via lldb-commits
DavidSpickett wrote: > It's somewhat implied, but is the goal to (continue to) avoid that > dependency? Other parts of LLDB do rely on libxml2 but I can see how you'd > want to limit the dependencies of lldb-server. Yeah I agree with how lldb-server does it now, and don't want to change that.

[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending RegisterFlags as XML (PR #69951)

2023-10-23 Thread Jonas Devlieghere via lldb-commits
JDevlieghere wrote: > And if you're not familiar with lldb-server and XML, as I wasn't, it doesn't > use libXML to generate it. That's why I'm building strings to fit with the > existing target.xml code. It's somewhat implied, but is the goal to (continue to) avoid that dependency? Other

[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending RegisterFlags as XML (PR #69951)

2023-10-23 Thread Greg Clayton via lldb-commits
@@ -10,6 +10,7 @@ #define LLDB_TARGET_REGISTERFLAGS_H #include "lldb/Utility/Log.h" +#include "lldb/Utility/StreamString.h" clayborg wrote: We can just forward declare StreamString, and possibly remove Log.h above as well if we want to.

[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending RegisterFlags as XML (PR #69951)

2023-10-23 Thread Greg Clayton via lldb-commits
@@ -175,3 +175,35 @@ std::string RegisterFlags::AsTable(uint32_t max_width) const { return table; } + +void RegisterFlags::ToXML(StreamString ) const { + // Example XML: + // + // + // + strm.Indent(); + strm << ""; + for (const Field : m_fields) { +//

[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending RegisterFlags as XML (PR #69951)

2023-10-23 Thread Greg Clayton via lldb-commits
@@ -3113,6 +3119,10 @@ GDBRemoteCommunicationServerLLGS::BuildTargetXml() { if (!format.empty()) response << "format=\"" << format << "\" "; +if (reg_info->flags_type) { + response << "type=\"" << reg_info->flags_type->GetID() << "\" "; +}

[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending RegisterFlags as XML (PR #69951)

2023-10-23 Thread David Spickett via lldb-commits
DavidSpickett wrote: And if you're not familiar with lldb-server and XML, as I wasn't, it doesn't use libXML to generate it. That's why I'm building strings to fit with the existing target.xml code. https://github.com/llvm/llvm-project/pull/69951

[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending RegisterFlags as XML (PR #69951)

2023-10-23 Thread via lldb-commits
llvmbot wrote: @llvm/pr-subscribers-lldb Author: David Spickett (DavidSpickett) Changes This adds ToXML methods to encode RegisterFlags and its fields into XML according to GDB's target XML format:

[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending RegisterFlags as XML (PR #69951)

2023-10-23 Thread David Spickett via lldb-commits
DavidSpickett wrote: For https://discourse.llvm.org/t/rfc-adding-register-field-information-to-lldb-server/74143. May be helpful to look at https://github.com/DavidSpickett/llvm-project/commit/93bdc630f6a4d27c4849b756838c5d70d23e2e90 which will be the next PR and adds the first register

[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending RegisterFlags as XML (PR #69951)

2023-10-23 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett edited https://github.com/llvm/llvm-project/pull/69951 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb][lldb-server] Enable sending registerflags as XML (PR #69951)

2023-10-23 Thread David Spickett via lldb-commits
https://github.com/DavidSpickett created https://github.com/llvm/llvm-project/pull/69951 This adds ToXML methods to encode RegisterFlags and its fields into XML according to GDB's target XML format: