summaryrefslogtreecommitdiff
path: root/output
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2019-08-10 01:38:06 -0700
committerH. Peter Anvin <hpa@zytor.com>2019-08-10 01:46:58 -0700
commit322bee0aac0f177127e4a33aff94a5fa2158a0f9 (patch)
tree77ea5f8db299b2ff7c32e25a5c770f9e3e9c6975 /output
parentab6f8319552f17d269a5bf2facea48ea1c338b71 (diff)
downloadnasm-322bee0aac0f177127e4a33aff94a5fa2158a0f9.tar.gz
Additional listing options, improve help output, fix macro limits
Additional listing options: -Ld to display counts in decimal -Lp to output a list file in every pass (to make sure one exists) Clean up the help output and make it comprehensive. The -hf and -y options are no longer necessary, although they are supported for backwards compatiblity. Fix macro-levels so it actually count descent levels; a new macro-tokens limit introduced for the actual token limit. Slightly simplify the limits code. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'output')
-rw-r--r--output/codeview.c2
-rw-r--r--output/outform.c35
-rw-r--r--output/outform.h2
3 files changed, 28 insertions, 11 deletions
diff --git a/output/codeview.c b/output/codeview.c
index 870d573f..4dbc9b3a 100644
--- a/output/codeview.c
+++ b/output/codeview.c
@@ -59,7 +59,7 @@ static void cv8_output(int type, void *param);
static void cv8_cleanup(void);
const struct dfmt df_cv8 = {
- "Codeview 8", /* .fullname */
+ "Codeview 8+", /* .fullname */
"cv8", /* .shortname */
cv8_init, /* .init */
cv8_linenum, /* .linenum */
diff --git a/output/outform.c b/output/outform.c
index d299d04a..3ab15d2a 100644
--- a/output/outform.c
+++ b/output/outform.c
@@ -43,6 +43,7 @@
#define BUILD_DRIVERS_ARRAY
#include "outform.h"
+#include "outlib.h"
const struct ofmt *ofmt_find(const char *name,
const struct ofmt_alias **ofmt_alias)
@@ -90,29 +91,45 @@ void ofmt_list(const struct ofmt *deffmt, FILE * fp)
/* primary targets first */
for (ofp = drivers; (of = *ofp); ofp++) {
- fprintf(fp, " %c %-10s%s\n",
- of == deffmt ? '*' : ' ',
- of->shortname, of->fullname);
+ fprintf(fp, " %-20s %s%s\n",
+ of->shortname,
+ of->fullname,
+ of == deffmt ? " [default]" : "");
}
/* lets walk through aliases then */
for (i = 0; i < ARRAY_SIZE(ofmt_aliases); i++) {
if (!ofmt_aliases[i].shortname)
continue;
- fprintf(fp, " %-10s%s\n",
+ fprintf(fp, " %-20s %s\n",
ofmt_aliases[i].shortname,
ofmt_aliases[i].fullname);
}
}
-void dfmt_list(const struct ofmt *ofmt, FILE *fp)
+void dfmt_list(FILE *fp)
{
+ const struct ofmt * const *ofp;
+ const struct ofmt *of;
const struct dfmt * const *dfp;
const struct dfmt *df;
+ char prefixbuf[32];
+ const char *prefix;
- for (dfp = ofmt->debug_formats; (df = *dfp); dfp++) {
- fprintf(fp, " %c %-10s%s\n",
- df == dfmt ? '*' : ' ',
- df->shortname, df->fullname);
+ for (ofp = drivers; (of = *ofp); ofp++) {
+ if (of->debug_formats && of->debug_formats != null_debug_arr) {
+ snprintf(prefixbuf, sizeof prefixbuf, "%s:",
+ of->shortname);
+ prefix = prefixbuf;
+
+ for (dfp = of->debug_formats; (df = *dfp); dfp++) {
+ if (df != &null_debug_form)
+ fprintf(fp, " %-10s %-9s %s%s\n",
+ prefix,
+ df->shortname, df->fullname,
+ df == of->default_dfmt ? " [default]" : "");
+ prefix = "";
+ }
+ }
}
}
diff --git a/output/outform.h b/output/outform.h
index 5d30d645..9d068dbf 100644
--- a/output/outform.h
+++ b/output/outform.h
@@ -373,7 +373,7 @@ static const struct ofmt_alias ofmt_aliases[] = {
const struct ofmt *ofmt_find(const char *name, const struct ofmt_alias **ofmt_alias);
const struct dfmt *dfmt_find(const struct ofmt *, const char *);
void ofmt_list(const struct ofmt *, FILE *);
-void dfmt_list(const struct ofmt *ofmt, FILE * fp);
+void dfmt_list(FILE *);
extern const struct dfmt null_debug_form;
#endif /* NASM_OUTFORM_H */