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

Verify that debuggers are reset after TDML tests are run #1131

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

stevedlawrence
Copy link
Member

Current behavior in Daffodil is to automatically disable debugging after a call to runOneTest, which helps to avoid errors where enabling debugging in one test might cause failures in another test.

This updates a test to use the latest TDML API and confirm that this behavior actually happens. Note that the schema that originally found the issue with long-lived debugger state is no longer valid in Daffodil, so it needed some tweaks. This also simplifies the custom debugger to avoid storing strings that are never needed.

DAFFODIL-790

Copy link
Contributor

@mbeckerle mbeckerle left a comment

Choose a reason for hiding this comment

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

+1

I found a typo in a comment.


class CustomTraceRunner extends TraceRunner {
private var _lines = List.empty[String]
// reset the numeLines counter to 0
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo numeLines

Copy link
Contributor

@tuxji tuxji left a comment

Choose a reason for hiding this comment

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

+1

I'm not familiar with this approach to debugging Daffodil. Do I understand that the InteractiveDebugger class here does not mean that you interact with a live interactive debugger command line, rather, it lets you supply a callback "listener" class which can trace parts of Daffodil execution and print or accumulate data to help you debug a problem?

@stevedlawrence
Copy link
Member Author

Do I understand that the InteractiveDebugger class here does not mean that you interact with a live interactive debugger command line, rather, it lets you supply a callback "listener" class which can trace parts of Daffodil execution and print or accumulate data to help you debug a problem?

Yep. There's a number of commands that the interactive debugger understands (e.g. "break", "step", "continue", "eval"). The "listener" or "debugger runner" is what provides the commands to run and receives the results to display. The name "interactive" is probably not the best since it really doesn't need to have user interaction at all (e.g the TraceDebuggerRunner just uses a list of predetermined commands). But I think it originally did require user input, but was eventually generalized and the name stuck.

Current behavior in Daffodil is to automatically disable debugging after
a call to runOneTest, which helps to avoid errors where enabling
debugging in one test might cause failures in another test.

This updates a test to use the latest TDML API and confirm that this
behavior actually happens. Note that the schema that originally found
the issue with long-lived debugger state is no longer valid in Daffodil,
so it needed some tweaks. This also simplifies the custom debugger to
avoid storing strings that are never needed.

DAFFODIL-790
@stevedlawrence stevedlawrence force-pushed the daffodil-790-tdml-debug branch from 6196aab to 8b553ae Compare December 14, 2023 18:36
@stevedlawrence stevedlawrence merged commit f41f06a into apache:main Dec 14, 2023
9 checks passed
@stevedlawrence stevedlawrence deleted the daffodil-790-tdml-debug branch December 14, 2023 18:37
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.

3 participants