# -*- shell-script -*- # "set autolist" debugger command # # Copyright (C) 2010-2011, 2016 Rocky Bernstein # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to # the Free Software Foundation, 59 Temple Place, Suite 330, Boston, # MA 02111 USA. _Dbg_help_add_sub set autolist \ '**set autolist** [**on**|**off**] Run list command automatically every time the debugger enters See also: --------- **show autolist**' 1 _Dbg_next_complete[set autolist]='_Dbg_complete_onoff' proc _Dbg_do_set_autolist { typeset onoff=$(1:-'off') matchstr $onoff { on | 1 { _Dbg_write_journal_eval "_Dbg_cmdloop_hooks[list]=_Dbg_do_list" } off | 0 { _Dbg_write_journal_eval "unset '_Dbg_cmdloop_hooks[list]'" unset '_Dbg_cmdloop_hooks[list]' } * { _Dbg_errmsg "\"on\" or \"off\" expected." return 1 } } _Dbg_do_show 'autolist' return 0 } (CommandList children: [ (C {(_Dbg_help_add_sub)} {(set)} {(autolist)} { (SQ <"**set autolist** [**on**|**off**]\n"> <"\n"> <"Run list command automatically every time the debugger enters\n"> <"\n"> <"See also:\n"> <"---------\n"> <"\n"> <"**show autolist**"> ) } {(1)} ) (C {(_Dbg_next_complete) (Lit_Other "[") (set)} {(autolist) (Lit_Other "]") (Lit_Other "=") (SQ <_Dbg_complete_onoff>)} ) (FuncDef name: _Dbg_do_set_autolist body: (BraceGroup children: [ (C {(typeset)} {(Lit_VarLike "onoff=") (BracedVarSub token: suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [101 107] ) } ) (Case to_match: {($ VSub_Name "$onoff")} arms: [ (case_arm pat_list: [{(on)} {(1)}] action: [ (C {(_Dbg_write_journal_eval)} {(DQ ("_Dbg_cmdloop_hooks[list]=_Dbg_do_list"))}) ] spids: [117 123 133 -1] ) (case_arm pat_list: [{(off)} {(0)}] action: [ (C {(_Dbg_write_journal_eval)} {(DQ ("unset '_Dbg_cmdloop_hooks[list]'"))}) (C {(unset)} {(SQ <"_Dbg_cmdloop_hooks[list]">)}) ] spids: [136 142 159 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (C {(_Dbg_errmsg)} { (DQ (EscapedLiteralPart token:) (on) (EscapedLiteralPart token: ) (" or ") (EscapedLiteralPart token:) (off) (EscapedLiteralPart token: ) (" expected.") ) } ) (ControlFlow token: arg_word:{(1)}) ] spids: [162 164 -1 186] ) ] spids: [110 114 186] ) (C {(_Dbg_do_show)} {(SQ )}) (ControlFlow token: arg_word:{(0)}) ] spids: [95] ) spids: [91 94] ) ] )