You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My cpp code is throwing some IndexError: vector::_M_range_check exception, which is caused by an out-of-range vector access. I'd like to use gdb to find the location (stack trace) of this exception.
I tried to use catch throw, but there are too many other (caught) exceptions during the running of the program. So I found this answer, which uses break abort. Unfortunately, pybind11 is catching this exception, so the code does not reach the abort function. I'd like to know if there are any good ideas to locate an exception in cpp code warpped by pybind11?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
My cpp code is throwing some
IndexError: vector::_M_range_check
exception, which is caused by an out-of-range vector access. I'd like to usegdb
to find the location (stack trace) of this exception.I tried to use
catch throw
, but there are too many other (caught) exceptions during the running of the program. So I found this answer, which usesbreak abort
. Unfortunately, pybind11 is catching this exception, so the code does not reach theabort
function. I'd like to know if there are any good ideas to locate an exception in cpp code warpped by pybind11?Beta Was this translation helpful? Give feedback.
All reactions