+
+ emit_line (list, "%4u:%-13s **** %s\n",
+ cache->line, cache->file->filename, p);
+ num_lines_shown ++;
+ }
+ }
+}
+
+/* Sometimes the user doesn't want to be bothered by the debugging
+ records inserted by the compiler, see if the line is suspicious. */
+
+static int
+debugging_pseudo (list_info_type *list, const char *line)
+{
+#ifdef OBJ_ELF
+ static int in_debug;
+ int was_debug;
+#endif
+
+ if (list->debugging)
+ {
+#ifdef OBJ_ELF
+ in_debug = 1;
+#endif
+ return 1;
+ }
+#ifdef OBJ_ELF
+ was_debug = in_debug;
+ in_debug = 0;
+#endif
+
+ while (ISSPACE (*line))
+ line++;
+
+ if (*line != '.')
+ {
+#ifdef OBJ_ELF
+ /* The ELF compiler sometimes emits blank lines after switching
+ out of a debugging section. If the next line drops us back
+ into debugging information, then don't print the blank line.
+ This is a hack for a particular compiler behaviour, not a
+ general case. */
+ if (was_debug
+ && *line == '\0'
+ && list->next != NULL
+ && list->next->debugging)
+ {
+ in_debug = 1;
+ return 1;
+ }
+#endif
+
+ return 0;
+ }
+
+ line++;
+
+ if (strncmp (line, "def", 3) == 0)
+ return 1;
+ if (strncmp (line, "val", 3) == 0)
+ return 1;
+ if (strncmp (line, "scl", 3) == 0)
+ return 1;
+ if (strncmp (line, "line", 4) == 0)
+ return 1;
+ if (strncmp (line, "endef", 5) == 0)
+ return 1;
+ if (strncmp (line, "ln", 2) == 0)
+ return 1;
+ if (strncmp (line, "type", 4) == 0)
+ return 1;
+ if (strncmp (line, "size", 4) == 0)
+ return 1;
+ if (strncmp (line, "dim", 3) == 0)
+ return 1;
+ if (strncmp (line, "tag", 3) == 0)
+ return 1;
+ if (strncmp (line, "stabs", 5) == 0)
+ return 1;
+ if (strncmp (line, "stabn", 5) == 0)
+ return 1;
+
+ return 0;
+}
+
+static void
+listing_listing (char *name ATTRIBUTE_UNUSED)
+{
+ list_info_type *list = head;
+ file_info_type *current_hll_file = (file_info_type *) NULL;
+ char *buffer;
+ const char *p;
+ int show_listing = 1;
+ unsigned int width;
+
+ buffer = XNEWVEC (char, listing_rhs_width);
+ data_buffer = XNEWVEC (char, MAX_BYTES);
+ eject = 1;
+ list = head->next;
+
+ while (list)
+ {
+ unsigned int list_line;
+
+ width = listing_rhs_width > paper_width ? paper_width :
+ listing_rhs_width;
+
+ list_line = list->line;
+ switch (list->edict)
+ {
+ case EDICT_LIST:
+ /* Skip all lines up to the current. */
+ list_line--;
+ break;
+ case EDICT_NOLIST:
+ show_listing--;
+ break;
+ case EDICT_NOLIST_NEXT:
+ if (show_listing == 0)
+ list_line--;
+ break;
+ case EDICT_EJECT:
+ break;
+ case EDICT_NONE:
+ break;
+ case EDICT_TITLE:
+ title = list->edict_arg;
+ break;
+ case EDICT_SBTTL:
+ subtitle = list->edict_arg;
+ break;
+ default:
+ abort ();
+ }
+
+ if (show_listing <= 0)
+ {
+ while (list->file->linenum < list_line
+ && !list->file->at_end)
+ p = buffer_line (list->file, buffer, width);
+ }
+
+ if (list->edict == EDICT_LIST
+ || (list->edict == EDICT_NOLIST_NEXT && show_listing == 0))
+ {
+ /* Enable listing for the single line that caused the enable. */
+ list_line++;
+ show_listing++;
+ }
+
+ if (show_listing > 0)
+ {
+ /* Scan down the list and print all the stuff which can be done
+ with this line (or lines). */
+ if (list->hll_file)
+ current_hll_file = list->hll_file;
+
+ if (current_hll_file && list->hll_line && (listing & LISTING_HLL))
+ print_source (current_hll_file, list, width);
+
+ if (list->line_contents)