{bfd_arch_unknown,/* File arch not known */bfd_arch_obscure,/* Arch known, not one of these */bfd_arch_m68k,/* Motorola 68xxx */#definebfd_mach_m680001#definebfd_mach_m680082#definebfd_mach_m680103#definebfd_mach_m680204#definebfd_mach_m680305#definebfd_mach_m680406#definebfd_mach_m680607
#definebfd_mach_sparc_v8plusa5/* with ultrasparc add'ns. */#definebfd_mach_sparc_sparclite_le6#definebfd_mach_sparc_v97#definebfd_mach_sparc_v9a8/* with ultrasparc add'ns. */#definebfd_mach_sparc_v8plusb9/* with cheetah add'ns. */#definebfd_mach_sparc_v9b10/* with cheetah add'ns. *//* Nonzero if MACH has the v9 instruction set. */
bfd_arch_rs6000,/* IBM RS/6000 */bfd_arch_hppa,/* HP PA RISC */bfd_arch_d10v,/* Mitsubishi D10V */bfd_arch_z8k,/* Zilog Z8000 */#definebfd_mach_z80011#definebfd_mach_z80022bfd_arch_h8500,/* Hitachi H8/500 */bfd_arch_sh,/* Hitachi SH */
typedefint(*fprintf_ftype)PARAMS((FILE*,constchar*,...));enumdis_insn_type{dis_noninsn,/* Not a valid instruction */dis_nonbranch,/* Not a branch instruction */dis_branch,/* Unconditional branch */dis_condbranch,/* Conditional branch */dis_jsr,/* Jump to subroutine */dis_condjsr,/* Conditional jump to subroutine */dis_dref,/* Data reference instruction */dis_dref2/* Two data references in instruction */};
andispassedbackoutintoeachcallback.Thevariousfieldsareusedforconveyinginformationfromyourmainroutineintoyourcallbacks,forpassinginformationintotheinstructiondecoders(suchastheaddressesofthecallbackfunctions),orforpassinginformationbackfromtheinstructiondecoderstotheircallers.Itmustbeinitializedbeforeitisfirstpassed;thiscanbedonebyhand,orusingoneoftheinitializationmacrosbelow.*/typedefstructdisassemble_info{fprintf_ftypefprintf_func;FILE*stream;PTRapplication_data;/*Targetdescription.Wecouldreplacethiswithapointertothebfd,butthatwouldrequireone.Therecurrentlyisn'tanysuchrequirementsotoavoidintroducingonewerecordtheseexplicitly.*//* The bfd_flavour. This can be bfd_target_unknown_flavour. */enumbfd_flavourflavour;/* The bfd_arch value. */enumbfd_architecturearch;/* The bfd_mach value. */unsignedlongmach;/* Endianness (for bi-endian cpus). Mono-endian cpus can ignore this. */enumbfd_endianendian;/*Anarrayofpointerstosymbolseitheratthelocationbeingdisassembledoratthestartofthefunctionbeingdisassembled.Thearrayissortedsothatthefirstsymbolisintendedtobetheoneused.Theothersarepresentforanymisc.purposes.Thisisnotsetreliably,butifitisnotNULL,itiscorrect.*/asymbol**symbols;/* Number of symbols in array. */intnum_symbols;/*Forusebythedisassembler.Thetop16bitsarereservedforpublicuse(andaredocumentedhere).Thebottom16bitsarefortheinternaluseofthedisassembler.*/unsignedlongflags;#defineINSN_HAS_RELOC0x80000000PTRprivate_data;/*Functionusedtogetbytestodisassemble.MEMADDRistheaddressofthestufftobedisassembled,MYADDRistheaddresstoputthebytesin,andLENGTHisthenumberofbytestoread.INFOisapointertothisstruct.Returnsanerrnovalueor0forsuccess.*/int(*read_memory_func)PARAMS((bfd_vmamemaddr,bfd_byte*myaddr,intlength,structdisassemble_info*info));/*Functionwhichshouldbecalledifwegetanerrorthatwecan'trecoverfrom.STATUSistheerrnovaluefromread_memory_funcandMEMADDRistheaddressthatweweretryingtoread.INFOisapointertothisstruct.*/void(*memory_error_func)PARAMS((intstatus,bfd_vmamemaddr,structdisassemble_info*info));/* Function called to print ADDR. */void(*print_address_func)PARAMS((bfd_vmaaddr,structdisassemble_info*info));/*FunctioncalledtodetermineifthereisasymbolatthegivenADDR.Ifthereis,thefunctionreturns1,otherwiseitreturns0.Thisisusedbyportswhichsupportanoverlaymanagerwheretheoverlaynumberisheldinthetoppartofanaddress.Insomecircumstanceswewanttoincludetheoverlaynumberintheaddress,(normallybecausethereisasymbolassociatedwiththataddress),butsometimeswewanttomaskouttheoverlaybits.*/int(*symbol_at_address_func)PARAMS((bfd_vmaaddr,structdisassemble_info*info));/* These are for buffer_read_memory. */bfd_byte*buffer;bfd_vmabuffer_vma;intbuffer_length;/*Thisvariablemaybesetbytheinstructiondecoder.Itsuggeststhenumberofbytesobjdumpshoulddisplayonasingleline.Iftheinstructiondecodersetsthis,itshouldalwayssetittothesamevalueinordertogetreasonablelookingoutput.*/intbytes_per_line;/* the next two variables control the way objdump displays the raw data *//* For example, if bytes_per_line is 8 and bytes_per_chunk is 4, the *//*outputwilllooklikethis:00:0000000000000000withthechunksdisplayedaccordingto"display_endian".*/intbytes_per_chunk;enumbfd_endiandisplay_endian;/*Resultsfrominstructiondecoders.Notalldecodersyetsupportthisinformation.Thisinfoisseteachtimeaninstructionisdecoded,andisonlyvalidforthelastsuchinstruction.Todeterminewhetherthisdecodersupportsthisinformation,setinsn_info_validto0,decodeaninstruction,thencheckit.*/charinsn_info_valid;/* Branch info has been set. */charbranch_delay_insns;/*Howmanysequentialinsn'swillrunbeforeabranchtakeseffect.(0=normal)*/chardata_size;/* Size of data reference in insn, in bytes */enumdis_insn_typeinsn_type;/* Type of instruction */bfd_vmatarget;/*Targetaddressofbranchordref,ifknown;zeroifunknown.*/bfd_vmatarget2;/* Second target address for dref2 */