Add the vpiFile and vpiLineNo properties to system functions. Most other objects have stubs that return "N/A"/0. Interactive functions (called from the debugger) use <interactive> for the file name.