fbsd-nat: Don't use '%jd' and '%ju' with printf_filtered.
authorJohn Baldwin <jhb@FreeBSD.org>
Mon, 30 Aug 2021 18:08:38 +0000 (11:08 -0700)
committerJohn Baldwin <jhb@FreeBSD.org>
Tue, 7 Sep 2021 23:09:17 +0000 (16:09 -0700)
commitaaa394b7dfe7f388d12a4875fae58b6bc3e6da5e
treeeb8a410c8a09e4d3e43644fbcd6b36a81bc3842d
parent1aa04a582c83d1e74133ba1c847a261487bb3c54
fbsd-nat: Don't use '%jd' and '%ju' with printf_filtered.

The handler for 'info proc status' for native processes on FreeBSD
uses the 'j' size modifier along with uintmax_t / intmax_t casts to
output integer values for types such as off_t that are not aliases of
a basic C type such as 'int' or 'long'.  printf_filtered does not
support the 'j' modifer, so this resulted in runtime errors in
practice:

(gdb) info proc stat
process 8674
Name: ls
State: T (stopped)
Parent process: 8673
Process group: 8674
Session id: 2779
Unrecognized format specifier 'j' in printf

Instead, use plongest and pulongest to generate the output strings of
these integer values.

gdb/ChangeLog:

* fbsd-nat.c (fbsd_nat_target::info_proc): Use plongest and
pulongest instead of %j.
gdb/ChangeLog
gdb/fbsd-nat.c
This page took 0.024658 seconds and 4 git commands to generate.