aboutsummaryrefslogtreecommitdiff
path: root/lldb
diff options
context:
space:
mode:
Diffstat (limited to 'lldb')
-rwxr-xr-xlldb/examples/python/performance.py9
-rw-r--r--lldb/examples/summaries/cocoa/CFString.py7
-rw-r--r--lldb/include/lldb/Utility/AnsiTerminal.h11
-rw-r--r--lldb/test/API/commands/expression/import-std-module/array/TestArrayFromStdModule.py3
-rw-r--r--lldb/tools/lldb-dap/tool/lldb-dap.cpp11
-rw-r--r--lldb/utils/lui/lldbutil.py4
6 files changed, 32 insertions, 13 deletions
diff --git a/lldb/examples/python/performance.py b/lldb/examples/python/performance.py
index b86b5a5..c3181b6 100755
--- a/lldb/examples/python/performance.py
+++ b/lldb/examples/python/performance.py
@@ -16,7 +16,6 @@ import resource
import sys
import subprocess
import time
-import types
# ----------------------------------------------------------------------
# Code that auto imports LLDB
@@ -121,19 +120,19 @@ class BreakpointAction(Action):
self.breakpoints.append(breakpoint)
else:
if module:
- if isinstance(module, types.ListType):
+ if isinstance(module, list):
for module_path in module:
self.modules.Append(lldb.SBFileSpec(module_path, False))
- elif isinstance(module, types.StringTypes):
+ elif isinstance(module, str):
self.modules.Append(lldb.SBFileSpec(module, False))
if name:
# "file" can be a list or a string
if file:
- if isinstance(file, types.ListType):
+ if isinstance(file, list):
self.files = lldb.SBFileSpecList()
for f in file:
self.files.Append(lldb.SBFileSpec(f, False))
- elif isinstance(file, types.StringTypes):
+ elif isinstance(file, str):
self.files.Append(lldb.SBFileSpec(file, False))
self.breakpoints.append(
self.target.BreakpointCreateByName(name, self.modules, self.files)
diff --git a/lldb/examples/summaries/cocoa/CFString.py b/lldb/examples/summaries/cocoa/CFString.py
index 74bd927..02b6706 100644
--- a/lldb/examples/summaries/cocoa/CFString.py
+++ b/lldb/examples/summaries/cocoa/CFString.py
@@ -11,11 +11,6 @@ import lldb
import lldb.runtime.objc.objc_runtime
import lldb.formatters.Logger
-try:
- unichr
-except NameError:
- unichr = chr
-
def CFString_SummaryProvider(valobj, dict):
logger = lldb.formatters.Logger.Logger()
@@ -107,7 +102,7 @@ class CFStringSynthProvider:
value = b1 * 256 + b0
else:
value = b0 * 256 + b1
- pystr = pystr + unichr(value)
+ pystr = pystr + chr(value)
# read max_len unicode values, not max_len bytes
max_len = max_len - 1
return pystr
diff --git a/lldb/include/lldb/Utility/AnsiTerminal.h b/lldb/include/lldb/Utility/AnsiTerminal.h
index 41acac7..aaaf94c 100644
--- a/lldb/include/lldb/Utility/AnsiTerminal.h
+++ b/lldb/include/lldb/Utility/AnsiTerminal.h
@@ -72,6 +72,17 @@
#define ANSI_ESC_START_LEN 2
+// Cursor Position, set cursor to position [l, c] (default = [1, 1]).
+#define ANSI_CSI_CUP(...) ANSI_ESC_START #__VA_ARGS__ "H"
+// Reset cursor to position.
+#define ANSI_CSI_RESET_CURSOR ANSI_CSI_CUP()
+// Erase In Display.
+#define ANSI_CSI_ED(opt) ANSI_ESC_START #opt "J"
+// Erase complete viewport.
+#define ANSI_CSI_ERASE_VIEWPORT ANSI_CSI_ED(2)
+// Erase scrollback.
+#define ANSI_CSI_ERASE_SCROLLBACK ANSI_CSI_ED(3)
+
// OSC (Operating System Commands)
// https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
#define OSC_ESCAPE_START "\033"
diff --git a/lldb/test/API/commands/expression/import-std-module/array/TestArrayFromStdModule.py b/lldb/test/API/commands/expression/import-std-module/array/TestArrayFromStdModule.py
index ed028a1..4aea800 100644
--- a/lldb/test/API/commands/expression/import-std-module/array/TestArrayFromStdModule.py
+++ b/lldb/test/API/commands/expression/import-std-module/array/TestArrayFromStdModule.py
@@ -11,6 +11,9 @@ class TestCase(TestBase):
@add_test_categories(["libc++"])
@skipIf(compiler=no_match("clang"))
@skipIf(macos_version=["<", "15.0"])
+ @skipIf(
+ bugnumber="ASTImport of lambdas not supported: https://github.com/llvm/llvm-project/issues/149477"
+ )
def test(self):
self.build()
diff --git a/lldb/tools/lldb-dap/tool/lldb-dap.cpp b/lldb/tools/lldb-dap/tool/lldb-dap.cpp
index e59cef9..45caa1a 100644
--- a/lldb/tools/lldb-dap/tool/lldb-dap.cpp
+++ b/lldb/tools/lldb-dap/tool/lldb-dap.cpp
@@ -21,6 +21,7 @@
#include "lldb/Host/MainLoopBase.h"
#include "lldb/Host/MemoryMonitor.h"
#include "lldb/Host/Socket.h"
+#include "lldb/Utility/AnsiTerminal.h"
#include "lldb/Utility/Status.h"
#include "lldb/Utility/UriParser.h"
#include "lldb/lldb-forward.h"
@@ -74,6 +75,7 @@ typedef int socklen_t;
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/un.h>
+#include <termios.h>
#include <unistd.h>
#endif
@@ -261,6 +263,15 @@ static llvm::Error LaunchRunInTerminalTarget(llvm::opt::Arg &target_arg,
files.push_back(files.back());
if (llvm::Error err = SetupIORedirection(files))
return err;
+ } else if ((isatty(STDIN_FILENO) != 0) &&
+ llvm::StringRef(getenv("TERM")).starts_with_insensitive("xterm")) {
+ // Clear the screen.
+ llvm::outs() << ANSI_CSI_RESET_CURSOR ANSI_CSI_ERASE_VIEWPORT
+ ANSI_CSI_ERASE_SCROLLBACK;
+ // VS Code will reuse the same terminal for the same debug configuration
+ // between runs. Clear the input buffer prior to starting the new process so
+ // prior input is not carried forward to the new debug session.
+ tcflush(STDIN_FILENO, TCIFLUSH);
}
RunInTerminalLauncherCommChannel comm_channel(comm_file);
diff --git a/lldb/utils/lui/lldbutil.py b/lldb/utils/lui/lldbutil.py
index 140317a..589acae 100644
--- a/lldb/utils/lui/lldbutil.py
+++ b/lldb/utils/lui/lldbutil.py
@@ -951,7 +951,7 @@ def get_GPRs(frame):
from lldbutil import get_GPRs
regs = get_GPRs(frame)
for reg in regs:
- print "%s => %s" % (reg.GetName(), reg.GetValue())
+ print("%s => %s" % (reg.GetName(), reg.GetValue()))
...
"""
return get_registers(frame, "general purpose")
@@ -965,7 +965,7 @@ def get_FPRs(frame):
from lldbutil import get_FPRs
regs = get_FPRs(frame)
for reg in regs:
- print "%s => %s" % (reg.GetName(), reg.GetValue())
+ print("%s => %s" % (reg.GetName(), reg.GetValue()))
...
"""
return get_registers(frame, "floating point")