From patchwork Wed Mar 22 16:56:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 66756 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7FBA03858C52 for ; Wed, 22 Mar 2023 16:57:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7FBA03858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679504221; bh=0pD62r2qQfXw7vhsLKJk6qgzKy56O8+fwLeSViku/68=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=ou6F0mA7s9tFoqOBKJ3MTVCja3OBJTPvlP6ZgIRJODvuTu3xoxCUba4PCeteWMfJF ra3zA4g8m3yWm8C+JZvtSCNOJdDnXpjfZOKY50PbNeUcXUOJ4rLduEHVenE5IgIrIB K6nXZYwqYD7hF+yOiTeC1jL5lRGMg3ypopVIAgWQ= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) by sourceware.org (Postfix) with ESMTPS id 1BD1A385802F for ; Wed, 22 Mar 2023 16:56:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1BD1A385802F Received: by mail-io1-xd2e.google.com with SMTP id y85so2734379iof.13 for ; Wed, 22 Mar 2023 09:56:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679504186; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0pD62r2qQfXw7vhsLKJk6qgzKy56O8+fwLeSViku/68=; b=dxOedcsAoq3N4MBtx5XgfTRiIP/njwuzdb2lprwsyxMpQ82NoP33wqTvZzmLQknu4x UHZEEsbhNAW0KZ6pp+c6zawTmq6rGCDSm55OqDwviI+SoQSRyKUIMARjs4njnWk3uRxd X5kIq+NXMrW/QM9d7ov7suw4f92YWB6LdxTXUAueevkrJB8RStz6AE2qyxyWKbd3u0Jz p1H3vUfTfPJOQWY3w869EBWDat3H3JFwIOAiClsh26GOqVhC+H1B1fJBQKIXeJqR7WB7 p4X2sms7LwKr0VvgRB7qnT7c3BrGHcZ1qXuCKTiQmgSIlE5lZAa0/s+xoo7UwdQN17UH QJnw== X-Gm-Message-State: AO0yUKUNjIwuRbWvTQmSl7ec8LJ7FrOXbcGD/8oCBzJS/I0k1KPU257M TcTw9v3RVA7gL4AkSJkMcPRZ+6AjLJpuJEiJHyY+NA== X-Google-Smtp-Source: AK7set/kRKnliXbnBMjMwBknvSE5G4+VTHltB95Fjsh1GwEy4FnM7KEQiwG7946wOYWCVAhotXYBhw== X-Received: by 2002:a6b:d101:0:b0:752:6338:3d8 with SMTP id l1-20020a6bd101000000b00752633803d8mr4444008iob.6.1679504186253; Wed, 22 Mar 2023 09:56:26 -0700 (PDT) Received: from localhost.localdomain (71-211-185-113.hlrn.qwest.net. [71.211.185.113]) by smtp.gmail.com with ESMTPSA id q2-20020a02a982000000b003c505bdf305sm5316117jam.141.2023.03.22.09.56.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Mar 2023 09:56:25 -0700 (PDT) To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Use ui_out for "maint info frame-unwinders" Date: Wed, 22 Mar 2023 10:56:16 -0600 Message-Id: <20230322165616.2036104-1-tromey@adacore.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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-Patchwork-Original-From: Tom Tromey via Gdb-patches From: Tom Tromey Reply-To: Tom Tromey Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" This changes "maint info frame-unwinders" to use ui-out. This makes the table slightly nicer. In general I think it's better to use ui-out for tables. --- gdb/frame-unwind.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c index a3673dde77a..866b2e6b4a6 100644 --- a/gdb/frame-unwind.c +++ b/gdb/frame-unwind.c @@ -347,13 +347,22 @@ maintenance_info_frame_unwinders (const char *args, int from_tty) struct gdbarch *gdbarch = target_gdbarch (); struct frame_unwind_table *table = get_frame_unwind_table (gdbarch); + ui_out *uiout = current_uiout; + ui_out_emit_table table_emitter (uiout, 2, -1, "FrameUnwinders"); + uiout->table_header (27, ui_left, "name", "Name"); + uiout->table_header (25, ui_left, "type", "Type"); + uiout->table_body (); + for (struct frame_unwind_table_entry *entry = table->list; entry != NULL; entry = entry->next) { const char *name = entry->unwinder->name; const char *type = frame_type_str (entry->unwinder->type); - gdb_printf (gdb_stdout, "%-16s\t%-16s\n", name, type); + ui_out_emit_list tuple_emitter (uiout, nullptr); + uiout->field_string ("name", name); + uiout->field_string ("type", type); + uiout->text ("\n"); } }