.Q.prf0 pid

Where pid is a process ID, returns a table representing a snapshot of the call stack at the time of the call in another kdb+ process pid, with columns

name   assigned name of the function
file   path to the file containing the definition
line   line number of the definition
col    column offset of the definition, 0-based
text   function definition or source string
pos    execution position (caret) within text

This process must be started from the same binary as the one running .Q.prf0, otherwise binary mismatch is signalled.