Ignore .dwarf_line entries of span 0
Some entries in .dwarf_line might span 0 instructions, because a following entry refers to exactly the same address. An enhancement might be to make all these addresses equivalent in the matcher.
This commit is contained in:
parent
24a68dbba2
commit
b87020a5cd
1 changed files with 17 additions and 15 deletions
|
@ -49,6 +49,9 @@ let add_line_boxes render_data matcher_data dwarf_lines =
|
||||||
fold_ahead (fun (cur_render_data, cur_matcher_data) cur_reg reg_ahead ->
|
fold_ahead (fun (cur_render_data, cur_matcher_data) cur_reg reg_ahead ->
|
||||||
let box_start = Z.to_int @@ cur_reg.Dwarf.lnr_address in
|
let box_start = Z.to_int @@ cur_reg.Dwarf.lnr_address in
|
||||||
let box_end = Z.to_int @@ reg_ahead.Dwarf.lnr_address in
|
let box_end = Z.to_int @@ reg_ahead.Dwarf.lnr_address in
|
||||||
|
(match box_start = box_end with
|
||||||
|
| true -> cur_render_data, cur_matcher_data
|
||||||
|
| false ->
|
||||||
Format.eprintf "Add box %x -- %x@." box_start box_end ;
|
Format.eprintf "Add box %x -- %x@." box_start box_end ;
|
||||||
let n_matcher_data, block_class_id =
|
let n_matcher_data, block_class_id =
|
||||||
Asm_matcher.add_block cur_matcher_data cur_reg in
|
Asm_matcher.add_block cur_matcher_data cur_reg in
|
||||||
|
@ -62,6 +65,7 @@ let add_line_boxes render_data matcher_data dwarf_lines =
|
||||||
})
|
})
|
||||||
in
|
in
|
||||||
(n_render_data, n_matcher_data))
|
(n_render_data, n_matcher_data))
|
||||||
|
)
|
||||||
(cur_render_data, cur_matcher_data) reg_list)
|
(cur_render_data, cur_matcher_data) reg_list)
|
||||||
(render_data, matcher_data)
|
(render_data, matcher_data)
|
||||||
dwarf_lines
|
dwarf_lines
|
||||||
|
@ -81,7 +85,6 @@ let _ =
|
||||||
!elf_files
|
!elf_files
|
||||||
in
|
in
|
||||||
|
|
||||||
(*
|
|
||||||
List.iter (fun (ElfHandle(path, _, static_info, _)) ->
|
List.iter (fun (ElfHandle(path, _, static_info, _)) ->
|
||||||
let line_info = static_info.ds_evaluated_line_info in
|
let line_info = static_info.ds_evaluated_line_info in
|
||||||
Format.eprintf "Line infos <%s>:@. %a@."
|
Format.eprintf "Line infos <%s>:@. %a@."
|
||||||
|
@ -89,7 +92,6 @@ let _ =
|
||||||
(make_pp Dwarf.pp_evaluated_line_info)
|
(make_pp Dwarf.pp_evaluated_line_info)
|
||||||
line_info ;
|
line_info ;
|
||||||
) elf_handles ;
|
) elf_handles ;
|
||||||
*)
|
|
||||||
|
|
||||||
let map_with_state mapper initial_state lst =
|
let map_with_state mapper initial_state lst =
|
||||||
List.fold_right (fun elt (cur_state, accu) ->
|
List.fold_right (fun elt (cur_state, accu) ->
|
||||||
|
|
Loading…
Reference in a new issue