Debugging Features in Numba 0.55#

Numba 0.55 enables following features:

Added info args#

See info args. In previous versions info args always returns No arguments..

Extended info locals#

See info locals.

Breakpoint with condition by function argument#

Test numba_dpex/tests/debugging/

When set breakpoint on the function or the first line of the function than info locals and info args provide correct values. It makes it posible to use breakpoint with condition by function argument.


Source code numba_dpex/examples/debug/

14def common_loop_body(param_a, param_b):
15    param_c = param_a + numba.float32(10)  # Set breakpoint here
16    param_d = param_b * numba.float32(0.5)
17    result = param_c + param_d
18    return result

Set breakpoint with condition by function argument:

$ NUMBA_OPT=0 gdb-oneapi -q python
(gdb) break if param_a == 3
(gdb) run numba_dpex/examples/debug/ --api=numba-dpex-kernel
Thread 2.1 hit Breakpoint 1, with SIMD lane 3, __main__::common_loop_body (param_a=3, param_b=3) at
25          param_c = param_a + 10  # Set breakpoint here
(gdb) print param_a
$1 = 3


See Local Variables Lifetime in Numba IR.


See Example 2 - Using NUMBA_DUMP_ANNOTATION.

Displaying Complex Data Types#

Numba 0.55 improves displaying of complex data types like arrays. It makes it possible to access data in arrays. It is possible to get array values by commands like :samp:x/10f and :samp:print[5].

See print expr and whatis [arg] and ptype [arg]