Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nick Roberts <nickrob@snap.net.nz>
To: Denis PILAT <denis.pilat@st.com>
Cc: Vladimir Prus <ghost@cs.msu.su>, gdb-patches@sources.redhat.com
Subject: Re: [RFC] varobj deletion after the binary has changed
Date: Wed, 24 Jan 2007 21:49:00 -0000	[thread overview]
Message-ID: <17847.54349.654238.452957@kahikatea.snap.net.nz> (raw)
In-Reply-To: <45B61B41.90509@st.com>

[-- Attachment #1: message body and .signature --]
[-- Type: text/plain, Size: 2320 bytes --]

 > > 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?

It's a global variable so I don't think it will ever be reported as out
of scope.

 > Yes we are, gdb crashes.

This is a bug in GDB and how to deal with variable objects when restarting
should be a separate issue.  I see the same problem in a CVS snapshot of
6.2 vintage but not in GDB 6.3 from Fedora Core 5.  So unless the problem
disappeared in 6.3 and reasppeared later, which is unlikely, I think Fedora
must have solved it with one of their patches.  The problem is I don't know
which one.

I attach the SPEC file which lists the patches.  If anyone can give me an
educated guess as to which the relevant patch is, I'll try it.  Some of the
patches specify an architecture, but they may be more general than they
suggest.

In case it helps here's part of the stack at crash:

#0  0x081454e4 in check_typedef (type=0x95e1e6d) at gdbtypes.c:1402
#1  0x080f5769 in allocate_value (type=0x95e1e6d) at value.c:217
#2  0x080eca5d in read_var_value (var=0x95ee3f0, frame=0x0) at findvar.c:399
#3  0x080ffb3b in value_of_variable (var=0x95ee3f0, b=0x0) at valops.c:808
#4  0x080f88ef in evaluate_subexp_standard (expect_type=0x0, exp=0x95e9958, pos=0xbfdba084, noside=EVAL_NORMAL) at eval.c:480
#5  0x080f79f2 in evaluate_subexp (expect_type=0x0, exp=0x95e9958, pos=0xbfdba084, noside=EVAL_NORMAL) at eval.c:76
#6  0x080f7bc9 in evaluate_expression (exp=0x95e9958) at eval.c:166
#7  0x081a8613 in gdb_evaluate_expression (exp=0x95e9958, value=0xbfdba0e4) at wrapper.c:49
#8  0x081a7734 in c_value_of_root (var_handle=0xbfdba1e0) at varobj.c:2025
#9  0x081a6ede in value_of_root (var_handle=0xbfdba1e0, type_changed=0xbfdba17c) at varobj.c:1672
#10 0x081a6054 in varobj_update (varp=0xbfdba1e0, changelist=0xbfdba1c8) at varobj.c:1068

The crash occurs because computing TYPE_CODE (type) involves a memory
violation.  This comes from "type = SYMBOL_TYPE (var)" in read_var_value, in
turn from var = exp->elts[pc + 2].symbol which is from exp = var->root->exp of
the variable object in question (if that makes sense!).


-- 
Nick                                           http://www.inet.net.nz/~nickrob


[-- Attachment #2: SPEC file for FC5 GDB --]
[-- Type: application/octet-stream, Size: 18053 bytes --]

  reply	other threads:[~2007-01-24 21: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
2007-01-24 21:49       ` Nick Roberts [this message]
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=17847.54349.654238.452957@kahikatea.snap.net.nz \
    --to=nickrob@snap.net.nz \
    --cc=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