public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: jeremy.bennett@embecosm.com
To: gdb-gnats@sources.redhat.com
Cc: jeremy.bennett@embecosm.com
Subject: gdb/2499: to_can_use_hw_breakpoint/CAN_USE_HARDWARE_WATCHPOINT ambiguous
Date: Tue, 12 Aug 2008 06:38:00 -0000	[thread overview]
Message-ID: <20080812063054.6627.qmail@sourceware.org> (raw)


>Number:         2499
>Category:       gdb
>Synopsis:       to_can_use_hw_breakpoint/CAN_USE_HARDWARE_WATCHPOINT ambiguous
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 12 06:38:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     jeremy.bennett@embecosm.com
>Release:        unknown-1.0
>Organization:
>Environment:
Fedora 9 Linux, GDB 6.8, OpenRISC 1000 (or1k) target
>Description:
The code to set a watchpoint in watch_command_1() tests to see if a hardware watchpoint is available, using CAN_USE_HARDARE_WATCHPOINT, which in turn calls the to_can_use_hw_breakpoint() function of the target.

This returns 0 to indicate that the particular type of watchpoint is unsupported and -1 to indicate either that there are insufficient watchpoint resources or that two different types of watchpoint cannot simultaneously be supported. However for the latter case the error message given is always:

  "Target can only support one kind of HW watchpoint at a time."

This is confusing if the problem is actually that the resources have run out.

This bug is related to Bug 967, concerning the need to pass to_can_use_hw_breakpoint() additional information for it to make a good judgement.

Not a high priority, but entered here for the record.
>How-To-Repeat:
At present I can only demonstrate this with the GDB 6.8 port for the OpenRISC architecture, which supports a maximum of 4 watchpoints:

(gdb) rwatch a
Hardware read watchpoint 1: a
(gdb) rwatch b
Hardware read watchpoint 2: b
(gdb) rwatch c
Hardware read watchpoint 3: c
(gdb) rwatch d
Hardware read watchpoint 4: d
(gdb) rwatch e
Target can only support one kind of HW watchpoint at a time.
(gdb) 

It should occur for any architecture with finite hardware watchpoint resources.
>Fix:
I suggest to_can_use_hw_breakpoint() specification is extended to allow return -2 to indicate resources have run out with -1 reserved for its current meaning. The code in watch_command_1() could then be extended to print out the appropriate message in each case. This would be backwards compatible with the existing code base.

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


                 reply	other threads:[~2008-08-12  6:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080812063054.6627.qmail@sourceware.org \
    --to=jeremy.bennett@embecosm.com \
    --cc=gdb-gnats@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).