Table Of Contents

Previous topic

Function pointers

Next topic

Compiling a context

This Page

Source Locations

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.

Faking it

If you don’t have source code for your internal representation, but need to debug, you can generate a C-like representation of the functions in your context using :c:func:`gcc_jit_context_dump_to_file()`:

gcc_jit_context_dump_to_file (ctxt, "/tmp/something.c",
                              1 /* update_locations */);

This will dump C-like code to the given path. If the update_locations argument is true, this will also set up gcc_jit_location information throughout the context, pointing at the dump file as if it were a source file, giving you something you can step through in the debugger.