From: "John R. Moore" <jmoore@redhat.com>
To: Keith Seitz <keiths@cygnus.com>
Cc: <gdb@sources.redhat.com>
Subject: Re: print_insn and streams
Date: Fri, 17 Aug 2001 15:15:00 -0000 [thread overview]
Message-ID: <Pine.GSO.4.31.0108171455300.20113-100000@cse.cygnus.com> (raw)
In-Reply-To: <Pine.GSO.4.33.0108171435180.11484-100000@makita.cygnus.com>
> printcmd.c currently defines print_insn as:
>
> static int
> print_insn (CORE_ADDR memaddr, struct ui_file *stream)
> {
> if (TARGET_BYTE_ORDER == BIG_ENDIAN)
> TARGET_PRINT_INSN_INFO->endian = BFD_ENDIAN_BIG;
> else
> TARGET_PRINT_INSN_INFO->endian = BFD_ENDIAN_LITTLE;
>
> if (TARGET_ARCHITECTURE != NULL)
> TARGET_PRINT_INSN_INFO->mach = TARGET_ARCHITECTURE->mach;
> /* else: should set .mach=0 but some disassemblers don't grok this */
>
> return TARGET_PRINT_INSN (memaddr, TARGET_PRINT_INSN_INFO);
> }
>
> Is there some reason that it is ignoring the parameter stream? Can it not
> just be set in the disasm info? (TARGET_PRINT_INSN_INFO->stream = stream;)
>
> Curious.
> Keith
When print_insn was first put in printcmd.c (-r1.108):
--------------------------------------------------------------
/* Print the instruction at address MEMADDR in debugged memory,
on STREAM. Returns length of the instruction, in bytes. */
int
print_insn (memaddr, stream)
CORE_ADDR memaddr;
GDB_FILE *stream;
{
disassemble_info info;
#define GDB_INIT_DISASSEMBLE_INFO(INFO, STREAM) \
(INFO).fprintf_func = (fprintf_ftype)fprintf_filtered, \
(INFO).stream = (STREAM), \
(INFO).read_memory_func = dis_asm_read_memory, \
(INFO).memory_error_func = dis_asm_memory_error, \
(INFO).print_address_func = dis_asm_print_address, \
(INFO).insn_info_valid = 0
GDB_INIT_DISASSEMBLE_INFO(info, stream);
/* If there's no disassembler, something is very wrong. */
if (tm_print_insn == NULL)
abort ();
return (*tm_print_insn) (memaddr, &info);
}
-------------------------------------------
"stream" was used until -r1.124
revision 1.124
date: 1996/07/15 23:54:22; author: grossman; state: Exp; lines: +11 -8
* defs.h printcmd.c: Create global disassemble_info structure
tm_print_insn_info.
* gdbtk.c (gdb_disassemble): Setup di.mach from
tm_print_insn_info.mach, and set endian from TARGET_BYTE_ORDER.
* i386-tdep.c (set_assembly_language_command): set
tm_print_insn_info.mach to the appropriate value for 386 or 8086
disassembly.
* printcmd.c (print_insn): Move init of disassembler_info to
_initialize_printcmd. Set endian for disassembler here.
* sparc-tdep.c: Set tm_print_insn_info.mach as appropriate to
select sparc/sparclite.
* config/sparc/{tm-sparc.h tm-sparclite.h}: Get rid of
TM_PRINT_INSN. Set TM_PRINT_INSN_MACH to
bfd_mach_sparc/bfd_mach_sparc_sparclite.
---------
The parameter was left in rather than removing and fixing all the
routines that call it.
FWIW,
John
next prev parent reply other threads:[~2001-08-17 15:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-08-17 14:37 Keith Seitz
2001-08-17 15:15 ` John R. Moore [this message]
2001-08-20 22:58 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.GSO.4.31.0108171455300.20113-100000@cse.cygnus.com \
--to=jmoore@redhat.com \
--cc=gdb@sources.redhat.com \
--cc=keiths@cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox