From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id p0AuJ/JMa2D5MwAAWB0awg (envelope-from ) for ; Mon, 05 Apr 2021 13:46:26 -0400 Received: by simark.ca (Postfix, from userid 112) id 9152C1E789; Mon, 5 Apr 2021 13:46:26 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_SIGNED, MAILING_LIST_MULTI,RDNS_DYNAMIC,T_DKIM_INVALID,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 6E3941E590 for ; Mon, 5 Apr 2021 13:46:25 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D4F5D3857C5E; Mon, 5 Apr 2021 17:46:24 +0000 (GMT) Received: from pb-smtp21.pobox.com (pb-smtp21.pobox.com [173.228.157.53]) by sourceware.org (Postfix) with ESMTPS id 874853857C5E for ; Mon, 5 Apr 2021 17:46:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 874853857C5E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kichwacoders.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=jonah@kichwacoders.com Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 176A81229E1 for ; Mon, 5 Apr 2021 13:46:16 -0400 (EDT) (envelope-from jonah@kichwacoders.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=mime-version :references:in-reply-to:from:date:message-id:subject:to:cc :content-type; s=sasl; bh=JNbgtPx5EK4HOf20YOQaXlBcEgI=; b=pcfZzV hoyCIypa8vBNbxgBAOlrPDnFkBmoHuCUUml5z5aMFoAjoM99AUG7Mrh9nhClpuJN pgVqieKiG/9mGlao4Qgk4GyodesqlVCYqs90CCStcY4c53aEeZ5N7T6dYmyVodA9 f9OTDIZr6Pi81e71KWFg37p64AYkt+p6tz5dw= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 101BF1229DD for ; Mon, 5 Apr 2021 13:46:16 -0400 (EDT) (envelope-from jonah@kichwacoders.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kichwacoders.com; h=mime-version:references:in-reply-to:from:date:message-id:subject:to:cc:content-type; s=mesmtp; bh=bjnkrkEOvZMrINhicD0rEkEuXmlNnlqL6rM4hk8/PtA=; b=PvB+Ldgi0RLkktqCakJKFAGgXfi3DKwDeEdvTS5XMlISolEPqp7iStrM7ZQoAnuiRpMmxDc2vNPeUgONN6S733t58pJJbJfd0DIkKqdU9xwjASBx8GIJ5unR3h7Fk7zdFqwTb3HXyhLOagdiH1YOVZaQ0n80nTF2M/FgJ1Uuirk= Received: from mail-wr1-f46.google.com (unknown [209.85.221.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-smtp21.pobox.com (Postfix) with ESMTPSA id 848CE1229DB for ; Mon, 5 Apr 2021 13:46:12 -0400 (EDT) (envelope-from jonah@kichwacoders.com) Received: by mail-wr1-f46.google.com with SMTP id f6so5489798wrv.12 for ; Mon, 05 Apr 2021 10:46:12 -0700 (PDT) X-Gm-Message-State: AOAM530hD07J/XgsFiusvLmm5+KYkTb+gcRrSJIN9sP/P4oXtpMm30Z3 XqK6VkFgo2wLfxVsdp7nygOsu7jocPgY7fXFimo= X-Google-Smtp-Source: ABdhPJxvphinYOLfkBPrcKsGbaoJCCVD1IQ/wc6qnVHnFq1jtMH2EWZuEHucgMQNyKR9nxyYRH3MM7rwrxcKnGG5mVs= X-Received: by 2002:a5d:5541:: with SMTP id g1mr7035801wrw.419.1617644770746; Mon, 05 Apr 2021 10:46:10 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonah Graham Date: Mon, 5 Apr 2021 13:45:34 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/2] Breakpoint conditions at locations with differing contexts To: Tankut Baris Aktemur X-Pobox-Relay-ID: CFEA3FF6-9636-11EB-960F-D609E328BF65-18936988!pb-smtp21.pobox.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On Fri, 31 Jul 2020 at 11:42, Tankut Baris Aktemur via Gdb-patches < 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=3D572589. Thanks for the new GDB feature! 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=3Dmi2 --quiet =3Dthread-group-added,id=3D"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=3D{number=3D"1",type=3D"breakpoint",disp=3D"keep",enabled=3D"y= ",addr=3D"",cond=3D"invalid condition here",times=3D"0",original-location=3D"main"},{number=3D"1.1",enabled=3D"N*= ",addr=3D"0x0000000000001160",func=3D"main",file=3D"../src/bug572589.c",ful= lname=3D"/scratch/eclipse/src/cdt/runtime-CDT/bug572589/src/bug572589.c",li= ne=3D"20",thread-groups=3D["i1"]} (gdb) info break &"info break\n" ~"Num Type Disp Enb Address What\n" ~"1 breakpoint keep y \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=3D{nr_rows=3D"1",nr_cols=3D"6",hdr=3D[{width=3D"7",= alignment=3D"-1",col_name=3D"number",colhdr=3D"Num"},{width=3D"14",alignmen= t=3D"-1",col_name=3D"type",colhdr=3D"Type"},{width=3D"4",alignment=3D"-1",c= ol_name=3D"disp",colhdr=3D"Disp"},{width=3D"3",alignment=3D"-1",col_name=3D= "enabled",colhdr=3D"Enb"},{width=3D"18",alignment=3D"-1",col_name=3D"addr",= colhdr=3D"Address"},{width=3D"40",alignment=3D"2",col_name=3D"what",colhdr= =3D"What"}],body=3D[bkpt=3D{number=3D"1",type=3D"breakpoint",disp=3D"keep",= enabled=3D"y",addr=3D"",cond=3D"invalid condition here",times=3D"0",original-location=3D"main"},{number=3D"1.1",enabled=3D"N*= ",addr=3D"0x0000000000001160",func=3D"main",file=3D"../src/bug572589.c",ful= lname=3D"/scratch/eclipse/src/cdt/runtime-CDT/bug572589/src/bug572589.c",li= ne=3D"20",thread-groups=3D["i1"]}]} (gdb) Is the enabled=3D"N*" what CDT can use to know that? https://sourceware.org/gdb/current/onlinedocs/gdb/GDB_002fMI-Breakpoint-Com= mands.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? Can the warning string be part of the breakpoint structure returned in MI? 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. Any guidance you can provide is most welcome. Thanks, Jonah