-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Labels
Milestone
Description
High-level objective
- Add initial support of DWARF data Add GDB* support to Numba generated GPU kernels. #26
Fix bugs
- GDB fails on "-O0" generated IR Initialize issues with code-generation NUMBA_OPT value has no impact on generated IR #39, DWARF symbol generation failure at -00 #285 (Possibly related to SPIR-V validation error when running Kmeans kernel #88)
- Current llvm-spirv causes an error due to unsafe address space casting. Removing kernel wrapper function #364, Remove kernel wrapper function #372, Fix/remove addressspace cast #432
- Double function call in Numba #382
Double function call in Numba, wrapper or wrong debug info generation. Blocker for backtrace and local variables.
Debugging features to support
Fulfill gap with Numba functionality
- User must be able to step the code line by line, and also read and write the function arguments and local variables Overwriting function arguments and local variables while gdb debugging #325
- Setting breakpoints with function names DEBUG: Setting breakpoints with function names #326
- Call stack (aka. Backtrace) should be supported, when an offloaded function is calling another (inlined?) function DEBUG: Backtrace support #328
- Setting breakpoints with variable values (e.g. “break if a == 1”) DEBUG: Setting breakpoints with variable values #327
- Core dumping DEBUG: Support core dumping #324
Other features
- DEBUG: improve displaying complex data types #329
Consider improving support of complex data types. With “vanilla” Numba, debugger can only analyse the contents of simple types, such as integers and doubles. But with a numpy array, debugger output starts to be difficult for an average user. For an example, see https://numba.pydata.org/numba-doc/latest/user/troubleshoot.html#running-with-gdb-enabled, in particular how the debugger shows the variable “c” (which is a numpy array). We should aim to show such types as single objects, similar to how we do it with C++ class objects.
Single kernel function, offloaded:
- Set a breakpoint in kernel, using formats
- “break function_name” DEBUG: Setting breakpoints with function names #326
- “break filename:function_name" DEBUG: Setting breakpoints with function names #326
- “break filename:line_number"
- Step through the kernel, line by line (command “next”)
- If a kernel is executed by multiple threads in parallel, see that debugger hits the breakpoint for each thread #483
A kernel function calling another offloaded function:
- Debugger can hit breakpoints in both functions Second off-loaded function not in DWARF #37
- Output of backtrace (command “backtrace”) DEBUG: Backtrace support #328
- Step inside function calls (command “step”) DEBUG: Step inside function calls (command “step”) #352
- List of function names (command “info functions”) DEBUG: info functions #330, Nested function information is missing #478
Variables: #338
- Show list of variables (command “info locals”) Python script variables not in DWARF #36
- See variable types (command “ptype variable”) DEBUG: ptype variable #331
- See variable values (command “print variable”) DEBUG: print variable #332
- Set conditional breakpoints (command “break condition”) DEBUG: Setting breakpoints with variable values #327
- Support
info args
#437 - Access elements of a complex variable type (e.g. access different indexes of a multi-dimensional array) #484
- Overwriting function arguments and local variables while gdb debugging #325
Overwrite the value of a variable (command “print variable = <new_value>”) - Incorrect result of info locals and info args commands when debugging w/ GDB numba/numba#7527
Non-functional requirements
- End-user documentation for each feature Update User Guides about Debugging #380
- Test for each feature Provide test cases for all debugging features #365
Additional
- Better explain when local variable values are available for debugger #525
- Run GDB tests in CI #526
- Extend local variables lifetime for improving debugging #527
- Test debugging for numba-dppy and numba side-by-side #528
- Evaluate GDB debugging with parfor generated kernels #465