20 #include "../../file.h" 21 #include "../../implicit.h" 22 #include "../../print.h" 23 #include "../../main.h" 24 #include "../../rule.h" 25 #include "../../debug.h" 26 #include "../../vpath.h" 30 #include "../file2line.h" 35 " 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\n" 36 "FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN\n" 37 "OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\n" 38 "PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\n" 39 "OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n" 40 "MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS\n" 41 "TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE\n" 42 "PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\n" 43 "REPAIR OR CORRECTION.\n" 45 " 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n" 46 "WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\n" 47 "REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\n" 48 "INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\n" 49 "OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\n" 50 "TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\n" 51 "YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\n" 52 "PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\n" 53 "POSSIBILITY OF SUCH DAMAGES.\n";
55 #include "../subcmd.h" 59 "Show list of target breakpoints",
60 "\n\nShow list of target breakpoints.",
64 "Show where we are currently stopped",
65 "\n\nShow line and Makefile name of where we are currently stopped.",
69 "Show possible breakpoint lines for all targets",
70 "\n\nShow possible breakpoint lines for all targets.",
74 "Show target local variables and their values",
75 "\n\nShow target local variables and their values.",
79 "Show read-in Makefiles",
80 "\n\nShow read-in Makefiles. The last is the one initially named.",
84 "Show target-stack frame",
85 "\n\nShow target-stack frame.",
89 "Show implicit or pattern rules",
91 "Show implicit or pattern rules. Add VERBOSE if you want more info." 96 "Show program information and why we are stopped",
97 "\n\nShow program information and why we are stopped.",
102 "\n\nShow specific target information. See 'help target'.",
106 "Show a list of target names and file locations",
107 " [NAMES|POSITIONS|TASKS|ALL]\n\n" 108 "Show the explicitly-named targets found in read Makefiles.\n" 109 "Suboptions are as follows:\n" 110 " NAMES -- shows target names,\n" 111 " POSITIONS -- shows the location in the Makefile\n" 112 " ALL -- shows names and location\n" 113 " TASKS -- shows target name if it has commands associated with it\n" 115 "The default is ALL.",
119 "Show a list of tasks and their descriptions",
124 "Show all GNU Make variables",
125 "\n\nShow all GNU Make variables.",
129 "Various kinds of warranty you do not have",
130 "\n\nVarious kinds of warranty you do not have.",
133 { NULL, NULL, NULL, NULL,
false, 0}
138 dbg_cmd_info_target_entry (
const file_t *p_target,
152 printf(
"\t%s", p_target->
name);
160 || (output_mask & INFO_TARGET_NAME) ) {
162 printf(
"%s", p_target->
name);
165 printf(
"%s\n", p_target->
name);
173 const struct file *p_target1 = *(
const file_t **) p1;
174 const struct file *p_target2 = *(
const file_t **) p2;
175 return strcmp(p_target1->
name, p_target2->
name);
181 struct file **file_slot_0 = (
struct file **) hash_dump (&
files, 0,
184 struct file **pp_file_slot;
185 struct file *p_target;
187 for (pp_file_slot = file_slot_0; pp_file_slot < file_end; pp_file_slot++) {
188 if ((p_target = *pp_file_slot) != NULL)
189 dbg_cmd_info_target_entry(p_target, output_mask);
196 struct file **file_slot_0 = (
struct file **) hash_dump (&
files, 0,
199 struct file **pp_file_slot;
200 struct file *p_target;
202 for (pp_file_slot = file_slot_0; pp_file_slot < file_end; pp_file_slot++) {
203 if ((p_target = *pp_file_slot) != NULL && p_target->
description) {
217 && p_floc->
filenm[0] !=
'/')
218 dbg_msg(
"Line %lu of \"%s/%s\"",
224 dbg_msg(
"No line number info recorded.\n");
232 printf(
_(
"Program invocation:\n"));
235 printf(
_(
"Recursion level: %u\n"),
makelevel);
240 printf(
_(
"Program is stopped after running rule command(s).\n"));
243 printf(
_(
"Program stopped before rule-prequisite checking.\n"));
246 printf(
_(
"Program is stopped after rule-prequisite checking.\n"));
249 printf(
_(
"Program stopped for updating a goal.\n"));
253 printf(
_(
"Program stopped for reading a file.\n"));
257 printf(
_(
"Program stopped after an error encountered.\n"));
261 printf(
_(
"Program stopped in stepping.\n"));
265 printf(
_(
"Program stopped in stepping before running rule command(s).\n"));
269 printf(
_(
"Program stopped from explicit debugger function call.\n"));
273 printf(
_(
"Reason not given.\n"));
286 if (!psz_args || 0==strlen(psz_args)) {
288 for (i = 0; info_subcommands[i].
name; i++) {
290 &(info_subcommands[i]),
false);
294 char *psz_subcmd =
get_word(&psz_args);
295 if (0 == strcmp(psz_subcmd,
"lines")) {
300 const char *psz_target = NULL;
301 char *psz_subcmds = NULL;
309 printf(
"Can't get variable information for target %s\n",
315 dbg_errmsg(
"No target information for %s.", psz_target);
320 }
else if (
is_abbrev_of (psz_subcmd,
"breakpoints", 1)) {
324 if (0 == strlen(psz_args))
328 dbg_errmsg(
"File %s not in list of read-in files.", psz_args);
335 if (0 == strlen(psz_args))
337 else if (0 == strcmp(psz_args,
"verbose"))
349 }
else if (0 == strcmp(psz_subcmd,
"targets")) {
352 if (0 == strlen(psz_args))
363 printf(
"Expecting 'all', 'positions', 'names', 'tasks', or nothing; got %s.\n",
369 }
else if (0 == strcmp(psz_subcmd,
"tasks")) {
373 if (0 == strlen(psz_args)) {
379 printf(
"target unknown\n");
392 dbg_errmsg(
_(
"Undefined command \"%s\". Try \"help info\"."),
401 dbg_cmd_info_init(
unsigned int c)
404 short_command[c].use =
_(
"info [SUBCOMMAND]");
405 short_command[c].doc =
406 _(
"Show program information regarding SUBCOMMAND.\n" 407 "If SUBCOMMAND is not specified, give list of \"info\" subcommands.");
file_t * p_target
Definition: trace.h:81
unsigned int phony
Definition: filedef.h:109
info_target_output_mask_t
Definition: trace.h:61
const char * name
Definition: filedef.h:36
char * starting_directory
const char * name
Definition: subcmd.h:5
debug_enter_reason_t last_stop_reason
const char * WARRANTY
Definition: command/info.h:32
gmk_floc floc
Definition: filedef.h:39
void print_variable_info(const void *item, void *arg)
rule_t * find_rule(const char *psz_name)
void dbg_cmd_info_tasks()
Definition: command/info.h:194
void print_variable_data_base(void)
struct hash_table table
Definition: variable.h:93
struct commands * cmds
Definition: filedef.h:46
debug_return_t dbg_cmd_info(char *psz_args)
Definition: command/info.h:284
void print_rule(rule_t *r, bool b_verbose)
void dbg_print_invocation(void)
bool is_abbrev_of(const char *psz_substr, const char *psz_word, unsigned int i_min)
void dbg_cmd_info_program()
Definition: command/info.h:229
debug_return_t
Definition: trace.h:32
void list_breakpoints(void)
unsigned long ht_fill
Definition: hash.h:49
void dbg_cmd_info_line()
Definition: command/info.h:211
#define _(msgid)
Definition: make.h:293
unsigned long lineno
Definition: gnuremake.h:26
file_t * get_target(char **ppsz_args, const char **ppsz_target)
void initialize_file_variables(struct file *file, int reading)
void print_vpath_data_base(void)
bool print_read_makefiles(const char *psz_filename)
void file2lines_dump(void)
struct variable_set_list * variables
Definition: filedef.h:60
char * get_word(char **ppsz_str)
Definition: gnuremake.h:23
void print_rule_data_base(bool b_verbose)
const char * filenm
Definition: gnuremake.h:25
struct variable_set * set
Definition: variable.h:101
void set_file_variables(struct file *file)
debug_return_t dbg_cmd_where(char *psz_args)
Definition: where.h:23
void dbg_help_subcmd_entry(const char *psz_subcmd_name, const char *psz_fmt, subcommand_var_info_t *p_subcmd, bool full_info)
Definition: help.h:25
void dbg_cmd_info_targets(info_target_output_mask_t output_mask)
Definition: command/info.h:179
int dbg_target_compare(const void *p1, const void *p2)
Definition: command/info.h:171
target_stack_node_t * p_stack_top
const char * description
Definition: filedef.h:43
subcommand_var_info_t info_subcommands[]
Definition: command/info.h:57
debug_return_t dbg_cmd_target(char *psz_args)
Definition: target.h:21
void print_target_stack(target_stack_node_t *p, int i_pos, int i_max)