Break Functions - Epson S5U1C17001C Manual

Cmos 16-bit single chip microcomputer, c compiler package for s1c17 family
Hide thumbs Also See for S5U1C17001C:
Table of Contents

Advertisement

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.
10-52
EPSOn
(C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
S5U1C17001C ManUal

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the S5U1C17001C and is the answer not in the manual?

Table of Contents