public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Disassembler Output Styling
@ 2021-10-26  9:37 Andrew Burgess
  2021-10-26  9:37 ` [PATCH 1/4] gdb/python: make some global variables static Andrew Burgess
                   ` (4 more replies)
  0 siblings, 5 replies; 36+ messages in thread
From: Andrew Burgess @ 2021-10-26  9:37 UTC (permalink / raw)
  To: gdb-patches

This series replaces some parts of this earlier series:

  https://sourceware.org/pipermail/gdb-patches/2021-October/182526.html

Specifically, all of the disassembler styling related changes are now
replaced by this series.

In the earlier patch I develop a general API for augmenting the
disassembler output.  While I was working on that I realise I could
use that API to provide styled disassembler output, so I did that, and
included it in the earlier series.

However, after reading the feedback, and working with the new API a
little more, I realised that including the disassembler styling within
the general disassembler API was a bad idea.  It meant that when a
user wrote a plugin to augment the disassembler output, they had to
ensure that they also syntax-highlighted the output, this just seemed
unnecessary.

Instead, I think that syntax highlighting should be a separate step
that is performed after the disassembler output has been constructed,
whether that output is from GDB's builtin disassembler, or, in some
future world, where the output originates from a new Python
Disassembler API.

One additional reason I wanted the syntax highlighting to be moved out
of Python was, originally, so I could make use of libsource-highlight,
as we do for source code highlighting, I figured it would be quicker
to use that library than calling into Python, however, as I describe
in patch #3, the output of libsource-highlight on assembler code is
not great (currently), so in the end I stuck with the pure Python
solution.

If this series is accepted, then I plan to rebase the general purpose
disassembler API on to this, with some simplifications made now that
we don't need to support syntax highlighting.

Thanks,
Andrew

---

Andrew Burgess (4):
  gdb/python: make some global variables static
  gdb: rename source_styling_changed observer
  gdb: use python to colorize disassembler output
  gdb/python: move styling support to gdb.styling

 gdb/NEWS                         |   6 ++
 gdb/cli/cli-style.c              |  28 +++++-
 gdb/cli/cli-style.h              |   3 +
 gdb/data-directory/Makefile.in   |   1 +
 gdb/disasm.c                     |  23 ++++-
 gdb/disasm.h                     |   6 ++
 gdb/doc/gdb.texinfo              |  15 ++++
 gdb/extension-priv.h             |   6 ++
 gdb/extension.c                  |  20 +++++
 gdb/extension.h                  |   8 ++
 gdb/observable.c                 |   2 +-
 gdb/observable.h                 |   6 +-
 gdb/python/lib/gdb/__init__.py   |  18 ----
 gdb/python/lib/gdb/styling.py    |  48 ++++++++++
 gdb/python/python.c              | 145 ++++++++++++++++++++++++-------
 gdb/testsuite/gdb.base/style.exp |  46 ++++++++--
 gdb/tui/tui-winsource.c          |   4 +-
 17 files changed, 320 insertions(+), 65 deletions(-)
 create mode 100644 gdb/python/lib/gdb/styling.py

-- 
2.25.4


^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2022-02-14 11:22 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-26  9:37 [PATCH 0/4] Disassembler Output Styling Andrew Burgess
2021-10-26  9:37 ` [PATCH 1/4] gdb/python: make some global variables static Andrew Burgess
2021-10-27 20:20   ` Tom Tromey
2021-11-25 10:12     ` Andrew Burgess
2021-11-25 15:02       ` Enze Li
2021-11-25 18:11         ` Andrew Burgess
2021-10-26  9:37 ` [PATCH 2/4] gdb: rename source_styling_changed observer Andrew Burgess
2021-10-27 20:22   ` Tom Tromey
2021-11-25 10:17     ` Andrew Burgess
2021-10-26  9:37 ` [PATCH 3/4] gdb: use python to colorize disassembler output Andrew Burgess
2021-10-27 20:38   ` Tom Tromey
2021-10-28 16:28     ` Andrew Burgess
2021-11-22 14:44       ` Andrew Burgess
2021-10-26  9:37 ` [PATCH 4/4] gdb/python: move styling support to gdb.styling Andrew Burgess
2021-10-27 20:39   ` Tom Tromey
2021-11-25 10:36 ` [PATCHv2 0/2] Disassembler Output Styling Andrew Burgess
2021-11-25 10:36   ` [PATCHv2 1/2] gdb: use python to colorize disassembler output Andrew Burgess
2021-11-25 11:04     ` Eli Zaretskii
2021-11-25 10:36   ` [PATCHv2 2/2] gdb/python: move styling support to gdb.styling Andrew Burgess
2021-12-06 14:32   ` Ping: [PATCHv2 0/2] Disassembler Output Styling Andrew Burgess
2021-12-13 14:12   ` [PATCHv3 " Andrew Burgess
2021-12-13 14:12     ` [PATCHv3 1/2] gdb: use python to colorize disassembler output Andrew Burgess
2021-12-13 14:12     ` [PATCHv3 2/2] gdb/python: move styling support to gdb.styling Andrew Burgess
2022-01-11 14:30     ` [PATCHv4 0/2] Disassembler Output Styling Andrew Burgess
2022-01-11 14:31       ` [PATCHv4 1/2] gdb: use python to colorize disassembler output Andrew Burgess
2022-02-10 21:13         ` Tom Tromey
2022-02-11 14:27           ` Andrew Burgess
2022-02-13 18:02             ` Tom Tromey
2022-02-14 11:22               ` Andrew Burgess
2022-01-11 14:31       ` [PATCHv4 2/2] gdb/python: move styling support to gdb.styling Andrew Burgess
2022-02-10 21:15         ` Tom Tromey
2022-02-10 21:16         ` Tom Tromey
2022-01-21 16:26       ` [PATCHv5 0/2] Disassembler Output Styling Andrew Burgess
2022-01-21 16:26         ` [PATCHv5 1/2] gdb: use python to colorize disassembler output Andrew Burgess
2022-01-21 16:26         ` [PATCHv5 2/2] gdb/python: move styling support to gdb.styling Andrew Burgess
2022-02-03 20:32         ` [PATCHv5 0/2] Disassembler Output Styling Andrew Burgess

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).