| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
#include "../../src/trace.h" |
| 22 |
#include "../../src/commands.h" |
| 23 |
#include "../../src/file.h" |
| 24 |
#include "../../src/variable.h" |
| 25 |
#include "../cmd.h" |
| 26 |
#include "../fns.h" |
| 27 |
|
| 28 |
extern debug_return_t |
| 29 |
dbg_cmd_target(char *psz_args) |
| 30 |
{ |
| 31 |
const char *psz_target; |
| 32 |
file_t *p_target = get_target(&psz_args, &psz_target); |
| 33 |
|
| 34 |
if (p_target) { |
| 35 |
print_target_mask_t i_mask = 0; |
| 36 |
char *psz_word; |
| 37 |
|
| 38 |
while( (psz_word = get_word(&psz_args))) { |
| 39 |
if (!*psz_word) { |
| 40 |
break; |
| 41 |
} else if (is_abbrev_of(psz_word, "depends", 1)) { |
| 42 |
i_mask |= PRINT_TARGET_DEPEND; |
| 43 |
} else if (is_abbrev_of(psz_word, "order", 1)) { |
| 44 |
i_mask |= PRINT_TARGET_ORDER; |
| 45 |
} else if (is_abbrev_of(psz_word, "nonorder", 1)) { |
| 46 |
i_mask |= PRINT_TARGET_NONORDER; |
| 47 |
} else if (is_abbrev_of(psz_word, "attributes", 1)) { |
| 48 |
i_mask |= PRINT_TARGET_ATTRS; |
| 49 |
} else if (is_abbrev_of(psz_word, "state", 1)) { |
| 50 |
i_mask |= PRINT_TARGET_STATE; |
| 51 |
} else if (is_abbrev_of(psz_word, "time", 1)) { |
| 52 |
i_mask |= PRINT_TARGET_TIME; |
| 53 |
} else if (is_abbrev_of(psz_word, "variables", 1)) { |
| 54 |
i_mask |= PRINT_TARGET_VARS; |
| 55 |
} else if (is_abbrev_of(psz_word, "commands", 1)) { |
| 56 |
i_mask |= PRINT_TARGET_CMDS; |
| 57 |
} else if (is_abbrev_of(psz_word, "expand", 1)) { |
| 58 |
i_mask |= (PRINT_TARGET_CMDS_EXP); |
| 59 |
} else if (is_abbrev_of(psz_word, "previous", 1)) { |
| 60 |
i_mask |= PRINT_TARGET_PREV; |
| 61 |
} else { |
| 62 |
printf("Don't understand attribute '%s'\n", psz_word); |
| 63 |
return debug_readloop; |
| 64 |
} |
| 65 |
} |
| 66 |
|
| 67 |
if (0 == i_mask) i_mask = PRINT_TARGET_ALL & (~PRINT_TARGET_VARS_HASH); |
| 68 |
|
| 69 |
if (i_mask & PRINT_TARGET_VARS) { |
| 70 |
initialize_file_variables (p_target, 0); |
| 71 |
set_file_variables (p_target); |
| 72 |
} |
| 73 |
|
| 74 |
if (p_target->description) { |
| 75 |
printf("#: %s", p_target->description); |
| 76 |
} |
| 77 |
print_target_props(p_target, i_mask); |
| 78 |
} |
| 79 |
return debug_readloop; |
| 80 |
} |
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|