This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix for PR gdb/17017


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]