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 breakpoints/26096] gdb sets breakpoint at cold clone
Date: Tue, 09 Jun 2020 14:23:10 +0000	[thread overview]
Message-ID: <bug-26096-4717-OBJ0QaFGnP@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-26096-4717@http.sourceware.org/bugzilla/>

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

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #1)
> Tentative patch:

OK, that's too restrictive, we miss out on the '() const':
...
(gdb) complete b const_overload_fn()^M
b struct_with_const_overload::const_overload_fn()^M
b struct_with_const_overload::const_overload_fn() const^M
(gdb) PASS: gdb.linespec/cpcompletion.exp: const-overload: cmd complete "b
const_overload_fn()"
b const_overload_fn^M
Breakpoint 36 at 0x400646: file
/data/gdb_versions/devel/src/gdb/testsuite/gdb.linespec/cpls.cc, line 197.^M
(gdb) info breakpoint $bpnum^M
Num     Type           Disp Enb Address            What^M
36      breakpoint     keep y   0x0000000000400646 in
struct_with_const_overload::const_overload_fn() at /data/gd\
b_versions/devel/src/gdb/testsuite/gdb.linespec/cpls.cc:197^M
(gdb) FAIL: gdb.linespec/cpcompletion.exp: const-overload: compare "b
const_overload_fn" completion list with bp \
location list: matches
...

Let's try this:
...
diff --git a/gdb/utils.c b/gdb/utils.c
index 102db28787..8b20d6669e 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -2652,7 +2652,34 @@ strncmp_iw_with_mode (const char *string1, const char
*string2,
          return 0;
        }
       else
-       return (*string1 != '\0' && *string1 != '(');
+       {
+         if (*string1 == '\0')
+           return 0;
+
+         /* Skip over '(.*)'.  */
+         if (*string1 != '(')
+           return 1;
+         while (true)
+           {
+             string1++;
+             if (*string1 == '\0')
+               return 0;
+             if (*string1 == ')')
+               break;
+           }
+
+         /* Return no-match if there's a "[clone .cold]" suffix.  */
+         while (true)
+           {
+             string1++;
+             if (*string1 == '\0')
+               return 0;
+             if (*string1 == '[')
+               return strcmp (string1, "[clone .cold]") == 0;
+           }
+
+         return 1;
+       }
     }
   else
     return 1;
...

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

  parent reply	other threads:[~2020-06-09 14:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-09 10:57 [Bug breakpoints/26096] New: " vries at gcc dot gnu.org
2020-06-09 13:17 ` [Bug breakpoints/26096] " vries at gcc dot gnu.org
2020-06-09 14:23 ` vries at gcc dot gnu.org [this message]
2021-05-29 10:38 ` vries at gcc dot gnu.org
2021-05-31 14:16 ` vries at gcc dot gnu.org
2021-05-31 14:35 ` vries at gcc dot gnu.org
2021-05-31 17:06 ` bernd.edlinger at hotmail dot de
2021-06-01 13:25 ` cvs-commit at gcc dot gnu.org
2021-06-01 13:33 ` vries at gcc dot gnu.org
2021-06-01 13:33 ` vries at gcc dot gnu.org
2021-06-01 14:14 ` bernd.edlinger at hotmail dot de

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-26096-4717-OBJ0QaFGnP@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).