Add prog path in render data
This commit is contained in:
parent
caac87e70a
commit
e918374675
4 changed files with 25 additions and 9 deletions
|
@ -86,8 +86,8 @@ let _ =
|
||||||
line_info ;
|
line_info ;
|
||||||
) elf_handles ;
|
) elf_handles ;
|
||||||
|
|
||||||
let multi_render_data = List.map (fun (ElfHandle(_, _, static_info, asm)) ->
|
let multi_render_data = List.map (fun (ElfHandle(path, _, static_info, asm)) ->
|
||||||
let render_data = Renderer.init_render_data asm in
|
let render_data = Renderer.init_render_data asm path in
|
||||||
let line_info = static_info.ds_evaluated_line_info in
|
let line_info = static_info.ds_evaluated_line_info in
|
||||||
let boxed_render_data = add_line_boxes render_data line_info in
|
let boxed_render_data = add_line_boxes render_data line_info in
|
||||||
boxed_render_data
|
boxed_render_data
|
||||||
|
|
|
@ -39,13 +39,20 @@ let render_prog_box annotated_prog = Jingoo.Jg_types.(Renderer.AnnotAsm.(
|
||||||
|> box_list
|
|> box_list
|
||||||
))
|
))
|
||||||
|
|
||||||
let render_progs_box annotated_progs =
|
let render_progs_box annotated_progs = Jingoo.Jg_types.(
|
||||||
List.map render_prog_box annotated_progs
|
List.map (fun (prog_path, annotated_prog) ->
|
||||||
|> Jingoo.Jg_types.box_list
|
[
|
||||||
|
("path", box_string prog_path);
|
||||||
|
("prog", render_prog_box annotated_prog)
|
||||||
|
] |> box_obj)
|
||||||
|
annotated_progs
|
||||||
|
|> box_list
|
||||||
|
)
|
||||||
|
|
||||||
(** [render multi_render_data] renders the given [render_data] to a string. *)
|
(** [render multi_render_data] renders the given [render_data] to a string. *)
|
||||||
let render multi_render_data = Jingoo.(
|
let render multi_render_data = Jingoo.(
|
||||||
let annotated_progs = List.map (fun render_data ->
|
let annotated_progs = List.map (fun render_data ->
|
||||||
|
render_data.Renderer.render_prog_path,
|
||||||
Renderer.render_data_to_annotated_asm render_data) multi_render_data in
|
Renderer.render_data_to_annotated_asm render_data) multi_render_data in
|
||||||
let models = [
|
let models = [
|
||||||
("progs", render_progs_box annotated_progs);
|
("progs", render_progs_box annotated_progs);
|
||||||
|
|
|
@ -20,6 +20,11 @@
|
||||||
border: 1px solid #9584ff;
|
border: 1px solid #9584ff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.progpath {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 1.3em;
|
||||||
|
}
|
||||||
|
|
||||||
.subroutine {
|
.subroutine {
|
||||||
margin: 20px 0;
|
margin: 20px 0;
|
||||||
}
|
}
|
||||||
|
@ -48,9 +53,10 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="prog_container">
|
<div class="prog_container">
|
||||||
{% for subroutines in progs %}
|
{% for prog in progs %}
|
||||||
<div class="prog">
|
<div class="prog">
|
||||||
{% for subroutine in subroutines %}
|
<h2 class="progpath">{{ prog.path }}</h2>
|
||||||
|
{% for subroutine in prog.prog %}
|
||||||
<div class="subroutine">
|
<div class="subroutine">
|
||||||
<div class="sub_headline">
|
<div class="sub_headline">
|
||||||
<span class="addr">{{ subroutine.sub_addr }}</span>
|
<span class="addr">{{ subroutine.sub_addr }}</span>
|
||||||
|
|
|
@ -17,6 +17,7 @@ type tag_addr_range_t = TaggedRange of addr_range_tag_t * addr_range_t *
|
||||||
box_data_t
|
box_data_t
|
||||||
|
|
||||||
type render_data_t = {
|
type render_data_t = {
|
||||||
|
render_prog_path : string ;
|
||||||
render_prog : RawAsm.asm_info_t ;
|
render_prog : RawAsm.asm_info_t ;
|
||||||
render_boxes : tag_addr_range_t list ;
|
render_boxes : tag_addr_range_t list ;
|
||||||
render_prev_address : RawAsm.addr_t RawAsm.AddrMap.t
|
render_prev_address : RawAsm.addr_t RawAsm.AddrMap.t
|
||||||
|
@ -51,8 +52,10 @@ let make_prev_address prog =
|
||||||
addr_map
|
addr_map
|
||||||
|
|
||||||
(** Initializes a rendering data structure on the given program *)
|
(** Initializes a rendering data structure on the given program *)
|
||||||
let init_render_data prog =
|
let init_render_data prog path =
|
||||||
{ render_prog = prog ;
|
{
|
||||||
|
render_prog_path = path ;
|
||||||
|
render_prog = prog ;
|
||||||
render_boxes = [] ;
|
render_boxes = [] ;
|
||||||
render_prev_address = make_prev_address prog ;
|
render_prev_address = make_prev_address prog ;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue