Go to file
Andrew Burgess 0af2f23333 gdb/python: rework how the disassembler API reads the result object
This commit is a refactor ahead of the next change which will make
disassembler styling available through the Python API.

Unfortunately, in order to make the styling support available, I think
the easiest solution is to make a very small change to the existing
API.

The current API relies on returning a DisassemblerResult object to
represent each disassembled instruction.  Currently GDB allows the
DisassemblerResult class to be sub-classed, which could mean that a
user tries to override the various attributes that exist on the
DisassemblerResult object.

This commit removes this ability, effectively making the
DisassemblerResult class final.

Though this is a change to the existing API, I'm hoping this isn't
going to cause too many issues:

  - The Python disassembler API was only added in the previous release
    of GDB, so I don't expect it to be widely used yet, and

  - It's not clear to me why a user would need to sub-class the
    DisassemblerResult type, I allowed it in the original patch
    because at the time I couldn't see any reason to NOT allow it.

Having prevented sub-classing I can now rework the tail end of the
gdbpy_print_insn function; instead of pulling the results out of the
DisassemblerResult object by calling back into Python, I now cast the
Python object back to its C++ type (disasm_result_object), and access
the fields directly from there.  In later commits I will be reworking
the disasm_result_object type in order to hold information about the
styled disassembler output.

The tests that dealt with sub-classing DisassemblerResult have been
removed, and a new test that confirms that DisassemblerResult can't be
sub-classed has been added.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Reviewed-By: Tom Tromey <tom@tromey.com>
2023-05-16 10:30:46 +01:00
bfd Automatic date update in version.in 2023-05-16 00:00:35 +00:00
binutils Re: stack overflow in debug_write_type 2023-05-10 23:10:19 +09:30
config Merge config/picflag.m4 from gcc 2023-01-04 13:23:54 +10:30
contrib Import mklog.py from gcc repo 2020-09-25 10:24:44 -04:00
cpu cpu/mem.opc whitespace tidy 2023-03-16 17:30:19 +10:30
elfcpp Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
etc Update year range in gprofng copyright notices 2023-01-01 23:26:30 +10:30
gas PR28955 mips gas segfault 2023-05-13 20:47:31 +09:30
gdb gdb/python: rework how the disassembler API reads the result object 2023-05-16 10:30:46 +01:00
gdbserver gdbserver: Clear upper ZMM registers in the right location. 2023-05-08 10:39:52 -07:00
gdbsupport gdb: Fix building with latest libc++ 2023-04-29 00:35:11 -07:00
gnulib Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gold MIPS: support mips*64 as CPU and gnuabi64 as ABI 2023-04-23 14:32:43 +08:00
gprof Updated Hungarian translation for the gprof directory 2023-04-19 10:37:33 +01:00
gprofng gprofng: 30360 Seg. Fault when application uses std::thread 2023-04-17 13:01:38 -07:00
include Add LDPT_REGISTER_CLAIM_FILE_HOOK_V2 linker plugin hook [GCC PR109128] 2023-05-11 14:31:09 +00:00
intl egrep in binutils 2022-09-28 13:37:31 +09:30
ld LoongArch: Fix PLT entry generate bug 2023-05-15 09:22:27 +08:00
libbacktrace Ensure that libbacktrace/allocfail.sh is not deleted when creating release tarballs. 2023-01-12 13:39:03 +00:00
libctf libctf, link: fix CU-mapped links with CTF_LINK_EMPTY_CU_MAPPINGS 2023-04-08 16:07:17 +01:00
libdecnumber Merge config/ changes from GCC, to enable DFP on AArch64 2022-05-24 10:47:29 +01:00
libiberty Merge config/picflag.m4 from gcc 2023-01-04 13:23:54 +10:30
libsframe libsframe: minor formatting fixes in sframe_encoder_write_fre 2023-04-19 14:38:18 -07:00
opcodes x86: move a few more disassembler helper functions 2023-05-12 08:57:58 +02:00
readline gdb/readline: fix extra 'quit' message problem 2022-05-07 10:49:27 +01:00
sim sim: bpf: update to new BPF relocations 2023-04-26 19:22:14 +02:00
texinfo
zlib Regenerate with automake-1.15.1 2022-07-09 20:10:47 +09:30
.cvsignore
.editorconfig Add top-level .editorconfig file 2022-01-28 08:25:42 -05:00
.gitattributes binutils-gdb/git: highlight whitespace errors in source files 2022-07-25 14:35:41 +01:00
.gitignore Add gnu global outputs to .gitignore 2020-12-02 10:00:27 -05:00
ar-lib
ChangeLog Add a SECURITY.txt file describing the GNU Binutils' project's stance on security related bugs. 2023-04-20 16:52:11 +01:00
compile
config-ml.in
config.guess Update the config.guess and config.sub files from the master repository and regenerate files. 2022-01-17 16:21:22 +00:00
config.rpath
config.sub Update the config.guess and config.sub files from the master repository and regenerate files. 2022-01-17 16:21:22 +00:00
configure configure: remove dependencies on gmp and mpfr when gdb is disabled 2023-01-06 09:32:07 +01:00
configure.ac configure: remove dependencies on gmp and mpfr when gdb is disabled 2023-01-06 09:32:07 +01:00
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.LIBGLOSS
COPYING.NEWLIB
depcomp
djunpack.bat
install-sh
libtool.m4 libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case 2022-03-25 12:02:35 +00:00
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS MAINTAINERS: Update path to readline config.{sub,guess} files 2021-05-24 18:11:49 +02:00
Makefile.def toplevel: Makefile.def: add install-strip dependency on libsframe 2023-01-18 23:17:49 -08:00
Makefile.in toplevel: Makefile.def: add install-strip dependency on libsframe 2023-01-18 23:17:49 -08:00
Makefile.tpl Pass PKG_CONFIG_PATH down from top-level Makefile 2022-04-08 10:56:41 -04:00
makefile.vms
missing
mkdep
mkinstalldirs
move-if-change
multilib.am Merge autoconf / automake update changes from GCC. 2018-10-31 17:10:56 +00:00
README
README-maintainer-mode Note that at least dejagnu version 1.5.3 is required in order to be ale to run the testsuites. 2022-10-04 10:54:19 +01:00
SECURITY.txt Add a SECURITY.txt file describing the GNU Binutils' project's stance on security related bugs. 2023-04-20 16:52:11 +01:00
setup.com
src-release.sh Add a SECURITY.txt file describing the GNU Binutils' project's stance on security related bugs. 2023-04-20 16:52:11 +01:00
symlink-tree
test-driver
ylwrap

		   README for GNU development tools

This directory contains various GNU compilers, assemblers, linkers, 
debuggers, etc., plus their support routines, definitions, and documentation.

If you are receiving this as part of a GDB release, see the file gdb/README.
If with a binutils release, see binutils/README;  if with a libg++ release,
see libg++/README, etc.  That'll give you info about this
package -- supported targets, how to use it, how to report bugs, etc.

It is now possible to automatically configure and build a variety of
tools with one command.  To build all of the tools contained herein,
run the ``configure'' script here, e.g.:

	./configure 
	make

To install them (by default in /usr/local/bin, /usr/local/lib, etc),
then do:
	make install

(If the configure script can't determine your type of computer, give it
the name as an argument, for instance ``./configure sun4''.  You can
use the script ``config.sub'' to test whether a name is recognized; if
it is, config.sub translates it to a triplet specifying CPU, vendor,
and OS.)

If you have more than one compiler on your system, it is often best to
explicitly set CC in the environment before running configure, and to
also set CC when running make.  For example (assuming sh/bash/ksh):

	CC=gcc ./configure
	make

A similar example using csh:

	setenv CC gcc
	./configure
	make

Much of the code and documentation enclosed is copyright by
the Free Software Foundation, Inc.  See the file COPYING or
COPYING.LIB in the various directories, for a description of the
GNU General Public License terms under which you can copy the files.

REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info
on where and how to report problems.