# -*- shell-script -*- # gdb-like "undisplay" # # Copyright (C) 2002-2010 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 undisplay \ "**undisplay** *display-number*... Cancel some expressions to be displayed when program stops. Arguments are the code numbers of the expressions to stop displaying. Examples: --------- undisplay 0 # Removes display statement 0 undisplay 0 3 4 # Removes display statements 0, 3, and 4 See also: --------- *display* and *info display*." proc _Dbg_do_undisplay { typeset -i del if (( 0 == $# )) { _Dbg_errmsg 'You need to pass in some display numbers.' return 0 } for del in [$ifsjoin(Argv)] { if test -n $(_Dbg_disp_exp[$del]) { _Dbg_write_journal_eval "unset _Dbg_disp_exp[$del]" _Dbg_write_journal_eval "unset _Dbg_disp_enable[$del]" _Dbg_msg "Display entry $del unset." } else { _Dbg_msg "Display entry $del doesn't exist, so nothing done." } } return 0 } (CommandList children: [ (C {(_Dbg_help_add)} {(undisplay)} { (DQ ("**undisplay** *display-number*...\n") ("\n") ( "Cancel some expressions to be displayed when program stops. Arguments are the code numbers\n" ) ("of the expressions to stop displaying.\n") ("\n") ("Examples:\n") ("---------\n") ("\n") (" undisplay 0 # Removes display statement 0\n") (" undisplay 0 3 4 # Removes display statements 0, 3, and 4\n") ("\n") ("See also:\n") ("---------\n") ("\n") ("*display* and *info display*.") ) } ) (FuncDef name: _Dbg_do_undisplay body: (BraceGroup children: [ (C {(typeset)} {(-i)} {(del)}) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_DEqual left: (ArithWord w:{(Lit_Digits 0)}) right: (ArithWord w:{($ VSub_Pound "$#")}) ) ) terminator: ) ] action: [ (C {(_Dbg_errmsg)} {(SQ <"You need to pass in some display numbers.">)}) (ControlFlow token: arg_word:{(0)}) ] spids: [-1 115] ) ] spids: [-1 130] ) (ForEach iter_name: del iter_words: [{($ VSub_At "$@")}] do_arg_iter: False body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-n)} { (DQ (BracedVarSub token: bracket_op: (ArrayIndex expr: (ArithWord w:{($ VSub_Name "$del")}) ) spids: [154 159] ) ) } {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(_Dbg_write_journal_eval)} {(DQ ("unset _Dbg_disp_exp[") ($ VSub_Name "$del") ("]"))} ) (C {(_Dbg_write_journal_eval)} {(DQ ("unset _Dbg_disp_enable[") ($ VSub_Name "$del") ("]"))} ) (C {(_Dbg_msg)} {(DQ ("Display entry ") ($ VSub_Name "$del") (" unset."))}) ] spids: [-1 166] ) ] else_action: [ (C {(_Dbg_msg)} { (DQ ("Display entry ") ($ VSub_Name "$del") (" doesn't exist, so nothing done.") ) } ) ] spids: [196 208] ) ] spids: [144 211] ) spids: [139 142] ) (ControlFlow token: arg_word:{(0)}) ] spids: [89] ) spids: [85 88] ) ] )