home *** CD-ROM | disk | FTP | other *** search
-
-
-
- DDDDIIIISSSSAAAASSSSMMMM((((3333EEEE)))) DDDDIIIISSSSAAAASSSSMMMM((((3333EEEE))))
-
-
-
- NNNNAAAAMMMMEEEE
- dis_init, dis_init32, dis_init64, dis_regs, dis_regs32, dis_regs64,
- disasm, disasm32, disasm64, disassembler32, disassembler64 - disassembler
- functions
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<ddddiiiissssaaaasssssssseeeemmmmbbbblllleeeerrrr....hhhh>>>>
-
- void dis_init (char *addr_format,char *value_format,
- char *reg_names[],int print_jal_targets);
-
- void dis_init32 (char *addr_format,char *value_format,
- char *reg_names[],int print_jal_targets);
-
- void dis_init64 (char *addr_format,char *value_format,
- char *reg_names[],int print_jal_targets);
-
- void dis_regs(char *buffer,unsigned regmask,
- unsigned reg_values[]);
-
- void dis_regs32(char *buffer,unsigned regmask,
- unsigned reg_values[]);
-
- void dis_regs64(char *buffer,unsigned regmask,
- __uint64_t reg_values[]);
-
- int disasm(char *buffer,Elf32_Addr address,Elf32_Addr iword,
- Elf32_Addr *regmask,Elf32_Addr *symbol_value,
- Elf32_Addr *ls_register);
-
- int disasm32(char *buffer,Elf32_Addr address,Elf32_Addr iword,
- Elf32_Addr *regmask,Elf32_Addr *symbol_value,
- Elf32_Addr *ls_register);
-
- int disasm64(char *buffer,Elf64_Addr address, Elf32_Addr iword,
- Elf32_Addr *regmask,Elf64_Addr *symbol_value,
- Elf32_Addr *ls_register);
-
- int disassembler(Elf32_Addr iadr, int regstyle,
- char *(*get_symname)(),int (*get_regvalue)(),
- long (*get_bytes)(), void (*print_header)());
-
- int disassembler32(Elf32_Addr iadr, int regstyle,
- char *(*get_symname)(),int (*get_regvalue)(),
- long (*get_bytes)(), void (*print_header)());
-
- int disassembler64(__uint64_t iadr, int regstyle,
- char *(*get_symname)(),int (*get_regvalue)(),
- long (*get_bytes)(), void (*print_header)());
-
-
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- DDDDIIIISSSSAAAASSSSMMMM((((3333EEEE)))) DDDDIIIISSSSAAAASSSSMMMM((((3333EEEE))))
-
-
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- Three sets of register names which people might want to use:
- ccccoooommmmppppiiiilllleeeerrrr:::: zzzzeeeerrrroooo,,,, aaaatttt,,,, vvvv0000,,,, ............
- hhhhaaaarrrrddddwwwwaaaarrrreeee:::: rrrr0000,,,, rrrr1111,,,, rrrr2222,,,, ............
- aaaasssssssseeeemmmmbbbblllleeeerrrr:::: $$$$0000,,,, $$$$aaaatttt,,,, $$$$2222,,,,............
-
- _d_i_s__i_n_i_t, _d_i_s__i_n_i_t_3_2, and _d_i_s__i_n_i_t_6_4 functions initialize disassembler
- and set options for disassembly. "addr_format" and "value_format"
- specify in the style of "printf" the null-terminated formats for printing
- the address and value of the instruction. If nil, they default to
- "%#010x"; if they are the empty string, we omit to print these items.
-
- "reg_names" is a pointer to an array of 32 strings which we will use to
- represent the general-purpose registers. The *_NAMES macros above give
- three common choices; if nil, we use compiler names.
-
- print_jal_targets tells us whether to print the targets of jal
- instructions numerically.
-
- _d_i_s__r_e_g_s, _d_i_s__r_e_g_s_3_2, and _d_i_s__r_e_g_s_6_4 functions Given a null-terminated
- buffer (presumably from "disasm"), we append an ascii representation of
- register values in the form "<$5=0x50,$7=0x44,...>".
-
- "regmask" is a bitmask of registers as in "disasm", "reg_values" an array
- (with empty slots for the registers not indicated in the mask) of their
- values.
-
- _d_i_s_a_s_m, _d_i_s_a_s_m_3_2, and _d_i_s_a_s_m_6_4 functions Disassemble instruction, putting
- null-terminated result into "buffer" (no trailing newline). Details
- governed by "dis_init".
-
- buffer: array of characters allocated by the caller; 64 bytes should be
- more than enough.
-
- address: byte address.
-
- iword: the instruction.
-
- regmask: returns a bitmask of the gp registers the instruction uses, with
- the LSB indicating register 0 regardless of endianness.
-
- symbol_value: for a jal instruction, the target value; for a load or
- store, the immediate value.
-
- ls_register: for a load or store, the number of the base register.
-
- return value: -1 for a load or store, 1 for a jal, 2 for a j, jr, jalr,
- or branch, 0 for other.
-
- _d_i_s_a_s_s_e_m_b_l_e_r, _d_i_s_a_s_s_e_m_b_l_e_r_3_2, and _d_i_s_a_s_s_e_m_b_l_e_r_6_4 functions Older
- interface, which always prints on stdout.
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- DDDDIIIISSSSAAAASSSSMMMM((((3333EEEE)))) DDDDIIIISSSSAAAASSSSMMMM((((3333EEEE))))
-
-
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- disassembler(3X),
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-