From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: Keith Seitz Cc: gdb@sources.redhat.com Subject: Re: print_insn and streams Date: Mon, 20 Aug 2001 22:58:00 -0000 Message-id: <3B81F87E.4050203@cygnus.com> References: X-SW-Source: 2001-08/msg00164.html > Hi, > > 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;) Keith, have you looked at gdb/mi/mi-cmd-disas.c (yes the code is nasty) which calls the TARGET_PRINT_INSN() with a ui-out builder. If the main function was split in two would the second half do what you're after? You can check the output by looking at the mi-disassemble.exp test (or the doco which might be easier to read :-). Andrew