Paul Pluzhnikov <[EMAIL PROTECTED]> wrote:
> moongeegee <[EMAIL PROTECTED]> 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' 
_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to