Debian Codegraph @

libdebugger/command/where.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 /**
21 * \brief Debugger `where` command.
22 *
23 * Show dependency target call stack information.
24 **/
25
26 #include "../../src/trace.h"
27 #include "../../src/print.h"
28 #include "../fns.h"
29 #include "../stack.h"
30
31 extern debug_return_t
32 dbg_cmd_where (char *psz_amount)
33 {
34 int i_amount;
35
36 if (!psz_amount || !*psz_amount) {
37 i_amount = MAX_STACK_SHOW;
38 } else if (!get_int(psz_amount, &i_amount, true)) {
39 return debug_readloop;
40 }
41
42 if (p_stack_top)
43 print_target_stack (p_stack_top, i_stack_pos, i_amount);
44
45 if (p_stack_floc_top)
46 print_floc_stack (i_stack_pos, i_amount);
47
48 /* If we are in a recursive Make, show the command invocation */
49 if (makelevel > 0)
50 {
51 printf("Most-recent (level %u) invocation:\n\t", makelevel);
52 dbg_print_invocation();
53 }
54 return debug_readloop;
55 }
56
57
58 /*
59 * Local variables:
60 * eval: (c-set-style "gnu")
61 * indent-tabs-mode: nil
62 * End:
63 */