Info commands

The info functions command displays the list of functions in the debugged program.

Syntax

info functions
info functions [Regex]

Note

Running the info functions command without arguments may produce a lot of output as the list of all functions in all loaded shared libraries is typically very long.

Parameters

Regex

If the regex is specified, the info functions command lists the functions matching the regex. If omitted, the command lists all functions in all loaded modules (main program and shared libraries).

Consider Numba-dppy kernel code. See the source file numba_dppy/examples/debug/simple_sum.py:

15import dpctl
16import numpy as np
17
18import numba_dppy as dppy
19
20
21@dppy.kernel(debug=True)
22def data_parallel_sum(a, b, c):
23    i = dppy.get_global_id(0)
24    c[i] = a[i] + b[i]
25
26
27global_size = 10
28N = global_size
29
30a = np.array(np.random.random(N), dtype=np.float32)
31b = np.array(np.random.random(N), dtype=np.float32)
32c = np.ones_like(a)
33
34device = dpctl.SyclDevice("opencl:gpu")
35with dppy.offload_to_sycl_device(device):
36    data_parallel_sum[global_size, dppy.DEFAULT_LOCAL_SIZE](a, b, c)
37
38print("Done...")

Run the debugger and use the info functions command. The output is as follows:

$ NUMBA_OPT=0 gdb-oneapi -q python
(gdb) set breakpoint pending on
(gdb) break simple_sum.py:22
(gdb) run simple_sum.py
(gdb) info functions data_parallel_sum
...
All functions matching regular expression "data_parallel_sum":
File simple_sum.py:
20:         void __main__::data_parallel_sum(DPPYArray<float, 1, C, mutable, aligned>, DPPYArray<float, 1, C, mutable, aligned>, DPPYArray<float, 1, C, mutable, aligned>);
(gdb) continue
(gdb) info functions __main__
...
All functions matching regular expression "__main__":
20:         void __main__::data_parallel_sum(DPPYArray<float, 1, C, mutable, aligned>, DPPYArray<float, 1, C, mutable, aligned>, DPPYArray<float, 1, C, mutable, aligned>);
(gdb) continue
...
Done...

See also: