Debian Codegraph @

libdebugger/command/expand.c

raw symbols SCIP
1 /*
2 Copyright (C) 2004-2005, 2007-2009, 2011, 2020 R. Bernstein
3 <[email protected]>
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
21 /** \file libdebugger/command/expand.c
22 *
23 * \brief Debugger `expand` command.
24 *
25 */
26
27 #include "../../src/trace.h"
28 #include "../fns.h"
29
30 /** \file libdebugger/command/expand.c
31 *
32 * \brief Debugger `expand` command.
33 */
34
35 extern debug_return_t
36 dbg_cmd_expand (char *psz_string)
37 {
38 static char *psz_last_string = NULL;
39
40 if (!psz_string || !*psz_string) {
41 /* Use last target value */
42 if (psz_last_string)
43 psz_string = psz_last_string;
44 else {
45 printf("No current expand string - must supply something to print\n");
46 return debug_readloop;
47 }
48 }
49
50 if (dbg_cmd_show_exp(psz_string, true)) {
51 if (psz_last_string) free(psz_last_string);
52 psz_last_string = strdup(psz_string);
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 */