[Lldb-commits] [lldb] [lldb-dap] Fix source references (PR #144364)

Ebuka Ezike via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 17 10:08:41 PDT 2025


da-viper wrote:

> I looked at the code some more and it seems like we return the address of the symbol if there is one, and only use the actual address (i.e. the pc) when there is none. I was trying to find the code that computes the line in that case (i.e. `pc - symbol`) and I couldn't immediately find it.

we use the address to create a source reference. 
https://github.com/llvm/llvm-project/blob/8b79cd751c70d3e8aec78df0cc39e9779493adf1/lldb/tools/lldb-dap/DAP.cpp#L513-L530

> I think this PR is fine in the sense that it improves the status quo, but we probably want to take a more wholistic approach at this problem at some point. For example, if we don't have a symbol, it would be nice to have a source reference for a given range (say the next 64 or 128 instructions) and then as we step keep using that sourceReference but bump the "relative line number" in that artificial source file.
Yeah makes more sense,



https://github.com/llvm/llvm-project/pull/144364


More information about the lldb-commits mailing list