10-52
EPSOn
S5U1C17001C ManUal
(C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
10 DEBUggEr
10.6.6 Break functions
The target program being executed is made to break by one of the following causes:
•
Break conditions set by a break setup command are met.
•
A forcible break is applied (by clicking the [Stop] button).
•
An illegal attempt is made to access memory, etc.
Command-actuated breaks
The debugger
gdb
supports the following two types of breaks for which break conditions can be set by a
command:
1. Software PC break
2. Hardware PC break
In all cases, the program being executed is made to break when break conditions are met.
Software PC breaks (
break
and
tbreak
commands)
This type of break occurs when the executed PC address matches the address set by a command. The program
is actually made to break before executing the instruction at that address. Breakpoints can be set at up to 200
address locations.
There are two types of software PC breaks: normal and temporary. Both are the same in terms of functionality.
The only difference is that a normal software PC breakpoint remains effective until being cleared by a command,
regardless of how many times the program is made to break (a hit). Conversely, a temporary software PC
breakpoint is cleared after one break hit.
break
command: This command sets a normal software PC breakpoint.
Example: To set a software PC breakpoint at address 0xc0001c
(gdb)
break
*0xc0001c
Breakpoint 1 at 0xc0001c: file main.c, line 7.
tbreak
command: This command sets a temporary software PC breakpoint.
Example: To set a temporary software PC breakpoint at address 0xc0001e
(gdb)
tbreak
*0xc0001e
Breakpoint 2 at 0xc0001e: file main.c, line 10.
When a software PC break occurs, the debugger waits for command input after displaying the following message:
(gdb) continue
Continuing.
Breakpoint 1, main () at main.c:7
Breakpoints can be set by specifying a source line number or function/label name, as well as by directly
specifying addresses. Specifying a source line number sets a breakpoint at the address of the first assembler
instruction to be executed among those for which the specified line is expanded. Specifying a line that is not
expanded to such assembler instructions, such as a variable declaration that does not involve initialization, a
breakpoint will be set at the line that contains the first instruction to be executed next.
Example: To set a software PC breakpoint at line 7 in
main.c
(gdb)
break
main.c:7
Breakpoint 1 at 0xc0001c: file main.c, line 7.
Specifying a function name sets a breakpoint at the source line that contains the first instruction to be executed
in the function. No breakpoints are set at lines consisting only of variable declarations.
Example: To set a software PC breakpoint in function
main
(gdb)
break
main
Breakpoint 1 at 0xc0001c: file main.c, line 7.
Although the
ld
instruction to save registers is added at the beginning of a function when compiling source
files, the address of this instruction does not constitute a breakpoint because it does not correspond to any
source line. However, it can be set as a breakpoint by specifying that address.
Summary of Contents for S5U1C17001C
Page 6: ......
Page 17: ...1 General S5U1C17001C Manual 1 General ...
Page 18: ......
Page 21: ...1 2 Install S5U1C17001C Manual 2 Installation ...
Page 22: ......
Page 29: ...3 SoftDev S5U1C17001C Manual 3 Software Development Procedures ...
Page 30: ......
Page 103: ...4 SrcFiles S5U1C17001C Manual 4 Source files ...
Page 104: ......
Page 121: ...5 IDE S5U1C17001C Manual 5 gnU17 iDE ...
Page 122: ......
Page 365: ...6 Compiler S5U1C17001C Manual 6 C Compiler ...
Page 366: ......
Page 385: ...7 Library S5U1C17001C Manual 7 library ...
Page 386: ......
Page 405: ...8 Assemblr S5U1C17001C Manual 8 assembler ...
Page 406: ......
Page 439: ...9 Linker S5U1C17001C Manual 9 linker ...
Page 440: ......
Page 449: ...10 Debugger S5U1C17001C Manual 10 Debugger ...
Page 450: ......
Page 626: ...11 Tools S5U1C17001C Manual 11 Other Tools ...
Page 627: ......
Page 696: ...S1C17 Family C Compiler Package Quick Reference Reference ...