summaryrefslogtreecommitdiff
path: root/checklink/Disassembler.ml
blob: 0e2c68830bacd4c4fe2dfe8f65d6b8220ff596f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
open ELF_parsers
open ELF_types
open PPC_printers
open PPC_utils

let disassemble elf sym_name =
  let sym =
    List.find
      (fun sym -> sym.st_name = sym_name)
      (Array.to_list elf.e_symtab)
  in
  match code_of_sym elf sym with
  | None -> "Couldn't find the code for that symbol name"
  | Some(ecode) ->
      string_of_instr_list ecode