![]() ![]() This state information includes variable values, register contents, and data stored in memory.The three basic commands are where, print and info, and Table 4.2 below lists them and a few of their variations. Once the application halts, the next step is to examine the processor's state. Table 4.1 below lists these commands and a number of different usages.įor example, break main halts the application as the main function starts and break 20 halts the application as it reaches line 20.The command watch x halts the application when x changes value, and rwatch x halts the application when x is read.The break command can be shortened to b and watch can be shortened to w. Watchpoints are created with watch, and halt the application when a specific condition occurs. Breakpoints are created with the break command, and halt the application when a location in code (line number, function name, instruction address) is reached. This discussion divides them into three categories: commands that set breakpoints and watchpoints, commands that read processor information, and commands that control the execution of the application.īefore you can analyze the conditions that cause a bug, you need to halt the application at the right place. ![]() To effectively use spu-gdb from the command line, you need to understand its basic instructions. Enter run to complete the application's execution.ħ. Repeat previous steps until the bug is discovered. Use the step, next, or continue commands to execute succeeding lines.Ħ. When the application halts, use commands such as info to examine the state of the processor.ĥ. Enter run.This executes the application until the breakpoint location is reached or the watchpoint condition becomes valid.Ĥ. At the (gdb) prompt, use break to create a breakpoint or watch to create a watchpoint.ģ. Enter spu-gdb followed by the name of the executable.This starts the debugger.Ģ. A typical spu-gdb session consists of seven main stages:ġ. If you try to debug an optimized application, its breakpoints and watchpoints won't work correctly. Second, the SPU architecture is simpler than the PPU's, so it's easier to analyze its registers and memory.Third, SPUs perform the brunt of the Cell's number crunching, so it's very important to get your SPU applications working properly.Ī PPU or SPU application can be debugged only if it was compiled with -g and without optimization.The -g option inserts debug information into the executable and makes sure that each line can be executed separately. First, its commands are essentially the same as those used by ppu-gdb. This section concentrates on spu-gdb for three reasons. If you're already familiar with these commands, you might want to read Part 4 in this series, which describes the Full-System Simulator. ppu-gdb debugs applications built for the PPU and spu-gdb debugs applications built for the SPU.īoth use the same commands, which are the same commands used by gdb. Just as gcc is the preeminent open source tool for building applications, gdb is the preeminent tool for debugging them.The Cell SDK provides two debuggers, both based on gdb. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |