From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sonic307-54.consmr.mail.ir2.yahoo.com (sonic307-54.consmr.mail.ir2.yahoo.com [87.248.110.31]) by sourceware.org (Postfix) with ESMTPS id C0AED3972481 for ; Wed, 27 May 2020 16:04:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C0AED3972481 X-YMail-OSG: jUfO0H4VM1kx699LWbMnCp0P6NaCiaDVUBu5CTMQAtKXSUbf3f2poVe4pk3TVON jHO3teOKPPXhF0T3KQNXcC94e.ICCKUszG7e4GLHFALMB.AtENtklV1sLDCOkhKDPlXttQrqY6G5 ZOsGiFqID1Kwlqs4QhrJnuf_VlBFS_sxBPyEPFOdKKyugr931erlAErTshHde4UPyMrgrrhs1FzU uYHqTIkQNPXyNNT2Y.LSk_eUVyPJ3MZYv5Qa59oBHGNJfvnY8vD4NwaH0zn0eLhzXMFYkdS_a_yn tUh05WgCQZJWLPH59Xo7.cJ9swZ3q2Xrf_CAyRY6sH2cjhIJpYvwr8EpkxJ7raNTA3IDp98YvhJj QsyoviliKdyXkSJfkYP4euS3cVgGFwXauUFYf4BoCNmQ2OF6PfzwLlfqO2eiYrnmB4tWtrQ9CBcA FsGXDWPEVylz1mBKQc_BIffN7SjeSZQaIQyNqsY.k4DQCy9NyCzHrF8wdagtG_u3SslpLg99lA3Q YOAJN06ItGgXRh9utF_Ngcucywqiu40KIGYAwyeJ3ZJ7uef71j.ej0zKTv5qw94pEY2ybn5wy5HL ZoXnIg4iNQEvMNYbfFSKU1b5Xl_SlCeCviAmbPnYHWA4Q88qGF7ABR3.LVDQIuy1uWgK_yvKGMdm AAbbLp6p5dUPzLyH8Em2HFdvhVdkAFfQ26mrbmZ.y9eV9VlpkquFeeGYMDdUipGRYUx6Ur9MOhEu aEENDvhPYYZ120XBe6uejnEj9CIRopF5GVFW6YwSB8doFXc4472SHsSkC9lU4Ejeo0JF6dtymFYp EvBqpczZK7RiOaxPKv8PsYvdCeSucEHD2MPCmf1qRL5TwanT3wTl5n20xUmO1NWsMJoWDyDzjekU Wt9mk3BdbGddTxBYEZEbXDNect.E6vOioOMtEYXyqz09L98w3UL.00FmPxh6PnXZ18J.fXG3YLaG UOimje0yQz2Qaehn_lAigXq0oP0ceYPUEGaMR6AXtc0XiYZkY3jsMnvwnqsEQKsDaCsgiiS6YVst GsPRrHvfkGi8RPGWZ_KjUTMN.vxZnZDZQWAuD74llucFY8wcch8syh5r4tkqmc4dzeiRGtV2EcU9 zGqK3BQQFZglD1uWRvXuUchgMt0g4uVDDta709YQdT0loVJgelp9TV.PCefAZ2kHk1jJX0kpognU hc78Kim7HKpW3Ewu2U82QvGimHnRDBoj2fbK79.wid4vXNfQ5dFxAzKUkNDzMaIbGVOHLxodVXR2 26pyVABcAYLkwyOttMyYFPcZ1tR1Z7Fs46SMZCMbbgymtVPmCaYRDbkPzmYu_KOePtbBpqghOmVs p3NlF1bhofzhAwxzn Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ir2.yahoo.com with HTTP; Wed, 27 May 2020 16:04:23 +0000 Date: Wed, 27 May 2020 16:04:19 +0000 (UTC) From: Hannes Domani To: Gdb-patches Message-ID: <1062200567.878277.1590595459490@mail.yahoo.com> In-Reply-To: <56760df2-b642-c112-2a16-89320a2fba0e@suse.de> References: <20200516172632.4803-1-ssbssa.ref@yahoo.de> <20200516172632.4803-1-ssbssa@yahoo.de> <56760df2-b642-c112-2a16-89320a2fba0e@suse.de> Subject: Re: [RFC][PATCH 0/6] Step program considering the source column information MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailer: WebService/1.1.15959 YMailNorrin Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0 X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Wed, 27 May 2020 16:04:26 -0000 Am Mittwoch, 27. Mai 2020, 17:33:37 MESZ hat Tom de Vries Folgendes geschrieben: > On 16-05-2020 19:26, Hannes Domani via Gdb-patches wrote: > > Basically, this implements the new commands nextc (nc) and stepc (sc), > > which allow to step through the program until an instruction is reached= , > > that belongs to another source column (according to the debug informati= on). > > > > The current column location is visualized in the frame info, and in the= TUI. > > > > Also, the column information is added to 'maint info line-table' and th= e > > python line table interface. > > > > Since the frame info output is different, this certainly breaks the > > testsuite, so this column indicator needs a parameter to disable, but I > > wasn't concerned about this yet. > > > > With the example code from PR25913, it looks like this: > > > > (gdb) start > > Temporary breakpoint 2 at 0x40162d: file gdb-25911.c, line 4. > > Starting program: C:\src\tests\gdb-25911.exe > > > > Temporary breakpoint 2, main () at gdb-25911.c:4 > > 4=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 int a =3D 4; > >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 ^ > > (gdb) nc > > 6=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 a =3D 5; a =3D 6; a =3D 7; > >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^ > > (gdb) nc > > 6=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 a =3D 5; a =3D 6; a =3D 7; > >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^ > > (gdb) nc > > 6=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 a =3D 5; a =3D 6; a =3D 7; > >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 ^ > > (gdb) nc > > 8=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return 0; > > > > > > What do you think of this so far? > > > > Very nice :) > > As I've just learned by looking at this ( > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95360 ) PR, interesting > code in relation to this patch series is dwarf_record_line_p. > > The function implements filtering of line-table elements, and has as > related test-case gdb.dwarf2/dw2-single-line-discriminators.exp. > > If we disable the filtering (by returning 1 at the end instead of 0), we > get for test-case gdb.dwarf2/dw2-single-line-discriminators.exp: > ... > Temporary breakpoint 2, main () at > gdb.dwarf2/dw2-single-line-discriminators.c:26 > 26=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 x =3D 0; > (gdb) n > 28=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for (i =3D 0; i < 10; ++i) c= ontinue; /* stepi line */ > (gdb) si > 28=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for (i =3D 0; i < 10; ++i) c= ontinue; /* stepi line */ > ... > > That is: no progress is visible after the stepi.=C2=A0 If we re-enable th= e > filtering, we have: > ... > Temporary breakpoint 1, main () at > gdb.dwarf2/dw2-single-line-discriminators.c:26 > 26=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 x =3D 0; > (gdb) n > 28=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for (i =3D 0; i < 10; ++i) c= ontinue; /* stepi line */ > (gdb) si > 0x00000000004004cd=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 28=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 for (i =3D 0; i < 10; ++i) continue; /* > stepi line */ > ... > > So, progress is visible. > > If we now use your patch series, and with the filtering enabled, we have: > ... > Temporary breakpoint 1, main () at > gdb.dwarf2/dw2-single-line-discriminators.c:26 > 26=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 x =3D 0; >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^ > (gdb) n > 28=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for (i =3D 0; i < 10; ++i) c= ontinue; /* stepi line */ >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 ^ > (gdb) si > 0x00000000004004cd=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 28=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 for (i =3D 0; i < 10; ++i) continue; /* > stepi line */ >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 ^ > (gdb) > 0x00000000004004d1=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 28=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 for (i =3D 0; i < 10; ++i) continue; /* > stepi line */ >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 ^ > (gdb) > 0x00000000004004d3=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 28=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 for (i =3D 0; i < 10; ++i) continue; /* > stepi line */ >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 ^ > (gdb) > 0x00000000004004d5=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 28=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 for (i =3D 0; i < 10; ++i) continue; /* > stepi line */ >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 ^ > ... > > So, we see progress in the insn addresses, but the column does not progre= ss. > > OTOH, if we disable filtering: > ... > Temporary breakpoint 1, main () at > gdb.dwarf2/dw2-single-line-discriminators.c:26 > 26=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 x =3D 0; >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^ > (gdb) n > 28=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for (i =3D 0; i < 10; ++i) c= ontinue; /* stepi line */ >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 ^ > (gdb) si > 28=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for (i =3D 0; i < 10; ++i) c= ontinue; /* stepi line */ >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 ^ > (gdb) si > 0x00000000004004d1=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 28=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 for (i =3D 0; i < 10; ++i) continue; /* > stepi line */ >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 ^ > (gdb) si > 28=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for (i =3D 0; i < 10; ++i) c= ontinue; /* stepi line */ >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^ > (gdb) si > 28=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for (i =3D 0; i < 10; ++i) c= ontinue; /* stepi line */ >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^ > (gdb) si > 0x00000000004004d8=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 28=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 for (i =3D 0; i < 10; ++i) continue; /* > stepi line */ >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 ^ > ... > we don't see progress after the first stepi, but eventually we do see > progress in the column. > > Looking at the line-info: > ... >=C2=A0=C2=A0 [0x00000147]=C2=A0 Set column to 8 >=C2=A0=C2=A0 [0x00000149]=C2=A0 Special opcode 161: advance Address by 11 = to 0x4004c6 > and Line by 2 to 28 >=C2=A0=C2=A0 [0x0000014a]=C2=A0 Extended opcode 4: set Discriminator to 4 >=C2=A0=C2=A0 [0x0000014e]=C2=A0 Special opcode 103: advance Address by 7 t= o 0x4004cd and > Line by 0 to 28 > ... > perhaps we we should collapse entries that have the same column, so > something like this in dwarf_record_line_p: > ... >=C2=A0=C2=A0 if (line !=3D last_line) >=C2=A0=C2=A0=C2=A0=C2=A0 return 1; >=C2=A0=C2=A0 if (colum !=3D last_column) >=C2=A0=C2=A0=C2=A0=C2=A0 return 1; > >=C2=A0=C2=A0 return 0; > > ... Interesting. I'm just wondering, if dwarf_record_line_p merges all entries of the same l= ine, why does my column-based stepping even work at all? Is it because of line_has_non_zero_discriminator? If yes, what is the discriminator? Hannes