public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug exp/30911] [gdb/exp] Cannot call ifunc strstr with debuginfo installed
Date: Thu, 28 Sep 2023 10:49:42 +0000	[thread overview]
Message-ID: <bug-30911-4717-T8ezSNp1GC@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-30911-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=30911

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Tentative fix: swap the order here:
...
diff --git a/gdb/infcall.c b/gdb/infcall.c
index 0f9ad34bbb4..20d0f9acca5 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -316,17 +316,20 @@ find_function_addr (struct value *function,
             FUNCTION_TYPE have been asked for.  */
          if (retval_type != NULL || function_type != NULL)
            {
-             type *target_ftype = find_function_type (funaddr);
-             /* If we don't have debug info for the target function,
-                see if we can instead extract the target function's
-                type from the type that the resolver returns.  */
-             if (target_ftype == NULL)
-               target_ftype = find_gnu_ifunc_target_type (resolver_addr);
+             /* Try to get the target function's type from the type that
+                the resolver returns.  We do this first to work around
+                PR gas/29517. */
+             type *target_ftype = find_gnu_ifunc_target_type (resolver_addr);
              if (target_ftype != NULL)
                {
                  value_type = check_typedef (target_ftype)->target_type ();
                  ftype = target_ftype;
                }
+
+             /* Try to get the target function's type from the target
+                function. */
+             if (target_ftype == NULL)
+               target_ftype = find_function_type (funaddr);
            }
        }
       else
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  reply	other threads:[~2023-09-28 10:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-28 10:48 [Bug exp/30911] New: " vries at gcc dot gnu.org
2023-09-28 10:49 ` vries at gcc dot gnu.org [this message]
2023-09-28 10:50 ` [Bug exp/30911] " sam at gentoo dot org
2023-09-28 11:24 ` vries at gcc dot gnu.org
2023-09-28 11:54 ` vries at gcc dot gnu.org
2023-09-28 13:09 ` [Bug symtab/30911] " vries at gcc dot gnu.org
2023-09-28 16:08 ` vries at gcc dot gnu.org
2023-09-30  8:37 ` [Bug symtab/30911] [gdb/symtab] " vries at gcc dot gnu.org
2023-10-16 14:32 ` cvs-commit at gcc dot gnu.org
2023-10-16 14:33 ` vries at gcc dot gnu.org

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=bug-30911-4717-T8ezSNp1GC@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).