diff options
author | Segher Boessenkool <segher@kernel.crashing.org> | 2012-07-27 03:32:21 +0000 |
---|---|---|
committer | Segher Boessenkool <segher@kernel.crashing.org> | 2012-07-27 03:32:21 +0000 |
commit | c71bb85d64f4ddcc7ae1c991e44ff3b48d2a5dc9 (patch) | |
tree | c6819d5667d3e9e65e38c73a6f755f35a5a24a91 /gas | |
parent | 5a3f286f4595d4ddffe74a0cbf72923044827db8 (diff) | |
download | gdb-c71bb85d64f4ddcc7ae1c991e44ff3b48d2a5dc9.zip gdb-c71bb85d64f4ddcc7ae1c991e44ff3b48d2a5dc9.tar.gz gdb-c71bb85d64f4ddcc7ae1c991e44ff3b48d2a5dc9.tar.bz2 |
2012-07-26 Segher Boessenkool <segher@kernel.crashing.org>
gas/
* listing.c (struct list_message): New.
(struct list_info_struct): Delete "message". Add "messages"
and "last_message".
(listing_message): Adjust.
(listing_newline): Adjust.
(print_lines): Adjust.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 9 | ||||
-rw-r--r-- | gas/listing.c | 28 |
2 files changed, 31 insertions, 6 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 2d62c41..fee2ba3 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,12 @@ +2012-07-26 Segher Boessenkool <segher@kernel.crashing.org> + + * listing.c (struct list_message): New. + (struct list_info_struct): Delete "message". Add "messages" + and "last_message". + (listing_message): Adjust. + (listing_newline): Adjust. + (print_lines): Adjust. + 2012-07-24 Jan Beulich <jbeulich@suse.com> * config/tc-i386-intel.c (i386_intel_simplify_register): Handle diff --git a/gas/listing.c b/gas/listing.c index 6d28f31..38518e4 100644 --- a/gas/listing.c +++ b/gas/listing.c @@ -143,6 +143,12 @@ enum edict_enum }; +struct list_message +{ + char *message; + struct list_message *next; +}; + /* This structure remembers which line from which file goes into which frag. */ struct list_info_struct @@ -170,8 +176,8 @@ struct list_info_struct /* High level language source line. */ unsigned int hll_line; - /* Pointer to any error message associated with this line. */ - char *message; + /* Pointers to linked list of messages associated with this line. */ + struct list_message *messages, *last_message; enum edict_enum edict; char *edict_arg; @@ -232,9 +238,17 @@ listing_message (const char *name, const char *message) { unsigned int l = strlen (name) + strlen (message) + 1; char *n = (char *) xmalloc (l); + struct list_message *lm = xmalloc (sizeof *lm); strcpy (n, name); strcat (n, message); - listing_tail->message = n; + lm->message = n; + lm->next = NULL; + + if (listing_tail->last_message) + listing_tail->last_message->next = lm; + else + listing_tail->messages = lm; + listing_tail->last_message = lm; } } @@ -404,7 +418,8 @@ listing_newline (char *ps) new_i->line = line; new_i->file = file_info (file); new_i->next = (list_info_type *) NULL; - new_i->message = (char *) NULL; + new_i->messages = NULL; + new_i->last_message = NULL; new_i->edict = EDICT_NONE; new_i->hll_file = (file_info_type *) NULL; new_i->hll_line = 0; @@ -792,6 +807,7 @@ print_lines (list_info_type *list, unsigned int lineno, unsigned int octet_in_word = 0; char *src = data_buffer; int cur; + struct list_message *msg; /* Print the stuff on the first line. */ listing_page (list); @@ -839,8 +855,8 @@ print_lines (list_info_type *list, unsigned int lineno, emit_line (list, "\t%s\n", string ? string : ""); - if (list->message) - emit_line (list, "**** %s\n", list->message); + for (msg = list->messages; msg; msg = msg->next) + emit_line (list, "**** %s\n", msg->message); for (lines = 0; lines < (unsigned int) listing_lhs_cont_lines |