ocaml/debugger/symbols.mli

72 lines
2.8 KiB
OCaml
Raw Permalink Normal View History

(**************************************************************************)
(* *)
(* OCaml *)
(* *)
(* Jerome Vouillon, projet Cristal, INRIA Rocquencourt *)
(* OCaml port by John Malecki and Xavier Leroy *)
(* *)
(* Copyright 1996 Institut National de Recherche en Informatique et *)
(* en Automatique. *)
(* *)
(* All rights reserved. This file is distributed under the terms of *)
(* the GNU Lesser General Public License version 2.1, with the *)
(* special exception on linking described in the file LICENSE. *)
(* *)
(**************************************************************************)
open Events
(* Modules used by the program. *)
val modules : string list ref
PR#6270: remove need for -I directives to ocamldebug in common case (patch by Josh Watzman) Add absolute directory names to bytecode format for ocamldebug to use The need for a long list of -I directives makes interactively using ocamldebug a pain in the butt. Many folks have solved this with various `find` invocations or even Python wrappers, but those lead to other problems when it might include files you weren't expecting (or miss things you were). But all of this is really annoying since the tooling should be able to figure out itself, even heuristically, where your source files are -- gdb gets this right, why can't we? This patch implements one of the more important heuristics from gdb: you typically debug on the same machine you built on, so looking for the source files and built artifacts in the absolute paths where they were during compilation is a good first try. We write out absolute paths into a new structure at the beginning of the debug section and then automatically append those directories into the load path. This means mean that if you happen to be debugging on a machine where the original source and build artifacts are *not* available in their original absolute locations, things will work as before, using the standard load path mechanism. You can also explicitly use -I to prepend directories to the load path and override the defaults located by this new mechanism. I personally find this makes using ocamldebug much more pleasant :) git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14533 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-06 08:06:22 -07:00
(* Absolute directories containing source code on machine where source was
* compiled *)
val program_source_dirs : string list ref
(* Clear loaded symbols *)
val clear_symbols : unit -> unit
(* Read debugging info from executable or dynlinkable file
and associate with given code fragment *)
val read_symbols : int -> string -> unit
(* Add debugging info from memory and associate with given
code fragment *)
val add_symbols : int -> Instruct.debug_event list list -> unit
(* Erase debugging info associated with given code fragment *)
val erase_symbols : int -> unit
(* Return the list of all code fragments that have debug info associated *)
val code_fragments : unit -> int list
(* Flip "event" bit on all instructions in given fragment *)
val set_all_events : int -> unit
(* Return event at given PC, or raise Not_found *)
(* Can also return pseudo-event at beginning of functions *)
val any_event_at_pc : Debugcom.pc -> code_event
(* Return event at given PC, or raise Not_found *)
val event_at_pc : Debugcom.pc -> code_event
(* Set event at given PC *)
val set_event_at_pc : Debugcom.pc -> unit
(* List the events in `module'. *)
val events_in_module : string -> int * Instruct.debug_event list
(* List the modules in given code fragment. *)
val modules_in_code_fragment : int -> string list
(* First event after the given position. *)
(* --- Raise `Not_found' if no such event. *)
val event_at_pos : string -> int -> code_event
(* Closest event from given position. *)
(* --- Raise `Not_found' if no such event. *)
val event_near_pos : string -> int -> code_event
(* Recompute the current event *)
val update_current_event : unit -> unit