remake  4.3+dbg-1.5
where.h
Go to the documentation of this file.
1 /* Write commands associated with a given target. */
2 /*
3 Copyright (C) 2011 R. Bernstein <rocky@gnu.org>
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 /* Show target call stack info. */
21 
23 dbg_cmd_where (char *psz_amount)
24 {
25  int i_amount;
26 
27  if (!psz_amount || !*psz_amount) {
28  i_amount = MAX_STACK_SHOW;
29  } else if (!get_int(psz_amount, &i_amount, true)) {
30  return debug_readloop;
31  }
32 
33  if (p_stack_top)
35 
36  if (p_stack_floc_top)
37  print_floc_stack (i_stack_pos, i_amount);
38 
39  /* If we are in a recursive Make, show the command invocation */
40  if (makelevel > 0)
41  {
42  printf("Most-recent (level %u) invocation:\n\t", makelevel);
44  }
45  return debug_readloop;
46 }
47 
48 static void
49 dbg_cmd_where_init(unsigned int c)
50 {
51  short_command[c].func = &dbg_cmd_where;
52  short_command[c].use = _("where");
53 }
54 
55 
56 /*
57  * Local variables:
58  * eval: (c-set-style "gnu")
59  * indent-tabs-mode: nil
60  * End:
61  */
debug_return_t dbg_cmd_where(char *psz_amount)
Definition: where.h:23
floc_stack_node_t * p_stack_floc_top
unsigned int makelevel
void dbg_print_invocation(void)
debug_return_t
Definition: trace.h:32
int i_stack_pos
#define _(msgid)
Definition: make.h:293
Definition: trace.h:40
bool get_int(const char *psz_arg, int *pi_result, bool b_warn)
target_stack_node_t * p_stack_top