Bug 14818 - R_Srcref not updated when entering function
Summary: R_Srcref not updated when entering function
Alias: None
Product: R
Classification: Unclassified
Component: Misc (show other bugs)
Version: R 2.14.1 patched
Hardware: All All
: P5 normal
Assignee: R-core
Depends on:
Reported: 2012-02-16 13:42 UTC by Stephan Wahlbrink
Modified: 2015-12-14 13:45 UTC (History)
1 user (show)

See Also:

Patch (1.69 KB, application/octet-stream)
2012-02-16 13:42 UTC, Stephan Wahlbrink

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Wahlbrink 2012-02-16 13:42:21 UTC
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.
Comment 1 Duncan Murdoch 2012-02-16 16:58:05 UTC
Please check out r58367 or later of R-devel to confirm that this gives you the information you need.
Comment 2 Stephan Wahlbrink 2012-02-17 17:16:31 UTC
Yes, it works. Thanks.