public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] [gdb/testsuite] Handle remote host in escape_for_host
@ 2023-03-17 12:29 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2023-03-17 12:29 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a14e3d11b2656355ca2c3d5b5a9f05e46f71e897

commit a14e3d11b2656355ca2c3d5b5a9f05e46f71e897
Author: Tom de Vries <tdevries@suse.de>
Date:   Fri Mar 17 13:29:13 2023 +0100

    [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:
---
 gdb/testsuite/lib/gdb.exp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

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]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-17 12:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-17 12:29 [binutils-gdb] [gdb/testsuite] Handle remote host in escape_for_host Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).