From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B7DC13858D39; Wed, 16 Aug 2023 15:41:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B7DC13858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1692200513; bh=py8Wetn1CHzBWJmyv7J+zGnwA6rMIiiY5f4Kn+BaxEQ=; h=From:To:Subject:Date:From; b=csALNn/mUjX84v+2ZR512jDwpKLJdligVXs/fcz19l5m+CuTJAJGm4qVJfxq5g5pl OA0tSwps400NEzb+th5say60AtmiWSLDO5GCbmqjw1v3f+upfdB1XdZyiFy7h6uLuV TWIO6H7d97pDHsAzdS8/bUY9J3yiwvaydOT3qviE= From: "moshe.rubin at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/30771] New: GDB need a silent thread-selecting command akin to "select-frame" Date: Wed, 16 Aug 2023 15:41:53 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 8.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: moshe.rubin at gmail dot com X-Bugzilla-Status: UNCONFIRMED 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=3D30771 Bug ID: 30771 Summary: GDB need a silent thread-selecting command akin to "select-frame" Product: gdb Version: 8.2.1 Status: UNCONFIRMED Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: moshe.rubin at gmail dot com Target Milestone: --- Problem Description =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D GDB enables users to select threads and frames from the gdb command line pr= ompt using the "thread n" and "frame n" commands. When used, these commands dis= play output to the display, e.g.: (gdb) thread 2 [Switching to thread 2 (Thread 0x155538885700 (LWP 8875))] #0 0x0000155552be3aa8 in hack_digit (p=3D0x155538882480) at printf_fp.c:175 175 printf_fp.c: No such file or directory. (gdb) (gdb) frame 1 #1 __GI___printf_fp_l (...) at printf_fp.c:962 962 in printf_fp.c (gdb) GDB also supports the "up" and "down" commands for selecting a frame relati= ve to the currently selected one. Like "frame n", they also display output to= the screen. Thankfully, gdb has a silent version of "frame n", i.e. "select-frame n": #0 0x0000155552be3aa8 in hack_digit (p=3D0x155538882480) at printf_fp.c:175 175 in printf_fp.c (gdb) select-frame 1 (gdb) The value of this silent selection command cannot be overstated. It enables complex custom commands to make many frame selections without producing dis= play "noise" as an artifact. The problem is that there is no analog for silently selecting threads. No matter how one tries, it is impossible to select a thread without getting unwanted output on the display. Playing with logging commands, set command= s, and the like do not help. Here is an example of a custom command run that executes "thread n" commands internally, producing a messy display output: (gdb) custom_command [Switching to thread 3 (Thread 0x155555354b00 (LWP 16327))] #0 0x0000155554019ad3 in ... [Switching to thread 4 (Thread 0x15553084e700 (LWP 13823))] #0 std::_Hashtable Request =3D=3D=3D=3D=3D=3D=3D Can a silent gdb-prompt thread-selecting command (e.g., 'select-thread') be added to the already existing 'select-frame'? --=20 You are receiving this mail because: You are on the CC list for the bug.=