public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: Andrew Burgess <aburgess@redhat.com>, binutils@sourceware.org
Subject: Re: [PATCH 3/3] objdump: allow the disassembler colors to be customized
Date: Wed, 10 Aug 2022 16:57:37 +0100	[thread overview]
Message-ID: <ba02b973-7963-4897-d472-832ce987b69a@redhat.com> (raw)
In-Reply-To: <eeeec9230c92befafbce066c0cb0f27b3e9a3824.1660139020.git.aburgess@redhat.com>

Hi Andrew,

> I don't know if this style of environment encoded settings will be
> acceptable or not.  

If we are going to accept an environment variable for patch 2/3 then
I see no reason why it cannot be extended here.

> The alternative would be some kind of
> configuration file system. 

Meh - of the two I prefer environment variables over configuration files.
Environment variables are easier to change in a nested fashion, configuration
files are not.

> My inspiration for the approach I propose
> here is the LS_COLORS variable used by `ls`.

Agreed - there is precedence for this kind of behaviour.

> +<mode_selection> ::= "OFF" | "B" | "X"

Shouldn't the modes be "off", "on" and "extended" ?

> +<style_item> ::= <style_code> "=" <escape_string>

Your syntax description does not document "<escape string>".
It really should do so, or else provide a reference to
where it is documentede.

> +<style_code> ::= "ad" | "ao" | "as" | "cm" | "im"
> +               | "mn" | "rg" | "sm" | "sy" | "tx"

I am a big fan of long descriptive names.  It makes things
much easier to read.  So by all means, allow shortened versions
if you want, but it would be really nice to support names like
"registers", "addresses", "symbols" etc.



> +      /* The defaults colors for --disassembler-color=color.  */
> +      disasm_styles[(unsigned int) dis_style_address] = "35";
> +      disasm_styles[(unsigned int) dis_style_address_offset] = "35";

You might as well replace these magic numbers (eg 35) with #define'd
constants.  That would be more descriptive.  (Assuming that the defined
names are color names of course).


Cheers
   Nick


      reply	other threads:[~2022-08-10 15:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-10 14:24 [PATCH 0/3] Disassembler styling, bug fixes and customisation Andrew Burgess
2022-08-10 14:24 ` [PATCH 1/3] objdump: fix extended (256) disassembler colors Andrew Burgess
2022-08-10 15:32   ` Nick Clifton
2022-08-10 16:12     ` Andrew Burgess
2022-08-10 14:24 ` [PATCH 2/3] objdump: introduce OBJDUMP_COLORS environment variable Andrew Burgess
2022-08-10 15:48   ` Nick Clifton
2022-08-10 14:24 ` [PATCH 3/3] objdump: allow the disassembler colors to be customized Andrew Burgess
2022-08-10 15:57   ` Nick Clifton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ba02b973-7963-4897-d472-832ce987b69a@redhat.com \
    --to=nickc@redhat.com \
    --cc=aburgess@redhat.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).