Skip to content

check callflag when comparing contexts - #14360

Merged
kevinushey merged 36 commits into
mainfrom
bugfix/debugger-context-comparison-fixup
Mar 4, 2024
Merged

kevinushey merged 36 commits into
mainfrom
bugfix/debugger-context-comparison-fixup

Conversation

@kevinushey

@kevinushey kevinushey commented Mar 2, 2024 •

Copy link
Copy Markdown
Collaborator

Intent

Addresses #10664, which appears to have regressed.
Addresses #14306.
Addresses #14276.

QA note: it's possible that this issue may only occur with the latest release of R; perhaps older versions of R are fine?

Approach

Similar to the last fix, tighten up the checks on whether two contexts can be considered equal.

Automated Tests

N/A

QA Notes

This PR adds a number of files for manual testing of the debugger, located in the RStudio repository at src/cpp/tests/debugger. The intention here is that these files can be opened in RStudio, and one can follow the instructions in each file to test various debug cases.

Documentation

N/A

Checklist

  • If this PR adds a new feature, or fixes a bug in a previously released version, it includes an entry in NEWS.md
  • If this PR adds or changes UI, the updated UI meets accessibility standards
  • A reviewer is assigned to this PR (if unsure who to assign, check Area Owners list)
  • This PR passes all local unit tests

@kevinushey
kevinushey marked this pull request as draft March 3, 2024 03:10
@kevinushey
kevinushey requested a review from gtritchie March 3, 2024 19:01
@kevinushey
kevinushey marked this pull request as ready for review March 3, 2024 19:01
Comment on lines +189 to +194
# Bytes (elements 2, 4) and columns (elements 5, 6) may be different due to
# multibyte characters. If only four values are given, the columns and bytes
# are assumed to match. Lines (elements 1, 3) and parsed lines (elements 7,
# 8) may differ if a #line directive is used in code: the former will respect
# the directive, the latter will just count lines. If only 4 or 6 elements
# are given, the parsed lines will be assumed to match the lines.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's just me, but I found this documentation to be nigh-on indecipherable...

Comment on lines -2636 to -2645
tryExternalCodeBrowser(event.getFunction(), event, new Command()
{
@Override
public void execute()
{
final String path = CodeBrowserEditingTarget.getCodeBrowserPath(
event.getFunction());
columnManager_.closeTabWithPath(path, false);
}
});

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this code wasn't working before, but we now write in relevant "close on debugger exited" handlers elsewhere.

@@ -81,14 +81,18 @@ class RCntxt: public RCntxtInterface
// NOTE: 'srcref()' attribute may be set to <in-bc-interp>
// symbol for contexts associated with bytecode evaluation!
bool isNull() const;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reordered to match the order defined in the R sources. Not strictly necessary, but makes cross-referencing a bit easier.

{
public:
// accessors for RCNTXT entries
virtual SEXP callfun() const = 0;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

@gtritchie gtritchie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants