MCPcopy Create free account
hub / github.com/boostorg/build / builtin_backtrace

Function builtin_backtrace

src/engine/builtins.cpp:1374–1403  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1372 */
1373
1374LIST * builtin_backtrace( FRAME * frame, int flags )
1375{
1376 LIST * const levels_arg = lol_get( frame->args, 0 );
1377 int levels = list_empty( levels_arg )
1378 ? (int)( (unsigned int)(-1) >> 1 )
1379 : atoi( object_str( list_front( levels_arg ) ) );
1380
1381 LIST * result = L0;
1382 for ( ; ( frame = frame->prev ) && levels; --levels )
1383 {
1384 char const * file;
1385 int line;
1386 char buf[ 32 ];
1387 string module_name[ 1 ];
1388 get_source_line( frame, &file, &line );
1389 sprintf( buf, "%d", line );
1390 string_new( module_name );
1391 if ( frame->module->name )
1392 {
1393 string_append( module_name, object_str( frame->module->name ) );
1394 string_append( module_name, "." );
1395 }
1396 result = list_push_back( result, object_new( file ) );
1397 result = list_push_back( result, object_new( buf ) );
1398 result = list_push_back( result, object_new( module_name->value ) );
1399 result = list_push_back( result, object_new( frame->rulename ) );
1400 string_free( module_name );
1401 }
1402 return result;
1403}
1404
1405
1406/*

Callers

nothing calls this directly

Calls 8

lol_getFunction · 0.85
object_strFunction · 0.85
get_source_lineFunction · 0.85
string_newFunction · 0.85
string_appendFunction · 0.85
list_push_backFunction · 0.85
object_newFunction · 0.85
string_freeFunction · 0.85

Tested by

no test coverage detected