This is the mail archive of the gdb-prs@sourceware.org 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]

breakpoints/2528: Watchpoint stop not properly handled on latest GDB (gdb-weekly-6.8.50.20080916)


>Number:         2528
>Category:       breakpoints
>Synopsis:       Watchpoint stop not properly handled on latest GDB (gdb-weekly-6.8.50.20080916)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 22 12:08:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     eran@umicos.com
>Release:        gdb-weekly-6.8.50.20080916.tar.bz2
>Organization:
>Environment:
Segger GDB server (www.segger.com)
GDB 6.8.5 cross-compiled on Windows XP to debug ARM targets
AT91SAM7X-EK Evaluation kit, Segger J-Link J-Tag device
>Description:
When setting a hardware watchpoint on a variable, GDB stops and fails to detect the stop reason (claims to stops due to SIGTRAP).
On previous GDB version (tested up to 6.7.1), the hardware watchpoint is properly detected.

It is important to note that Segger's excellent GDB server reports ALL stops (be it breakpoint or watchpoint) simply by sending a 'T05' command - which includes no details regarding the stop cause (however it works ok on the old GDB version).
>How-To-Repeat:
Connect a Segger J-Link device to an Atmel AT91SAM7X-EK board, load a program with a variable to set a watchpoint on and execute the following GDB commands:

target remote 127.0.0.1:2331
monitor reset 8
monitor speed auto
monitor writeu32 0xFFFFFD44 = 0x00008000
monitor writeu32 0xFFFFFC20 = 0x00000601
monitor sleep 10
monitor writeu32 0xFFFFFC2C = 0x00480a0e
monitor sleep 10
monitor writeu32 0xFFFFFC30 = 0x00000007
monitor sleep 10
monitor writeu32 0xFFFFFF60 = 0x00480100
monitor sleep 100
set remote memory-write-packet-size 1024
set remote memory-write-packet-size fixed

load c:\\temp\\ufl.elf

break main
jump resetHandler
delete
watch ufl_ready
cont
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="rlol-sux.txt"
Content-Disposition: inline; filename="rlol-sux.txt"


Broken latest GDB:
------------------

80              AT91C_BASE_EFC0->EFC_FMR &= ~AT91C_MC_NEBP;
remote:target_xfer_partial (2, (null), 0x19bef08,  0x0,  0x21fdd7, 1) = 1, bytes = 00
TARGET_REGION_OK_FOR_HW_WATCHPOINT (2227671, 1) = 0x1
target_can_use_hw_breakpoint (6, 1, 0) = 1
Hardware watchpoint 2: ufl_ready
remote:target_xfer_partial (2, (null), 0x19bf848,  0x0,  0x21fdd7, 1) = 1, bytes = 00
target_insert_watchpoint (0x21fdd7, 1, 0) = 0
target_terminal_inferior ()
target_resume (-1, continue, 0)
target_wait (-1, status) = 0,   status->kind = stopped, signal = SIGTRAP
target_fetch_registers (pc) = f0042000 0x2004f0 2098416
STOPPED_BY_WATCHPOINT () = 0
target_terminal_ours_for_output ()

Program received signal SIGTRAP, Trace/breakpoint trap.
target_remove_watchpoint (0x21fdd7, 1, 0) = 0
target_terminal_ours ()
remote:target_xfer_partial (2, (null), 0x153f8d0,  0x0,  0x2004f0, 4) = 4, bytes =
 01 30 a0 e3
main () at ufl-at91\ufl-at91.c:109
109         ufl_ready = 1;

Working (6.7.1) GDB:
---------------------

80              AT91C_BASE_EFC0->EFC_FMR &= ~AT91C_MC_NEBP;
remote:target_xfer_partial (2, (null), 0x12ff660,  0x0,  0x21fdd7, 1) = 1, bytes =
 00
TARGET_REGION_OK_FOR_HW_WATCHPOINT (2227671, 1) = 0x1
target_can_use_hw_breakpoint (6, 1, 0) = 1
Hardware watchpoint 2: ufl_ready
remote:target_xfer_partial (2, (null), 0x12ff8f0,  0x0,  0x21fdd7, 1) = 1, bytes =
 00
target_insert_watchpoint (0x21fdd7, 1, 0) = 0
target_terminal_inferior ()
target_resume (-1, continue, 0)
target_wait (-1, status) = 42000,   status->kind = stopped, signal = SIGTRAP
target_fetch_registers (pc) = f0042000 0x2004f0 2098416
remote:target_xfer_partial (2, (null), 0x22f7a0,  0x0,  0x2004f0, 4) = 4, bytes =
 01 30 a0 e3
remote:target_xfer_partial (2, (null), 0x12ffd08,  0x0,  0x21fdd7, 1) = 1, bytes = 00
target_remove_watchpoint (0x21fdd7, 1, 0) = 0
remote:target_xfer_partial (2, (null), 0x12fe3f8,  0x0,  0x21fdd7, 1) = 1, bytes = 00
target_insert_watchpoint (0x21fdd7, 1, 0) = 0
target_terminal_inferior ()
target_resume (-1, continue, 0)
target_wait (-1, status) = 42000,   status->kind = stopped, signal = SIGTRAP
target_fetch_registers (pc) = f8042000 0x2004f8 2098424
remote:target_xfer_partial (2, (null), 0x22f7a0,  0x0,  0x2004f8, 4) = 4, bytes =
 ff ff ff ea
remote:target_xfer_partial (2, (null), 0x12ffd68,  0x0,  0x21fdd7, 1) = 1, bytes = 01
target_remove_watchpoint (0x21fdd7, 1, 0) = 0
target_terminal_ours ()
Hardware watchpoint 2: ufl_ready

Old value = 0 '\0'
New value = 1 '\001'
0x002004f8 in main () at ufl-at91\ufl-at91.c:109
109         ufl_ready = 1;


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