diff options
author | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2022-11-20 14:52:09 +0100 |
---|---|---|
committer | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2022-11-20 14:52:09 +0100 |
commit | f1a8d786c37bbe40d0bc2fec618d0e875d043811 (patch) | |
tree | ff978c7c99096c6ab8198900b78a00014a2eccbb /gdb | |
parent | abad6c11d03e17a5fef9d6fff5e58f8a288620f0 (diff) | |
download | gdb-f1a8d786c37bbe40d0bc2fec618d0e875d043811.zip gdb-f1a8d786c37bbe40d0bc2fec618d0e875d043811.tar.gz gdb-f1a8d786c37bbe40d0bc2fec618d0e875d043811.tar.bz2 |
Fix sol-thread.c compilation on 32-bit Solaris
sol-thread.c fails to compile on 32-bit Solaris: there are several
instances of
In file included from /vol/src/gnu/gdb/hg/master/local/gdb/../gdbsupport/common-defs.h:203,
from /vol/src/gnu/gdb/hg/master/local/gdb/defs.h:28,
from /vol/src/gnu/gdb/hg/master/local/gdb/sol-thread.c:51:
/vol/src/gnu/gdb/hg/master/local/gdb/sol-thread.c: In member function ‘virtual void sol_thread_target::resume(ptid_t, int, gdb_signal)’:
/vol/src/gnu/gdb/hg/master/local/gdb/sol-thread.c:416:20: error: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘ULONGEST’ {aka ‘long long unsigned int’} [-Werror=format=]
416 | warning (_("Specified thread %ld seems to have terminated"),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/vol/src/gnu/gdb/hg/master/local/gdb/../gdbsupport/gdb_locale.h:28:29:
note: in definition of macro ‘_’
28 | # define _(String) gettext (String)
| ^~~~~~
/vol/src/gnu/gdb/hg/master/local/gdb/sol-thread.c:416:40: note: format
string is defined here
416 | warning (_("Specified thread %ld seems to have terminated"),
| ~~^
| |
| long int
| %lld
Fixed by using pulongest () instead.
Tested on i386-pc-solaris2.11, amd64-pc-solaris2.11,
sparc-sun-solaris2.11, and sparcv9-sun-solaris2.11 (together with
Simon's patch for PR build/29798).
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/sol-thread.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index 18754f4..c9abb45 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -413,8 +413,8 @@ sol_thread_target::resume (ptid_t ptid, int step, enum gdb_signal signo) if (ptid.pid () == -2) /* Inactive thread. */ error (_("This version of Solaris can't start inactive threads.")); if (info_verbose && ptid.pid () == -1) - warning (_("Specified thread %ld seems to have terminated"), - save_ptid.tid ()); + warning (_("Specified thread %s seems to have terminated"), + pulongest (save_ptid.tid ())); } beneath ()->resume (ptid, step, signo); @@ -435,8 +435,8 @@ sol_thread_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus, if (ptid.pid () == -2) /* Inactive thread. */ error (_("This version of Solaris can't start inactive threads.")); if (info_verbose && ptid.pid () == -1) - warning (_("Specified thread %ld seems to have terminated"), - ptid_for_warning.tid ()); + warning (_("Specified thread %s seems to have terminated"), + pulongest (ptid_for_warning.tid ())); } ptid_t rtnval = beneath ()->wait (ptid, ourstatus, options); @@ -973,14 +973,14 @@ sol_thread_target::pid_to_str (ptid_t ptid) lwp = thread_to_lwp (ptid, -2); if (lwp.pid () == -1) - return string_printf ("Thread %ld (defunct)", - ptid.tid ()); + return string_printf ("Thread %s (defunct)", + pulongest (ptid.tid ())); else if (lwp.pid () != -2) - return string_printf ("Thread %ld (LWP %ld)", - ptid.tid (), lwp.lwp ()); + return string_printf ("Thread %s (LWP %ld)", + pulongest (ptid.tid ()), lwp.lwp ()); else - return string_printf ("Thread %ld ", - ptid.tid ()); + return string_printf ("Thread %s ", + pulongest (ptid.tid ())); } else if (ptid.lwp () != 0) return string_printf ("LWP %ld ", ptid.lwp ()); |