Skip to content

Commit e5f7d85

Browse files
committed
Tweaking the buffer size and fixing the python format.
1 parent 9246649 commit e5f7d85

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

lldb/test/API/tools/lldb-dap/output/TestDAP_output.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,22 @@
22
Test lldb-dap output events
33
"""
44

5-
import dap_server
65
from lldbsuite.test.decorators import *
76
from lldbsuite.test.lldbtest import *
8-
from lldbsuite.test import lldbutil
97
import lldbdap_testcase
10-
import re
118

129

1310
class TestDAP_output(lldbdap_testcase.DAPTestCaseBase):
1411
def test_output(self):
1512
program = self.getBuildArtifact("a.out")
1613
self.build_and_launch(program)
1714
source = "main.c"
18-
main_source_path = self.getSourcePath(source)
1915
lines = [line_number(source, "// breakpoint 1")]
2016
breakpoint_ids = self.set_source_breakpoints(source, lines)
2117
self.continue_to_breakpoints(breakpoint_ids)
2218

23-
output = self.collect_stdout(
24-
timeout_secs=1.0,
25-
pattern="abcdef"
26-
)
19+
# Ensure partial messages are still sent.
20+
output = self.collect_stdout(timeout_secs=1.0, pattern="abcdef")
2721
self.assertTrue(output and len(output) > 0, "expect no program output")
2822

2923
self.continue_to_exit()
@@ -33,5 +27,5 @@ def test_output(self):
3327
self.assertIn(
3428
"abcdefghi\r\nhello world\r\n",
3529
output,
36-
'full output not found in: ' + output
37-
)
30+
'full output not found in: ' + output,
31+
)

lldb/tools/lldb-dap/lldb-dap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ void SendProcessEvent(LaunchMethod launch_method) {
399399
// Grab any STDOUT and STDERR from the process and send it up to VS Code
400400
// via an "output" event to the "stdout" and "stderr" categories.
401401
void SendStdOutStdErr(lldb::SBProcess &process) {
402-
char buffer[1024];
402+
char buffer[4096];
403403
size_t count;
404404
while ((count = process.GetSTDOUT(buffer, sizeof(buffer))) > 0)
405405
g_dap.SendOutput(OutputType::Stdout, llvm::StringRef(buffer, count));

0 commit comments

Comments
 (0)