Debian Codegraph @

libdebugger/command/delete.c

raw symbols SCIP
1 /*
2 Copyright (C) 2011, 2020 R. Bernstein <[email protected]>
3 This file is part of GNU Make (remake variant).
4
5 GNU Make is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
8 any later version.
9
10 GNU Make is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GNU Make; see the file COPYING. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
19
20 /** \file libdebugger/command/delete.c
21 *
22 * \brief Debugger `delete` command
23 *
24 * Delete some breakpoints. Arguments are breakpoint numbers with spaces
25 * in between. To delete all breakpoints, give no arguments.
26 */
27
28 #include "../../src/trace.h"
29 #include "../break.h"
30 #include "../fns.h"
31 #include "../msg.h"
32
33 extern debug_return_t
34 dbg_cmd_delete(char *psz_args)
35 {
36 int i_brkpt;
37 char *psz_word;
38
39 if (!psz_args || !*psz_args) {
40 unsigned int breakpoints_removed = 0;
41 for (unsigned int i=1; i<=i_breakpoints; i++) {
42 if (remove_breakpoint(i, true)) breakpoints_removed++;
43 }
44 dbg_msg(_("%u breakpoint(s) removed."), breakpoints_removed);
45
46 return debug_readloop;
47 }
48
49 psz_word = get_word(&psz_args);
50 while ( psz_word && *psz_word ) {
51 if (get_int(psz_word, &i_brkpt, true)) {
52 remove_breakpoint(i_brkpt, false);
53 }
54 psz_word = get_word(&psz_args);
55 }
56
57 return debug_readloop;
58 }
59
60 /*
61 * Local variables:
62 * eval: (c-set-style "gnu")
63 * indent-tabs-mode: nil
64 * End:
65 */