Skip to content

Commit d5679e6

Browse files
committed
Document lldb print setting
1 parent 825d721 commit d5679e6

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

crates/ark/src/debug.rs

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,33 @@ pub extern "C" fn ark_print_rs(x: libr::SEXP) -> *const ffi::c_char {
1717
})
1818
}
1919

20-
// Uses lobstr's `sxp()` function because libr can't find `R_inspect()`.
21-
// It's an `attribute_hidden` function but since the symbol is visible
22-
// on macOS (and you can call it in the debugger) I would have expected
23-
// libr to be able to find it.
20+
/// Inspect structure of R object
21+
///
22+
/// Uses lobstr's `sxp()` function because libr can't find `R_inspect()`.
23+
/// It's an `attribute_hidden` function but since the symbol is visible
24+
/// on macOS (and you can call it in the debugger) I would have expected
25+
/// libr to be able to find it.
26+
///
27+
/// Requires lldb setting:
28+
///
29+
/// ```
30+
/// settings set escape-non-printables false
31+
/// ```
2432
#[no_mangle]
2533
pub extern "C" fn ark_inspect_rs(x: libr::SEXP) -> *const ffi::c_char {
2634
capture_console_output(|| {
27-
// FIXME: These options don't seem to work
28-
let one = harp::RObject::try_from(1).unwrap();
29-
harp::raii::RLocalOption::new("cli.num_colors", one.sexp);
30-
31-
harp::raii::RLocalOptionBoolean::new("cli.unicode", false);
32-
3335
let out = RFunction::new("lobstr", "sxp").add(x).call().unwrap();
3436
unsafe { libr::Rf_PrintValue(out.sexp) };
3537
})
3638
}
3739

40+
/// Print backtrace via rlang
41+
///
42+
/// Requires lldb setting:
43+
///
44+
/// ```
45+
/// settings set escape-non-printables false
46+
/// ```
3847
#[no_mangle]
3948
pub extern "C" fn ark_trace_back_rs() -> *const ffi::c_char {
4049
capture_console_output(|| {

0 commit comments

Comments
 (0)