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.129.124]) by sourceware.org (Postfix) with ESMTPS id 2612D38A940F for ; Tue, 11 Jan 2022 14:31:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2612D38A940F Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-675-io0p2MWoOzGKucT6PI9qAQ-1; Tue, 11 Jan 2022 09:31:09 -0500 X-MC-Unique: io0p2MWoOzGKucT6PI9qAQ-1 Received: by mail-wr1-f69.google.com with SMTP id h26-20020adfa4da000000b001a652d52d8eso2930088wrb.16 for ; Tue, 11 Jan 2022 06:31:09 -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=yurG2yMByllfLKV2NlNxDCZePdVRxh9uU79Ois2mqbU=; b=QYwr8pUQxkBVAkg+lkLQGBxtyztBWWrLkv8woNp6+rZ++bDK1w4+mdVA1Vkkx5735F zk5H5mYHpYvTL+Rsk8++m82qgsItOAgdMEnLwzI6YSwt8BbnSS2N0PzetwPUeCYZLEwa jKXuXebKPkqEHfUzkVIQUm4TKgNKOEzicKC//+QNQjSzxsT5E50hW1dOyQiaRIn1ChVj Hfcoj2rE7Iknv8PMR+7PCwcCE5UJoQQu69gCmwBQaRxYckImvXH19mjYQitdtC3VGzBq 8Vf50jboEbDksSD9EJt3AntcZWkPvHC+7yCTZPYcz/52AhHxT02AhKn2WPIqGkzUTLR7 5x2A== X-Gm-Message-State: AOAM532bnNrzLxy0GRP3DoqNYrWKuko7gnnf676Jm9Pq+ImA6n27l1xx Nie2Tsjdj3kdVuvo6RJ/YhHDkOfSWsMx9qn7SZksbm1uoWM+z+ed9Yj9uFOaH12SP1rLh7HFCEF q+dAlnaVUqtePVUNMZ5+na3IGM7nqgIEysZn14robQx9ZGNZBbqNWo/QmrqJB232ANLJjZdJgVQ == X-Received: by 2002:a7b:cd02:: with SMTP id f2mr1692777wmj.68.1641911468111; Tue, 11 Jan 2022 06:31:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJzSkwffuOrcK0D6Sbqkm/L9cMQyPsCpko2/M0HlsraJPFJQHZ9Z5EigWHo3p6way+w7ZnXNUQ== X-Received: by 2002:a7b:cd02:: with SMTP id f2mr1692751wmj.68.1641911467768; Tue, 11 Jan 2022 06:31:07 -0800 (PST) Received: from localhost (host86-188-49-82.range86-188.btcentralplus.com. [86.188.49.82]) by smtp.gmail.com with ESMTPSA id n9sm2220470wmq.37.2022.01.11.06.31.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jan 2022 06:31:07 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCHv4 0/2] Disassembler Output Styling Date: Tue, 11 Jan 2022 14:30:59 +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=-5.8 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: Tue, 11 Jan 2022 14:31:14 -0000 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 | 98 +++++++++++++++++++++++++++++++- gdb/testsuite/gdb.base/style.exp | 82 +++++++++++++++++++++++++- 14 files changed, 409 insertions(+), 24 deletions(-) create mode 100644 gdb/python/lib/gdb/styling.py -- 2.25.4