This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Question about watchpoint


Hi,

I have another question about set watchpoint, the embedded system I used
is ARM7TDMI, and it support 2 watchpoints. When I set wathcpoint on the
GDB host said, why it read lots of memory? And the last two are weird,
one is the last saved pc, and other is the address saved in that pc
subtracts 4. And after continue, it will set breakpoint in that address
saved in pc! 

I think the answer is very easy for you. But I spend a lot of time on
that, and still not understand. Could anybody give me an answer? 

Thanks a lot. 
 

Regards,
Lan


GDB result:
(gdb) r
Sending packet: $Hc-1#09...[+]Ack
[+][$][E][0][1][#][a][6]Packet received: E01
Sending packet: $qC#b4...[+]Ack
[+][$][Q][C][0][#][c][4]Packet received: QC0
Sending packet: $qOffsets#4b...[+]Ack
[+][$][#][0][0]Packet received: 
Sending packet: $?#3f...[+]Ack
[+][$][S][0][5][#][b][8]Packet received: S05
target_wait (-1, status) = 0,   status->kind = stopped, signal = SIGTRAP
Sending packet: $Hg0#df...[+]Ack
[+][$][O][K][#][9][a]Packet received: OK
Sending packet: $g#67...[+]Ack
[+][$][0][1][0][0][0][0][0][0][8][8][0][c][5][9][0][0][0][0][2][9][d][e]
[0][7][0][0][0][0][0][0][0][0][d][8][2][a][2][a][0][0][0][0][2][9][d][e]
[0][7][0][0][0][0][0][0][1][8][0][0][0][0][0][0][0][0][0][0][0][0][0][0]
[0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0]
[0][0][8][3][0][3][f][f][f][f][7][0][a][3][4][1][0][0][6][c][b][7][0][6]
[0][0][6][c][b][7][0][6][0][0][0][0][0][0][0][0][0][0][1][3][0][0][0][0]
[2][0][#][0][f]Packet received:
01000000880c59000029de0700000000d82a2a000029de07000000180000000000000000
0000000000000000000000008303ffff70a341006cb706006cb706000000000013000020
target_fetch_registers (pc) = 6cb70600 0x6b76c 440172
target_terminal_ours_for_output ()
target_terminal_ours ()
AppInitTask (argc=0, argv=0x0) at ../main/appmain.c:425
(gdb) watchpoint clock_speed
target_terminal_ours ()
Undefined command: "watchpoint".  Try "help".
(gdb) watch clock_speed
Sending packet: $m6b6c8,4#36...[+]Ack
[+][$][f][0][4][f][2][d][e][9][#][6][4]Packet received: f04f2de9
target_xfer_memory (0x6b6c8, xxx, 4, read, xxx) = 4, bytes = f0 4f 2d e9
Sending packet: $m6b6cc,4#61...[+]Ack
[+][$][4][c][d][0][4][d][e][2][#][5][a]Packet received: 4cd04de2
target_xfer_memory (0x6b6cc, xxx, 4, read, xxx) = 4, bytes = 4c d0 4d e2
Sending packet: $m6b6d0,4#2f...[+]Ack
[+][$][0][0][a][0][a][0][e][1][#][1][8]Packet received: 00a0a0e1
target_xfer_memory (0x6b6d0, xxx, 4, read, xxx) = 4, bytes = 00 a0 a0 e1
Sending packet: $m6b6d4,4#33...[+]Ack
[+][$][0][1][b][0][a][0][e][1][#][1][a]Packet received: 01b0a0e1
target_xfer_memory (0x6b6d4, xxx, 4, read, xxx) = 4, bytes = 01 b0 a0 e1
Sending packet: $m6b6d8,4#37...[+]Ack
[+][$][6][0][6][5][a][0][e][3][#][f][a]Packet received: 6065a0e3
target_xfer_memory (0x6b6d8, xxx, 4, read, xxx) = 4, bytes = 60 65 a0 e3
Sending packet: $m6b6dc,4#62...[+]Ack
[+][$][8][4][1][f][8][f][e][2][#][3][8]Packet received: 841f8fe2
target_xfer_memory (0x6b6dc, xxx, 4, read, xxx) = 4, bytes = 84 1f 8f e2
Sending packet: $m6b6e0,4#30...[+]Ack
[+][$][1][f][0][0][a][0][e][3][#][2][0]Packet received: 1f00a0e3
target_xfer_memory (0x6b6e0, xxx, 4, read, xxx) = 4, bytes = 1f 00 a0 e3
Sending packet: $m6b6e4,4#34...[+]Ack
[+][$][e][9][c][7][0][2][e][b][#][6][1]Packet received: e9c702eb
target_xfer_memory (0x6b6e4, xxx, 4, read, xxx) = 4, bytes = e9 c7 02 eb
Sending packet: $m6b6e8,4#38...[+]Ack
[+][$][c][9][a][3][0][0][e][b][#][5][7]Packet received: c9a300eb
target_xfer_memory (0x6b6e8, xxx, 4, read, xxx) = 4, bytes = c9 a3 00 eb
Sending packet: $m6b6ec,4#63...[+]Ack
[+][$][e][1][1][c][a][0][e][3][#][5][3]Packet received: e11ca0e3
target_xfer_memory (0x6b6ec, xxx, 4, read, xxx) = 4, bytes = e1 1c a0 e3
Sending packet: $m6b6f0,4#31...[+]Ack
[+][$][8][4][0][0][a][0][e][3][#][f][5]Packet received: 8400a0e3
target_xfer_memory (0x6b6f0, xxx, 4, read, xxx) = 4, bytes = 84 00 a0 e3
Sending packet: $m6b6f4,4#35...[+]Ack
[+][$][3][0][a][3][0][0][e][b][#][1][e]Packet received: 30a300eb
target_xfer_memory (0x6b6f4, xxx, 4, read, xxx) = 4, bytes = 30 a3 00 eb
Sending packet: $m6b6f8,4#39...[+]Ack
[+][$][6][0][9][7][f][e][e][b][#][6][8]Packet received: 6097feeb
target_xfer_memory (0x6b6f8, xxx, 4, read, xxx) = 4, bytes = 60 97 fe eb
Sending packet: $m6b6fc,4#64...[+]Ack
[+][$][f][4][2][1][9][f][e][5][#][3][6]Packet received: f4219fe5
target_xfer_memory (0x6b6fc, xxx, 4, read, xxx) = 4, bytes = f4 21 9f e5
Sending packet: $m6b700,4#fc...[+]Ack
[+][$][f][4][1][1][9][f][e][5][#][3][5]Packet received: f4119fe5
target_xfer_memory (0x6b700, xxx, 4, read, xxx) = 4, bytes = f4 11 9f e5
Sending packet: $m6b704,4#00...[+]Ack
[+][$][0][0][0][0][a][0][e][3][#][e][9]Packet received: 0000a0e3
target_xfer_memory (0x6b704, xxx, 4, read, xxx) = 4, bytes = 00 00 a0 e3
Sending packet: $m41a3dc,4#8d...[+]Ack
[+][$][5][4][c][a][0][0][0][0][#][e][d]Packet received: 54ca0000
target_xfer_memory (0x41a3dc, xxx, 4, read, xxx) = 4, bytes =
 54 ca 00 00
Sending packet: $mca50,4#f6...[+]Ack
[+][$][0][2][f][0][a][0][e][1][#][1][f]Packet received: 02f0a0e1
target_xfer_memory (0xca50, xxx, 4, read, xxx) = 4, bytes = 02 f0 a0 e1
Watchpoint 1: clock_speed
 (gdb) i f
Stack level 0, frame at 0x41a3e0:
 pc = 0x6b76c in AppInitTask (../main/appmain.c:425); saved pc 0xca54
 called by frame at 0x41a3e0
 source language c.
 Arglist at 0x41a370, args: argc=0, argv=0x0
 Locals at 0x41a370, Saved registers:
  r4 at 0x41a3bc, r5 at 0x41a3c0, r6 at 0x41a3c4, r7 at 0x41a3c8, r8 at
0x41a3cc, r9 at 0x41a3d0, r10 at 0x41a3d4, r11 at 0x41a3d8,
  lr at 0x41a3dc, pc at 0x41a3dc
(gdb) x 0x41a3dc
Sending packet: $m41a3dc,4#8d...[+]Ack
[+][$][5][4][c][a][0][0][0][0][#][e][d]Packet received: 54ca0000
target_xfer_memory (0x41a3dc, xxx, 4, read, xxx) = 4, bytes = 54 ca 00
00
0x41a3dc <APPLICATION_INIT_TASK_STACK+1976>:	andeq	r12, r0, r4, asr
r10
(gdb) i f
Stack level 0, frame at 0x41a3e0:
 pc = 0x6b76c in AppInitTask (../main/appmain.c:425); saved pc 0xca54
 called by frame at 0x41a3e0
 source language c.
 Arglist at 0x41a370, args: argc=0, argv=0x0
 Locals at 0x41a370, Saved registers:
  r4 at 0x41a3bc, r5 at 0x41a3c0, r6 at 0x41a3c4, r7 at 0x41a3c8, r8 at
0x41a3cc, r9 at 0x41a3d0, r10 at 0x41a3d4, r11 at 0x41a3d8,
  lr at 0x41a3dc, pc at 0x41a3dc
(gdb) x 0xca54
Sending packet: $mca54,4#fa...[+]Ack
[+][$][9][4][0][1][1][f][e][5][#][f][f]Packet received: 94011fe5
target_xfer_memory (0xca54, xxx, 4, read, xxx) = 4, bytes = 94 01 1f e5
0xca54 <$p+4>:	ldr	r0, [pc, #-404]	; 0xc8c8 <$d+44>
(gdb) x 0xca50
Sending packet: $mca50,4#f6...[+]Ack
[+][$][0][2][f][0][a][0][e][1][#][1][f]Packet received: 02f0a0e1
target_xfer_memory (0xca50, xxx, 4, read, xxx) = 4, bytes = 02 f0 a0 e1
0xca50 <$p>:	mov	pc, r2
(gdb) c
Continuing.
Sending packet: $Z0,ca54,4#43...[+]Ack
[+][<][9][c][1][4][5][9][0][0][>][$][O][K][#][9][a]Packet received: OK
Packet Z0 (software-breakpoint) is supported
target_insert_breakpoint (0xca54, xxx) = 0
target_terminal_inferior ()
Sending packet: $vCont?#49...[+]Ack
[+][$][#][0][0]Packet received: 
Packet vCont (verbose-resume) is NOT supported
Sending packet: $Hc0#db...[+]Ack
[+][$][O][K][#][9][a]Packet received: OK
Sending packet: $s#73...[+]Ack
target_resume (-1, step, 0)
[+][p][A][d][d][r][ ][i][s][ ][:][ ][0][x][0][0][0][6][b][7][6][c][
][\r][\n][i][N][e][w][A][d][d][r][ ][i][s][ ][:][
][0][x][0][0][0][0][0][0][0][0][ ][\r][\n][i][N][e][w][P][C][ ][i][s][
][:][ ][0][x][0][0][0][6][b][7][7][0][ ][\r][\n][s][ ][n][e][x][t][
][i][n][s][t][:][ ][0][x][ ][ ][ ][6][b][7][7][0][
][\r][\n][b][r][a][n][c][h][ ][i][s][:][ ][0][
][\r][\n][%][s][w][i][_][n][u][m][ ][ ][:][ ][0][
][\r][\n][^][$][T][0][5][0][f][:][7][0][b][7][0][6][0][0][;][0][d][:][7]
[0][a][3][4][1][0][0][;][#][5][3]Packet received:
T050f:70b70600;0d:70a34100;
target_wait (-1, status) = 0,   status->kind = stopped, signal = SIGTRAP
Sending packet: $m6b6c8,4#36...[+]Ack
[+][$][f][0][4][f][2][d][e][9][#][6][4]Packet received: f04f2de9
target_xfer_memory (0x6b6c8, xxx, 4, read, xxx) = 4, bytes = f0 4f 2d e9
Sending packet: $m6b6cc,4#61...[+]Ack
[+][$][4][c][d][0][4][d][e][2][#][5][a]Packet received: 4cd04de2
target_xfer_memory (0x6b6cc, xxx, 4, read, xxx) = 4, bytes = 4c d0 4d e2
Sending packet: $m6b6d0,4#2f...[+]Ack
[+][$][0][0][a][0][a][0][e][1][#][1][8]Packet received: 00a0a0e1
target_xfer_memory (0x6b6d0, xxx, 4, read, xxx) = 4, bytes = 00 a0 a0 e1
Sending packet: $m6b6d4,4#33...[+]Ack
[+][$][0][1][b][0][a][0][e][1][#][1][a]Packet received: 01b0a0e1
target_xfer_memory (0x6b6d4, xxx, 4, read, xxx) = 4, bytes = 01 b0 a0 e1
Sending packet: $m6b6d8,4#37...[+]Ack
[+][$][6][0][6][5][a][0][e][3][#][f][a]Packet received: 6065a0e3
target_xfer_memory (0x6b6d8, xxx, 4, read, xxx) = 4, bytes = 60 65 a0 e3
Sending packet: $m6b6dc,4#62...[+]Ack
[+][$][8][4][1][f][8][f][e][2][#][3][8]Packet received: 841f8fe2
target_xfer_memory (0x6b6dc, xxx, 4, read, xxx) = 4, bytes = 84 1f 8f e2
Sending packet: $m6b6e0,4#30...[+]Ack
[+][$][1][f][0][0][a][0][e][3][#][2][0]Packet received: 1f00a0e3
target_xfer_memory (0x6b6e0, xxx, 4, read, xxx) = 4, bytes = 1f 00 a0 e3
Sending packet: $m6b6e4,4#34...[+]Ack
[+][$][e][9][c][7][0][2][e][b][#][6][1]Packet received: e9c702eb
target_xfer_memory (0x6b6e4, xxx, 4, read, xxx) = 4, bytes = e9 c7 02 eb
Sending packet: $m6b6e8,4#38...[+]Ack
[+][$][c][9][a][3][0][0][e][b][#][5][7]Packet received: c9a300eb
target_xfer_memory (0x6b6e8, xxx, 4, read, xxx) = 4, bytes = c9 a3 00 eb
Sending packet: $m6b6ec,4#63...[+]Ack
[+][$][e][1][1][c][a][0][e][3][#][5][3]Packet received: e11ca0e3
target_xfer_memory (0x6b6ec, xxx, 4, read, xxx) = 4, bytes = e1 1c a0 e3
Sending packet: $m6b6f0,4#31...[+]Ack
[+][$][8][4][0][0][a][0][e][3][#][f][5]Packet received: 8400a0e3
target_xfer_memory (0x6b6f0, xxx, 4, read, xxx) = 4, bytes = 84 00 a0 e3
Sending packet: $m6b6f4,4#35...[+]Ack
[+][$][3][0][a][3][0][0][e][b][#][1][e]Packet received: 30a300eb
target_xfer_memory (0x6b6f4, xxx, 4, read, xxx) = 4, bytes = 30 a3 00 eb
Sending packet: $m6b6f8,4#39...[+]Ack
[+][$][6][0][9][7][f][e][e][b][#][6][8]Packet received: 6097feeb
target_xfer_memory (0x6b6f8, xxx, 4, read, xxx) = 4, bytes = 60 97 fe eb
Sending packet: $m6b6fc,4#64...[+]Ack
[+][$][f][4][2][1][9][f][e][5][#][3][6]Packet received: f4219fe5
target_xfer_memory (0x6b6fc, xxx, 4, read, xxx) = 4, bytes = f4 21 9f e5
Sending packet: $m6b700,4#fc...[+]Ack
[+][$][f][4][1][1][9][f][e][5][#][3][5]Packet received: f4119fe5
target_xfer_memory (0x6b700, xxx, 4, read, xxx) = 4, bytes = f4 11 9f e5
Sending packet: $m6b704,4#00...[+]Ack
[+][$][0][0][0][0][a][0][e][3][#][e][9]Packet received: 0000a0e3
target_xfer_memory (0x6b704, xxx, 4, read, xxx) = 4, bytes = 00 00 a0 e3
Sending packet: $g#67...[+]Ack
[+][$][3][0][b][9][0][6][0][0][8][8][0][c][5][9][0][0][0][0][2][9][d][e]
[0][7][0][0][0][0][0][0][0][0][d][8][2][a][2][a][0][0][0][0][2][9][d][e]
[0][7][0][0][0][0][0][0][1][8][0][0][0][0][0][0][0][0][0][0][0][0][0][0]
[0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0]
[0][0][8][3][0][3][f][f][f][f][7][0][a][3][4][1][0][0][7][4][b][7][0][6]
[0][0][7][0][b][7][0][6][0][0][0][0][0][0][0][0][0][0][1][3][0][0][0][0]
[2][0][#][f][2]Packet received:
30b90600880c59000029de0700000000d82a2a000029de07000000180000000000000000
0000000000000000000000008303ffff70a3410074b7060070b706000000000013000020
target_fetch_registers (r5) = 0029de07 0x7de2900 132000000
target_terminal_inferior ()
Sending packet: $s#73...[+]Ack
target_resume (-1, step, 0)
[+][p][A][d][d][r][ ][i][s][ ][:][ ][0][x][0][0][0][6][b][7][7][0][
][\r][\n][i][N][e][w][A][d][d][r][ ][i][s][ ][:][
][0][x][f][f][f][f][f][d][a][0][ ][\r][\n][i][N][e][w][P][C][ ][i][s][
][:][ ][0][x][0][0][0][6][b][5][1][8][ ][\r][\n][s][ ][n][e][x][t][
][i][n][s][t][:][ ][0][x][ ][ ][ ][6][b][5][1][8][
][\r][\n][b][r][a][n][c][h][ ][i][s][:][ ][1][
][\r][\n][s][a][v][e][_][r][e][g][i][s][t][e][r][ ][i][s][:][ ][0][
][\r][\n][%]remote_interrupt called
remote_stop called
target_stop ()
target_terminal_ours ()
Interrupted while waiting for the program.
Give up (and stop debugging it)? (y or n) Sending packet:
$m6b704,4#00...[+]Ack
Please answer y or n.
Interrupted while waiting for the program.
Give up (and stop debugging it)? (y or n) y
target_mourn_inferior ()
(gdb)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]