Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Denis PILAT <denis.pilat@st.com>
To: Vladimir Prus <ghost@cs.msu.su>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC] varobj deletion after the binary has changed
Date: Tue, 23 Jan 2007 14:49:00 -0000	[thread overview]
Message-ID: <45B61B41.90509@st.com> (raw)
In-Reply-To: <ep50dj$bft$1@sea.gmane.org>

Vladimir Prus wrote:
> And what kind of problems does it cause, for the record? I'd expect that
> attempt of evaluating such expressions will result in value being "",
> and in_scope="false". Do you get anything worse than that?
>   
Yes we are, gdb crashes.
In our case, when the -exec-run reloads the binary file, it stops at a 
breakpoint previously set and the frame_id is exactly the same as the 
one stored in the varobj object during the previous run (our SP does not 
change, under linux native targets, it is "randomized" I guess.). So 
when front-end executes -var-update, GDB thinks the varobj refers to a 
valid frame (but it's wrong since the program has changed) and try to 
access stuff he should not.

There is a way to reproduce it under native linux target:
Compile the following source file to get "a.out"
    #include <stdio.h>
    int a_global = 0;
    int main()
    {
      printf("hello");
      a_global++;
      return a_global;
    }

Run "gdb -i mi a.out" and the following command:
    -var-create varname * a_global
    shell touch a.out
    70-break-insert -t main
    71-exec-run
    75-var-update varname

==> you got it ! (Segmentation fault)

> Or maybe, implement "binary changed" MI notification that can be used
> by the frontend as it sees fit.
>   
That's a good option for the front end to make cleanup in its "watched" 
variable but it won't fix the current problem.

-- 
Denis


  reply	other threads:[~2007-01-23 14:49 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-23 12:32 Denis PILAT
2007-01-23 12:45 ` Daniel Jacobowitz
2007-01-23 12:52   ` Vladimir Prus
2007-01-23 14:49     ` Denis PILAT [this message]
2007-01-24 21:49       ` Nick Roberts
2007-01-24 22:07         ` Daniel Jacobowitz
2007-01-24 22:08         ` Frédéric Riss
2007-01-24 22:18           ` Nick Roberts
2007-01-24 22:52             ` Frédéric Riss
2007-01-24 23:14               ` Nick Roberts
2007-01-25  2:41             ` Daniel Jacobowitz
2007-01-25 20:50               ` Nick Roberts
2007-01-26  7:25                 ` Denis PILAT
2007-01-23 17:20   ` Denis PILAT
2007-01-25 17:28     ` Denis PILAT
2007-01-25 22:31       ` Nick Roberts
2007-01-25 23:27         ` Daniel Jacobowitz
2007-01-29 12:39           ` Denis PILAT
2007-01-29 22:12             ` Nick Roberts
2007-01-30  8:49               ` Denis PILAT
2007-01-31 19:07               ` Denis PILAT
2007-01-31 21:29                 ` Nick Roberts
2007-02-01  9:49                   ` Denis PILAT
2007-02-08 16:41                     ` Daniel Jacobowitz
2007-02-08 19:33                       ` Nick Roberts
2007-02-08 19:55                         ` Daniel Jacobowitz
2007-02-09 15:43                         ` Eli Zaretskii
2007-02-12 21:10                           ` Denis PILAT
2007-02-13  0:11                             ` Nick Roberts
2007-02-13  8:26                               ` Denis PILAT
2007-02-20 16:06                             ` Andreas Schwab
2007-02-20 16:17                               ` Denis PILAT

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=45B61B41.90509@st.com \
    --to=denis.pilat@st.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=ghost@cs.msu.su \
    /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