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

gdb/369: [Zz]0 software breakpoint packet broken



>Number:         369
>Category:       gdb
>Synopsis:       [Zz]0 software breakpoint packet broken
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 20 08:58:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     ac131313@redhat.com
>Release:        unknown-1.0
>Organization:
>Environment:
all
>Description:
A software breakpoint is implemented by modifying target memory.  A GDB using memory writes to set software breakpoints and a GDB using Z0 packets should exibit identical behavour.  Z0 is an optomization and should not result in changes in the targets behavour.

Unfortunatly, one aspect of a software breakpoint was not fully considered.  If the target program moves code around, the software breakpoint moves with it.  GDB, through its overlay mechanism, is capable of tracking this and will attempt to set/clear such software breakpoints.

The problems occure when GDB attempts to remove a reloacated breakpoint using a Z0 packet.  GDB can't tell the target what the original memory value was (that isn't transfered as part of the packet).  The target doesn't know what the original value was - the address changed.

Workarounds?

Disable software breakpoints when there are overlays.
Have GDB ``guess'' what is in the moved breakpoint and just write it.
Have the target understand overlay tables so it can also track moved breakpoints.

Fix?

Probably define a new breakpoint vis:

-> Z5,<address>,<bp-val>
<- <original-memory> OR z5,<address>,<original-memory>

-> z5,<address>,<original-memory>
<- OK



 
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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