[RFA 3/3] libctf: compilation failure on MinGW due to missing errno values

Joel Brobecker brobecker@adacore.com
Sun Jan 5 06:01:00 GMT 2020


Hi Nick,

> I think what makes most sense is to migrate away from using E* constants
> except for where we reflect the E* return of some underlying call
> (ENOMEM/EAGAIN from malloc, say). libctf itself should only explicitly
> set ECTF_* errors it also defines, in the range below ECTF_BASE. While
> this is technically an API change, no users to date are affected. Here
> and there this might require extra work for users responding to the
> errors: e.g. they'd now need to check for ECTF_NOMEM || ENOMEM. However,
> given that they'd already have to do this for ENOMEM versus EAGAIN I
> don't consider this much of a problem. :)
> 
> Something like this (atop my latest patch series, will write a
> changelog if people think this makes sense):

I think it makes sense. In fact, it looks very good :-).

Will you let me know when it's pushed to master? We'll want to
cherry-pick the change on gdb-9-branch as well...

Thanks for the reviews and patch!

> diff --git a/include/ctf-api.h b/include/ctf-api.h
> index fb494b2021..c85abe1f6d 100644
> --- a/include/ctf-api.h
> +++ b/include/ctf-api.h
> @@ -204,7 +204,10 @@ enum
>     ECTF_DUMPSECTCHANGED,	/* Section changed in middle of dump.  */
>     ECTF_NOTYET,			/* Feature not yet implemented.  */
>     ECTF_INTERNAL,		/* Internal error in link.  */
> -   ECTF_NONREPRESENTABLE	/* Type not representable in CTF.  */
> +   ECTF_NONREPRESENTABLE,	/* Type not representable in CTF.  */
> +   ECTF_INVAL,			/* Invalid argument to CTF function.  */
> +   ECTF_NOMEM,			/* Out of memory in libctf.  */
> +   ECTF_ARGOVERFLOW		/* Limit on number of function arguments reached.  */
[snip snip snip for brievity]

-- 
Joel



More information about the Binutils mailing list