public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "tromey at sourceware dot org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug rust/31401] Error when placing watchpoint rust debug build
Date: Tue, 20 Feb 2024 14:37:06 +0000	[thread overview]
Message-ID: <bug-31401-4717-xpVtWTpQ96@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-31401-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=31401

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID
                 CC|                            |tromey at sourceware dot org

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
Hi.  Thanks for the bug report.

(gdb) watch *0x123456789
Attempt to take contents of a non-pointer value.

Here you're attempting to dereference just some
random int.  gdb used to allow this in the old
days (maybe it still does in C mode, not sure).
However you really need a typed pointer here.
Or you can just watch an expression -- best is
with "-location", like:

(gdb) watch -location a


(gdb) watch *(char*)0x123456789
unexpected token

This one is C syntax, not Rust.


(gdb) watch "0x7fffffffd214"
Watchpoint 2: "0x7fffffffd214"

This one watches that particular string, which is
not really what you want.  Perhaps this should be
an error, except strings are coerced to memory and
so gdb thinks this might actually change at some point.


> Both of the examples above work normally in the release build.

This probably works because gdb doesn't see any Rust debug info
and so defaults to the "minimal" language, which is basically
the same as C.

Anyway I don't think there's a bug here.  I'm going to close
this report.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  reply	other threads:[~2024-02-20 14:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-19 14:20 [Bug rust/31401] New: " jlmacedomatos at gmail dot com
2024-02-20 14:37 ` tromey at sourceware dot org [this message]
2024-02-21 16:00 ` [Bug rust/31401] " jlmacedomatos at gmail dot com

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=bug-31401-4717-xpVtWTpQ96@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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).