public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "iamanonymous.cs at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/112582] Inconsistent Variable Values: Discrepancy between Source-Level and Instruction-Level Debugging
Date: Mon, 20 Nov 2023 08:28:22 +0000	[thread overview]
Message-ID: <bug-112582-4-iHN3moEkGt@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-112582-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112582

--- Comment #2 from Anonymous <iamanonymous.cs at gmail dot com> ---
(In reply to Andrew Pinski from comment #1)
>         .cfi_def_cfa_offset 32
>         .loc 1 27 5 view .LVU27
>         movl    $-5, %eax
>         .loc 1 28 5 view .LVU28
>         movl    $-10, %edx
>         .loc 1 29 3 view .LVU29 // point where after `si`'s is located
>         leaq    14(%rsp), %rsi
>         leaq    12(%rsp), %rdi
>         .loc 1 27 5 view .LVU30
>         movw    %ax, 12(%rsp)
>         .loc 1 28 3 is_stmt 1 view .LVU31
>         .loc 1 28 5 is_stmt 0 view .LVU32
>         movw    %dx, 14(%rsp)
>         .loc 1 29 3 is_stmt 1 view .LVU33 // point where step is 
>         call    foo
> ...
>        .ascii "x\0"    # DW_AT_name
>                         # DW_AT_decl_file (1, /app/example.c)
>                         # DW_AT_decl_line (0x1a)
>         .byte   0x16  # DW_AT_decl_column
>         .long   0x9e  # DW_AT_type
>         .uleb128 0x2    # DW_AT_location
>         .byte   0x91  # DW_OP_fbreg
>         .sleb128 -20
>         .uleb128 0x3    # (DIE (0x78) DW_TAG_variable)
>         .ascii "y\0"    # DW_AT_name
>                         # DW_AT_decl_file (1, /app/example.c)
>                         # DW_AT_decl_line (0x1a)
>         .byte   0x19  # DW_AT_decl_column
>         .long   0x9e  # DW_AT_type
>         .uleb128 0x2    # DW_AT_location
>         .byte   0x91  # DW_OP_fbreg
>         .sleb128 -18
> 
> Not a bug.

Thank you, Andrew, for your response. I have concerns regarding the information
provided by the debugger, as it may be somewhat misleading. Although the
debugger indicates that lines 27 and 28 have been executed, a closer
examination reveals that the assigned values of the x and y variables do not
align with expected results. From the user's perspective, it appears that lines
27 and 28 have indeed been executed, yet the variable values remain unchanged.
Therefore, I was wondering whether there are any guarantees from the compiler
or debugger.

  parent reply	other threads:[~2023-11-20  8:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-17  6:35 [Bug debug/112582] New: " iamanonymous.cs at gmail dot com
2023-11-17  6:45 ` [Bug debug/112582] " pinskia at gcc dot gnu.org
2023-11-20  8:28 ` iamanonymous.cs at gmail dot com [this message]
2023-11-20  8:40 ` rguenth at gcc dot gnu.org
2023-11-20  9:20 ` iamanonymous.cs at gmail dot com
2023-11-20  9:21 ` sjames at gcc dot gnu.org
2023-11-20  9:25 ` iamanonymous.cs 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-112582-4-iHN3moEkGt@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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).