Bug 21980

Summary: Make "show args" show arguments passed through the CLI to gdbserver
Product: gdb Reporter: Ciro Santilli <ciro.santilli>
Component: serverAssignee: Not yet assigned to anyone <unassigned>
Status: UNCONFIRMED ---    
Severity: normal    
Priority: P2    
Version: 7.11   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:

Description Ciro Santilli 2017-08-20 11:18:44 UTC
Current behavior is a bit confusing:

    gdbserver :1234 ./prog.out arg0 arg1
    gdb -ex 'target remote :1234' ./prog.out
    
Then:

    (gdb) b main
    (gdb) c
    (gdb) show args
    Argument list to give program being debugged when it is started is ""
    (gdb) print argc
    $1 = 3

Would require sending the arguments over the protocol I expect.
Comment 1 Ciro Santilli 2017-08-20 11:37:11 UTC
And while we are at it, also make args persist for --multi across runs: currently it is only used for the first one. See also: https://sourceware.org/bugzilla/show_bug.cgi?id=21981
Comment 2 Andreas Schwab 2017-08-20 12:57:19 UTC
*** Bug 21979 has been marked as a duplicate of this bug. ***
Comment 3 Ciro Santilli 2017-08-20 14:27:47 UTC
Sorry, the site or my internet was a bit shaky.