Created attachment 1271 [details]
When entering a function which is marked to debug, the srcref of the function body is printed to the console but global variable R_Srcref is not updated. R_Srcref should be updated too, so that other code like GUIs can access and show the current source position as well.
The relevant code is in applyClosure and R_execClosure in eval.c; a patch is attached.
Please check out r58367 or later of R-devel to confirm that this gives you the information you need.
Yes, it works. Thanks.