From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 19863395C025; Thu, 17 Nov 2022 09:56:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 19863395C025 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668678961; bh=dhYezs4tGxHksFqoSHQfIqCKLHfooN2pbkUQEszAOec=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kIUNiBr5H6Wn/jzVkberBH5vuur5EdgK9Q9kVaBfCpWmqUMqzU2t6sz/3IDV9nIbL wX0yAQEleADDF5fo7Ob2BElD/+f9zXOjmrJeclPdXfcIHCDqQiFoMTqo2XLw1syXNu bRTIKAVlPAFvlCCXJGJUb0ZC8FlsGWNGOZ5qz/VU= From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug build/29791] [13 regression] Many gdbsupport files don't compile on Solaris Date: Thu, 17 Nov 2022 09:55:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: build X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: 13.1 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29791 --- Comment #4 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Rainer Orth : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Df4ad82b3bcc4= ae2cecba00177561ddfad49ccef2 commit f4ad82b3bcc4ae2cecba00177561ddfad49ccef2 Author: Rainer Orth Date: Thu Nov 17 10:55:25 2022 +0100 Fix various procfs.c compilation errors procfs.c has accumulated several compilation errors lately (some of them new with GCC 12), which are fixed by this patch: * auxv_parse gets: /vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c:144:7: error: int procfs_target::auxv_parse(gdb_byte**, gdb_byte*, CORE_ADDR*, CORE_ADDR*) marked override, but does not override 144 | int auxv_parse (gdb_byte **readptr, | ^~~~~~~~~~ Obviouly, procfs.c was missed in the auxv_parse constification. * dead_procinfo has: /vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c: In function void dead_procinfo(procinfo*, const char*, int): /vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c:563:11: warning: the addre= ss of procinfo::pathname will never be NULL [-Waddress] 563 | if (pi->pathname) | ~~~~^~~~~~~~ /vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c:238:8: note: procinfo::pathname declared here 238 | char pathname[MAX_PROC_NAME_SIZE]; /* Pathname to /proc en= try */ | ^~~~~~~~ The warning is correct, so the code can lose support for the NULL pathname case. * create_inferior has this ugly warning: /vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c: In member function virtual void procfs_target::create_inferior(const char*, const std::string&, char**, int): /vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c:2815:19: warning: char* std::strncpy(char*, const char*, size_t) output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncatio= n] 2815 | strncpy (tryname, p, len); | ~~~~~~~~^~~~~~~~~~~~~~~~~ /vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c:2814:26: note: length comp= uted here 2814 | len =3D strlen (p); | ~~~~~~~^~~ It seems that this is another case of GCC PR middle-end/88059, which Martin Sebor refuses to fix. So I'm using the hack suggested in the PR to use memcpy instead of strncpy. * find_memory_regions_callback fails with /vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c: In function int find_memory_regions_callback(prmap*, find_memory_region_ftype, void*): /vol/src/gnu/gdb/hg/master/dist/gdb/procfs.c:3167:18: error: too few arguments to function 3167 | return (*func) ((CORE_ADDR) map->pr_vaddr, | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ 3168 | map->pr_size, | ~~~~~~~~~~~~~ 3169 | (map->pr_mflags & MA_READ) !=3D 0, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3170 | (map->pr_mflags & MA_WRITE) !=3D 0, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3171 | (map->pr_mflags & MA_EXEC) !=3D 0, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3172 | 1, /* MODIFIED is unknown, pass it as true. = */ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~ 3173 | data); | ~~~~~ Again, procfs.c was overlooked when adding the new memory_tagged arg. Unfortunately, it wasn't even documented in gdb/defs.h when it was added in commit 68cffbbd4406b4efe1aa6e18460b1d7ca02549f1 Author: Luis Machado Date: Thu Mar 31 11:42:35 2022 +0100 [AArch64] MTE corefile support With those changes, procfs.c compiles again. Together with the hack from the Solaris gdbsupport breakage reported in PR build/29791, I was able to build and test gdb on both amd64-pc-solaris2.11 and sparcv9-sun-solaris2.11. Approved-By: Simon Marchi --=20 You are receiving this mail because: You are on the CC list for the bug.=