Debian Codegraph @

libdebugger/command/continue.c

raw symbols SCIP
1 /*
2 Copyright (C) 2011, 2015, 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 /* Continue running program. */
20
21 /** \file libdebugger/command/continue.c
22 *
23 * \brief Debugger `continue` command.
24 *
25 * Debugger command to continue running.
26 */
27
28 #include "../../src/trace.h"
29 #include "../../src/expand.h"
30 #include "../break.h"
31 #include "../fns.h"
32 #include "../stack.h"
33
34 extern debug_return_t
35 dbg_cmd_continue (char *psz_args)
36 {
37 if (psz_args && *psz_args) {
38 char *psz_target = get_word(&psz_args);
39 file_t *p_target = NULL;
40 brkpt_mask_t i_brkpt_mask;
41
42 /** FIXME: DRY with code in break.h **/
43 if (p_stack && p_stack->p_target) {
44 char *psz_expanded_target =
45 variable_expand_set(psz_target, p_stack->p_target->variables);
46 if (*psz_expanded_target) {
47 p_target = lookup_file(psz_expanded_target);
48 }
49 } else
50 p_target = lookup_file(psz_target);
51
52 if (!p_target) {
53 printf("Can't find target %s; breakpoint not set.\n", psz_target);
54 return debug_cmd_error;
55 }
56
57 /* FIXME: Combine with code in continue. */
58 psz_args = get_word(&psz_args);
59 if (!(psz_args && *psz_args))
60 i_brkpt_mask = BRK_ALL;
61 else {
62 char *psz_break_type;
63 i_brkpt_mask = get_brkpt_option(psz_args);
64 while ((psz_break_type = get_word(&psz_args))) {
65 if (!(psz_break_type && *psz_break_type)) break;
66 i_brkpt_mask |= get_brkpt_option(psz_break_type) ;
67 }
68 }
69
70 if (!add_breakpoint(p_target, i_brkpt_mask|BRK_TEMP))
71 return debug_cmd_error;
72 } else {
73 db_level = 0;
74 }
75
76 i_debugger_stepping = 0;
77 i_debugger_nexting = 0;
78 define_variable_in_set("MAKEFLAGS", sizeof("MAKEFLAGS")-1,
79 "", o_debugger, 0, NULL, NULL);
80 return continue_execution;
81 };
82
83 /*
84 * Local variables:
85 * eval: (c-set-style "gnu")
86 * indent-tabs-mode: nil
87 * End:
88 */