Skip to content

Commit

Permalink
Make pointers_to_other_sections an optional argument
Browse files Browse the repository at this point in the history
  • Loading branch information
let-def committed May 18, 2023
1 parent 2e2d553 commit 518cdbd
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/decodedline_elf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let () =
| None -> ()
| Some section ->
let pointers_to_other_sections =
Some (Owee_elf.debug_line_pointers buffer sections)
Owee_elf.debug_line_pointers buffer sections
and body =
Owee_buf.cursor (Owee_elf.section_body buffer section)
in
Expand Down
2 changes: 1 addition & 1 deletion examples/decodedline_macho.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ let debug_section segment = function
as section ->
let body = Owee_buf.cursor (Owee_macho.section_body buffer segment section) in
let rec aux () =
match Owee_debug_line.read_chunk body ~pointers_to_other_sections:None with
match Owee_debug_line.read_chunk body ?pointers_to_other_sections:None with
| None -> ()
| Some (header, chunk) ->
let check header state () =
Expand Down
2 changes: 1 addition & 1 deletion src/owee_debug_line.ml
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ let read_header t ~pointers_to_other_sections =
in
(header, chunk)

let read_chunk t ~pointers_to_other_sections =
let read_chunk ?pointers_to_other_sections t =
if at_end t
then None
else Some (read_header t ~pointers_to_other_sections)
Expand Down
4 changes: 2 additions & 2 deletions src/owee_debug_line.mli
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ type pointers_to_other_sections = {
pointers to strings in entirely separate sections of DWARF. You can use
{! Owee_elf.debug_line_pointers} to construct such a value. *)
val read_chunk
: cursor
-> pointers_to_other_sections:pointers_to_other_sections option
: ?pointers_to_other_sections:pointers_to_other_sections
-> cursor
-> (header * cursor) option

(** State of the linenumber automaton.
Expand Down
2 changes: 1 addition & 1 deletion src/owee_location.ml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ let extract_debug_info buffer =
(*Printf.eprintf "Looking for 0x%X\n" t;*)
let body = Owee_elf.section_body buffer section in
let pointers_to_other_sections =
Some (Owee_elf.debug_line_pointers buffer sections) in
Owee_elf.debug_line_pointers buffer sections in
let count = count_rows body ~pointers_to_other_sections in
let debug_entries = Array.make count
{addr_lo = max_int; addr_hi = max_int; payload = None} in
Expand Down

0 comments on commit 518cdbd

Please sign in to comment.