Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention debugonce()? #51

Open
jennybc opened this issue Feb 26, 2019 · 8 comments
Open

Mention debugonce()? #51

jennybc opened this issue Feb 26, 2019 · 8 comments
Labels
debugging debugging R code

Comments

@jennybc
Copy link
Member

jennybc commented Feb 26, 2019

Maybe in the debug() section here:

https://whattheyforgot.org/debugging-r-code.html#debugging-others-code

@jimhester
Copy link
Collaborator

I have literally never used this myself (barely ever used debug() either for that matter), but sure ;)

@jennybc
Copy link
Member Author

jennybc commented Feb 26, 2019

Hmmm, I have been using debugonce() lately 🤔. Context: debugging things in another package . For example, I used it when figuring out that devtools / remotes problem. I wanted to call devtools but drop into the debugger when I entered remotes:::combine_deps().

And I think I used when I was doing revdep checks (and PRs) for tibble v2.x. Once you figure out who's screaming, you do debugonce() on that, then rerun the test.

@jennybc
Copy link
Member Author

jennybc commented Feb 26, 2019

What would your workflow be in those situations?

@jimhester
Copy link
Collaborator

Generally when I am that far into the weeds debugging something I am planning on fixing it and sending a PR, so generally I do the standard clone + load_all() + browser() thing.

But I can see how it would be useful and we probably should mention it.

@jennybc
Copy link
Member Author

jennybc commented Feb 26, 2019

It's true that I was in the the source package at that point. So I think I did eventually use browser().

@jimhester
Copy link
Collaborator

Thinking about this more I guess I typically use options(error = recover) when there is something in another package where you could potentially use debugonce()

@jennybc
Copy link
Member Author

jennybc commented Feb 27, 2019

I think an interesting axis on which to compare all of these is how ephemeral they are, i.e. what it feels like to turn the debugging approach ON and OFF. I suspect that influences what we are choosing in different situations.

@jennybc
Copy link
Member Author

jennybc commented Feb 27, 2019

And also the affordances in our preferred working environment, e.g. RStudio vs. emacs/vim, whether you have the source package yet or not, etc.

@edavidaja edavidaja added the debugging debugging R code label Jun 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debugging debugging R code
Projects
None yet
Development

No branches or pull requests

3 participants