Skip to content

Commit bc1fee1

Browse files
committed
Fix handling of unreadable memory regions.
1 parent 90ce83c commit bc1fee1

File tree

5 files changed

+218
-184
lines changed

5 files changed

+218
-184
lines changed

adapter/codelldb/src/debug_session.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ pub struct DebugSession {
8888
breakpoint_mode: BreakpointMode,
8989
summary_timeout: time::Duration,
9090
max_summary_length: usize,
91+
max_instr_bytes: usize,
9192
}
9293

9394
// AsyncResponse is used to "smuggle" futures out of request handlers
@@ -173,6 +174,7 @@ impl DebugSession {
173174
breakpoint_mode: BreakpointMode::Path,
174175
summary_timeout: time::Duration::from_millis(10),
175176
max_summary_length: 32,
177+
max_instr_bytes: 9,
176178
};
177179

178180
let con_reader = tokio::fs::File::from_std(con_reader);
@@ -870,7 +872,7 @@ impl DebugSession {
870872
let handle = handles::from_i64(args.source_reference)?;
871873
let dasm = self.disasm_ranges.find_by_handle(handle).unwrap();
872874
Ok(SourceResponseBody {
873-
content: dasm.get_source_text(),
875+
content: dasm.get_source_text(self.max_instr_bytes),
874876
mime_type: Some("text/x-lldb.disassembly".to_owned()),
875877
})
876878
}

0 commit comments

Comments
 (0)