Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Taimoor <tmirza@codesourcery.com>
To: Vladimir Prus <vladimir.prus@gmail.com>, <gdb-patches@sourceware.org>
Subject: Re: [PATCH 2/2] Testsuite for varobj updation after symbol removal
Date: Mon, 11 May 2015 13:49:00 -0000	[thread overview]
Message-ID: <5550B37B.4050201@codesourcery.com> (raw)
In-Reply-To: <553E83ED.80000@gmail.com>



On 04/27/2015 11:46 PM, Vladimir Prus wrote:
>
> thanks, so the issue is that removing a symbol file recreates
> *all* global varobjs, and in the process clears any change of value
> since the last update. I agree the patch is fixing that.
>
> There's a second change, it seems - to invalidate varobj that refers to types in unloaded objfile - is there a test for that?
>

Hi Vladimir,

Sorry for delayed response. There are no separate tests for invalidation 
of varobjs in unloaded objfile as it gets tested by existing varobj 
tests. If we don't invalidate varobjs in unloaded objfile, a lot GDB 
tests will fail. This is because while trying to retrieve old varobj 
value for already removed objfile (to compare with current value), it 
will try to access pointers that are no longer valid and that will 
result in failure.
Marking varobjs that refers to types in unloaded objfile invalid makes 
sure we do not accidentally use dangling pointers to obtain varobj value 
for unloaded objfile.

IMO, GDB should avoid using pointers whose target has been already freed 
and this change specifically marks var->type to NULL to make sure no 
dangling pointers remain after objfile is unloaded so any subsequent 
call to varobj_get_value does not result in segmentation fault.


Thanks,
Taimoor


  parent reply	other threads:[~2015-05-11 13:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-16  3:33 [PATCH 0/2] Improved variable object invalidation in GDB Taimoor Mirza
2015-04-16  3:33 ` [PATCH 2/2] Testsuite for varobj updation after symbol removal Taimoor Mirza
2015-04-17 15:18   ` Vladimir Prus
2015-04-23  8:05     ` Taimoor
2015-04-27 18:53       ` Vladimir Prus
2015-04-27 19:10         ` Vladimir Prus
2015-05-11 13:49         ` Taimoor [this message]
2015-05-28  9:52           ` Taimoor
2015-06-05  3:03           ` [PATCH 2/2] [PING]Testsuite " Taimoor
2015-04-16  3:33 ` [PATCH 1/2] Fix " Taimoor Mirza
  -- strict thread matches above, loose matches on Subject: below --
2019-10-17 10:03 [PATCH 0/2] Improved variable object invalidation in GDB Raza, Saqlain
2019-10-17 10:03 ` [PATCH 2/2] Testsuite for varobj updation after symbol removal Raza, Saqlain
2014-06-27 10:14 [PATCH 0/2] Improved variable object invalidation in GDB Taimoor Mirza
2014-06-27 10:14 ` [PATCH 2/2] Testsuite for varobj updation after symbol removal Taimoor Mirza
2014-07-13 16:11   ` Taimoor

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=5550B37B.4050201@codesourcery.com \
    --to=tmirza@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=vladimir.prus@gmail.com \
    /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