Where the exception was thrown?

This is a discussion on Where the exception was thrown? within the C++ Programming forums, part of the General Programming Boards category; Is there a way to know where the exception was created? I catch an exception from a string being constructed ...

  1. #1
    Registered User Mortissus's Avatar
    Join Date
    Dec 2004
    Location
    Brazil, Porto Alegre
    Posts
    152

    Where the exception was thrown?

    Is there a way to know where the exception was created? I catch an exception from a string being constructed with NULL, but do not know what string assignment causes the problem.

    Thanks!

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    7,339
    Usually if you are running through a debugger you can have execution stop when an exception is thrown and then check the stack to find the culprit.

  3. #3
    Registered User Mortissus's Avatar
    Join Date
    Dec 2004
    Location
    Brazil, Porto Alegre
    Posts
    152
    I was trying to use a debugger.I found my error. I was trying to use gdb compiling with option -g. gdb can provide some (in)correct information when compiling in this mode.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Exception handling in a large project
    By EVOEx in forum C++ Programming
    Replies: 7
    Last Post: 01-25-2009, 06:33 AM
  2. exception handling
    By coletek in forum C++ Programming
    Replies: 2
    Last Post: 01-12-2009, 04:28 PM
  3. How do I catch an exception thrown from a linked DLL?
    By 6tr6tr in forum C++ Programming
    Replies: 2
    Last Post: 04-24-2008, 07:49 AM
  4. using swap to make assignment operator exception safe
    By George2 in forum C++ Programming
    Replies: 9
    Last Post: 01-10-2008, 05:32 AM
  5. Problem with the exception class in MINGW
    By indigo0086 in forum C++ Programming
    Replies: 6
    Last Post: 01-20-2007, 12:12 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21