Re: [PATCH v4] Add debuginfod support to GDB

Simon Marchi
2020-02-24T20:39:49Z

On 2020-02-23 11:42 p.m., Aaron Merey wrote:
> On Fri, Feb 21, 2020 at 3:12 PM Simon Marchi <simark@simark.ca> wrote:
>> I'll have to build debuginfod and configure it, so I can give it a try
>> and see how it files.
>>
>> In the mean time: if we fail to parse the server's response as a bfd or
>> if the build id doesn't match, I think we need to display a warning,
>> because it probably means that the server sent us something bad, or there
>> was some problem somewhere in the pipeline.
>>
>> Currently, if that happens, the user would see "Download successful", but
>> no debug info loaded, so it's a bit misleading.
>
> I added the warnings but removed the "Download successful" anyway
> since it resulted in too much noise.
>
> Aaron
>

I just noticed that the debuginfod_debuginfo_query definition is not in sync with
the declaration, so when we build without debug info support, we get:

CXX debuginfod-support.o
/home/smarchi/src/binutils-gdb/gdb/debuginfod-support.c: In function ‘scoped_fd debuginfod_debuginfo_query(const unsigned char*, int, gdb::unique_xmalloc_ptr<char>*)’:
/home/smarchi/src/binutils-gdb/gdb/debuginfod-support.c:36:1: error: no previous declaration for ‘scoped_fd debuginfod_debuginfo_query(const unsigned char*, int, gdb::unique_xmalloc
_ptr<char>*)’ [-Werror=missing-declarations]
debuginfod_debuginfo_query (const unsigned char *build_id __attribute__((unused)),
^~~~~~~~~~~~~~~~~~~~~~~~~~

I also think you could remove the __attribute__((unused)). We don't use -Wunused-parameter
in GDB, and I don't think we plan to (there are a ton of places with unused parameters like
that, that don't hurt).

Simon