This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix for PR gdb/17017
- From: Pedro Alves <palves at redhat dot com>
- To: Siva Chandra <sivachandra at google dot com>
- Cc: gdb-patches <gdb-patches at sourceware dot org>
- Date: Wed, 04 Jun 2014 21:05:09 +0100
- Subject: Re: [PATCH] Fix for PR gdb/17017
- Authentication-results: sourceware.org; auth=none
- References: <CAGyQ6gzKv7KzJsvndX1OGY4_0yPw5ewB=O3F49LdEHkp-N-O7w at mail dot gmail dot com>
On 06/04/2014 08:57 PM, Siva Chandra wrote:
> The attached patch should fix PR 17017.
>
> ChangeLog
>
> 2014-06-04 Siva Chandra Reddy <sivachandra@google.com>
>
> testsuite/
>
> PR gdb/17017
> * gdb.python/py-xmethods.exp (gdb_test_if_inferiorio): New function.
> Update few gdb_test invocations to gdb_test_if_inferiorio.
Ah, I hadn't realized the test was relying on IO. It's unfortunate,
as that way the coverage isn't complete when testing against gdbserver.
Can we make it not rely on IO instead? You want to be
sure the C++ methods were called, right?
E.g., one idea would be, instead of:
int
B::geta (void)
{
cout << "From CC B::geta:" << endl;
return 2 * a;
}
Do:
int B_geta_called;
int
B::geta (void)
{
B_geta_called++;
return 2 * a;
}
And then from GDB, read the B_geta_called variable
to tell whether the method was called. You can e.g.,
use get_integer_valueof for that.
--
Pedro Alves