(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:_Dbg_restore_info) op: assign_op.Equal rhs: { (DQ (${ Id.VSub_Name _Dbg_tmpdir) (/) (${ Id.VSub_Name _Dbg_debugger_name) (_restore_) ($ Id.VSub_Dollar '$$') ) } spids: [58] ) ] ) (C {(_Dbg_help_add)} {(shell)} { (DQ ('**shell** [*options*]\n') ('\n') ('Options:\n') ('--------\n') ('\n') (" --no-fns | -F : don't copy in function definitions from parent shell\n") (" --no-vars | -V : don't copy in variable definitions\n") (' --shell SHELL_NAME\n') (' --posix : corresponding shell option\n') (' --login | l : corresponding shell option\n') (' --noprofile : corresponding shell option\n') (' --norc : corresponding shell option\n') ('\n') ('Enter a nested shell, not a subshell. Before entering the shell\n') ('current variable definitions and function definitions are stored in\n') ('profile ') ($ Id.VSub_DollarName '$_Dbg_shell_temp_profile') ('. which is is read in via the\n') ('**--init-file** option.\n') ('\n') ("If you don't want variable definitions to be set, use option **-V** or\n") ("**--no-vars**. If you don't want function definitions to be set, use\n") ('option **-F** or **--no-fns**. There are several corresponding shell\n') ('options. Many of these by nature defeate reading on saved functions\n') ('and variables.\n') ('\n') ('The shell that used is taken from the shell used to build the debugger\n') ('which is: ') ($ Id.VSub_DollarName '$_Dbg_shell_name') ('. Use **--shell** to a different compatible shell.\n') ('\n') ('By default, variables set or changed in the shell do not persist after\n') ('the shell is left to to back to the debugger or debugged program.\n') ('\n') ('However you can tag variables to persist by running the function\n') ("'save_vars' which takes a list of variable names. You can run this\n") ('as many times as you want with as many variable names as you want.\n') ('\n') ('For example:\n') (' save_vars PROFILE PARSER\n') ('marks variable PROFILE and PARSER to be examined and their values used\n') ('in the trap EXIT of the shell.\n') ) } ) (command.ShFunction name: _Dbg_parse_shell_cmd_options body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:OPTLIND) op: assign_op.Equal rhs: {(SQ )} spids: [130] ) ] ) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:135) cond: [ (C {(getopts_long)} {(lFV)} {(opt)} {(no-fns)} {(0)} {(posix)} {(no_argument)} {(login)} {(no_argument)} {(shell)} {(required_argument)} {(norc)} {(no_argument)} {(no-vars)} {(0)} {(SQ )} {($ Id.VSub_At '$@')} ) ] body: (command.DoGroup children: [ (command.Case to_match: {(DQ ($ Id.VSub_DollarName '$opt'))} arms: [ (case_arm pat_list: [{(F)} {(no-fns)}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:_Dbg_o_fns) op: assign_op.Equal rhs: {(0)} spids: [208] ) ] ) ] spids: [199 205 210 -1] ) (case_arm pat_list: [{(V)} {(no-vars)}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:_Dbg_o_vars) op: assign_op.Equal rhs: {(0)} spids: [222] ) ] ) ] spids: [213 219 224 -1] ) (case_arm pat_list: [{(shell)}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:shell) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$OPTARG')} spids: [232] ) ] ) ] spids: [227 229 234 -1] ) (case_arm pat_list: [ {(norc)} {(posix)} {(restricted)} {(login)} {(l)} {(noediting)} {(noprofile)} ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:_Dbg_shell_opts) op: assign_op.PlusEqual rhs: {(DQ (--) ($ Id.VSub_DollarName '$opt'))} spids: [266] ) ] ) ] spids: [237 263 273 -1] ) (case_arm pat_list: [{(Id.Lit_Star '*')}] action: [ (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:281) arg_word: {(1)} ) ] spids: [276 278 286 -1] ) ] ) ] ) ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:295) arg_word: {(0)} ) ] ) ) (command.ShFunction name: _Dbg_do_shell body: (command.BraceGroup children: [ (command.Sentence child: (C {(typeset)} {(-i)} {(_Dbg_o_fns)}) terminator: (Token id:Id.Op_Semi val:';' span_id:315) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:_Dbg_o_fns) op: assign_op.Equal rhs: {(1)} spids: [317] ) ] ) (command.Sentence child: (C {(typeset)} {(-i)} {(_Dbg_o_vars)}) terminator: (Token id:Id.Op_Semi val:';' span_id:326) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:_Dbg_o_vars) op: assign_op.Equal rhs: {(1)} spids: [328] ) ] ) (C {(typeset)} {(Id.Lit_VarLike '_Dbg_shell_opts=') (SQ )}) (C {(typeset)} {(Id.Lit_VarLike 'shell=') ($ Id.VSub_DollarName '$_Dbg_shell')}) (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.VSub_Pound '$#')}) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:356) ) ] action: [ (C {(_Dbg_parse_shell_cmd_options)} {($ Id.VSub_At '$@')}) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DParen child: (arith_expr.Binary op_id: Id.Arith_NEqual left: (arith_expr.ArithWord w:{($ Id.VSub_QMark '$?')}) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) ) ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:379) ) ] ) ] spids: [346 358] ) ] ) (C {(typeset)} {(-i)} {(_Dbg_rc)}) (C {(_Dbg_shell_new_shell_profile)} {($ Id.VSub_DollarName '$_Dbg_o_vars')} {($ Id.VSub_DollarName '$_Dbg_o_fns')} ) (command.Simple words: [ {(echo)} {(DQ ("PS1='") (${ Id.VSub_Name _Dbg_debugger_name) (' ') (Id.Lit_Other '$') (" '"))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_DGreat val:'>>' span_id:417) fd: -1 arg_word: {($ Id.VSub_DollarName '$_Dbg_shell_temp_profile')} ) ] ) (C {($ Id.VSub_DollarName '$shell')} {(--init-file)} {($ Id.VSub_DollarName '$_Dbg_shell_temp_profile')} {($ Id.VSub_DollarName '$_Dbg_shell_opts')} ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:rc) op: assign_op.Equal rhs: {($ Id.VSub_QMark '$?')} spids: [431] ) ] ) (C {(_Dbg_restore_from_nested_shell)}) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DParen child: (arith_expr.Binary op_id: Id.Arith_DEqual left: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) right: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:_Dbg_running span_id:448) ) ) ) (C {(_Dbg_print_location_and_command)}) ] ) ] ) ) (C {(_Dbg_alias_add)} {(sh)} {(shell)}) ] )