remake  4.3+dbg-1.5
delete.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2011, 2020 R. Bernstein <rocky@gnu.org>
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  Delete some breakpoints. Arguments are breakpoint numbers with spaces
21  in between."To delete all breakpoints, give no argument.
22 */
23 
24 static debug_return_t
25 dbg_cmd_delete(char *psz_args)
26 {
27  int i_brkpt;
28  char *psz_word;
29 
30  if (!psz_args || !*psz_args) {
31  unsigned int breakpoints_removed = 0;
32  for (unsigned int i=1; i<=i_breakpoints; i++) {
33  if (remove_breakpoint(i, true)) breakpoints_removed++;
34  }
35  dbg_msg(_("%u breakpoint(s) removed."), breakpoints_removed);
36 
37  return debug_readloop;
38  }
39 
40  psz_word = get_word(&psz_args);
41  while ( psz_word && *psz_word ) {
42  if (get_int(psz_word, &i_brkpt, true)) {
43  remove_breakpoint(i_brkpt, false);
44  }
45  psz_word = get_word(&psz_args);
46  }
47 
48  return debug_readloop;
49 }
50 
51 static void
52 dbg_cmd_delete_init(unsigned int c)
53 {
54  short_command[c].func = &dbg_cmd_delete;
55  short_command[c].use = _("delete BREAKPOINT_NUMBERS...");
56 }
57 
58 /*
59  * Local variables:
60  * eval: (c-set-style "gnu")
61  * indent-tabs-mode: nil
62  * End:
63  */
unsigned int i_breakpoints
bool remove_breakpoint(unsigned int i, bool silent)
debug_return_t
Definition: trace.h:32
#define _(msgid)
Definition: make.h:293
Definition: trace.h:40
void dbg_msg()
char * get_word(char **ppsz_str)
bool get_int(const char *psz_arg, int *pi_result, bool b_warn)