Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8973885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:32:57+00:00 2026-06-15T18:32:57+00:00

Catching like this, using GDB : catch throw When exception is thrown, the program

  • 0

Catching like this, using GDB:

catch throw

When exception is thrown, the program stops.

How to make GDB not stop when exception is thrown but is caught by the program ?
Or should I have global try-catch and not using GDB

catch throw

?

EDIT1

try
{
  // every time exception is thrown
  // program is stopped by GDB
}
catch(const std::exception &e)
{
  // even if the exception is caught by the program
}

EDIT2 starting gdb

gdb
file /usr/home/user/program
shell ps x
attach #pid
catch throw
c
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:32:59+00:00Added an answer on June 15, 2026 at 6:32 pm

    catch throw will catch all thrown exceptions and there isn’t a way to restrict that.

    You have at least two options here. You could just not use catch throw at all, and if you’re on some flavor of unix, it will seg fault and stop at the point the exception is thrown, if it won’t be caught.

    Alternately you could set a breakpoint on __raise_exception as seen at ftp://ftp.gnu.org/pub/old-gnu/Manuals/gdb/html_node/gdb_30.html (which was the first hit when I used google – please try to research yourself before posting on Stackoverflow).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is not so much of a problem but more feedback and thoughts. I
I've recently seen code like this: val maybeInt = catching(classOf[NFE]) opt arg.toInt What is
I got many lines in a row which may throw an exception, but no
Is it correct to implement my caching object like this in my controller :
I'm having trouble with catching Zend exceptions. It looks like Zend has it's own
I would like to know the version of ASP.NET supports using Windows AppFabric caching
Catching Throwable is unadvisable for reasons outlined in different posts. However, would it make
I'm using JavaScript and Prototype and catching the key presses from the user. I
I've got a chunk of code that looks like this: var task = Task.Factory.StartNew(()
I've got a chunk of code that looks like this: var task = Task.Factory.StartNew(()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.