Skip to content

Commit af85146

Browse files
Merge branch 'main' into invariant-change
2 parents a3d0e64 + 40fbc76 commit af85146

File tree

5 files changed

+94
-44
lines changed

5 files changed

+94
-44
lines changed

libcxx/include/__tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,8 +1445,8 @@ __tree<_Tp, _Compare, _Allocator>::__tree(const __tree& __t)
14451445

14461446
*__root_ptr() = static_cast<__node_base_pointer>(__copy_construct_tree(__t.__root()));
14471447
__root()->__parent_ = __end_node();
1448-
__begin_node_ = static_cast<__end_node_pointer>(std::__tree_min(static_cast<__node_base_pointer>(__end_node())));
1449-
__size_ = __t.size();
1448+
__begin_node_ = static_cast<__end_node_pointer>(std::__tree_min(__end_node()->__left_));
1449+
__size_ = __t.size();
14501450
}
14511451

14521452
template <class _Tp, class _Compare, class _Allocator>

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include "lldb/Utility/StreamString.h"
4242
#include "lldb/Utility/UnimplementedError.h"
4343
#include "lldb/Utility/UriParser.h"
44+
#include "llvm/Support/ErrorHandling.h"
4445
#include "llvm/Support/JSON.h"
4546
#include "llvm/Support/ScopedPrinter.h"
4647
#include "llvm/TargetParser/Triple.h"
@@ -536,14 +537,54 @@ static llvm::StringRef GetEncodingNameOrEmpty(const RegisterInfo &reg_info) {
536537

537538
static llvm::StringRef GetFormatNameOrEmpty(const RegisterInfo &reg_info) {
538539
switch (reg_info.format) {
540+
case eFormatDefault:
541+
return "";
542+
case eFormatBoolean:
543+
return "boolean";
539544
case eFormatBinary:
540545
return "binary";
546+
case eFormatBytes:
547+
return "bytes";
548+
case eFormatBytesWithASCII:
549+
return "bytes-with-ascii";
550+
case eFormatChar:
551+
return "char";
552+
case eFormatCharPrintable:
553+
return "char-printable";
554+
case eFormatComplex:
555+
return "complex";
556+
case eFormatCString:
557+
return "cstring";
541558
case eFormatDecimal:
542559
return "decimal";
560+
case eFormatEnum:
561+
return "enum";
543562
case eFormatHex:
544563
return "hex";
564+
case eFormatHexUppercase:
565+
return "hex-uppercase";
545566
case eFormatFloat:
546567
return "float";
568+
case eFormatOctal:
569+
return "octal";
570+
case eFormatOSType:
571+
return "ostype";
572+
case eFormatUnicode16:
573+
return "unicode16";
574+
case eFormatUnicode32:
575+
return "unicode32";
576+
case eFormatUnsigned:
577+
return "unsigned";
578+
case eFormatPointer:
579+
return "pointer";
580+
case eFormatVectorOfChar:
581+
return "vector-char";
582+
case eFormatVectorOfSInt64:
583+
return "vector-sint64";
584+
case eFormatVectorOfFloat16:
585+
return "vector-float16";
586+
case eFormatVectorOfFloat64:
587+
return "vector-float64";
547588
case eFormatVectorOfSInt8:
548589
return "vector-sint8";
549590
case eFormatVectorOfUInt8:
@@ -562,8 +603,24 @@ static llvm::StringRef GetFormatNameOrEmpty(const RegisterInfo &reg_info) {
562603
return "vector-uint64";
563604
case eFormatVectorOfUInt128:
564605
return "vector-uint128";
606+
case eFormatComplexInteger:
607+
return "complex-integer";
608+
case eFormatCharArray:
609+
return "char-array";
610+
case eFormatAddressInfo:
611+
return "address-info";
612+
case eFormatHexFloat:
613+
return "hex-float";
614+
case eFormatInstruction:
615+
return "instruction";
616+
case eFormatVoid:
617+
return "void";
618+
case eFormatUnicode8:
619+
return "unicode8";
620+
case eFormatFloat128:
621+
return "float128";
565622
default:
566-
return "";
623+
llvm_unreachable("Unknown register format");
567624
};
568625
}
569626

lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,10 +481,29 @@ void ProcessGDBRemote::BuildDynamicRegisterInfo(bool force) {
481481
.Success())
482482
reg_info.format =
483483
llvm::StringSwitch<Format>(value)
484+
.Case("boolean", eFormatBoolean)
484485
.Case("binary", eFormatBinary)
486+
.Case("bytes", eFormatBytes)
487+
.Case("bytes-with-ascii", eFormatBytesWithASCII)
488+
.Case("char", eFormatChar)
489+
.Case("char-printable", eFormatCharPrintable)
490+
.Case("complex", eFormatComplex)
491+
.Case("cstring", eFormatCString)
485492
.Case("decimal", eFormatDecimal)
493+
.Case("enum", eFormatEnum)
486494
.Case("hex", eFormatHex)
495+
.Case("hex-uppercase", eFormatHexUppercase)
487496
.Case("float", eFormatFloat)
497+
.Case("octal", eFormatOctal)
498+
.Case("ostype", eFormatOSType)
499+
.Case("unicode16", eFormatUnicode16)
500+
.Case("unicode32", eFormatUnicode32)
501+
.Case("unsigned", eFormatUnsigned)
502+
.Case("pointer", eFormatPointer)
503+
.Case("vector-char", eFormatVectorOfChar)
504+
.Case("vector-sint64", eFormatVectorOfSInt64)
505+
.Case("vector-float16", eFormatVectorOfFloat16)
506+
.Case("vector-float64", eFormatVectorOfFloat64)
488507
.Case("vector-sint8", eFormatVectorOfSInt8)
489508
.Case("vector-uint8", eFormatVectorOfUInt8)
490509
.Case("vector-sint16", eFormatVectorOfSInt16)
@@ -494,6 +513,14 @@ void ProcessGDBRemote::BuildDynamicRegisterInfo(bool force) {
494513
.Case("vector-float32", eFormatVectorOfFloat32)
495514
.Case("vector-uint64", eFormatVectorOfUInt64)
496515
.Case("vector-uint128", eFormatVectorOfUInt128)
516+
.Case("complex-integer", eFormatComplexInteger)
517+
.Case("char-array", eFormatCharArray)
518+
.Case("address-info", eFormatAddressInfo)
519+
.Case("hex-float", eFormatHexFloat)
520+
.Case("instruction", eFormatInstruction)
521+
.Case("void", eFormatVoid)
522+
.Case("unicode8", eFormatUnicode8)
523+
.Case("float128", eFormatFloat128)
497524
.Default(eFormatInvalid);
498525
} else if (name == "set") {
499526
reg_info.set_name.SetString(value);

lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp

Lines changed: 6 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,40 +1093,6 @@ class SimplePythonFile : public OwnedPythonFile<NativeFile> {
10931093
char SimplePythonFile::ID = 0;
10941094
} // namespace
10951095

1096-
namespace {
1097-
class PythonBuffer {
1098-
public:
1099-
PythonBuffer &operator=(const PythonBuffer &) = delete;
1100-
PythonBuffer(const PythonBuffer &) = delete;
1101-
1102-
static Expected<PythonBuffer> Create(PythonObject &obj,
1103-
int flags = PyBUF_SIMPLE) {
1104-
Py_buffer py_buffer = {};
1105-
PyObject_GetBuffer(obj.get(), &py_buffer, flags);
1106-
if (!py_buffer.obj)
1107-
return llvm::make_error<PythonException>();
1108-
return PythonBuffer(py_buffer);
1109-
}
1110-
1111-
PythonBuffer(PythonBuffer &&other) {
1112-
m_buffer = other.m_buffer;
1113-
other.m_buffer.obj = nullptr;
1114-
}
1115-
1116-
~PythonBuffer() {
1117-
if (m_buffer.obj)
1118-
PyBuffer_Release(&m_buffer);
1119-
}
1120-
1121-
Py_buffer &get() { return m_buffer; }
1122-
1123-
private:
1124-
// takes ownership of the buffer.
1125-
PythonBuffer(const Py_buffer &py_buffer) : m_buffer(py_buffer) {}
1126-
Py_buffer m_buffer;
1127-
};
1128-
} // namespace
1129-
11301096
// Shared methods between TextPythonFile and BinaryPythonFile
11311097
namespace {
11321098
class PythonIOFile : public OwnedPythonFile<File> {
@@ -1220,12 +1186,12 @@ class BinaryPythonFile : public PythonIOFile {
12201186
num_bytes = 0;
12211187
return Status();
12221188
}
1223-
auto pybuffer = PythonBuffer::Create(pybuffer_obj.get());
1224-
if (!pybuffer)
1225-
// Cloning since the wrapped exception may still reference the PyThread.
1226-
return Status::FromError(pybuffer.takeError()).Clone();
1227-
memcpy(buf, pybuffer.get().get().buf, pybuffer.get().get().len);
1228-
num_bytes = pybuffer.get().get().len;
1189+
PythonBytes pybytes(PyRefType::Borrowed, pybuffer_obj->get());
1190+
if (!pybytes)
1191+
return Status::FromError(llvm::make_error<PythonException>());
1192+
llvm::ArrayRef<uint8_t> bytes = pybytes.GetBytes();
1193+
memcpy(buf, bytes.begin(), bytes.size());
1194+
num_bytes = bytes.size();
12291195
return Status();
12301196
}
12311197
};

lldb/tools/lldb-dap/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"vscode:prepublish": "tsc -p ./",
4646
"watch": "tsc -watch -p ./",
4747
"format": "npx prettier './src-ts/' --write",
48-
"package": "vsce package --out ./out/lldb-dap.vsix",
48+
"package": "rm -rf ./out/lldb-dap.vsix && vsce package --out ./out/lldb-dap.vsix",
4949
"publish": "vsce publish",
5050
"vscode-uninstall": "code --uninstall-extension llvm-vs-code-extensions.lldb-dap",
5151
"vscode-install": "code --install-extension ./out/lldb-dap.vsix"

0 commit comments

Comments
 (0)