diff options
author | Walter Erquinigo <a20012251@gmail.com> | 2025-08-05 13:53:15 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-05 13:53:15 -0400 |
commit | 9179b079812319010ab09718926ee73ca26ecc78 (patch) | |
tree | 3ab3b2e62ce5c475e4a9817ed06097f6fa4be44e /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp | |
parent | b5bf1000465c69d647c0eb0f0dc40d03dde17aea (diff) | |
download | llvm-9179b079812319010ab09718926ee73ca26ecc78.zip llvm-9179b079812319010ab09718926ee73ca26ecc78.tar.gz llvm-9179b079812319010ab09718926ee73ca26ecc78.tar.bz2 |
[LLDB] Complete a missing register format mapping in the gdb-remote p… (#152170)
…rotocol
When writing a custom gdb-remote server I realized that the encoder and
decoder of register formats is incomplete.
- Add the encoder on the server side and add an llvm_unreachable is
there's a missing case.
- Add a decoder on the client side that doesn't fail. We have to keep it
flexible.
I couldn't figure out an easy way to test this but the changes seem very
straightforward to me.
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp | 59 |
1 files changed, 58 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp index 89d2730..04786af 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp @@ -41,6 +41,7 @@ #include "lldb/Utility/StreamString.h" #include "lldb/Utility/UnimplementedError.h" #include "lldb/Utility/UriParser.h" +#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/JSON.h" #include "llvm/Support/ScopedPrinter.h" #include "llvm/TargetParser/Triple.h" @@ -536,14 +537,54 @@ static llvm::StringRef GetEncodingNameOrEmpty(const RegisterInfo ®_info) { static llvm::StringRef GetFormatNameOrEmpty(const RegisterInfo ®_info) { switch (reg_info.format) { + case eFormatDefault: + return ""; + case eFormatBoolean: + return "boolean"; case eFormatBinary: return "binary"; + case eFormatBytes: + return "bytes"; + case eFormatBytesWithASCII: + return "bytes-with-ascii"; + case eFormatChar: + return "char"; + case eFormatCharPrintable: + return "char-printable"; + case eFormatComplex: + return "complex"; + case eFormatCString: + return "cstring"; case eFormatDecimal: return "decimal"; + case eFormatEnum: + return "enum"; case eFormatHex: return "hex"; + case eFormatHexUppercase: + return "hex-uppercase"; case eFormatFloat: return "float"; + case eFormatOctal: + return "octal"; + case eFormatOSType: + return "ostype"; + case eFormatUnicode16: + return "unicode16"; + case eFormatUnicode32: + return "unicode32"; + case eFormatUnsigned: + return "unsigned"; + case eFormatPointer: + return "pointer"; + case eFormatVectorOfChar: + return "vector-char"; + case eFormatVectorOfSInt64: + return "vector-sint64"; + case eFormatVectorOfFloat16: + return "vector-float16"; + case eFormatVectorOfFloat64: + return "vector-float64"; case eFormatVectorOfSInt8: return "vector-sint8"; case eFormatVectorOfUInt8: @@ -562,8 +603,24 @@ static llvm::StringRef GetFormatNameOrEmpty(const RegisterInfo ®_info) { return "vector-uint64"; case eFormatVectorOfUInt128: return "vector-uint128"; + case eFormatComplexInteger: + return "complex-integer"; + case eFormatCharArray: + return "char-array"; + case eFormatAddressInfo: + return "address-info"; + case eFormatHexFloat: + return "hex-float"; + case eFormatInstruction: + return "instruction"; + case eFormatVoid: + return "void"; + case eFormatUnicode8: + return "unicode8"; + case eFormatFloat128: + return "float128"; default: - return ""; + llvm_unreachable("Unkown register format") }; } |