summaryrefslogtreecommitdiff
path: root/debugger
diff options
context:
space:
mode:
Diffstat (limited to 'debugger')
-rw-r--r--debugger/symbols.ml20
1 files changed, 11 insertions, 9 deletions
diff --git a/debugger/symbols.ml b/debugger/symbols.ml
index 8ed9b9db76..36f8f874eb 100644
--- a/debugger/symbols.ml
+++ b/debugger/symbols.ml
@@ -56,16 +56,18 @@ let relocate_event orig ev =
let read_symbols' bytecode_file =
let ic = open_in_bin bytecode_file in
- begin try
- Bytesections.read_toc ic;
- ignore(Bytesections.seek_section ic "SYMB");
- with Bytesections.Bad_magic_number | Not_found ->
- prerr_string bytecode_file; prerr_endline " is not a bytecode file.";
- raise Toplevel
- end;
+ let toc =
+ try
+ let toc = Bytesections.read_toc ic in
+ ignore(Bytesections.seek_section toc ic Bytesections.Name.SYMB);
+ toc
+ with Bytesections.Bad_magic_number | Not_found ->
+ prerr_string bytecode_file; prerr_endline " is not a bytecode file.";
+ raise Toplevel
+ in
Symtable.restore_state (input_value ic);
begin try
- ignore (Bytesections.seek_section ic "DBUG")
+ ignore (Bytesections.seek_section toc ic Bytesections.Name.DBUG)
with Not_found ->
prerr_string bytecode_file; prerr_endline " has no debugging info.";
raise Toplevel
@@ -84,7 +86,7 @@ let read_symbols' bytecode_file =
List.fold_left (fun s e -> String.Set.add e s) !dirs (input_value ic)
done;
begin try
- ignore (Bytesections.seek_section ic "CODE")
+ ignore (Bytesections.seek_section toc ic Bytesections.Name.CODE)
with Not_found ->
(* The file contains only debugging info,
loading mode is forced to "manual" *)