public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Varun Kumar Erigila <varun.erigila@blackfigtech.com>
To: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: gdb deletes watchpoint for local variables in scope
Date: Thu, 5 Jan 2023 12:46:04 +0000	[thread overview]
Message-ID: <BMXPR01MB1029F6BB649C642EC4E485438DFA9@BMXPR01MB1029.INDPRD01.PROD.OUTLOOK.COM> (raw)

[-- Attachment #1: Type: text/plain, Size: 1137 bytes --]

Hello everyone,
              Gdb complains saying "Watchpoint <number> deleted because the program has left the block in which its expression is valid", even though the local variable is still in scope for RISC-V architecture.
              Test Code: Compiler Explorer (godbolt.org)<https://godbolt.org/z/dhb5K5KK4>

               Code compiled with clang(trunk):

        *   clang -g -static -c program.c
        *   riscv64-unknown-elf-gcc program.o -o program -march=rv64imac -mabi=lp64

              Gdb(12.1):

  *   riscv64-unknown-elf-gdb program
  *   break main
  *   set can-use-hw-watchpoints 0
  *   watch q
  *   continue
  *   Watchpoint 2 deleted because the program has left the block in
  *   which its expression is valid.
  *   0x00000000000101e0 in func () at watch_cond.c:2

              Even though the variable q is still in scope in main, gdb prints this message immediately after func() returns.
               I'm trying to debug gdb on update_watchpoint function where this message is originating from.

               Any suggestions on why gdb is behaving so.

regards
Varun

             reply	other threads:[~2023-01-05 12:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-05 12:46 Varun Kumar Erigila [this message]
2023-01-24 15:29 ` Simon Sobisch

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=BMXPR01MB1029F6BB649C642EC4E485438DFA9@BMXPR01MB1029.INDPRD01.PROD.OUTLOOK.COM \
    --to=varun.erigila@blackfigtech.com \
    --cc=gdb@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).