From: Aaron Merey Date: Thu, 6 Feb 2020 20:58:14 +0000 (-0500) Subject: gdb/debuginfod-support.c: separate stub functions X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7d53a905462fec4382ecea9912745025d600aa4;p=thirdparty%2Fbinutils-gdb.git gdb/debuginfod-support.c: separate stub functions --- diff --git a/gdb/debuginfod-support.c b/gdb/debuginfod-support.c index c19884d89a7..04b55ca1d50 100644 --- a/gdb/debuginfod-support.c +++ b/gdb/debuginfod-support.c @@ -12,21 +12,38 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -You should have received a copy of the GNU General Public License + + You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include #include "defs.h" #include "debuginfod-support.h" -#if HAVE_LIBDEBUGINFOD + +#ifndef HAVE_LIBDEBUGINFOD +int +debuginfod_source_query (const unsigned char *build_id __attribute__((unused)), + int build_id_len __attribute__((unused)), + const char *srcpath __attribute__((unused)), + char **filename __attribute__((unused))) +{ + return -ENOSYS; +} + +int +debuginfod_debuginfo_query (const unsigned char *build_id __attribute__((unused)), + int build_id_len __attribute__((unused)), + char **filename __attribute__((unused))) +{ + return -ENOSYS; +} +#else #include -#endif -#if HAVE_LIBDEBUGINFOD static int progressfn (debuginfod_client *c, - long a __attribute__ ((unused)), - long b __attribute__ ((unused))) + long a __attribute__((unused)), + long b __attribute__((unused))) { return check_quit_flag (); } @@ -41,7 +58,6 @@ debuginfod_init () return c; } -#endif /* See debuginfod-support.h */ @@ -51,7 +67,6 @@ debuginfod_source_query (const unsigned char *build_id, const char *srcpath, char **filename) { -#if HAVE_LIBDEBUGINFOD debuginfod_client *c = debuginfod_init (); if (c == nullptr) @@ -65,9 +80,6 @@ debuginfod_source_query (const unsigned char *build_id, debuginfod_end (c); return fd; -#else - return -ENOSYS; -#endif } /* See debuginfod-support.h */ @@ -77,7 +89,6 @@ debuginfod_debuginfo_query (const unsigned char *build_id, int build_id_len, char **filename) { -#if HAVE_LIBDEBUGINFOD debuginfod_client *c = debuginfod_init (); if (c == nullptr) @@ -87,7 +98,5 @@ debuginfod_debuginfo_query (const unsigned char *build_id, debuginfod_end (c); return fd; -#else - return -ENOSYS; -#endif } +#endif