M
M
Mercury132016-09-13 13:07:54
C++ / C#
Mercury13, 2016-09-13 13:07:54

How to catch in GDB an exception thrown from basic_string(const charT*)?

There was an accident at the junction of my code and COM - "basic_string:: _S_construct null not valid". Apparently, some COM object unexpectedly returned a NULL string. You can hardly understand this matter with logic, you need to look for the point where it happened. The standard way to intercept where the crash happened (RMB → Add breakpoint → Break when C++ exception is thrown) doesn't work - the constructor basic_string::basic_string(const charT*)belongs to libc++.
What are the ways to understand where the accident came from?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mercury13, 2016-09-13
@Mercury13

Found.
Connect static libc++ ( -static-libstdc++), then everything will be fine.

R
Rou1997, 2016-09-13
@Rou1997

Load symbols from libc++ and put break.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question