ROCm / ROCgdb

This is ROCgdb, the ROCm source-level debugger for Linux, based on GDB, the GNU source-level debugger.
https://rocm.docs.amd.com/projects/ROCgdb/en/latest/
GNU General Public License v2.0
50 stars 9 forks source link

Cannot set breakpoint for specific thread #26

Closed hgtsoi closed 1 month ago

hgtsoi commented 8 months ago

ROCm 5.7 Ubuntu20.04

ROCgdb seems cannot set kernel function as breakpoint for a specific thread, e,g.

b   kernel_foo    thread 4

kernel_foo really got called in app binary as I can set breakpoint for kernel_foo without thread filter, and it did hit.

So set breakpoint for a specific wave is not supported yet?

lancesix commented 4 months ago

Hi @hgtsoi,

The b .. thread construct requires that the thread exists at the moment you use the command. This cannot be used for a thread that will (maybe) exist in the future.

What you could do is:

b kernel_foo if $_thread == 4

This will have a condition associated with the breakpoint which is evaluated when the breakpoint is hit instead of when creating the breakpoint.

[Note that there is no guarantee regarding what will be the thread number assigned by GDB to a particular wave in your application.]