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 ->
|
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
|
||||||
Format.eprintf "Add box %x -- %x@." box_start box_end ;
|
(match box_start = box_end with
|
||||||
let n_matcher_data, block_class_id =
|
| true -> cur_render_data, cur_matcher_data
|
||||||
Asm_matcher.add_block cur_matcher_data cur_reg in
|
| false ->
|
||||||
let n_render_data, _ = Renderer.add_box_excl
|
Format.eprintf "Add box %x -- %x@." box_start box_end ;
|
||||||
cur_render_data (box_start, box_end)
|
let n_matcher_data, block_class_id =
|
||||||
Renderer.(Some {
|
Asm_matcher.add_block cur_matcher_data cur_reg in
|
||||||
box_file = Z.to_int cur_reg.lnr_file;
|
let n_render_data, _ = Renderer.add_box_excl
|
||||||
box_line = Z.to_int cur_reg.lnr_line;
|
cur_render_data (box_start, box_end)
|
||||||
box_col = Z.to_int cur_reg.lnr_column;
|
Renderer.(Some {
|
||||||
box_class_id = block_class_id;
|
box_file = Z.to_int cur_reg.lnr_file;
|
||||||
})
|
box_line = Z.to_int cur_reg.lnr_line;
|
||||||
in
|
box_col = Z.to_int cur_reg.lnr_column;
|
||||||
(n_render_data, n_matcher_data))
|
box_class_id = block_class_id;
|
||||||
|
})
|
||||||
|
in
|
||||||
|
(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