Control: tags -1 + moreinfo

On Wednesday, July 25 2018, GSR wrote:

> Hello:
>
> Current man page says "write core file to filename instead of
> core.pid" but the real outcome is that dump is written to
> filename.pid. Probably because it's not just a single PID, but a list
> of PIDs, which neither man page nor -h talk about.

Sorry, I'm not sure I understand the problem.  The '-o' option works as
expected here:

  $ bash /usr/bin/gcore 21153
  0x00007f11fc3d0404 in __GI___nanosleep (requested_time=0x7ffc3cb70240, 
remaining=0x0) at ../sysdeps/unix/sysv/linux/nanosleep.c:28
  28    ../sysdeps/unix/sysv/linux/nanosleep.c: No such file or directory.
  Saved corefile core.21153

  $ bash /usr/bin/gcore -o blabla 21258
  0x00007f3531233404 in __GI___nanosleep (requested_time=0x7fff80925a40, 
remaining=0x0) at ../sysdeps/unix/sysv/linux/nanosleep.c:28
  28    ../sysdeps/unix/sysv/linux/nanosleep.c: No such file or directory.
  Saved corefile blabla.21258

  $ bash /usr/bin/gcore -o blabla 21549 21550
  0x00007fc267908404 in __GI___nanosleep (requested_time=0x7ffc76bc1c80, 
remaining=0x0) at ../sysdeps/unix/sysv/linux/nanosleep.c:28
  28    ../sysdeps/unix/sysv/linux/nanosleep.c: No such file or directory.
  Saved corefile blabla.21549
  0x00007fab24ce5404 in __GI___nanosleep (requested_time=0x7ffc2d80a380, 
remaining=0x0) at ../sysdeps/unix/sysv/linux/nanosleep.c:28
  28    ../sysdeps/unix/sysv/linux/nanosleep.c: No such file or directory.
  Saved corefile blabla.21550

> While checking what was going on, I found -a is not documented in man
> page, and script has not comment at all about what it really does
> (options are found in 10.19 of info docs, it toggles two defaults,
> Linux only).

For some reason (probably because of the non-free aspect of it), the
version of gdb.texinfo present in the salsa GDB repo is not the one
shipped on upstream GDB 8.1.  The gcore manpage is generated from this
file, so this is why you're seeing an old version of it.

The -a option was introduced last year in order to replicate the
coredump-filter feature implemented a while ago on GDB.  However, it's
not true that the script doesn't contain a comment explaining it.  This
is what I see here:

  # When the -a option is present, this may hold additional commands
  # to ensure gdb dumps all mappings (OS dependent).

When the manpage is updated, you'll also be able to see the description
there.

> Suggestions:
>
> - change man page and -h output to say "pid[s]".

This change would be welcome, IMO.

> - support single PID with exact filename (no .pid extension). If you
>   can get a list of PIDs, you can also probably do the loop, so the
>   feature isn't so helpful but more importantly it disallows things
>   like '-o >( gzip - > "path/${PID}.gz" )' (on the fly compression) or
>   '-o "$T"' (a safe T created by tempfile(1)).
>
> - fix man page for -o "write core file to filename if one PID, or
>   filename.pid if multiple PIDs, instead of default core.pid".

I don't really understand the two proposals above.

> - fix man page for -a (point to info? small text explaining?).

This is not necessary, as I explained above.

Cheers,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

Attachment: signature.asc
Description: PGP signature

Reply via email to