public inbox for
 help / color / mirror / Atom feed
From: Tom Tromey <>
To: Aaron Merey via Gdb-patches <>
Cc: Aaron Merey <>,
Subject: Re: [PATCH] gdb/source: Fix open_source_file error handling
Date: Wed, 08 Feb 2023 10:44:21 -0700	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <> (Aaron Merey via Gdb-patches's message of "Fri, 27 Jan 2023 22:37:48 -0500")

>>>>> "Aaron" == Aaron Merey via Gdb-patches <> writes:

Aaron> Fix this by having open_source_file return a negative errno if it fails
Aaron> to open a source file.  Use this value to generate the error message
Aaron> instead of errno. Also add new function throw_sys_errmsg for reporting
Aaron> this value.

I wonder if it's guaranteed somewhere that the errno values are always
Aaron> +/* Same as perror_with_name except that ERRCODE specifies the error
Aaron> +   instead of errno.  */
Aaron> +
Aaron> +void
Aaron> +throw_sys_errmsg (const char *string, int errcode)

IMO probably better to just add a parameter to perror_with_name that
defaults to 0, meaning use errno.

However, if you want to go this route, a function that always throws
must be marked ATTRIBUTE_NORETURN.


      parent reply	other threads:[~2023-02-08 17:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-28  3:37 Aaron Merey
2023-02-01 19:45 ` Keith Seitz
2023-02-02  1:38   ` Aaron Merey
2023-02-08 17:53     ` Tom Tromey
2023-02-02 10:29   ` Bruno Larsen
2023-02-08 17:44 ` Tom Tromey [this message]

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* 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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).