From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id CIX2AyNpLWoB9gQAWB0awg (envelope-from ) for ; Sat, 13 Jun 2026 10:28:51 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=StDYIaA1; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id F2E8D1E098; Sat, 13 Jun 2026 10:28:50 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 251991E070 for ; Sat, 13 Jun 2026 10:28:50 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7192F4B99F68 for ; Sat, 13 Jun 2026 14:28:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7192F4B99F68 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=StDYIaA1 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by sourceware.org (Postfix) with ESMTPS id ADF104BA2E10 for ; Sat, 13 Jun 2026 14:28:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ADF104BA2E10 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ADF104BA2E10 Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=2a00:1450:4864:20::62f ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1781360895; cv=pass; b=s6Oj4RHKoedvflF26jC9Jci56eVo10l87dMcKWod+QNy+inSkRtYLa0bmWoLShBPF+8FBx1EPMWeWOaJ+EK1qmemznHvEetc7KKlj+j2peAb46jYK3A39UFjyacTkJJpFS5AHHEMgqrmyvzGoppRU4qpU2lu3Bgs+FrnWBAwksw= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1781360895; c=relaxed/simple; bh=soQIAx/elkqriM1UxtAFcuFHvlNQ07kt/mSTiaqGMUE=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=g42gqSCUKCzNmPIrfCWogSErhmg2PCUEN7mtEzluKdmKtpwGnzSm9uxGUqjaIeTb01H5z9g0OjXTt1+gOu3vSOwK+RAQnR2/p5HeqvDX4Ce9T17M9jRRh5L93G1tLOUfiprlDKUL5eg4FxICiWzZrB2WlCm3jd1xMjLcupfGhCg= ARC-Authentication-Results: i=2; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=StDYIaA1 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ADF104BA2E10 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-bec43ee8ff0so264062566b.1 for ; Sat, 13 Jun 2026 07:28:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1781360894; cv=none; d=google.com; s=arc-20240605; b=d4qSCTh6Ljjf/+CzVLr083ByM3LohVE/ZK1l4Fn6BBY9HV9b0219M4iuj1leYCOerp eKKTDX5zzMr5TH84pAjtisqAO47wdtwzkJWZ53j9Ip6S0F++ynk6LaAeAzw/1V4TLU5z uVyQcSOgrNj4rWbR9oq/wQvR0RlN4yAaVQVlJbkq87WLXrGZ8KdRC5Qz31IaukwBP1HQ +bKm8hFErYHO4YJLZl0OT8cbmyzdoSRzVJlETgvx5/ZIVmTNAQ96KzL8bjekwr8klFxa j7dge4DfqHRiShX6Sk5D39jwIxPyAlnpPkx0Ie07pjt1UU5/q3/t6w0ZzdIekZIauSrX o5Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=YqlEUWUGmqg4n1vCHNDKoT9yFSxc+5T6Ngl1oSkum+4=; fh=ukMJ4C+itErNSz65vU7hPqqkf8zWsP3SwwD6N60MPG4=; b=HLakYyS4IkJ4ww7rmFOag0XtxCpRQgjGfkJqitp8JJV+z99+HtN0DBJ3s1xDkJ4new J2MzniJQ+8S2nWUM1s9uHYMDtQphQ3fv/itwBkHBZTOPGfEXl13m/4rW/P/4PJaJQH8z WN6x769db3uMrhkD/cSdmHgRcc/KG5bUmE8Ty+pgDQ6Ki7W4aqckulIM+OhnKILVZ1Oz aSpNZF3rj+cvxoxyoQNLM5/8/ElrNt20TNsZRE6fwCXvv6nPIx6KRaOuK5wEFFTDbkW0 JGt+HjNbsYUStK2xVS1c9MDpHemiN7iiZsexGmfXCOWC0+yl7nAcRmOxpKscBdGCGJg0 Pzpg==; darn=sourceware.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781360894; x=1781965694; darn=sourceware.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=YqlEUWUGmqg4n1vCHNDKoT9yFSxc+5T6Ngl1oSkum+4=; b=StDYIaA1Re5cMRN0HlaOPtvR2YG2vyh+Y7xekPbyGFHuwjyS0j0KhWpsCbaEuAyukg 9tY+BcFgqrpqQ53IXvzr17u+8HGorAr1HT8RjFgM4heT3q8EZNpPIkOPgKHSREKUpH87 3Mf9S/D5Ohzo7tB2B6JrD9vs5TSh/Ijb3QmBsppDTTuzHczR1QUB1xpqIWP4ydB3PcsH ZzN3HDmzM0m5HS3j/2e19P8c+pjYo1Lh0MMRADqOEJqggG3qdXyBWjmHDdFpj3vMw3s5 lV62KntAxQnpuWUwxt9mKkJE/4EOrrTq/3Iku0v3MzL0mhcgQ7+Z8c4DoBrc6jM++kC6 mE0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781360894; x=1781965694; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=YqlEUWUGmqg4n1vCHNDKoT9yFSxc+5T6Ngl1oSkum+4=; b=P618BHmYt7XFzWoPa5y7U1p04IZycUdwCI2P0oINLzLE3glgLFiCXt4VHKLmIYt+xF G3kybqM2xziDWm/5OwA9xOglWmiLQJWQaQm009fHR0eM0qfGVdcH0VNcVDFgOKNf3UP7 jO5FvP+TmEAHWGMXZD9LG8IDHUDnC31qzQ1HdNShaJKqlpmi7G/kx4RxnIyRJ3VT15UW Ryy+tOlvJKK0CecRtXHEopdsMx3Rup6vSgRESBEqdAe1wZbPButhHfTVu/dsjXu+dFKA VRZfkjJ5ihcyz7v7ZEdgGPIBWLHxQSmHITsDNF8HAZBpQ6RsFcaDbwEkefujtoU5rch7 cNUw== X-Gm-Message-State: AOJu0Yziy1JxjATdv9FdUZbNzuQORVmRhUFQVEMPMTtbTR4eBFSPukXw gaZJ36Ai2t9jXUE+zgX4W0mb3shD02tjNvlmyMt1DaAZbbNR1+kDsdWaCPT5s/7GDgjfRg3HpYy 0qC0YIK0MRwojC+D3Q7K+FLw/v9C9Hr3mOQ== X-Gm-Gg: Acq92OElqmfRCvXvs9OiUlTOzRkVufEh7j8JUs3ES7ZVPAbmNbgIw09TcQQxWP3EQw/ A9G+UWAIEB4+HTpbHW74rzan9QQnthCFAnWeWgOO05whvDmyRaxYacCYf3/DWnr6j1bL/8atelp TYFEsSaxl+wVDc9UBNFPBmdfLNjXBwNK4OixI4LSCR3DcJ+RbLms6xmnGbfrwoypvRqJYiqRSDs tB/R9egUe7gc5RreHb9nNByiVg6+VE/fSSP4i43wnrAwVNon0egZO4F8lzxqU3kI0NQFaMG5M8/ p9FEx1EF9nry6esOFjkymwRzm87BOGureccO5YmD2WRv7tE+Wz4Be18OeYBKUPClvkBkFSNQFAs rYMOmRX2Wd3A1aVHqVPEtPC6kfSa4UYVpGwTfbTAb03Do9ddgsAfWgmNKMjNj2Wc= X-Received: by 2002:a17:907:a02:b0:bec:5264:e527 with SMTP id a640c23a62f3a-bfde53ce0d9mr362170566b.26.1781360893906; Sat, 13 Jun 2026 07:28:13 -0700 (PDT) MIME-Version: 1.0 References: <20260612-submit-zebra-style-v1-0-cfd00b5c984c@tromey.com> <20260612-submit-zebra-style-v1-5-cfd00b5c984c@tromey.com> In-Reply-To: <20260612-submit-zebra-style-v1-5-cfd00b5c984c@tromey.com> From: Matt Rice Date: Sat, 13 Jun 2026 07:28:01 -0700 X-Gm-Features: AVVi8CfoZ1X5sKCVjP7DhrLUqTgFlNvg5Et8bjEJaJWRhcXqii_atMWEwgv0ICU Message-ID: Subject: Re: [PATCH 5/5] Add zebra-striping to CLI table display To: Tom Tromey Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On Fri, Jun 12, 2026 at 7:27=E2=80=AFAM Tom Tromey wrote: > > This patch adds two new style settings to gdb. These can be used to > add "zebra striping" to CLI tables -- that is, change the prevailing > style of alternating lines of a table. > > Modifying the CLI ui-out is sufficient for most tables. However, this > did not work for stack traces, because those aren't ordinary tables. > This patch uses the "phony table" support (added earlier in this > series) to achieve the same effect without otherwise impacting stack > trace display. > > By default, styles are only changed if 256 colors are available. This > way we can choose a relatively innocuous grey background. > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D32285 > --- > gdb/NEWS | 10 +++++ > gdb/cli-out.c | 24 +++++++++-- > gdb/cli-out.h | 10 +++++ > gdb/cli/cli-style.c | 43 +++++++++++++++++- > gdb/cli/cli-style.h | 6 ++- > gdb/doc/gdb.texinfo | 8 ++++ > gdb/stack.c | 6 +++ > gdb/testsuite/gdb.base/style.exp | 3 ++ > gdb/testsuite/gdb.base/zebra-style.c | 32 ++++++++++++++ > gdb/testsuite/gdb.base/zebra-style.exp | 79 ++++++++++++++++++++++++++++= ++++++ > gdb/testsuite/lib/gdb-utils.exp | 14 +++--- > gdb/ui-out.c | 8 +++- > gdb/ui-out.h | 2 + > gdb/utils.c | 6 +++ > 14 files changed, 238 insertions(+), 13 deletions(-) > > diff --git a/gdb/NEWS b/gdb/NEWS > index d5214a98a57..99f3eccb11a 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -136,6 +136,16 @@ show progress-bars enabled > content, to be disabled (the set command), or to see if > progress-bars are currently enabled or not (the show command). > > +set style even-lines foreground COLOR > +set style even-lines background COLOR > +set style even-lines intensity VALUE > +set style odd-lines foreground COLOR > +set style odd-lines background COLOR > +set style odd-lines intensity VALUE > + Control the styling of even and odd lines of tables. These style > + settings are merged with any other style that would normally be > + applied when displaying the table. > + > info proc environ > Print the initial environment variables of the specified process. > Supported on Linux. I'm kind of hesitant to suggest it, (and only do so because it's easy to just say please feel free to disregard this in its entirety) One way I've liked to do this sort of thing rather than having separate UI for even and odd rows, you can have one command which sets an array of values. Then rather than alternating on even/odd you just mod by the array length. So you can set it to a solid color with one value, even/odd with two, three, and rainbow if it suits your fancy. I would suggest using python style arrays of dictionaries. `set style zebra-table =3D [{"foreground": COLOR, "background", COLOR, "intensity": VALUE}, ... ]` I kind of like this because it turns out to be less UI commands, for a more flexible effect. alas, It probably requires some overhead in order to be able to have UI taking python arrays, (or json values or whatever). I'll leave it up to you whether you feel it's worth the chew or not, I figure it doesn't hurt considering it...