Don't search for $SHELL in procfs.c

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Fri Jun 8 12:13:00 GMT 2018


When building gdb mainline on Solaris with g++ 8.1 with the fixes in

	https://sourceware.org/ml/gdb-patches/2018-06/msg00196.html

one failure remains:

/vol/src/gnu/gdb/gdb/dist/gdb/procfs.c: In member function ‘virtual void procfs_target::create_inferior(const char*, const string&, char**, int)’:
/vol/src/gnu/gdb/gdb/dist/gdb/procfs.c:3098:12: error: ‘char* std::strncpy(char*, const char*, size_t)’ output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
    strncpy (tryname, p, len);
    ~~~~~~~~^~~~~~~~~~~~~~~~~
/vol/src/gnu/gdb/gdb/dist/gdb/procfs.c:3097:19: note: length computed here
      len = strlen (p);
            ~~~~~~~^~~
cc1plus: all warnings being treated as errors

I didn't even try to get rid of this, but revived an older patch of mine
to rip out the code to search for $SHELL in $PATH.  procfs.c is the only
caller of fork_inferior that does this, and I don't see why Solaris
should be special here.  Since all callers call fork_inferior with
shell_file_arg = NULL now, one might even think about getting rid of
that arg as a followup.

Built on 64-bit Solaris 11.5/x86 (amd64-pc-solaris2.11), make check
running.  Ok for mainline if that passes?

Thanks.
        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2018-02-05  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* procfs.c (procfs_target::create_inferior): Don't search for $SHELL.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sol2-no-procfs-shell.patch
Type: text/x-patch
Size: 3846 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20180608/0c0767ba/attachment.bin>


More information about the Gdb-patches mailing list