2.7 Source Locations

C Type: gcc_jit_location

A gcc_jit_location encapsulates a source code location, so that you can (optionally) associate locations in your language with statements in the JIT-compiled code, allowing the debugger to single-step through your language.

gcc_jit_location instances are optional: you can always pass NULL to any API entrypoint accepting one.

You can construct them using gcc_jit_context_new_location().

You need to enable GCC_JIT_BOOL_OPTION_DEBUGINFO on the gcc_jit_context for these locations to actually be usable by the debugger:

gcc_jit_context_set_bool_option (
  ctxt,
  GCC_JIT_BOOL_OPTION_DEBUGINFO,
  1);
C Function: gcc_jit_location * gcc_jit_context_new_location (gcc_jit_context *ctxt, const char *filename, int line, int column)

Create a gcc_jit_location instance representing the given source location.

The parameter filename must be non-NULL. The call takes a copy of the underlying string, so it is valid to pass in a pointer to an on-stack buffer.