help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gdb


From: Andre Poenitz
Subject: Re: gdb
Date: Sat, 19 Apr 2008 09:16:04 +0200
User-agent: tin/1.9.2-20070201 ("Dalaruan") (UNIX) (Linux/2.6.22-14-generic (i686))

Paul Pluzhnikov <ppluzhnikov-nsp@gmail.com> wrote:
> moongeegee <moongeegee@gmail.com> writes:
> 
>> I am learning gdb to debug the program. As soon as I run the program,
>> it prompt me an error and terminated.
>> How to step into it or set breakpoint and find the problem. Thanks.
> 
> You may get better answers if you specify which platform you are
> using, which version of the compiler, etc.
> 
> Try setting breakpoint on __cxa_throw.
> 
>>
>> (gdb) run
>> Starting program: /usr/home/grp/gramtest < inputdata
>> terminate called after throwing an instance of 'std::logic_error'
>>   what():  empty rule
> 
> It sounds as if you (or some code you link to) installed non-default
> terminate handler, which printed above message.

It pretty much the behaviour one gets from g++ by default without doing
anything fancy:

  #include <stdexcept>
  int main() { throw std::logic_error("empty rule"); }

produces exactly the same output.

I guess somewhere in the OP's program someting similar happen.  Just
grepping the sources for the literal "empty rule" might already point to
the "interesting" location.

> Default terminate() should have aborted the program, at which point
> gdb should have told you where that's happening.

An uncaught exception in this case...

Andre' 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]