Stepping Into Functions with No Symbols

Introduction

When stepping into functions with no symbols, the MULTI debugger does not step over a statement when using the n or equivalent command. Instead, the debugger continues the program as if the c command were used. The basic steps in the Workaround section below can be used to work around the issue.

The special case of stepping through a program exit, to reach destructors or other post-exit code, is covered in detail in the Assembly Functions in Program Exit section.

Workaround

Use MULTI's Mixed (Interlaced Assembly and Source) display mode using the following steps:

  1. Locate the assembly functions.
  2. Before stepping into an assembly function, switch the debugger to Mixed view.
  3. Step over each assembly statement until you step out to C code.
  4. If the assembly instruction is bl to another assembly function, or bctrl, step INTO statement instead of stepping over.

Assembly Functions in Program Exit

Switch the debugger to Mixed view before running and pressing the A Button, so that the bl and bctrl instructions can be located. Then step into these instructions to prevent the program from running.

Debugging Program Exit

This example uses the SDK demo that can be built and installed at system/obj/ghs/cafe/demo/helloworld/DEBUG. When helloworld exits, it returns to _start, which then calls exit routine _Exit. These system functions in turn call assembly functions whose symbols are not available. To step over them, follow these steps:

  1. Set breakpoints where there are calls to assembly functions:
    • _start function, last line, return ret;
    • _Exit function, the line that calls __PPCExit(code);
  2. Run the program.
  3. Press the A Button on the Classic Controller to exit program.
  4. The program stops in the _start function at return ret;.
  5. Change the debugger to Mixed view, and then step over each assembly instruction.
  6. When stepping reaches C code, switch back to Source view if desired. Run or step to the next breakpoint in the _Exit function.
  7. At _PPCExit(code);, step INTO the __PPCExit function.
  8. Switch to Mixed view, and then step over each assembly instruction until you reach bctrl.
  9. Step INTO the bctrl instruction into the _OSDriver_OnDone function.

Paths to Program Exit

Before returning from main there are three possible exist paths:

Lock Other Threads on Single Step

Stepping only runs the current thread by default. For code that depends on other threads running, set MULTI to allow all threads to continue on a step.

MULTI → Debug → Target Settings → Lock Other Threads on Single Step

Revision History

2013/05/08 Automated cleanup pass.
2012/11/28 Initial version.


CONFIDENTIAL