From: Tom de Vries Date: Fri, 17 Mar 2023 12:29:13 +0000 (+0100) Subject: [gdb/testsuite] Handle remote host in escape_for_host X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a14e3d11b2656355ca2c3d5b5a9f05e46f71e897;p=binutils-gdb.git [gdb/testsuite] Handle remote host in escape_for_host With test-case gdb.arch/ftrace-insn-reloc.exp and host board local-remote-host-notty and target board native-gdbserver, I run into: ... FAIL: gdb.arch/ftrace-insn-reloc.exp: IPA loaded ... due to having: ... $ readelf -d ftrace-insn-reloc | grep RUNPATH 0x000000000000001d (RUNPATH) Library runpath: [] ... instead of: ... $ readelf -d ftrace-insn-reloc | grep RUNPATH 0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN] ... Handle this in escape_for_host. Tested on x86_64-linux. --- diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index b45c73fcc1a..8b1127ce0bc 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -4656,8 +4656,14 @@ set gdb_saved_set_unbuffered_mode_obj "" # Escape STR sufficiently for use on host commandline. proc escape_for_host { str } { - set map { - {$} {\$} + if { [is_remote host] } { + set map { + {$} {\\$} + } + } else { + set map { + {$} {\$} + } } return [string map $map $str]