With test-case gdb.server/fetch-exec-and-args.exp, on aarch64-linux I run into:
...
(gdb) break 28^M
Breakpoint 1 at 0xfffff7fd7b8c: file ../sysdeps/aarch64/dl-start.S, line 30.^M
(gdb) continue^M
Continuing.^M
^M
Breakpoint 1, _start () at ../sysdeps/aarch64/dl-start.S:30^M
30 mov x0, sp^M
(gdb) PASS: $exp: packet=on: test_exec_and_arg_fetch: \
continue to breakpoint: run to breakpoint
print argc^M
No symbol "argc" in current context.^M
(gdb) FAIL: $exp: packet=on: test_exec_and_arg_fetch: print argc
...
The problem is that the "break 28" is not specific about the file.
Fix this by setting the breakpoint on fetch-exec-and-args.c:28.
Tested on aarch64-linux.
PR testsuite/33522
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33522
gdbserver_run "a b c"
- gdb_breakpoint [gdb_get_line_number "Break here"]
+ gdb_breakpoint $::srcfile:[gdb_get_line_number "Break here"]
gdb_continue_to_breakpoint "run to breakpoint"
# Look in the inferior to check the arguments were passed