2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-15 13:02:11 +00:00

Make the BACKTRACE rule accept an optional 'levels' parameter.

[SVN r14563]
This commit is contained in:
Vladimir Prus
2002-07-22 17:39:42 +00:00
parent c564bb24a1
commit 398dd1c01f
2 changed files with 10 additions and 4 deletions

View File

@@ -178,7 +178,7 @@ load_builtins()
}
{
char * args[] = { 0 };
char * args[] = { "levels", "?", 0 };
bind_builtin( "BACKTRACE" ,
builtin_backtrace, 0, args );
}
@@ -600,8 +600,11 @@ void backtrace( FRAME *frame )
*/
LIST *builtin_backtrace( PARSE *parse, FRAME *frame )
{
LIST* levels_arg = lol_get( frame->args, 0 );
int levels = levels_arg ? atoi( levels_arg->string ) : ((unsigned int)(-1) >> 1) ;
LIST* result = L0;
while ( frame = frame->prev )
for(; (frame = frame->prev) && levels ; --levels )
{
char* file;
int line;

View File

@@ -178,7 +178,7 @@ load_builtins()
}
{
char * args[] = { 0 };
char * args[] = { "levels", "?", 0 };
bind_builtin( "BACKTRACE" ,
builtin_backtrace, 0, args );
}
@@ -600,8 +600,11 @@ void backtrace( FRAME *frame )
*/
LIST *builtin_backtrace( PARSE *parse, FRAME *frame )
{
LIST* levels_arg = lol_get( frame->args, 0 );
int levels = levels_arg ? atoi( levels_arg->string ) : ((unsigned int)(-1) >> 1) ;
LIST* result = L0;
while ( frame = frame->prev )
for(; (frame = frame->prev) && levels ; --levels )
{
char* file;
int line;