Skip to content

Python script variables not in DWARF #36

Closed
@mpuputti

Description

@mpuputti

Using a build with the commit #27.
The build generates a simple DWARF, which is enough to add and hit breakpoints.
But the script variables are missing in DWARF.

How to reproduce:
Set and hit a breakpoint in a kernel, and try to print a local variable.
Below sequence uses the script at https://github.com/IntelPython/numba/blob/pydppl/numba/dppl/examples/sum.py.
Note that the kernel function "data_parallel_sum" at line 13 has arguments 'a', 'b' and 'c', and a local variable 'i'.
That is, when GDB hits a breakpoint at line 13, it should be able to show the values of these variables.

$ export NUMBA_DPPL_DEBUG=1
$ export NUMBA_SAVE_DPPL_IR_FILES=1
$ gdb-oneapi -q --args python sum.py
(gdb) break sum.py:13
(gdb) run
<GDB hits the breakpoint at line 13>
(gdb) print a

Expected result : GDB prints the value of the function argument 'a'.
Detected : GDB prints "No symbol 'a' in current context."

Reading the IGC generated DWARF, we see that variables 'a', 'b', 'c' and 'i' are not in DWARF. And for that reason GDB is not aware of these variables.
Seems that the LLVM IR has some debug data - enough to generate a simple DWARF - but not enough to introduce script variables into DWARF.

Attached:

Blocked by:

Metadata

Metadata

Assignees

Labels

debugRelated to #149

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions