Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Aktemur, Tankut Baris via Gdb-patches" <gdb-patches@sourceware.org>
To: Jonah Graham <jonah@kichwacoders.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH 0/2] Breakpoint conditions at locations with differing contexts
Date: Tue, 6 Apr 2021 14:11:34 +0000	[thread overview]
Message-ID: <SN6PR11MB289356C9629B93F203412886C4769@SN6PR11MB2893.namprd11.prod.outlook.com> (raw)
In-Reply-To: <CAPmGMvi_TvWAs85J9VfHq-gDm=1KZxFHkSmW5MHhJD5vGekUrA@mail.gmail.com>

On Monday, April 5, 2021 7:46 PM, Jonah Graham wrote:
> On Fri, 31 Jul 2020 at 11:42, Tankut Baris Aktemur via Gdb-patches <mailto:gdb-patches@sourceware.org> wrote:
> > This is a short series about conditional breakpoints where the
> > condition may be invalid at some breakpoint locations because of their
> > context.
>
> Hi Tankut,
>
> I have been testing GDB master against current Eclipse CDT and I came across this change. I have some work in Eclipse CDT to display this information to the user which I am tracking in https://bugs.eclipse.org/bugs/show_bug.cgi?id=572589. Thanks for the new GDB feature!

Hi Jonah,

Thanks for the feedback and reporting this issue.

> 1. The problem I am having is that I want to display the "Breakpoint condition is invalid at this location" type info in the UI, but I can't see if there is any from MI to identify this information. Here is a trace that causes me a problem:
>
> $ ./gdb --interpreter=mi2 --quiet
> =thread-group-added,id="i1"
> (gdb)
> 18-file-exec-and-symbols --thread-group i1 /scratch/eclipse/src/cdt/runtime-CDT/bug572589/Debug/bug572589
> 18^done
> (gdb)
> 26-break-insert -c "invalid condition here" -f main
> &"warning: failed to validate condition at location 1, disabling:\n  "
> &"No symbol \"invalid\" in current context.\n"
> 26^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="<MULTIPLE>",cond="invalid condition here",times="0",original-location="main"},{number="1.1",enabled="N*",addr="0x0000000000001160",func="main",file="../src/bug572589.c",fullname="/scratch/eclipse/src/cdt/runtime-CDT/bug572589/src/bug572589.c",line="20",thread-groups=["i1"]}

This is an oversight.  The expected behavior is that the breakpoint
is rejected here, because at no location the condition is valid and
the condition is not being explicitly forced.
So, the expected behavior is

(gdb)
-break-insert -c "invalid condition here" -f main
^error,msg="No symbol \"invalid\" in current context."

I'll submit a patch to fix it.

> (gdb)
> info break
> &"info break\n"
> ~"Num     Type           Disp Enb Address            What\n"
> ~"1       breakpoint     keep y   <MULTIPLE>         \n"
> ~"\tstop only if invalid condition here\n"
> ~"1.1                         N*  0x0000000000001160 in main at ../src/bug572589.c:20\n"
> ~"(*): Breakpoint condition is invalid at this location.\n"
> ^done
> (gdb)
> 42-break-list
> 42^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="18",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="<MULTIPLE>",cond="invalid condition here",times="0",original-location="main"},{number="1.1",enabled="N*",addr="0x0000000000001160",func="main",file="../src/bug572589.c",fullname="/scratch/eclipse/src/cdt/runtime-CDT/bug572589/src/bug572589.c",line="20",thread-groups=["i1"]}]}
> (gdb)
>
> Is the enabled="N*" what CDT can use to know that? https://sourceware.org/gdb/current/onlinedocs/gdb/GDB_002fMI-Breakpoint-Commands.html#GDB_002fMI-Breakpoint-Commands shows that enabled can be y or n (lowercase). If this is the way to identify the invalid condition, can this be documented explicitly in the docs?

"N*" is the third possible value and it means "disabled because the
condition is invalid at the location".  I'll also submit a patch to
update the doc.

> Can the warning string be part of the breakpoint structure returned in MI?

Are you referring to the "warning: failed to validate condition
at location 1, disabling:" string?  I'm not sure it should be a part
of the breakpoint structure.  Wouldn't the 'N*' value suffice to give
the necessary information?

>
> 2. The other problem is I want to enable the -force-condition in the UI, but AFAICT that isn't supported from MI? If it is, I couldn't figure out the invocation that worked.

This flag does not exist.  I'll submit a patch to recognize it in
the MI command.

>
> Any guidance you can provide is most welcome.
>
> Thanks,
> Jonah

Thanks.
-Baris


Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

  reply	other threads:[~2021-04-06 14:12 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-31 15:42 Tankut Baris Aktemur
     [not found] ` <cover.1596209606.git.tankut.baris.aktemur@intel.com>
2020-07-31 15:42   ` [PATCH 1/2] gdb/breakpoint: disable a bp location if condition is invalid at that location Tankut Baris Aktemur
2020-07-31 15:42   ` [RFC][PATCH 2/2] gdb/breakpoint: add a '-force' flag to the 'condition' command Tankut Baris Aktemur
2020-08-03 10:28     ` Andrew Burgess
2020-08-20 21:24 ` [PATCH v2 0/2] Breakpoint conditions at locations with differing contexts Tankut Baris Aktemur
2020-08-20 21:24   ` [PATCH v2 1/2] gdb/breakpoint: disable a bp location if condition is invalid at that location Tankut Baris Aktemur
2020-09-19  3:05     ` Simon Marchi
2020-09-25 15:49       ` Aktemur, Tankut Baris via Gdb-patches
2020-09-25 16:10         ` Simon Marchi
2020-09-25 18:15           ` Aktemur, Tankut Baris via Gdb-patches
2020-10-13 12:24             ` Aktemur, Tankut Baris via Gdb-patches
2020-08-20 21:24   ` [PATCH v2 2/2] gdb/breakpoint: add flags to 'condition' and 'break' commands to force condition Tankut Baris Aktemur
2020-09-04 11:02   ` [PATCH v2 0/2] Breakpoint conditions at locations with differing contexts Tankut Baris Aktemur
2020-09-11 11:56   ` Tankut Baris Aktemur
2020-09-18 20:36   ` [PING][PATCH " Tankut Baris Aktemur
2020-09-25 15:51 ` [PATCH v3 " Tankut Baris Aktemur via Gdb-patches
2020-09-25 15:51   ` [PATCH v3 1/2] gdb/breakpoint: disable a bp location if condition is invalid at that location Tankut Baris Aktemur via Gdb-patches
2020-09-25 15:51   ` [PATCH v3 2/2] gdb/breakpoint: add flags to 'condition' and 'break' commands to force condition Tankut Baris Aktemur via Gdb-patches
2020-10-13 12:25 ` [PATCH v4 0/2] Breakpoint conditions at locations with differing contexts Tankut Baris Aktemur via Gdb-patches
2020-10-13 12:25   ` [PATCH v4 1/2] gdb/breakpoint: disable a bp location if condition is invalid at that location Tankut Baris Aktemur via Gdb-patches
2020-10-13 15:06     ` Eli Zaretskii via Gdb-patches
2020-10-13 15:17       ` Aktemur, Tankut Baris via Gdb-patches
2020-10-16 22:20     ` Simon Marchi
2020-10-13 12:25   ` [PATCH v4 2/2] gdb/breakpoint: add flags to 'condition' and 'break' commands to force condition Tankut Baris Aktemur via Gdb-patches
2020-10-13 15:08     ` Eli Zaretskii via Gdb-patches
2020-10-13 15:46       ` Aktemur, Tankut Baris via Gdb-patches
2020-10-13 16:12         ` Eli Zaretskii via Gdb-patches
2020-10-16 22:45     ` Simon Marchi
2020-10-19 13:58       ` Aktemur, Tankut Baris via Gdb-patches
2020-10-19 14:07         ` Simon Marchi
2020-10-27 10:13         ` Aktemur, Tankut Baris via Gdb-patches
2020-10-29 10:10           ` Tom de Vries
2020-10-29 10:30             ` Aktemur, Tankut Baris via Gdb-patches
2020-10-29 17:30     ` Pedro Alves
2020-11-10 19:33       ` Aktemur, Tankut Baris via Gdb-patches
2020-12-05 17:30         ` Pedro Alves
2020-12-10 20:30           ` Tom Tromey
2020-12-15 11:20             ` Aktemur, Tankut Baris via Gdb-patches
2020-11-10 19:51       ` Aktemur, Tankut Baris via Gdb-patches
2020-10-28 16:57   ` [PATCH v4 0/2] Breakpoint conditions at locations with differing contexts Gary Benson via Gdb-patches
2020-10-29  7:43     ` Aktemur, Tankut Baris via Gdb-patches
2021-04-05 17:45 ` [PATCH " Jonah Graham
2021-04-06 14:11   ` Aktemur, Tankut Baris via Gdb-patches [this message]
2021-04-06 14:37     ` Jonah Graham
2021-04-07  7:09       ` Aktemur, Tankut Baris via Gdb-patches
2021-04-07 11:26         ` Jonah Graham
2021-04-07 14:55   ` [PATCH 0/4] Multi-context invalid breakpoint conditions and MI Tankut Baris Aktemur via Gdb-patches
2021-04-07 14:55     ` [PATCH 1/4] gdb/doc: update the 'enabled' field's description for BP locations in MI Tankut Baris Aktemur via Gdb-patches
2021-04-07 15:15       ` Eli Zaretskii via Gdb-patches
2021-04-07 21:42       ` Simon Marchi via Gdb-patches
2021-04-07 14:55     ` [PATCH 2/4] testsuite, gdb.mi: fix duplicate test names in mi-break.exp Tankut Baris Aktemur via Gdb-patches
2021-04-07 21:49       ` Simon Marchi via Gdb-patches
2021-04-07 14:55     ` [PATCH 3/4] gdb/breakpoint: add a 'force_condition' parameter to 'create_breakpoint' Tankut Baris Aktemur via Gdb-patches
2021-04-07 22:08       ` Simon Marchi via Gdb-patches
2021-04-08  7:44         ` Aktemur, Tankut Baris via Gdb-patches
2021-04-08 13:59           ` Simon Marchi via Gdb-patches
2021-04-08 14:19             ` Aktemur, Tankut Baris via Gdb-patches
2021-04-07 14:55     ` [PATCH 4/4] gdb/mi: add a '-b' flag to the '-break-insert' cmd to force the condition Tankut Baris Aktemur via Gdb-patches
2021-04-07 15:18       ` Eli Zaretskii via Gdb-patches
2021-04-07 15:27         ` Aktemur, Tankut Baris via Gdb-patches
2021-04-07 15:53           ` Eli Zaretskii via Gdb-patches
2021-04-07 16:05             ` Aktemur, Tankut Baris via Gdb-patches
2021-04-07 16:50               ` Eli Zaretskii via Gdb-patches
2021-04-07 22:26       ` Simon Marchi via Gdb-patches
2021-04-08 14:22     ` [PATCH v2 0/4] Multi-context invalid breakpoint conditions and MI Tankut Baris Aktemur via Gdb-patches
2021-04-08 14:22       ` [PATCH v2 1/4] gdb/breakpoint: display "N" on MI for disabled-by-condition locations Tankut Baris Aktemur via Gdb-patches
2021-04-08 15:04         ` Eli Zaretskii via Gdb-patches
2021-04-08 14:22       ` [PATCH v2 2/4] testsuite, gdb.mi: fix duplicate test names in mi-break.exp Tankut Baris Aktemur via Gdb-patches
2021-04-08 14:22       ` [PATCH v2 3/4] gdb/breakpoint: add a 'force_condition' parameter to 'create_breakpoint' Tankut Baris Aktemur via Gdb-patches
2021-04-08 14:22       ` [PATCH v2 4/4] gdb/mi: add a '--force-condition' flag to the '-break-insert' cmd Tankut Baris Aktemur via Gdb-patches
2021-04-08 15:06         ` Eli Zaretskii via Gdb-patches
2021-04-08 15:12           ` Aktemur, Tankut Baris via Gdb-patches
2021-04-11  1:06         ` Jonah Graham
2021-04-11  1:12           ` Simon Marchi via Gdb-patches
2021-04-21 12:06             ` Aktemur, Tankut Baris via Gdb-patches
2021-04-21 12:36               ` Simon Marchi via Gdb-patches
2021-04-11  1:13       ` [PATCH v2 0/4] Multi-context invalid breakpoint conditions and MI Jonah Graham
2021-04-21 12:17       ` [PATCH v3 " Tankut Baris Aktemur via Gdb-patches
2021-04-21 12:17         ` [PATCH v3 1/4] gdb/breakpoint: display "N" on MI for disabled-by-condition locations Tankut Baris Aktemur via Gdb-patches
2021-04-21 12:48           ` Eli Zaretskii via Gdb-patches
2021-04-21 12:17         ` [PATCH v3 2/4] testsuite, gdb.mi: fix duplicate test names in mi-break.exp Tankut Baris Aktemur via Gdb-patches
2021-04-21 12:17         ` [PATCH v3 3/4] gdb/breakpoint: add a 'force_condition' parameter to 'create_breakpoint' Tankut Baris Aktemur via Gdb-patches
2021-04-21 13:18           ` Simon Marchi via Gdb-patches
2021-04-21 13:29             ` Aktemur, Tankut Baris via Gdb-patches
2021-04-21 14:28               ` Simon Marchi via Gdb-patches
2021-04-21 12:17         ` [PATCH v3 4/4] gdb/mi: add a '--force-condition' flag to the '-break-insert' cmd Tankut Baris Aktemur via Gdb-patches
2021-04-21 12:50           ` Eli Zaretskii via Gdb-patches
2021-04-21 13:37           ` Simon Marchi via Gdb-patches
2021-04-21 13:49             ` Aktemur, Tankut Baris via Gdb-patches
2021-04-21 14:26               ` Simon Marchi via Gdb-patches
2021-04-22 14:35         ` [PATCH v4 0/2] Multi-context invalid breakpoint conditions and MI Tankut Baris Aktemur via Gdb-patches
2021-04-22 14:35           ` [PATCH v4 1/2] gdb/mi: add a '--force-condition' flag to the '-break-insert' cmd Tankut Baris Aktemur via Gdb-patches
2021-05-06  2:40             ` Simon Marchi via Gdb-patches
2021-04-22 14:35           ` [PATCH v4 2/2] gdb/mi: add a '--force' flag to the '-break-condition' command Tankut Baris Aktemur via Gdb-patches
2021-04-22 14:47             ` Aktemur, Tankut Baris via Gdb-patches
2021-05-06  2:46             ` Simon Marchi via Gdb-patches
2021-05-06  8:50               ` Aktemur, Tankut Baris via Gdb-patches
2021-07-11 18:51               ` Jonah Graham
2021-07-12  0:25                 ` Jonah Graham
2021-07-12  8:33                 ` Aktemur, Tankut Baris via Gdb-patches
2021-05-05 15:57           ` [PATCH v4 0/2] Multi-context invalid breakpoint conditions and MI Aktemur, Tankut Baris via Gdb-patches
2021-04-07 21:24   ` [PATCH 0/2] Breakpoint conditions at locations with differing contexts Simon Marchi via Gdb-patches
2021-04-07 21:36     ` Jonah Graham

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=SN6PR11MB289356C9629B93F203412886C4769@SN6PR11MB2893.namprd11.prod.outlook.com \
    --to=gdb-patches@sourceware.org \
    --cc=jonah@kichwacoders.com \
    --cc=tankut.baris.aktemur@intel.com \
    /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