Modify elf_arrows accordingly

This commit is contained in:
Théophile Bastian 2019-11-18 11:35:27 +01:00
parent 700ca3db7f
commit 520d9527ab
2 changed files with 16 additions and 11 deletions

5
dune
View file

@ -1,4 +1,5 @@
(include_subdirs unqualified)
(executable
(name test_objdump)
(libraries linksem))
(name elf_arrows)
(libraries linksem jingoo))

View file

@ -12,7 +12,9 @@ let make_pp linksem_pp =
|> Format.fprintf fmt "%s")
type elf_path = string
type elf_handle = ElfHandle of elf_path * Elf_file.elf_file * Dwarf.dwarf_static
type elf_handle =
ElfHandle of elf_path * Elf_file.elf_file * Dwarf.dwarf_static
* Asm_info.NoAnnot.asm_info_t
(** Open an ELF file and loads its dwarf_static infos. *)
let open_elf elf_path =
@ -25,10 +27,11 @@ let open_elf elf_path =
| Error.Fail _ -> raise NotElf)
))
>>= fun elf_file -> (
let asm_info = Asm_acquire.acquire_asm elf_path in
let static_info = (match Dwarf.extract_dwarf_static elf_file with
| Some static_info -> static_info
| None -> raise NoDwarfStatic) in
Error.Success (ElfHandle (elf_path, elf_file, static_info)))
Error.Success (ElfHandle (elf_path, elf_file, static_info, asm_info)))
let elf_files = ref []
@ -46,10 +49,11 @@ let _ =
!elf_files
in
List.iter (fun (ElfHandle(path, _, static_info)) ->
let line_info = static_info.ds_evaluated_line_info in
Format.eprintf "Line infos <%s>:@. %a@."
path
(make_pp Dwarf.pp_evaluated_line_info)
line_info ;
) elf_handles
List.iter (fun (ElfHandle(path, _, static_info, asm)) ->
ignore asm ;
let line_info = static_info.ds_evaluated_line_info in
Format.eprintf "Line infos <%s>:@. %a@."
path
(make_pp Dwarf.pp_evaluated_line_info)
line_info ;
) elf_handles