@@ -17,24 +17,33 @@ pub extern "C" fn ark_print_rs(x: libr::SEXP) -> *const ffi::c_char {
17
17
} )
18
18
}
19
19
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
+ /// ```
24
32
#[ no_mangle]
25
33
pub extern "C" fn ark_inspect_rs ( x : libr:: SEXP ) -> * const ffi:: c_char {
26
34
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
-
33
35
let out = RFunction :: new ( "lobstr" , "sxp" ) . add ( x) . call ( ) . unwrap ( ) ;
34
36
unsafe { libr:: Rf_PrintValue ( out. sexp ) } ;
35
37
} )
36
38
}
37
39
40
+ /// Print backtrace via rlang
41
+ ///
42
+ /// Requires lldb setting:
43
+ ///
44
+ /// ```
45
+ /// settings set escape-non-printables false
46
+ /// ```
38
47
#[ no_mangle]
39
48
pub extern "C" fn ark_trace_back_rs ( ) -> * const ffi:: c_char {
40
49
capture_console_output ( || {
0 commit comments