From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 26C5F3858C60 for ; Fri, 21 Jan 2022 16:26:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 26C5F3858C60 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-104-t_5wqSxPM4mTA8ZeUzczAQ-1; Fri, 21 Jan 2022 11:26:51 -0500 X-MC-Unique: t_5wqSxPM4mTA8ZeUzczAQ-1 Received: by mail-wr1-f70.google.com with SMTP id h18-20020adfaa92000000b001d8094bbbbcso92252wrc.5 for ; Fri, 21 Jan 2022 08:26:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vnPEvzrY2FRLpLyVbDjUD/uYwzqeXNq3DQKwDJizhxo=; b=xiP2BpXzkP7c4cR7a2JZ/ZZ5Zuo3n5cfWt0LFg2TQ9uAYMfKj3zAlYik/izm9Zi1Fq vLTVcBZpomMCgOJAcXAQpw7uaHUIGUF5wPsVbX88ueTonO9HkIgGCkBjRytv8FA0mtHG LGN3RJgUw2/MW3hAPT9xIO/p+mGNGjRlbyiwobnD+i/yX4QqlV5xgnuGQubcvxJbLBS8 KhP8nqcvuYzH8dFAO4JAnVEKU796BSseYQZDMIisL1ovkX3hBFm7u5fL2r2fNcCKGYBD KviYRAqpuBXs6PkQncgwzTkcmJaexi2IQChJKaED6qa4pCbE3Ln8VNjhwZsI1OtYK5h5 wo6w== X-Gm-Message-State: AOAM533tDmDzxLQORTd9MRNYZFUJS0Sco+EhdL7KdEmnNUfibuBTczac cps9er8UcDCFPy3A8bWXR752I8A7OTtG5huneNqgsQWK/iB4lyCsvlbr7xNC1ZRsVTchiZ6PEL0 37cL45lnxNpDebbq8zVQPv8gw2NqrkB1puiCEBrKp3rPTe1/cloXFXaGeLpJED+AVl4JWKM95iw == X-Received: by 2002:adf:ce07:: with SMTP id p7mr4479678wrn.329.1642782410090; Fri, 21 Jan 2022 08:26:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwxY3FDGiDeGC2nnEscR7g61N/8uTgNO6fRJ139Gap2GL2wtkjjlQmgbd/vs8+5fdQJ85yp6Q== X-Received: by 2002:adf:ce07:: with SMTP id p7mr4479657wrn.329.1642782409775; Fri, 21 Jan 2022 08:26:49 -0800 (PST) Received: from localhost (host86-188-49-82.range86-188.btcentralplus.com. [86.188.49.82]) by smtp.gmail.com with ESMTPSA id bg23sm7227174wmb.5.2022.01.21.08.26.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jan 2022 08:26:49 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCHv5 0/2] Disassembler Output Styling Date: Fri, 21 Jan 2022 16:26:41 +0000 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-List-Received-Date: Fri, 21 Jan 2022 16:26:55 -0000 Changes in v5: Rebased onto current master. Simplified the colorize_disasm API in match my latest proposal here: https://sourceware.org/pipermail/gdb-patches/2022-January/185060.html That is, the colorize_disasm takes a bytes object, and is expected to return a bytes object, nothing else is allowed (ecept for None, which is a special case). Changes in v4: Rebased on to current master. The colorize_disasm function is now passed a bytes object rather than a unicode string. The return from colorize_disasm can be either a bytes object, or a unicode string. If GDB gets a unicode string, then it is converted to bytes using the current host_charset(). There's no change in the documentation in this version, the documentation has already been reviewed in a previous version. Changes in v3: In this update, the biggest change, is that the controlling setting is now 'set/show style disassembler enabled', that is I've added 'enabled' to the setting name. My reason for this is that, in the future, I might want to add additional disassembler styles, like: set style disassembler register .... set style disassembler mnemonic .... And the new setting name leaves this possibility open, while the old setting made this harder. This version also includes an improved test, minor updates to the docs to match the above change, and a rebase to current master. --- Andrew Burgess (2): gdb: use python to colorize disassembler output gdb/python: move styling support to gdb.styling gdb/NEWS | 6 +++ gdb/cli/cli-style.c | 44 +++++++++++++++++ gdb/cli/cli-style.h | 3 ++ gdb/data-directory/Makefile.in | 1 + gdb/disasm.c | 58 +++++++++++++++++++++- gdb/disasm.h | 25 ++++++++++ gdb/doc/gdb.texinfo | 15 ++++++ gdb/extension-priv.h | 6 +++ gdb/extension.c | 20 ++++++++ gdb/extension.h | 8 +++ gdb/python/lib/gdb/__init__.py | 18 ------- gdb/python/lib/gdb/styling.py | 49 ++++++++++++++++++ gdb/python/python.c | 85 ++++++++++++++++++++++++++++++-- gdb/testsuite/gdb.base/style.exp | 82 +++++++++++++++++++++++++++++- 14 files changed, 396 insertions(+), 24 deletions(-) create mode 100644 gdb/python/lib/gdb/styling.py -- 2.25.4