Skip to content

Commit e1ef32c

Browse files
debuginfo: Try to get minimal version of LLDB autotest framework running without crash with old LLDB version: Activate command execution but not Rust formatters
1 parent 177b359 commit e1ef32c

File tree

2 files changed

+27
-29
lines changed

2 files changed

+27
-29
lines changed

src/compiletest/runtest.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -545,17 +545,17 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
545545
script_str.push_str("version\n");
546546

547547
// Switch LLDB into "Rust mode"
548-
let rust_formatters_postfix = Path::new("./src/etc/lldb_rust_formatters.py");
549-
let lldb_rust_formatters = rust_src_root.join(rust_formatters_postfix);
550-
551-
script_str.push_str("command script import ");
552-
script_str.push_str(lldb_rust_formatters.as_str()
553-
.expect("Could not convert lldb_rust_formatters path to UTF-8"));
554-
script_str.push_str("\n");
555-
script_str.push_str("type summary add --no-value ");
556-
script_str.push_str("--python-function lldb_rust_formatters.print_val ");
557-
script_str.push_str("-x \".*\" --category Rust\n");
558-
script_str.push_str("type category enable Rust\n");
548+
// let rust_formatters_postfix = Path::new("./src/etc/lldb_rust_formatters.py");
549+
// let lldb_rust_formatters = rust_src_root.join(rust_formatters_postfix);
550+
551+
// script_str.push_str("command script import ");
552+
// script_str.push_str(lldb_rust_formatters.as_str()
553+
// .expect("Could not convert lldb_rust_formatters path to UTF-8"));
554+
// script_str.push_str("\n");
555+
// script_str.push_str("type summary add --no-value ");
556+
// script_str.push_str("--python-function lldb_rust_formatters.print_val ");
557+
// script_str.push_str("-x \".*\" --category Rust\n");
558+
// script_str.push_str("type category enable Rust\n");
559559

560560
// Set breakpoints on every line that contains the string "#break"
561561
for line in breakpoint_lines.iter() {

src/etc/lldb_batchmode.py

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def listen():
113113
event = lldb.SBEvent()
114114
wait_count = 0
115115
try:
116-
while wait_count < 15:
116+
while wait_count < 5:
117117
if listener.WaitForEvent(1, event):
118118
if lldb.SBBreakpoint.EventIsBreakpointEvent(event) and \
119119
lldb.SBBreakpoint.GetBreakpointEventTypeFromEvent(event) == \
@@ -171,21 +171,19 @@ def listen():
171171
print_debug("Starting breakpoint listener")
172172
start_breakpoint_listener(target)
173173

174-
### command_interpreter = debugger.GetCommandInterpreter()
175-
176-
### try:
177-
### script_file = open(script_path, 'r')
178-
###
179-
### for line in script_file:
180-
### command = line.strip()
181-
### if command != '':
182-
### execute_command(command_interpreter, command)
183-
###
184-
### except IOError as e:
185-
### print("Could not read debugging script '%s'." % script_path, file = sys.stderr)
186-
### print(e, file = sys.stderr)
187-
### print("Aborting.", file = sys.stderr)
188-
### sys.exit(1)
189-
### finally:
190-
### script_file.close()
174+
command_interpreter = debugger.GetCommandInterpreter()
175+
176+
try:
177+
script_file = open(script_path, 'r')
178+
for line in script_file:
179+
command = line.strip()
180+
if command != '':
181+
execute_command(command_interpreter, command)
182+
except IOError as e:
183+
print("Could not read debugging script '%s'." % script_path, file = sys.stderr)
184+
print(e, file = sys.stderr)
185+
print("Aborting.", file = sys.stderr)
186+
sys.exit(1)
187+
finally:
188+
script_file.close()
191189

0 commit comments

Comments
 (0)