| 1 | /* |
| 2 | Copyright (C) 2015, 2020 R. Bernstein |
| 3 | <[email protected]> |
| 4 | This file is part of GNU Make (remake variant). |
| 5 | |
| 6 | GNU Make is free software; you can redistribute it and/or modify |
| 7 | it under the terms of the GNU General Public License as published by |
| 8 | the Free Software Foundation; either version 2, or (at your option) |
| 9 | any later version. |
| 10 | |
| 11 | GNU Make is distributed in the hope that it will be useful, |
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | GNU General Public License for more details. |
| 15 | |
| 16 | You should have received a copy of the GNU General Public License |
| 17 | along with GNU Make; see the file COPYING. If not, write to |
| 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 19 | Boston, MA 02111-1307, USA. */ |
| 20 | |
| 21 | |
| 22 | /** |
| 23 | * \brief Debugger `step` command. |
| 24 | * |
| 25 | * Step execution until another stopping point is reached Argument N |
| 26 | * means do this N times (or until there's another reason to stop. |
| 27 | */ |
| 28 | |
| 29 | #include "../../src/trace.h" |
| 30 | #include "../../src/debug.h" |
| 31 | #include "../../src/variable.h" |
| 32 | #include "../fns.h" |
| 33 | |
| 34 | extern debug_return_t |
| 35 | dbg_cmd_step (char *psz_arg) |
| 36 | { |
| 37 | if (!psz_arg || !*psz_arg) { |
| 38 | i_debugger_stepping = 1; |
| 39 | i_debugger_nexting = 0; |
| 40 | define_variable_in_set("MAKEFLAGS", sizeof("MAKEFLAGS")-1, |
| 41 | "X", o_debugger, 0, NULL, NULL); |
| 42 | return continue_execution; |
| 43 | } |
| 44 | if (get_uint(psz_arg, &i_debugger_stepping, true)) { |
| 45 | define_variable_in_set("MAKEFLAGS", sizeof("MAKEFLAGS")-1, |
| 46 | "X", o_debugger, 0, NULL, NULL); |
| 47 | i_debugger_nexting = 0; |
| 48 | return continue_execution; |
| 49 | } else |
| 50 | return debug_readloop; |
| 51 | } |
| 52 | |
| 53 | |
| 54 | /* |
| 55 | * Local variables: |
| 56 | * eval: (c-set-style "gnu") |
| 57 | * indent-tabs-mode: nil |
| 58 | * End: |
| 59 | */ |