diff options
Diffstat (limited to 'binutils/prdbg.c')
-rw-r--r-- | binutils/prdbg.c | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/binutils/prdbg.c b/binutils/prdbg.c index c41d60c..133973c 100644 --- a/binutils/prdbg.c +++ b/binutils/prdbg.c @@ -519,30 +519,38 @@ pr_enum_type (p, tag, names, values) if (! append_type (info, "{ ")) return false; - val = 0; - for (i = 0; names[i] != NULL; i++) + if (names == NULL) { - if (i > 0) + if (! append_type (info, "/* undefined */")) + return false; + } + else + { + val = 0; + for (i = 0; names[i] != NULL; i++) { - if (! append_type (info, ", ")) + if (i > 0) + { + if (! append_type (info, ", ")) + return false; + } + + if (! append_type (info, names[i])) return false; - } - if (! append_type (info, names[i])) - return false; + if (values[i] != val) + { + char ab[20]; - if (values[i] != val) - { - char ab[20]; + print_vma (values[i], ab, false, false); + if (! append_type (info, " = ") + || ! append_type (info, ab)) + return false; + val = values[i]; + } - print_vma (values[i], ab, false, false); - if (! append_type (info, " = ") - || ! append_type (info, ab)) - return false; - val = values[i]; + ++val; } - - ++val; } return append_type (info, " }"); |