Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Issue with printing binary operator overloaded function on GDB 7.2
@ 2010-12-23  7:53 viju vincent
  2010-12-27 19:38 ` Keith Seitz
  0 siblings, 1 reply; 4+ messages in thread
From: viju vincent @ 2010-12-23  7:53 UTC (permalink / raw)
  To: gdb

Dear all,

 I am facing an issue while printing binary operator overloaded
function using GDB 7.2 on armv7a target

 Compiled C++  test code (gdb.cp/cpexprs.cc) using g++ (4.5.1)

 * On GDB 7.2 its showing multiple operator overloading functions for
binary operators

 * In case of cpexprs.exp testcase on GDB 7.2

 * From GDB log
{{{
   print base::operator!=
$17 = {bool (const base * const, const void &)} 0x9784
<base::operator!=(void const&) const>
(gdb) FAIL: gdb.cp/cpexprs.exp: print base::operator!=
}}}

* The available overloaded functions are displayed on GDB prompt

{{{
(gdb) p base::operator
operator char*() const             operator-=(void const&)
operator delete(void*)             operator->() const
operator delete[](void*)           operator->*(base const&) const
operator fluff*() const              operator->*(void const&) const
operator fluff**() const            operator/(base const&) const
operator int() const                  operator/(void const&) const
operator new(size_t)                operator/=(base const&)
operator new(unsigned int)       operator/=(void const&)
operator new[](size_t)              operator<(base const&) const
operator new[](unsigned int)     operator<(void const&) const
operator!() const                       operator<<(int) const
operator!=(base const&) const    operator<<=(int)
operator!=(void const&) const     operator<=(base const&) const
operator%(base const&) const     operator<=(void const&) const
operator%(void const&) const     operator=(base const&)
operator%=(base const&)           operator=(void const&)
operator%=(void const&)            operator==(base const&) const
operator&&(base const&) const    operator==(void const&) const
operator&&(void const&) const     operator>(base const&) const
operator&(base const&) const      operator>(void const&) const
operator&(void const&) const       operator>=(base const&) const
operator&=(base const&)            operator>=(void const&) const
operator&=(void const&)             operator>>(int) const
operator()() const                       operator>>=(int)
operator*(base const&) const      operator[](int) const
operator*(void const&) const       operator^(base const&) const
operator*=(base const&)             operator^(void const&) const
operator*=(void const&)              operator^=(base const&)
operator+(base const&) const      operator^=(void const&)
operator+(void const&) const       operator|(base const&) const
operator++()                              operator|(void const&) const
operator+=(base const&)             operator|=(base const&)
operator+=(void const&)              operator|=(void const&)
operator-(base const&) const        operator||(base const&) const
operator-(void const&) const        operator||(void const&) const
operator--()                                operator~() const
operator-=(base const&)
(gdb)
(gdb) print base::operator!=
$3 = {bool (const base * const, const void &)} 0x9784
<base::operator!=(void const&) const>
(gdb)
}}}

  * here there are  duplicate overloaded functions (for binary
operators) showing with void class object reference as an argument

  * output of "print base::operator!=" is not the expected one.
instead of "const void &", "const base &" is required


 * Same C++  source code (cpexprs.cc) compiled with gcc 4.3.3 and
debuged using GDB 7.2

   * Here no duplicate operator overloading function are displayed for
binary operators

   * And getting expected result on GDB while printing binary operator
overloaded function
{{{
(gdb) p base::operator
operator char*() const              operator--()
operator delete(void*)              operator-=(base const&)
operator delete[](void*)            operator->() const
operator fluff*() const               operator->*(base const&) const
operator fluff**() const             operator/(base const&) const
operator int() const                   operator/=(base const&)
operator new(size_t)                 operator<(base const&) const
operator new(unsigned int)        operator<<(int) const
operator new[](size_t)               operator<<=(int)
operator new[](unsigned int)      operator<=(base const&) const
operator!() const                        operator=(base const&)
operator!=(base const&) const    operator==(base const&) const
operator%(base const&) const    operator>(base const&) const
operator%=(base const&)          operator>=(base const&) const
operator&&(base const&) const   operator>>(int) const
operator&(base const&) const     operator>>=(int)
operator&=(base const&)           operator[](int) const
operator()() const                      operator^(base const&) const
operator*(base const&) const      operator^=(base const&)
operator*=(base const&)            operator|(base const&) const
operator+(base const&) const     operator|=(base const&)
operator++()                             operator||(base const&) const
operator+=(base const&)            operator~() const
operator-(base const&) const
(gdb) p base::operator!=
$1 = {bool (const base * const, const base &)} 0x9904
<base::operator!=(base const&) const>
(gdb)
}}}


if you have any idea to fix this issue, please share it

thanks and regards
viju


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Issue with printing binary operator overloaded function on GDB 7.2
  2010-12-23  7:53 Issue with printing binary operator overloaded function on GDB 7.2 viju vincent
@ 2010-12-27 19:38 ` Keith Seitz
  2010-12-27 19:44   ` Andreas Schwab
  0 siblings, 1 reply; 4+ messages in thread
From: Keith Seitz @ 2010-12-27 19:38 UTC (permalink / raw)
  To: viju vincent; +Cc: gdb

On 12/22/2010 11:53 PM, viju vincent wrote:

>   * From GDB log
> {{{
>     print base::operator!=
> $17 = {bool (const base * const, const void&)} 0x9784
> <base::operator!=(void const&) const>
> (gdb) FAIL: gdb.cp/cpexprs.exp: print base::operator!=
> }}}

What's a "const void&"? :-)

FWIW, I've tried CVS head with the following GCCs: 4.4.5 20101112 (Red 
Hat 4.4.5-2), 4.6.0 20101227 (experimental), and 4.5.2 (GCC), and none 
of them exhibit the problem (cpexprs.exp passes as I expect it to).

What does the debug info say the type of base::operator!= is? I suspect 
it is wrong. [You can use "readelf -wi" or "eu-readelf -wi" to inspect 
the debug info.]

Keith


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Issue with printing binary operator overloaded function on GDB 7.2
  2010-12-27 19:38 ` Keith Seitz
@ 2010-12-27 19:44   ` Andreas Schwab
  2010-12-27 20:05     ` Keith Seitz
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2010-12-27 19:44 UTC (permalink / raw)
  To: Keith Seitz; +Cc: viju vincent, gdb

Keith Seitz <keiths@redhat.com> writes:

> On 12/22/2010 11:53 PM, viju vincent wrote:
>
>>   * From GDB log
>> {{{
>>     print base::operator!=
>> $17 = {bool (const base * const, const void&)} 0x9784
>> <base::operator!=(void const&) const>
>> (gdb) FAIL: gdb.cp/cpexprs.exp: print base::operator!=
>> }}}
>
> What's a "const void&"? :-)
>
> FWIW, I've tried CVS head with the following GCCs: 4.4.5 20101112 (Red Hat
> 4.4.5-2), 4.6.0 20101227 (experimental), and 4.5.2 (GCC), and none of them
> exhibit the problem (cpexprs.exp passes as I expect it to).

See <http://gcc.gnu.org/PR43628>.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Issue with printing binary operator overloaded function on GDB 7.2
  2010-12-27 19:44   ` Andreas Schwab
@ 2010-12-27 20:05     ` Keith Seitz
  0 siblings, 0 replies; 4+ messages in thread
From: Keith Seitz @ 2010-12-27 20:05 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: viju vincent, gdb

On 12/27/2010 11:44 AM, Andreas Schwab wrote:
>> FWIW, I've tried CVS head with the following GCCs: 4.4.5 20101112 (Red Hat
>> 4.4.5-2), 4.6.0 20101227 (experimental), and 4.5.2 (GCC), and none of them
>> exhibit the problem (cpexprs.exp passes as I expect it to).
>
> See<http://gcc.gnu.org/PR43628>.

Excellent! I tried searching, but either I gave up to early or my 
searchfu is seriously degraded during the holidays...

Thanks!
Keith


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-12-27 20:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-23  7:53 Issue with printing binary operator overloaded function on GDB 7.2 viju vincent
2010-12-27 19:38 ` Keith Seitz
2010-12-27 19:44   ` Andreas Schwab
2010-12-27 20:05     ` Keith Seitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox