From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2041) id 23D023858401; Sat, 28 May 2022 03:09:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 23D023858401 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Vladimir Mezentsev To: bfd-cvs@sourceware.org, gdb-cvs@sourceware.org Subject: [binutils-gdb] gprofng: fix build with -mx32 X-Act-Checkin: binutils-gdb X-Git-Author: Vladimir Mezentsev X-Git-Refname: refs/heads/master X-Git-Oldrev: 4fb8f32e4063c4670e63c79f1384ee4f6bba08f0 X-Git-Newrev: 6094a48ec821a52731172f3471dce4923a482cd1 Message-Id: <20220528030931.23D023858401@sourceware.org> Date: Sat, 28 May 2022 03:09:31 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2022 03:09:31 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D6094a48ec821= a52731172f3471dce4923a482cd1 commit 6094a48ec821a52731172f3471dce4923a482cd1 Author: Vladimir Mezentsev Date: Fri May 27 19:54:26 2022 -0700 gprofng: fix build with -mx32 =20 gprofng/ChangeLog 2022-05-27 Vladimir Mezentsev =20 PR gprofng/28983 PR gprofng/29143 * src/Experiment.cc (write_header): Fix argument for ctime. Fix -Wformat=3D warnings. * src/Dbe.cc: Likewise. * src/DwarfLib.h: Fix [-Wsign-compare] warnings. * src/Experiment.h: Likewise. * src/ipc.cc: Fix -Wformat=3D warnings. Diff: --- gprofng/src/Dbe.cc | 14 ++++++-------- gprofng/src/DwarfLib.h | 6 +++--- gprofng/src/Experiment.cc | 16 ++++++++++------ gprofng/src/Experiment.h | 2 +- gprofng/src/ipc.cc | 2 +- 5 files changed, 21 insertions(+), 19 deletions(-) diff --git a/gprofng/src/Dbe.cc b/gprofng/src/Dbe.cc index 1a6e5214581..d2cd94bfc19 100644 --- a/gprofng/src/Dbe.cc +++ b/gprofng/src/Dbe.cc @@ -1944,21 +1944,19 @@ dbeGetOverviewText (int dbevindex) info->append (dbe_sprintf (GTXT (" Target : '%s'"), field)); field =3D exp->hostname; if (field && field[0]) - info->append (dbe_sprintf (NTXT (" %s %s (%s, %s)"), - GTXT ("Host :"), + info->append (dbe_sprintf (GTXT (" Host : %s (%s, %s)"), field, exp->architecture ? exp->architecture : GTXT (""), exp->os_version ? exp->os_version : GTXT (""))); - long start_sec =3D exp->start_sec; - char *p =3D ctime (&start_sec); // does this need to be freed? YXXX + time_t start_sec =3D (time_t) exp->start_sec; + char *p =3D ctime (&start_sec); hrtime_t tot_time =3D dbeCalcGroupDuration (grInd); double seconds =3D tot_time * 1.e-9; - info->append (dbe_sprintf (NTXT (" %s %s %s %0.3f %s"), - GTXT ("Start Time :"), p, - GTXT ("Duration :"), seconds, - GTXT ("Seconds"))); + info->append (dbe_sprintf ( + GTXT (" Start Time : %s Duration : %0.3f Seconds"), + p, seconds)); // Number of descendants/processes would be nice info->append (dbe_strdup (NTXT (""))); } diff --git a/gprofng/src/DwarfLib.h b/gprofng/src/DwarfLib.h index 95eff5751ff..07bd60fcb44 100644 --- a/gprofng/src/DwarfLib.h +++ b/gprofng/src/DwarfLib.h @@ -152,9 +152,9 @@ private: uint64_t timestamp; uint64_t file_size; uint64_t address; - uint32_t file; - uint32_t line; - uint32_t column; + int file; + int line; + int column; Dwarf_Half version; uint64_t op_index_register; Dwarf_Small maximum_operations_per_instruction; diff --git a/gprofng/src/Experiment.cc b/gprofng/src/Experiment.cc index a23c10c30a3..c797724af07 100644 --- a/gprofng/src/Experiment.cc +++ b/gprofng/src/Experiment.cc @@ -644,7 +644,7 @@ Experiment::ExperimentHandler::startElement (char*, cha= r*, char *qName, Attribut exp->exp_start_time =3D ts; str =3D attrs->getValue (NTXT ("time")); if (str !=3D NULL) - exp->start_sec =3D atol (str); + exp->start_sec =3D atoll (str); str =3D attrs->getValue (NTXT ("pid")); if (str !=3D NULL) exp->pid =3D atoi (str); @@ -4136,7 +4136,8 @@ Experiment::write_header () if (dbeSession->ipc_mode || dbeSession->rdt_mode) { // In GUI: print start time at the beginning - char *start_time =3D ctime (&start_sec); + time_t t =3D (time_t) start_sec; + char *start_time =3D ctime (&t); if (start_time !=3D NULL) { sb.setLength (0); @@ -4258,7 +4259,8 @@ Experiment::write_header () } =20 // add comment for start time - char *p =3D ctime (&start_sec); + time_t t =3D (time_t) start_sec; + char *p =3D ctime (&t); sb.setLength (0); if (p !=3D NULL) sb.sprintf (GTXT ("Experiment started %s"), p); @@ -6444,9 +6446,11 @@ Experiment::dump_map (FILE *outfile) load.tv_nsec +=3D NANOSEC; } fprintf (outfile, - "0x%08llx %8lld (0x%08llx) %5ld.%09ld %5ld.%09ld \"%s\"\n", - s->base, s->size, s->size, load.tv_sec, load.tv_nsec, - unload.tv_sec, unload.tv_nsec, s->obj->get_name ()); + "0x%08llx %8lld (0x%08llx) %5lld.%09lld %5lld.%09lld \"%s\"\n", + (long long) s->base, (long long) s->size, (long long) s->size, + (long long) load.tv_sec, (long long) load.tv_nsec, + (long long) unload.tv_sec, (long long) unload.tv_nsec, + s->obj->get_name ()); } fprintf (outfile, NTXT ("\n")); } diff --git a/gprofng/src/Experiment.h b/gprofng/src/Experiment.h index 41c44e4a08a..17c91bda23e 100644 --- a/gprofng/src/Experiment.h +++ b/gprofng/src/Experiment.h @@ -114,7 +114,7 @@ public: =20 // Configuration Information char *hostname; // Hosthame (e.g. mymachine) - long start_sec; // Starting timeval secs. + hrtime_t start_sec; // Starting timeval secs. char *username; // name of person performing the test char *architecture; // Architecture name ("sun4") Platform_t platform; // Sparc,Sparcv9,Intel diff --git a/gprofng/src/ipc.cc b/gprofng/src/ipc.cc index 932423cdf0d..edc70256a68 100644 --- a/gprofng/src/ipc.cc +++ b/gprofng/src/ipc.cc @@ -1281,7 +1281,7 @@ ipc_doWork (void *arg) { int arg1 =3D readInt (req); uint64_t arg2 =3D readLong (req); - ipc_log (" args =3D %d, %ld\n", arg1, arg2); + ipc_log (" args =3D %d, %lld\n", arg1, (long long) arg2); dbeSetSelObjV2 (arg1, arg2); writeString (NULL, req); }