remake  4.3+dbg-1.5
continue.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2011, 2015, 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 /* Continue running program. */
20 static debug_return_t
21 dbg_cmd_continue (char *psz_args)
22 {
23  if (psz_args && *psz_args) {
24  char *psz_target = get_word(&psz_args);
25  file_t *p_target = NULL;
26  brkpt_mask_t i_brkpt_mask;
27 
29  if (p_stack && p_stack->p_target) {
30  char *psz_expanded_target =
32  if (*psz_expanded_target) {
33  p_target = lookup_file(psz_expanded_target);
34  }
35  } else
36  p_target = lookup_file(psz_target);
37 
38  if (!p_target) {
39  printf("Can't find target %s; breakpoint not set.\n", psz_target);
40  return debug_cmd_error;
41  }
42 
43  /* FIXME: Combine with code in continue. */
44  psz_args = get_word(&psz_args);
45  if (!(psz_args && *psz_args))
46  i_brkpt_mask = BRK_ALL;
47  else {
48  char *psz_break_type;
49  i_brkpt_mask = get_brkpt_option(psz_args);
50  while ((psz_break_type = get_word(&psz_args))) {
51  if (!(psz_break_type && *psz_break_type)) break;
52  i_brkpt_mask |= get_brkpt_option(psz_break_type) ;
53  }
54  }
55 
56  if (!add_breakpoint(p_target, i_brkpt_mask|BRK_TEMP))
57  return debug_cmd_error;
58  } else {
59  db_level = 0;
60  }
61 
64  define_variable_in_set("MAKEFLAGS", sizeof("MAKEFLAGS")-1,
65  "", o_debugger, 0, NULL, NULL);
66  return continue_execution;
67 };
68 
69 static void
70 dbg_cmd_continue_init(unsigned int c)
71 {
72  short_command[c].func = &dbg_cmd_continue;
73  short_command[c].use = _("continue [TARGET [all|run|prereq|end]*]");
74 }
75 
76 /*
77  * Local variables:
78  * eval: (c-set-style "gnu")
79  * indent-tabs-mode: nil
80  * End:
81  */
file_t * p_target
Definition: trace.h:81
bool add_breakpoint(file_t *p_target, unsigned int brkp_mask)
Definition: types.h:60
unsigned int brkpt_mask_t
Definition: types.h:64
struct variable * define_variable_in_set(const char *name, size_t length, const char *value, enum variable_origin origin, int recursive, struct variable_set *set, const gmk_floc *flocp)
target_stack_node_t * p_stack
debug_return_t
Definition: trace.h:32
#define _(msgid)
Definition: make.h:293
file_t * lookup_file(const char *name)
char * variable_expand_set(char *psz_line, variable_set_list_t *p_file_set)
unsigned int i_debugger_nexting
struct variable_set_list * variables
Definition: filedef.h:60
char * get_word(char **ppsz_str)
Definition: trace.h:42
int db_level
Definition: debug.h:163
Definition: types.h:61
Definition: variable.h:34
Definition: trace.h:33
brkpt_mask_t get_brkpt_option(const char *psz_break_type)
unsigned int i_debugger_stepping
Definition: filedef.h:34