Skip to main content

Why do I get a "PRACTICE Stack Overflow" error when using Break.Set <address> /CMD "DO script.cmm" /RESUME? - Knowledgebase / PRACTICE - Lauterbach Support

Why do I get a "PRACTICE Stack Overflow" error when using Break.Set <address> /CMD "DO script.cmm" /RESUME?

Authors list

This error typically occurs when the breakpoint is hit repeatedly in a short period of time.

When the breakpoint is reached, the /CMD option executes the specified command. If /RESUME is also used, TRACE32 immediately resumes target execution without waiting for the PRACTICE script to finish.

As a result, the same breakpoint may be hit again while the previous instance of script.cmm is still running. Each breakpoint hit starts another instance of the script. If enough script instances accumulate, the maximum PRACTICE stack depth is exceeded and TRACE32 reports: “PRACTICE Stack Overflow”

Possible solutions

1. Remove /RESUME (recommended)

Configure the breakpoint as follows:

Break.Set <address> /CMD "DO script.cmm"

and place a Go command at the end of script.cmm:

Go

This ensures that target execution resumes only after the script has completed, preventing multiple concurrent executions in most cases.

2. Avoid DO if only a few commands are required

If the action consists of only one or two PRACTICE commands, execute them directly with /CMD instead of calling a separate script. This eliminates the overhead of starting a new PRACTICE script on every breakpoint hit.

For example:

Break.Set <address> /CMD "Data.Set %LONG 0x1000 0x12345678" /RESUME

3. Use JUMPTO instead of DO

If the code is already part of a running PRACTICE script, use JUMPTO to branch to a label instead of starting a new script instance.

For example:

Break.Set <address> /CMD "JUMPTO do_it"

...

do_it:
    ; commands
    Go

JUMPTO transfers control within the existing PRACTICE script and therefore does not create additional nested script executions.

Helpful Unhelpful

1 of 1 people found this page helpful

Add a comment

ID-0
To prove you are a human, please tell us the text you see in the CAPTCHA image