(command.CommandList children: [ (C {(_Dbg_help_add)} {(backtrace)} { (DQ ('**backtrace** [*n*]\n') ('\n') ('Print a backtrace of calling functions and sourced files.\n') ('\n') ('files. If *n* is given, list only *n* calls.\n') ('\n') ('Examples:\n') ('---------\n') ('\n') (' backtrace # Print a full stack trace\n') (' backtrace 2 # Print only the top two entries\n') ) } {(1)} {(_Dbg_complete_backtrace)} ) (command.ShFunction name: _Dbg_complete_backtrace body: (command.BraceGroup children: [ (C {(typeset)} {(-i)} {(Id.Lit_VarLike 'start=') (0)}) (command.Sentence child: (C {(typeset)} {(-i)} {(end)}) terminator: (Token id:Id.Op_Semi val:';' span_id:134) ) (command.DParen child: (arith_expr.BinaryAssign op_id: Id.Arith_Equal left: (sh_lhs_expr.Name name:end) right: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:_Dbg_stack_size span_id:139) ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) ) (C {(_Dbg_complete_num_range)} {($ Id.VSub_DollarName '$start')} {($ Id.VSub_DollarName '$end')} ) ] ) ) (command.ShFunction name: _Dbg_do_backtrace body: (command.BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (C {(_Dbg_not_running)}) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:173) arg_word: {(3)} ) ] ) (C {(typeset)} {(-i)} {(Id.Lit_VarLike 'count=') (braced_var_sub token: (Token id:Id.VSub_Number val:1 span_id:185) suffix_op: (suffix_op.Unary op_id: Id.VTest_ColonHyphen arg_word: {($ Id.VSub_DollarName '$_Dbg_stack_size')} ) ) } ) (command.AndOr ops: [Id.Op_DPipe] children: [ (C { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:191) command_list: (command.CommandList children: [(C {(_Dbg_is_int)} {($ Id.VSub_DollarName '$count')})] ) ) } ) (command.BraceGroup children: [ (C {(_Dbg_errmsg)} {(DQ ('Bad integer COUNT parameter: ') ($ Id.VSub_DollarName '$count'))} ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:210) arg_word: {(1)} ) ] ) ] ) (C {(typeset)} {(-i)} {(Id.Lit_VarLike 'frame_start=') (braced_var_sub token: (Token id:Id.VSub_Number val:2 span_id:225) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{(0)}) ) } ) (command.AndOr ops: [Id.Op_DPipe] children: [ (C { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:232) command_list: (command.CommandList children: [(C {(_Dbg_is_int)} {($ Id.VSub_DollarName '$frame_start')})] ) ) } ) (command.BraceGroup children: [ (C {(_Dbg_errmsg)} {(DQ ('Bad integer parameter: ') ($ Id.VSub_DollarName '$ignore_count'))} ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:251) arg_word: {(1)} ) ] ) ] ) (C {(typeset)} {(-i)} {(Id.Lit_VarLike 'i=') (frame_start)}) (C {(typeset)} {(-li)} {(adjusted_pos)}) (C {(typeset)} {(filename)}) (C {(typeset)} {(-i)} {(adjusted_pos)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_DEqual left: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:frame_start span_id:325) ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:334) ) ] action: [ (command.Sentence child: (command.DParen child: (arith_expr.UnaryAssign op_id: Id.Node_PostDMinus child: (sh_lhs_expr.Name name:count) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:345) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:adjusted_pos) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:349) command_list: (command.CommandList children: [(C {(_Dbg_frame_adjusted_pos)} {(0)})] ) ) } spids: [348] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:filename) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:357) command_list: (command.CommandList children: [ (C {(_Dbg_file_canonic)} { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: BASH_SOURCE span_id: 362 ) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$adjusted_pos')} ) ) ) ) } ) ] ) ) } spids: [356] ) ] ) (C {(_Dbg_frame_print)} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:373) command_list: (command.CommandList children: [(C {(_Dbg_frame_prefix)} {(0)})] ) ) } {(SQ (Token id:Id.Lit_Chars val:0 span_id:380))} {(SQ )} {(DQ ($ Id.VSub_DollarName '$filename'))} {(DQ ($ Id.VSub_DollarName '$_Dbg_frame_last_lineno'))} {(SQ )} ) ] spids: [321 336] ) ] ) (C {(typeset)} {(-i)} {(skip_fns)}) (command.DParen child: (arith_expr.BinaryAssign op_id: Id.Arith_Equal left: (sh_lhs_expr.Name name:skip_fns) right: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.ArithWord w: { (braced_var_sub token: (Token id:Id.VSub_Name val:FUNCNAME span_id:414) prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) } ) right: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:_Dbg_stack_size span_id:422) ) ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) ) (C {(_Dbg_frame_set_fn_param)} {($ Id.VSub_DollarName '$skip_fns')}) (command.ForExpr init: (arith_expr.BinaryAssign op_id: Id.Arith_Equal left: (sh_lhs_expr.Name name:i) right: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:frame_start span_id:476) ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) cond: (arith_expr.Binary op_id: Id.Arith_DAmp left: (arith_expr.Binary op_id: Id.Arith_LessEqual left: (arith_expr.VarRef token:(Token id:Id.Lit_ArithVarLike val:i span_id:483)) right: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:_Dbg_stack_size span_id:487) ) ) right: (arith_expr.Binary op_id: Id.Arith_Great left: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:count span_id:491) ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) ) ) update: (arith_expr.UnaryAssign op_id:Id.Node_PostDPlus child:(sh_lhs_expr.Name name:i)) body: (command.DoGroup children: [ (C {(typeset)} {(-i)} {(Id.Lit_VarLike 'arg_count=') (braced_var_sub token: (Token id:Id.VSub_Name val:BASH_ARGC span_id:517) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$_Dbg_next_argc')}) ) ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:adjusted_pos) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:525) command_list: (command.CommandList children: [ (C {(_Dbg_frame_adjusted_pos)} {($ Id.VSub_DollarName '$i')}) ] ) ) } spids: [524] ) ] ) (C {(_Dbg_msg_nocr)} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:534) command_list: (command.CommandList children: [(C {(_Dbg_frame_prefix)} {($ Id.VSub_DollarName '$i')})] ) ) ($ Id.VSub_DollarName '$i') } { (braced_var_sub token: (Token id:Id.VSub_Name val:FUNCNAME span_id:542) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$adjusted_pos')} ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) ) } ) (C {(typeset)} {(Id.Lit_VarLike 'parms=') (SQ )}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_NEqual left: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) right: (arith_expr.ArithWord w: { (braced_var_sub token: (Token id: Id.VSub_Name val: BASH_ARGC span_id: 574 ) prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) } ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:583) ) ] action: [ (C {(_Dbg_frame_fn_param_str)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (braced_var_sub token: (Token id: Id.VSub_Name val: FUNCNAME span_id: 596 ) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.ArithWord w: { ($ Id.VSub_DollarName '$adjusted_pos' ) } ) right: (arith_expr.ArithWord w: {(Id.Lit_Digits 1)} ) ) ) ) } right: {(DQ (source))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:612) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:_Dbg_parm_str) op: assign_op.Equal rhs: { (word_part.EscapedLiteral token: (Token id: Id.Lit_EscapedChar val: '\\"' span_id: 618 ) ) (command_sub left_token: (Token id: Id.Left_DollarParen val: '$(' span_id: 619 ) command_list: (command.CommandList children: [ (C {(_Dbg_file_canonic)} { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: BASH_ARGV span_id: 624 ) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.ArithWord w: { ($ Id.VSub_DollarName '$_Dbg_next_argv' ) } ) right: (arith_expr.ArithWord w: {(Id.Lit_Digits 1)} ) ) ) ) ) } ) ] ) ) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:633)) } spids: [617] ) ] ) ] spids: [591 614] ) ] ) ] spids: [564 585] ) ] ) (C {(typeset)} {(-l)} {(lineno)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_DEqual left: (arith_expr.VarRef token: (Token id: Id.Lit_ArithVarLike val: adjusted_pos span_id: 654 ) ) right: (arith_expr.ArithWord w: { (braced_var_sub token: (Token id: Id.VSub_Name val: BASH_SOURCE span_id: 660 ) prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) } ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:669) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:lineno) op: assign_op.Equal rhs: {(0)} spids: [674] ) ] ) (command.DParen child: (arith_expr.UnaryAssign op_id: Id.Node_PostDMinus child: (sh_lhs_expr.Name name:adjusted_pos) ) ) ] spids: [650 671] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:lineno) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:BASH_LINENO span_id:690) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$adjusted_pos')} ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) ) } spids: [688] ) ] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:filename) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:703) command_list: (command.CommandList children: [ (C {(_Dbg_file_canonic)} { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: BASH_SOURCE span_id: 708 ) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$adjusted_pos')} ) ) ) ) } ) ] ) ) } spids: [702] ) ] ) (C {(_Dbg_msg)} { (DQ ('(') ($ Id.VSub_DollarName '$_Dbg_parm_str') (') called from file ') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\`' span_id:723) ) ($ Id.VSub_DollarName '$filename') ("'") ) } {(DQ ('at line ') ($ Id.VSub_DollarName '$lineno'))} ) (command.DParen child: (arith_expr.UnaryAssign op_id: Id.Node_PostDMinus child: (sh_lhs_expr.Name name:count) ) ) ] ) ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:745) arg_word: {(0)} ) ] ) ) (C {(_Dbg_alias_add)} {(bt)} {(backtrace)}) (C {(_Dbg_alias_add)} {(T)} {(backtrace)}) (C {(_Dbg_alias_add)} {(where)} {(backtrace)}) ] )