Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* gdb.c++ failures
@ 2002-01-10  5:18 Jason Merrill
  2002-01-10 11:52 ` Daniel Jacobowitz
  0 siblings, 1 reply; 8+ messages in thread
From: Jason Merrill @ 2002-01-10  5:18 UTC (permalink / raw)
  To: gdb; +Cc: Jason Merrill

I've been looking at the various C++ debugging failures on
i686-pc-linux-gnu using dwarf2.  Here's my analysis:

  anon-union.exp: The C++ compiler is emitting an extra lexical block, so
   the breakpoint on the closing brace is treated as being outside the
   scope of the variable.  There are two issues here: The compiler output
   is wrong, and the testcase is relying on corner-case behavior that only
   works for the outermost block of a function.  Of course, I don't know
   how we could test for the compiler bug without doing this, so I suppose
   we might as well leave the testcase alone.

  classes.exp: dwarf2 doesn't provide mangled names for abstract
   constructors, and there is a difference of opinion between the
   demangler and c-typeprint.c as to whether the type should be written "A
   const &" or "const A &".  The demangler always puts the cv-qualifier
   after the type it affects, whereas gdb puts it in front whenever that
   would have the correct meaning.  Either one could be changed to match
   the other, or the testcase could be modified to accept either form.
   Thoughts?

   Also, gdb is including artificial arguments in the printed
   representation of the constructors for vB-vD.  The dwarf2 output
   indicates that they are artificial; gdb should not print them.  There
   doesn't seem to be a simple way to handle this in the current gdb data
   structures.

  cplusfuncs.exp: cp-demangle bug.  The code to handle demangling
   pointers-to-functions isn't complex enough.

  local.exp: The test tries to examine InnerLocal outside of its scope,
   which fails.  Doing a ptype while InnerLocal is in scope works fine.
   Meanwhile, ptype Local works outside of Local's scope; apparently being
   inside an additional block makes a difference.  This definitely seems
   like a gdb issue.

  method.exp: The 'print this' tests are failing because gdb is printing
   the types as, say, (A * const), and the test just wants (A *).  The
   former is correct, since 'this' is readonly.  Any objection to changing
   the test (and others affected) to allow the const?

  namespace.exp: gdb prints '\0', the testcase expects '\000'.  An obvious
   fix, which I will apply.

  templates.exp: the artificial args problem breaks destructor
   recognition.  Also, when asked to set a breakpoint on a constructor, gdb
   offers a menu of the different clones, which the testcase doesn't
   like; it seems correct to me.

   Also, the cv-qual placement issue breaks 'print Foo<volatile char *>::foo';
   it needs to be 'print "Foo<char volatile*>::foo"' to match the demangler
   output.  I take it the aCC demangler makes different choices?  I don't
   see any way to get around the dependence of template naming on the
   canonical format chosen by the demangler unless gdb learns to mangle
   names itself; perhaps the syntax of the test should vary with the compiler.

Jason


^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: gdb.c++ failures
@ 2002-01-10  9:12 Michael Elizabeth Chastain
  2002-01-10 11:21 ` Jason Merrill
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Elizabeth Chastain @ 2002-01-10  9:12 UTC (permalink / raw)
  To: gdb, jason; +Cc: fnf

Jason Merrill writes:

>  classes.exp: dwarf2 doesn't provide mangled names for abstract
>   constructors, and there is a difference of opinion between the
>   demangler and c-typeprint.c as to whether the type should be written "A
>   const &" or "const A &".  The demangler always puts the cv-qualifier
>   after the type it affects, whereas gdb puts it in front whenever that
>   would have the correct meaning.  Either one could be changed to match
>   the other, or the testcase could be modified to accept either form.
>   Thoughts?

I'm in favor of changing the test suite to accept either "A const &"
or "const A &".

>   method.exp: The 'print this' tests are failing because gdb is printing
>    the types as, say, (A * const), and the test just wants (A *).  The
>    former is correct, since 'this' is readonly.  Any objection to changing
>    the test (and others affected) to allow the const?

Fred Fish submitted a patch for this.  There is a second issue in the
patch about the type of "this" in const methods.  The type should be
"const A *", and I would be willing to accept "const A * const".
But gdb with stabs is printing just plain "A *".

On the question of accepting "A * const" as the type of "this",
I'm in favor of allowing that.

>  templates.exp:
>    Also, the cv-qual placement issue breaks 'print Foo<volatile char *>::foo';
>    it needs to be 'print "Foo<char volatile*>::foo"' to match the demangler
>    output.  I take it the aCC demangler makes different choices?  I don't
>    see any way to get around the dependence of template naming on the
>    canonical format chosen by the demangler unless gdb learns to mangle
>    names itself; perhaps the syntax of the test should vary with the compiler.

The test script could probe the demangler and then provide whatever
input gdb is using that day.  See gdb.c++/cplusfuncs.exp probe_demangler
for an example.

Michael C


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

end of thread, other threads:[~2002-01-12  1:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-10  5:18 gdb.c++ failures Jason Merrill
2002-01-10 11:52 ` Daniel Jacobowitz
2002-01-10 12:59   ` Jason Merrill
2002-01-10  9:12 Michael Elizabeth Chastain
2002-01-10 11:21 ` Jason Merrill
2002-01-10 11:32   ` Daniel Jacobowitz
2002-01-10 13:25     ` Jason Merrill
2002-01-11 17:11       ` Daniel Jacobowitz

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