mirror of
https://github.com/bminor/binutils-gdb.git
synced 2026-02-09 08:52:31 +00:00
[gdb/testsuite] Fix gdb.base/fileio.exp for local-remote-host-native
When running test-case gdb.base/fileio.exp with host/target board
local-remote-host-native I run into:
...
gdb compile failed, fileio.c: In function 'test_open':
<command-line>:0:8: error: expected expression before '.' token
fileio.c:89:15: note: in expansion of macro 'OUTDIR'
ret = open (OUTDIR FILENAME, O_CREAT | O_TRUNC | O_RDWR, S_IWUSR | S_IRUSR);
^~~~~~
...
Fix this by using:
- quote_for_host to pass -DOUTDIR to the compilation, and
- STRINGIFY to stringify OUTDIR in fileio.c.
Tested on x86_64-linux, with target board unix and host/target board
local-remote-host-native.
This commit is contained in:
@@ -73,6 +73,10 @@ static const char *strerrno (int err);
|
||||
|
||||
#define STRING "Hello World"
|
||||
|
||||
#define STRINGIFY(s) STRINGIFY_(s)
|
||||
#define STRINGIFY_(s) #s
|
||||
#define OUTDIR STRINGIFY (OUTDIR_)
|
||||
|
||||
static void stop (void) {}
|
||||
|
||||
/* A NULL string. We pass this to stat below instead of a NULL
|
||||
|
||||
@@ -27,7 +27,7 @@ if {[is_remote host]} {
|
||||
|
||||
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
|
||||
executable \
|
||||
[list debug "additional_flags=-DOUTDIR=\"$outdir/\""]] != "" } {
|
||||
[list debug additional_flags=[quote_for_host -DOUTDIR_=$outdir/]]] != "" } {
|
||||
untested "failed to compile"
|
||||
return -1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user