From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EB86B3858D32; Thu, 6 Apr 2023 07:50:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EB86B3858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1680767408; bh=uPJoAqrbbQiwFE3hZdp4VwBbTBmR/E+EEqP0nP3o5zo=; h=From:To:Subject:Date:From; b=cOnNZE89wsvvbK3B0n4BJjmVar+VF9raOwk7rd//c8HmrTjw7fVgdYeIYQgsyzQZF glPbvm4/N1gd+gCXPghwHPcHH6DWA6VHw8TbZ121UAn4xYxsWFkq8TEqxudn1DOJYy o7nOt9JlLRMiYw6GU1gct5l5qvEJqVJSh1YjciO0= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug cli/30320] New: [gdb/cli] lines_per_page not reset on "set height 0" Date: Thu, 06 Apr 2023 07:50:08 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: cli X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30320 Bug ID: 30320 Summary: [gdb/cli] lines_per_page not reset on "set height 0" Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: cli Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- I tested the following change: ... diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index bb4bd656471..a29fde6a7f4 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -216,8 +216,8 @@ if ![info exists INTERNAL_GDBFLAGS] { [join [list \ "-nw" \ "-nx" \ - {-iex "set height 0"} \ - {-iex "set width 0"}]] + {-eiex "set height 0"} \ + {-eiex "set width 0"}]] # If DEBUGINFOD_URLS is set, gdb will try to download sources and # debug info for f.i. system libraries. Prevent this. ... and I ran into only one regression: ... FAIL: gdb.base/paginate-execution-startup.exp: return: send \n to GDB ... The passing case looks like this: ... builtin_spawn /data/vries/gdb/leap-15-4/build/gdb/testsuite/../../gdb/gdb -= nw -nx -iex set height 0 -iex set width 0 -data-directory /data/vries/gdb/leap-15-4/build/gdb/data-directory -ex set height 2 -ex sta= rt --args /data/vries/gdb/leap-15-4/build/gdb/testsuite/outputs/gdb.base/paginate-exe= cution-startup/paginate-execution-startup^M GNU gdb (GDB) 14.0.50.20230405-git^M Copyright (C) 2023 Free Software Foundation, Inc.^M License GPLv3+: GNU GPL version 3 or later ^M This is free software: you are free to change and redistribute it.^M There is NO WARRANTY, to the extent permitted by law.^M Type "show copying" and "show warranty" for details.^M This GDB was configured as "x86_64-pc-linux-gnu".^M Type "show configuration" for configuration details.^M For bug reporting instructions, please see:^M .^M Find the GDB manual and other documentation resources online at:^M .^M ^M For help, type "help".^M Type "apropos word" to search for commands related to "word"...^M Reading symbols from /data/vries/gdb/leap-15-4/build/gdb/testsuite/outputs/gdb.base/paginate-exe= cution-startup/paginate-execution-startup...^M --Type for more, q to quit, c to continue without paging--PASS: gdb.base/paginate-execution-startup.exp: return: run to pagination ^M Temporary breakpoint 1 at 0x400512: file /data/vries/gdb/src/gdb/testsuite/gdb.base/paginate-execution-startup.c, li= ne 29.^M --Type for more, q to quit, c to continue without paging--^M Starting program: /data/vries/gdb/leap-15-4/build/gdb/testsuite/outputs/gdb.base/paginate-exe= cution-startup/paginate-execution-startup ^M ^M Temporary breakpoint 1, main () at /data/vries/gdb/src/gdb/testsuite/gdb.base/paginate-execution-startup.c:29^M 29 sleep (3);^M (gdb) PASS: gdb.base/paginate-execution-startup.exp: return: send \n to GDB ... And the failing case looks like this: ... builtin_spawn /data/vries/gdb/leap-15-4/build/gdb/testsuite/../../gdb/gdb -= nw -nx -eiex set height 0 -eiex set width 0 -data-directory /data/vries/gdb/leap-15-4/build/gdb/data-directory -ex set height 2 -ex sta= rt --args /data/vries/gdb/leap-15-4/build/gdb/testsuite/outputs/gdb.base/paginate-exe= cution-startup/paginate-execution-startup^M GNU gdb (GDB) 14.0.50.20230405-git^M Copyright (C) 2023 Free Software Foundation, Inc.^M License GPLv3+: GNU GPL version 3 or later ^M This is free software: you are free to change and redistribute it.^M There is NO WARRANTY, to the extent permitted by law.^M Type "show copying" and "show warranty" for details.^M This GDB was configured as "x86_64-pc-linux-gnu".^M Type "show configuration" for configuration details.^M For bug reporting instructions, please see:^M .^M Find the GDB manual and other documentation resources online at:^M .^M ^M For help, type "help".^M Type "apropos word" to search for commands related to "word"...^M Reading symbols from /data/vries/gdb/leap-15-4/build/gdb/testsuite/outputs/gdb.base/paginate-exe= cution-startup/paginate-execution-startup...^M Temporary breakpoint 1 at 0x400512: file /data/vries/gdb/src/gdb/testsuite/gdb.base/paginate-execution-startup.c, li= ne 29.^M --Type for more, q to quit, c to continue without paging--PASS: gdb.base/paginate-execution-startup.exp: return: run to pagination ^M Starting program: /data/vries/gdb/leap-15-4/build/gdb/testsuite/outputs/gdb.base/paginate-exe= cution-startup/paginate-execution-startup ^M ^M Temporary breakpoint 1, main () at /data/vries/gdb/src/gdb/testsuite/gdb.base/paginate-execution-startup.c:29^M 29 sleep (3);^M (gdb) FAIL: gdb.base/paginate-execution-startup.exp: return: send \n to GDB ... On obvious difference is in the amount of pagination prompts: 2 vs 1. Looking in more detail, the first pagination prompt is in different locatio= ns. Let's track pagination in both scenarios using watch lines_per_page and printed_lines. First (passing, 2 pagination prompts): - lines_per_page 0 -> 21 - lines_printed 0 -> 1 -> ... -> 15 - lines_per_page 21 -> 4294967295 - lines_per_page 4294967295 -> 2 - lines_printed 15 -> 0 (due to subsequent pagination prompt) - pagination prompt, press enter - lines_printed 0 -> 1 - lines_printed 1 -> 0 (due to subsequent pagination prompt) - pagination prompt, press enter - lines_printed 0 -> 1 -> 2 -> 3 -> 4 Second (failing, 1 pagination prompt): - lines_per_page 0 -> 21 - lines_per_page 21 -> 4294967295 - lines_per_page 4294967295 -> 2 - lines_printed 0 -> 1 - lines_printed 1 -> 0 (due to subsequent pagination prompt) - pagination prompt, press enter - lines_printed 0 -> 1 -> 2 -> 3 -> 4 It seems odd to me that we don't reset lines_printed to 0 when doing "set height 0", in other words, setting pagination to "off". In other words, I wonder if the failing scenario shows the correct behaviou= r. --=20 You are receiving this mail because: You are on the CC list for the bug.=