public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Why does debugging "pure virtual method called" have to be sohard?
  1998-11-02 11:56 Mike Stump
@ 1998-11-03 21:28 rich_paul
  1998-11-04 20:47 ` Why does debugging "pure virtual method called" have to be so hard? Jeffrey A Law
  -1 siblings, 1 reply; 22+ messages in thread
From: rich_paul @ 1998-11-03 21:28 UTC (permalink / raw)
  To: egcs

BTW, is there anything I have to do besides saying 'I hereby disclaim my
copyright to the patch I just submitted' ( which I just said ) in order to
have it used?

I suppose it wouldn't hurt to get a 'I don't own you' form from my
employer just for the record.  What do y'all need?


--------
Where do you want to crash, toady?


^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: Why does debugging "pure virtual method called" have to be so hard?
@ 1998-11-02 11:56 Mike Stump
  0 siblings, 0 replies; 22+ messages in thread
From: Mike Stump @ 1998-11-02 11:56 UTC (permalink / raw)
  To: jason, oliva; +Cc: egcs

> I'd rather modify __pure_virtual() so that it [ ... ] throws an
> exception of some non-standard type, say, __pure_virtual_exception,
> which may end up turning into a call of unexpected(), then
> terminate().

From the perspective of software fault tolerance, I think throwing an
exception, which can be caught and programmed around, would be more
desirable than what we do now or what we did yesterday.  I'm for it.

^ permalink raw reply	[flat|nested] 22+ messages in thread
* RE: Why does debugging "pure virtual method called" have to be so hard?
@ 1998-10-28 12:45 Wegher, Jeff
  0 siblings, 0 replies; 22+ messages in thread
From: Wegher, Jeff @ 1998-10-28 12:45 UTC (permalink / raw)
  To: egcs

I don't understand how throwing an exception when a pure virtual method is
accidentally invoked would help in the debugging process.  Won't the throw
unwind your stack so you can't see where it happened?  Yikes...  I'd much
rather have abort() called which will give me a core file to look at -- at
least under UNIX.

Jeff


^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: Why does debugging "pure virtual method called" have to be so hard?
@ 1998-10-16 13:29 John Lindal
  0 siblings, 0 replies; 22+ messages in thread
From: John Lindal @ 1998-10-16 13:29 UTC (permalink / raw)
  To: egcs

> How to others feel about calling abort instead of _exit?  abort might be
> more useful.

Another point in favor of abort() is that gdb will catch it and let you
examine the stack trace immediately.

Also, if you're just running along and it happens and you don't know what
caused it, you have the core dump right there.  Otherwise, you have to try
to figure out how to reproduce it before you can debug it.

John


^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: Why does debugging "pure virtual method called" have to be so hard?
@ 1998-10-16 11:28 John Lindal
  0 siblings, 0 replies; 22+ messages in thread
From: John Lindal @ 1998-10-16 11:28 UTC (permalink / raw)
  To: egcs

> The rest of us just set a breakpoint on __pure_virtual, and then run the
> program in the debugger.  We evidently don't find it hard enough to do
> something else.

That's a clever idea, but I didn't even know such a function existed.  I
suspect most people don't, so abort() would be much better since most
people know how to debug a core dump.

John


^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: Why does debugging "pure virtual method called" have to be so hard?
@ 1998-10-15 18:57 Mike Stump
  1998-10-16  4:10 ` Lassi A. Tuura
  0 siblings, 1 reply; 22+ messages in thread
From: Mike Stump @ 1998-10-15 18:57 UTC (permalink / raw)
  To: egcs, jafl; +Cc: jafl

> Date: Thu, 15 Oct 1998 16:16:21 -0700
> From: John Lindal <jafl@alice.wonderland.caltech.edu>

> Why does debugging "pure virtual method called" have to be so hard?

The rest of us just set a breakpoint on __pure_virtual, and then run
the program in the debugger.  We evidently don't find it hard enough
to do something else.

How to others feel about calling abort instead of _exit?  abort might
be more useful.

^ permalink raw reply	[flat|nested] 22+ messages in thread
* Why does debugging "pure virtual method called" have to be so hard?
@ 1998-10-15 16:00 John Lindal
  0 siblings, 0 replies; 22+ messages in thread
From: John Lindal @ 1998-10-15 16:00 UTC (permalink / raw)
  To: egcs; +Cc: jafl

Why does debugging "pure virtual method called" have to be so hard?  The
code generated by the compiler doesn't print out anything about where the
problem occurred and doesn't even dump core so one can examine the stack
trace in a debugger!

Surely it should be easy to get the compiler to generate code to dump core
when a pure virtual method is called?

John


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

end of thread, other threads:[~1998-11-04 20:47 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <199810160157.SAA17725.cygnus.egcs@kankakee.wrs.com>
1998-10-16  0:09 ` Why does debugging "pure virtual method called" have to be so hard? Jason Merrill
1998-10-26  2:13   ` Alexandre Oliva
1998-10-25 23:42     ` Jason Merrill
1998-10-26 13:42     ` Joe Buck
1998-10-27  3:02       ` Alexandre Oliva
1998-10-26 20:11         ` Joe Buck
1998-10-27 14:55       ` Mark Mitchell
1998-10-27 16:33         ` Joe Buck
1998-10-27 16:33           ` Mark Mitchell
1998-10-29  0:50           ` Why does debugging "pure virtual method called" have to be sohard? rich_paul
1998-11-01 15:00           ` rich_paul
1998-11-02  7:12             ` Martin von Loewis
1998-11-02 22:42               ` rich_paul
1998-10-27 18:13       ` rich_paul
1998-11-03 21:28 rich_paul
1998-11-04 20:47 ` Why does debugging "pure virtual method called" have to be so hard? Jeffrey A Law
  -- strict thread matches above, loose matches on Subject: below --
1998-11-02 11:56 Mike Stump
1998-10-28 12:45 Wegher, Jeff
1998-10-16 13:29 John Lindal
1998-10-16 11:28 John Lindal
1998-10-15 18:57 Mike Stump
1998-10-16  4:10 ` Lassi A. Tuura
1998-10-15 16:00 John Lindal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).