File tree 1 file changed +51
-0
lines changed
include/boost/stacktrace/detail
1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change @@ -247,6 +247,57 @@ public:
247
247
const std::size_t delimiter = result.find_first_of (' !' );
248
248
if (module_name) {
249
249
*module_name = result.substr (0 , delimiter);
250
+ if (!module_name->empty ()) {
251
+ ULONG64 base = 0 ;
252
+ res = (S_OK == idebug_->GetModuleByOffset (
253
+ offset,
254
+ 0 ,
255
+ nullptr ,
256
+ &base
257
+ ));
258
+
259
+ if (res) {
260
+ name[0 ] = ' \0 ' ;
261
+ size = 0 ;
262
+ res = (S_OK == idebug_->GetModuleNames (
263
+ DEBUG_ANY_ID,
264
+ base,
265
+ name,
266
+ sizeof (name),
267
+ &size,
268
+ nullptr ,
269
+ 0 ,
270
+ nullptr ,
271
+ nullptr ,
272
+ 0 ,
273
+ nullptr
274
+ ));
275
+ }
276
+
277
+ if (!res && size != 0 )
278
+ {
279
+ std::string module_path (size, char ());
280
+ res = (S_OK == idebug_->GetModuleNames (
281
+ DEBUG_ANY_ID,
282
+ base,
283
+ &module_path[0 ],
284
+ static_cast <ULONG>(module_path.size ()),
285
+ &size,
286
+ nullptr ,
287
+ 0 ,
288
+ nullptr ,
289
+ nullptr ,
290
+ 0 ,
291
+ nullptr
292
+ ));
293
+ if (res && size > 1 ) {
294
+ module_name->assign (module_path, size - 1 );
295
+ }
296
+ }
297
+ else if (res && size > 1 ) {
298
+ module_name->assign (name, size - 1 );
299
+ }
300
+ }
250
301
}
251
302
252
303
if (delimiter == std::string::npos) {
You can’t perform that action at this time.
0 commit comments