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,19 +49,23 @@ let add_line_boxes render_data matcher_data dwarf_lines =
|
|||
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_end = Z.to_int @@ reg_ahead.Dwarf.lnr_address in
|
||||
Format.eprintf "Add box %x -- %x@." box_start box_end ;
|
||||
let n_matcher_data, block_class_id =
|
||||
Asm_matcher.add_block cur_matcher_data cur_reg in
|
||||
let n_render_data, _ = Renderer.add_box_excl
|
||||
cur_render_data (box_start, box_end)
|
||||
Renderer.(Some {
|
||||
box_file = Z.to_int cur_reg.lnr_file;
|
||||
box_line = Z.to_int cur_reg.lnr_line;
|
||||
box_col = Z.to_int cur_reg.lnr_column;
|
||||
box_class_id = block_class_id;
|
||||
})
|
||||
in
|
||||
(n_render_data, n_matcher_data))
|
||||
(match box_start = box_end with
|
||||
| true -> cur_render_data, cur_matcher_data
|
||||
| false ->
|
||||
Format.eprintf "Add box %x -- %x@." box_start box_end ;
|
||||
let n_matcher_data, block_class_id =
|
||||
Asm_matcher.add_block cur_matcher_data cur_reg in
|
||||
let n_render_data, _ = Renderer.add_box_excl
|
||||
cur_render_data (box_start, box_end)
|
||||
Renderer.(Some {
|
||||
box_file = Z.to_int cur_reg.lnr_file;
|
||||
box_line = Z.to_int cur_reg.lnr_line;
|
||||
box_col = Z.to_int cur_reg.lnr_column;
|
||||
box_class_id = block_class_id;
|
||||
})
|
||||
in
|
||||
(n_render_data, n_matcher_data))
|
||||
)
|
||||
(cur_render_data, cur_matcher_data) reg_list)
|
||||
(render_data, matcher_data)
|
||||
dwarf_lines
|
||||
|
@ -81,7 +85,6 @@ 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@."
|
||||
|
@ -89,7 +92,6 @@ let _ =
|
|||
(make_pp Dwarf.pp_evaluated_line_info)
|
||||
line_info ;
|
||||
) elf_handles ;
|
||||
*)
|
||||
|
||||
let map_with_state mapper initial_state lst =
|
||||
List.fold_right (fun elt (cur_state, accu) ->
|
||||
|
|
Loading…
Reference in a new issue