From: Joel Brobecker <brobecker@adacore.com>
To: Jim Blandy <jimb@red-bean.com>
Cc: Pedro Alves <pedro@codesourcery.com>, gdb-patches@sourceware.org
Subject: Re: RFA: Building GDB under GLIBC 2.8
Date: Mon, 29 Dec 2008 05:50:00 -0000 [thread overview]
Message-ID: <20081229055001.GK4216@adacore.com> (raw)
In-Reply-To: <8f2776cb0812191645m56a7bd29ob563ea7d4e79724b@mail.gmail.com>
> 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 <jimb@red-bean.com>
> 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
next prev parent reply other threads:[~2008-12-29 5:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-13 2:05 Jim Blandy
2008-12-13 20:33 ` Mark Kettenis
2008-12-13 23:02 ` Andreas Schwab
2008-12-14 6:08 ` Jim Blandy
2008-12-14 19:57 ` Mark Kettenis
2008-12-14 21:54 ` Paul Pluzhnikov
2008-12-14 18:26 ` Jan Kratochvil
2008-12-14 18:26 ` RFA: Building GDB under GLIBC 2.8 [resend w/the patch] Jan Kratochvil
2008-12-15 9:02 ` RFA: Building GDB under GLIBC 2.8 Jim Blandy
2008-12-15 20:07 ` Tom Tromey
2008-12-15 20:17 ` Pedro Alves
2008-12-20 0:46 ` Jim Blandy
2008-12-29 5:50 ` Joel Brobecker [this message]
2008-12-29 23:48 ` Tom Tromey
2009-01-06 18:32 ` Jim Blandy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081229055001.GK4216@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=jimb@red-bean.com \
--cc=pedro@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox