254Chapter8 • Cross-Platform and Embedded Systems Development
(gdb) target remote /dev/ttyS0
Remote debugging using /dev/ttyS0
0x40001930 in .. ()
(gdb) continue
Continuing.
Breakpoint 1, main () at sum.c:6
6 printf("Enter first number : ");
(gdb) n
7 scanf("%d", &num1);
(gdb) n
8 printf("Enter second number : ");
(gdb) n
9 scanf("%d", &num2);
(gdb) n
11 total = num1 + num2;
(gdb) n
13 printf("\nThe sum is : %d\n", total);
(gdb) n
14 }
(gdb) n
warning: Cannot insert breakpoint 0:
Cannot access memory at address 0x1
(gdb) quit
The program is running. Exit anyway. (y or n) y
[root@desktop /root]#
You do not use the
run
command in this session because the program has already been
started by the
gdbserver
running on the target machine.
8.5.1.5Serial Cable
You can use a null modem cable to connect serial ports on the host and target machines.
Connections for the null modem cable for a DB-9 connector are as shown in Table 8-1. How-
ever, I hope that most people can simply go out and buy a null modem cable, without worrying
about pinouts.
Next Page >>
<< Previous Page
Back to the Table of Contents