gdb/linux-tdep: move "Perms" column right
Commit
29ef4c0699e1 ("gdb/linux-tdep.c: Add Perms to the 'info proc
mappings' output") has broken test gdb.base/info-proc.exp on Linux,
because it changes the output of "info proc mappings" in a way that the
test does not expect (my bad for not testing before pushing).
I looked at how FreeBSD handles this, since I remembered it did show
permission flags. It looks like this:
Start Addr End Addr Size Offset Flags File
0x200000 0x243000 0x43000 0x0 r-- CN-- /usr/local/bin/tmux
(I think that `Flags` and the flags not being aligned is not
intentional)
The test passes on FreeBSD, because the test looks for four hex numbers
in a row and ignores the rest:
".*Mapped address spaces:.*${hex}${ws}${hex}${ws}${hex}${ws}${hex}.*"
I suggest fixing it on Linux by moving the flags column to the same
place as in the FreeBSD output. It makes things a bit more consistent
between OSes, and we don't have to touch the test.
At the same time, make use of the actual length of the permission's
string to specify the number of characters to print.
Before this patch, the output looks like:
Start Addr End Addr Perms Size Offset objfile
0x55dd4b544000 0x55dd4b546000 r--p 0x2000 0x0 /usr/bin/sleep
and after, it looks like:
Start Addr End Addr Size Offset Perms objfile
0x5622ae662000 0x5622ae664000 0x2000 0x0 r--p /usr/bin/sleep
Change-Id: If0fc167b010b25f97a3c54e2f491df4973ccde8f