remake  4.3+dbg-1.5
debugger/command/expand.h
Go to the documentation of this file.
1 /* Show a string with variable references expanded. */
2 /*
3 Copyright (C) 2004-2005, 2007-2009, 2011, 2020 R. Bernstein
4 <rocky@gnu.org>
5 This file is part of GNU Make (remake variant).
6 
7 GNU Make is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11 
12 GNU Make is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with GNU Make; see the file COPYING. If not, write to
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
21 static debug_return_t
22 dbg_cmd_expand (char *psz_string)
23 {
24  static char *psz_last_string = NULL;
25 
26  if (!psz_string || !*psz_string) {
27  /* Use last target value */
28  if (psz_last_string)
29  psz_string = psz_last_string;
30  else {
31  printf("No current expand string - must supply something to print\n");
32  return debug_readloop;
33  }
34  }
35 
36  if (dbg_cmd_show_exp(psz_string, true)) {
37  if (psz_last_string) free(psz_last_string);
38  psz_last_string = strdup(psz_string);
39  }
40  return debug_readloop;
41 }
42 
43 static void
44 dbg_cmd_expand_init(unsigned int c)
45 {
46  short_command[c].func = &dbg_cmd_expand;
47  short_command[c].use = _("expand STRING");
48 }
49 
50 
51 /*
52  * Local variables:
53  * eval: (c-set-style "gnu")
54  * indent-tabs-mode: nil
55  * End:
56  */
debug_return_t
Definition: trace.h:32
bool dbg_cmd_show_exp(char *psz_arg, bool expand)
#define _(msgid)
Definition: make.h:293
Definition: trace.h:40