From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2133 invoked by alias); 29 Dec 2008 05:50:56 -0000 Received: (qmail 2125 invoked by uid 22791); 29 Dec 2008 05:50:55 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 29 Dec 2008 05:50:11 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id DA5992A966A; Mon, 29 Dec 2008 00:50:09 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id kI9dnrRlxfAJ; Mon, 29 Dec 2008 00:50:09 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id E78322A9669; Mon, 29 Dec 2008 00:50:08 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 7CB78E7ACD; Mon, 29 Dec 2008 09:50:01 +0400 (RET) Date: Mon, 29 Dec 2008 05:50:00 -0000 From: Joel Brobecker To: Jim Blandy Cc: Pedro Alves , gdb-patches@sourceware.org Subject: Re: RFA: Building GDB under GLIBC 2.8 Message-ID: <20081229055001.GK4216@adacore.com> References: <8f2776cb0812121804n1008f921h3898bb7bda1581c9@mail.gmail.com> <200812152016.56353.pedro@codesourcery.com> <8f2776cb0812191645m56a7bd29ob563ea7d4e79724b@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8f2776cb0812191645m56a7bd29ob563ea7d4e79724b@mail.gmail.com> User-Agent: Mutt/1.4.2.2i Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-12/txt/msg00441.txt.bz2 > Okay, I think this revision makes the changes people suggested. One of the things that I was wondering about is the report about numerous core files found after running the testsuite. Was this addressed by this new version? > commit 01ff08caa6977858da014630578f708b86f84803 > Author: Jim Blandy > Date: Fri Dec 12 17:47:01 2008 -0800 > > gdb > Check return values of functions declared with warn_unused_result > attribute in GLIBC 2.8. > * cli/cli-cmds.c (pwd_command): Check return value from getcwd. > * inflow.c (check_syscall): New function. > (new_tty): Use check_syscall to check return values from open and dup. > * linux-nat.c (linux_nat_info_proc_cmd): Check return value from fgets. > * main.c (captured_main): Call cwd after setting up gdb_stderr; > check for errors from getcwd. > * mi/mi-cmd-env.c (mi_cmd_env_pwd): Check return value from getcwd. > * ui-file.c (stdio_file_write): Ignore return value from fwrite. > (stdio_file_fputs): Same. > * utils.c (internal_vproblem): abort if last-ditch error message > write fails. Looks OK to me. I'm a little bit pained by seeing us forced to check return values in cases where we really don't care, but if this is the way things are going to be in glibc from now on. Were the glibc developers contacted and do we know what they said? I'm wondering if these new attributes are a done-deal or whether there are re-considering... > --- a/gdb/linux-nat.c > +++ b/gdb/linux-nat.c > @@ -3666,8 +3666,10 @@ linux_nat_info_proc_cmd (char *args, int from_tty) > if ((procfile = fopen (fname1, "r")) != NULL) > { > struct cleanup *cleanup = make_cleanup_fclose (procfile); > - fgets (buffer, sizeof (buffer), procfile); > - printf_filtered ("cmdline = '%s'\n", buffer); > + if (fgets (buffer, sizeof (buffer), procfile)) > + printf_filtered ("cmdline = '%s'\n", buffer); > + else > + warning (_("unable to read '/proc/%lld/cmdline'"), pid); I suggest taking advantage of fname1 in the call to warning, rather than duplicating the actual path. -- Joel