This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
gdb-patches@sources.redhat.com
- To: binutils at sources dot redhat dot com
- Subject: gdb-patches@sources.redhat.com
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- Date: Sat, 16 Dec 2000 23:18:10 -0500 (EST)
[RFA:] [patch] Add (optionally set) section field to struct disassemble_info.
CC to gdb-patches as this affects the disassembler interface.
Multi-ISA targets and presumably other strange beasts need to check
section flags and other info available there, to know how to display
instructions accurately. Note that this is just an augmentation of the
disassembler interface. Nothing uses this field right now, and nothing
should break by adding it. In much, it's like the symbols field and
yes, the section can be gleaned from a symbol, but symbols can be absent
while section information is still valid.
Ok to commit?
* dis-asm.h (struct disassemble_info): New member "section".
(INIT_DISASSEMBLE_INFO_NO_ARCH): Initialize section member.
Index: dis-asm.h
===================================================================
RCS file: /cvs/src/src/include/dis-asm.h,v
retrieving revision 1.18
diff -p -c -r1.18 dis-asm.h
*** dis-asm.h 2000/09/29 18:07:47 1.18
--- dis-asm.h 2000/12/17 03:52:52
*************** typedef struct disassemble_info {
*** 56,61 ****
--- 56,66 ----
/* Endianness (for bi-endian cpus). Mono-endian cpus can ignore this. */
enum bfd_endian endian;
+ /* Some targets need information about the current section to accurately
+ display insns. If this is NULL, the target disassembler function
+ will have to make its best guess. */
+ asection *section;
+
/* An array of pointers to symbols either at the location being disassembled
or at the start of the function being disassembled. The array is sorted
so that the first symbol is intended to be the one used. The others are
*************** extern int generic_symbol_at_address
*** 256,261 ****
--- 261,267 ----
#define INIT_DISASSEMBLE_INFO_NO_ARCH(INFO, STREAM, FPRINTF_FUNC) \
(INFO).fprintf_func = (fprintf_ftype)(FPRINTF_FUNC), \
(INFO).stream = (PTR)(STREAM), \
+ (INFO).section = NULL, \
(INFO).symbols = NULL, \
(INFO).num_symbols = 0, \
(INFO).buffer = NULL, \
brgds, H-P