From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-io1-xd2e.google.com with SMTP id y85so2734379iof.13 for ; Wed, 22 Mar 2023 09:56:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1679504186; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=0pD62r2qQfXw7vhsLKJk6qgzKy56O8+fwLeSViku/68=; b=QjsK4ytGgPJJZTwd6K8TG/7nw6HV5/b0LJIMkvmtZcPlQSPkfVzADqN1My7QQ/dJlS wAR68riHsvBz2EIvGUKa1BRSMaNtlAgjLrw40+MDldSCPci7zbF69CKSZyqdvvq+uKN7 sfuPNfZjQIzdr4Gsv8rltwsUYwW8qJlCGENqgvL6AqC87z3JO+Re7KfgwpW2cJYhqvTO kOk/6YL+8/ormCE/0gS8qCeQ1leGGAlssJrqd17086fXO32dXV913m72H9MFT82JBV0w 3BUpJ2ZS/pj0wT4vDxm3aUBY0uiy7cbuo6H9jOZFzDzhs+CLOEBxvnjofdGCbt7OThyi pe2w== 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) From: Tom Tromey 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 Content-Transfer-Encoding: 8bit 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 List-Id: 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"); } } -- 2.39.1