#define AS_OPTION_LISTING 5
#define AS_OPTION_OUTFILE 6
#define AS_OPTION_UNDEF 7
+#define AS_OPTION_VERBOSE 8
static struct as_option opts[] = {
{ "-f", AS_OPTION_FORMAT, AS_OPTION_HAS_ARG },
{ "-l", AS_OPTION_LISTING, AS_OPTION_HAS_ARG },
{ "-o", AS_OPTION_OUTFILE, AS_OPTION_HAS_ARG },
+ { "-v", AS_OPTION_VERBOSE, AS_OPTION_NO_ARG },
{ "--help", AS_OPTION_HELP, AS_OPTION_NO_ARG },
{ 0, 0, 0 }
}
+ case AS_OPTION_VERBOSE: {
+
+ state->verbose++;
+ break;
+
+ }
+
default: {
report_at (program_name, 0, REPORT_ERROR, "unsupported option '%s'", r);
}
+ free (sname);
continue;
}
if (xstrcasecmp (sname, "DGROUP") == 0 && *caret == ':') {
caret++;
+
+ free (sname);
continue;
}
cstr_cat (&cstr, start, caret - start);
+
+ free (sname);
continue;
}
char *line, *line_end, *real_line;
unsigned long real_line_len;
+ unsigned long new_line_number = 1;
unsigned long newlines;
- unsigned long new_line_number;
struct pp_pseudo_op_entry *poe;
void *load_line_internal_data = NULL;
}
- new_line_number = 1;
load_line_internal_data = load_line_create_internal_data (&new_line_number);
while (!load_line (&line, &line_end, &real_line, &real_line_len, &newlines, fp, &load_line_internal_data)) {
}
start = line;
+
+ if (state->verbose) {
+ printf ("%s:%lu: %.*s", get_filename (), get_line_number (), (int) real_line_len, real_line);
+ }
+
caret = (line = skip_whitespace (line));
if (!ignore_line && line >= line_end) {
if ((poe = find_cond_directive (arg))) {
poe->handler (start, &line);
- free (arg);
+ free (arg);
continue;
}
if ((poe = find_directive (arg))) {
poe->handler (start, &line);
- free (arg);
+ free (arg);
continue;
}
continue;
}
+
+ free (arg);
}
if (line < line_end) {
char *tokenized_line = preprocess_line (line, 0);
-
process_line (tokenized_line, tokenized_line + strlen (tokenized_line));
- free (tokenized_line);
}