Skip to content

Commit

Permalink
Merge branch 'master' into i7046-add-attach-memory-dump-test
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankyluk authored Jan 22, 2025
2 parents e1c8441 + 64f768e commit 6cded3f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
5 changes: 3 additions & 2 deletions make/utils_exposed.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,11 @@ endfunction (DynamoRIO_get_target_path_for_execution)

function (DynamoRIO_prefix_cmd_if_necessary cmd_out use_ats cmd_in)
if (ANDROID)
set(script ${PROJECT_BINARY_DIR}/tools/run_on_android_device.sh)
if (use_ats)
set(${cmd_out} "adb@shell@${cmd_in}${ARGN}" PARENT_SCOPE)
set(${cmd_out} "${script}@${cmd_in}${ARGN}" PARENT_SCOPE)
else ()
set(${cmd_out} adb shell ${cmd_in} ${ARGN} PARENT_SCOPE)
set(${cmd_out} ${script} ${cmd_in} ${ARGN} PARENT_SCOPE)
endif ()
elseif (CMAKE_CROSSCOMPILING AND DEFINED CMAKE_FIND_ROOT_PATH AND QEMU_BINARY)
if (use_ats)
Expand Down
4 changes: 4 additions & 0 deletions tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,7 @@ DR_install(FILES
"${CMAKE_CURRENT_SOURCE_DIR}/windbg-scripts/load_syms${SYMSFX}"
DESTINATION "${INSTALL_BIN}"
RENAME "load_syms${SYMSFX}.txt")

if (ANDROID)
configure_file(run_on_android_device.sh.in run_on_android_device.sh @ONLY)
endif ()
6 changes: 6 additions & 0 deletions tools/run_on_android_device.sh.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/sh

# Used to run a command on an Android device when building for Android
# while preserving the argument quoting used on the host.

@ADB@ shell $(printf "'%s' " "$@")

0 comments on commit 6cded3f

Please sign in to comment.