Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Taimoor <tmirza@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: Re: [PATCH 2/2] Testsuite for varobj updation after symbol removal
Date: Thu, 23 Apr 2015 08:05:00 -0000	[thread overview]
Message-ID: <5538A7A6.3000908@codesourcery.com> (raw)
In-Reply-To: <mgr881$mmd$1@ger.gmane.org>

Hi Vladimir,

Thanks for reviewing the patch.

On 04/17/2015 08:18 PM, Vladimir Prus wrote:
>
>
> On 04/16/2015 06:32 AM, Taimoor Mirza wrote:
>  > This patch provides testcases for variable object updation after
> removing
>  > symbols. Test programs are same as used for testing remove-symbol-file
>  > command in gdb.base. sym-file-main.c is modified to just add a global
>  > variable for which varible object is created in testsuite.
>  >
>
> Taimoor,
>
> thanks for the patch, and testsuite change. Looking at it, it appears
> that 'count' is
> a global variable, and it's modified in one place, in the main function,
> and after that
> you do 'remove-symbol-files' and verify that var-update reports reports
> 'count' as
> changed. But what does it test exactly? Since count is explicitly
> modified in the
> test, I'd imagine that -var-update will report it as changed even without
> 'remove-symbol-file'. In other words, does this testcase fail if the
> code patch is not
> applied?

Yes. This testcase fails without applying this patch. Below is 
problematic scenario:


1) Run GDB session and load symbols from file a.
2) Create varobj for some global variable test.
3) put some breakpoint in some function and run to that breakpoint.
4) Use add-symbol-file to load symbols of file b.
5) Put breakpoint on some other function that is called after updating
global variable test.
6) When this breakpoint gets hit, remove symbols of b using
'remove-symbol-file'.
7) print value of test. Its updated and different from initial value.
8) give 'var-update' command for variable object of 'test' and
changelist will be empty.

I know its not a common scenario but as long as it is valid
according to individual command specifications we have all the right to
expect it will produce the intended results.

>
> Even if so, does it test exactly what is your real case? It's easy to
> see why 'remove-symbol-files'
> can make some global variables no longer present. But how it can change
> value of some expression?

Its not the case of global variable not present. Its problem with 
properly displaying changeset for a valid global variable whose value is 
changed.
Step 7 in above scenario displays updated value of variable but 
-var-update for varobj of that variable gives empty changeset. The 
reason for this is mentioned in source code patch [PATCH 1/2].
>
> Thanks,
> Volodya
>


  reply	other threads:[~2015-04-23  8:05 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 [this message]
2015-04-27 18:53       ` Vladimir Prus
2015-04-27 19:10         ` Vladimir Prus
2015-05-11 13:49         ` Taimoor
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=5538A7A6.3000908@codesourcery.com \
    --to=tmirza@codesourcery.com \
    --cc=gdb-patches@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