3636# ' @param keep_source If `TRUE` will keep the srcrefs from an installed
3737# ' package. This is useful for debugging (especially inside of RStudio).
3838# ' It defaults to the option `"keep.source.pkgs"`.
39+ # ' @param generate_dsym (macOS only) If `TRUE`, and if the package includes a
40+ # ' native library (a `.so` file), a `dSYM` sidecar file is generated and
41+ # ' installed alongside the library. This file contains source and line
42+ # ' information that allows a debugger to step through original sources.
43+ # '
44+ # ' Note that since `install()` operates from a temporary directory, the source
45+ # ' paths will point to dangling locations. You will need to remap these paths
46+ # ' to the actual sources on your disk, e.g. with lldb:
47+ # '
48+ # ' ```
49+ # ' # Get information about the dangling temporary path for a function in your
50+ # ' # library
51+ # ' image lookup -vn my_function
52+ # '
53+ # ' # Remap the dangling location to the actual package path
54+ # ' settings set target.source-map /private/tmp/Rtmpnl5XgE/R.INSTALLe5133dcc3211/mypackage /path/to/mypackage
55+ # ' ```
3956# ' @param ... additional arguments passed to [remotes::install_deps()]
4057# ' when installing dependencies.
4158# ' @family package installation
@@ -50,6 +67,7 @@ install <-
5067 build_vignettes = FALSE ,
5168 keep_source = getOption(" keep.source.pkgs" ),
5269 force = FALSE ,
70+ generate_dsym = TRUE ,
5371 ... ) {
5472 pkg <- as.package(pkg )
5573
@@ -70,6 +88,7 @@ install <-
7088
7189 opts <- c(
7290 if (keep_source ) " --with-keep.source" ,
91+ if (is_macos && generate_dsym ) " --dsym" ,
7392 " --install-tests"
7493 )
7594 if (quick ) {
0 commit comments