简体   繁体   中英

In VisualStudio C++ debugger How do I see call stack when an stl:vector index out of range assertion is hit

Using C++ 20 with VS 2022 Community create a std::vector attempt to get an element outside the max bounds - you will get an assertion requestor, and you will see what happens:)

The stack trace is available in all the other cases I have encountered.

I have tried in all the "exception settings" turning on everything to no avail and still the call stack is wiped when this assertion is hit. I also tried finding a place in <vector> where I could manually put in a break point before the requestor is launched as well. Of course it is under many layers of templates and macros. Seemingly it triggers an internal runtime error "std::error report" requestor.

在此处输入图像描述

Ok - found it - it will only show the call stack after you hit "ignore", then it will put up a second requestor with a small print "show call stack" blue link-like button.

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM