44247e258f9ae65a808ef731fb12f3f561e78796
[deliverable/binutils-gdb.git] / gas / listing.c
1 /* listing.c - mainting assembly listings
2 Copyright (C) 1991, 1992 Free Software Foundation, Inc.
3
4 This file is part of GAS, the GNU Assembler.
5
6 GAS is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 GAS is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GAS; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
19
20 /*
21 Contributed by Steve Chamberlain
22 sac@cygnus.com
23
24
25 A listing page looks like:
26
27 LISTING_HEADER sourcefilename pagenumber
28 TITLE LINE
29 SUBTITLE LINE
30 linenumber address data source
31 linenumber address data source
32 linenumber address data source
33 linenumber address data source
34
35 If not overridden, the listing commands are:
36
37 .title "stuff"
38 Put "stuff" onto the title line
39 .sbttl "stuff"
40 Put stuff onto the subtitle line
41
42 If these commands come within 10 lines of the top of the page, they
43 will affect the page they are on, as well as any subsequent page
44
45 .eject
46 Thow a page
47 .list
48 Increment the enable listing counter
49 .nolist
50 Decrement the enable listing counter
51
52 .psize Y[,X]
53 Set the paper size to X wide and Y high. Setting a psize Y of
54 zero will suppress form feeds except where demanded by .eject
55
56 If the counter goes below zero, listing is suppressed.
57
58
59 Listings are a maintained by read calling various listing_<foo>
60 functions. What happens most is that the macro NO_LISTING is not
61 defined (from the Makefile), then the macro LISTING_NEWLINE expands
62 into a call to listing_newline. The call is done from read.c, every
63 time it sees a newline, and -l is on the command line.
64
65 The function listing_newline remembers the frag associated with the
66 newline, and creates a new frag - note that this is wasteful, but not
67 a big deal, since listing slows things down a lot anyway. The
68 function also rememebers when the filename changes.
69
70 When all the input has finished, and gas has had a chance to settle
71 down, the listing is output. This is done by running down the list of
72 frag/source file records, and opening the files as needed and printing
73 out the bytes and chars associated with them.
74
75 The only things which the architecture can change about the listing
76 are defined in these macros:
77
78 LISTING_HEADER The name of the architecture
79 LISTING_WORD_SIZE The make of the number of bytes in a word, this determines
80 the clumping of the output data. eg a value of
81 2 makes words look like 1234 5678, whilst 1
82 would make the same value look like 12 34 56
83 78
84 LISTING_LHS_WIDTH Number of words of above size for the lhs
85
86 LISTING_LHS_WIDTH_SECOND Number of words for the data on the lhs
87 for the second line
88
89 LISTING_LHS_CONT_LINES Max number of lines to use up for a continutation
90 LISTING_RHS_WIDTH Number of chars from the input file to print
91 on a line
92 */
93
94 #include <ctype.h>
95
96 #include "as.h"
97 #include <obstack.h>
98 #include "input-file.h"
99
100 #ifndef NO_LISTING
101 #ifndef LISTING_HEADER
102 #define LISTING_HEADER "GAS LISTING"
103 #endif
104 #ifndef LISTING_WORD_SIZE
105 #define LISTING_WORD_SIZE 4
106 #endif
107 #ifndef LISTING_LHS_WIDTH
108 #define LISTING_LHS_WIDTH 1
109 #endif
110 #ifndef LISTING_LHS_WIDTH_SECOND
111 #define LISTING_LHS_WIDTH_SECOND 1
112 #endif
113 #ifndef LISTING_RHS_WIDTH
114 #define LISTING_RHS_WIDTH 100
115 #endif
116 #ifndef LISTING_LHS_CONT_LINES
117 #define LISTING_LHS_CONT_LINES 4
118 #endif
119
120
121
122
123 /* This structure remembers which .s were used */
124 typedef struct file_info_struct
125 {
126 char *filename;
127 int linenum;
128 FILE *file;
129 struct file_info_struct *next;
130 int end_pending;
131
132 }
133
134 file_info_type;
135
136
137 /* this structure rememebrs which line from which file goes into which
138 frag */
139 typedef struct list_info_struct
140 {
141 /* Frag which this line of source is nearest to */
142 fragS *frag;
143 /* The actual line in the source file */
144 unsigned int line;
145 /* Pointer to the file info struct for the file which this line
146 belongs to */
147 file_info_type *file;
148
149 /* Next in list */
150 struct list_info_struct *next;
151
152
153 /* Pointer to the file info struct for the high level language
154 source line that belongs here */
155 file_info_type *hll_file;
156
157 /* High level language source line */
158 int hll_line;
159
160
161 /* Pointer to any error message associated with this line */
162 char *message;
163
164 enum
165 {
166 EDICT_NONE,
167 EDICT_SBTTL,
168 EDICT_TITLE,
169 EDICT_NOLIST,
170 EDICT_LIST,
171 EDICT_EJECT
172 } edict;
173 char *edict_arg;
174
175 }
176
177 list_info_type;
178
179
180 static struct list_info_struct *head;
181 struct list_info_struct *listing_tail;
182 extern int listing;
183 extern unsigned int physical_input_line;
184 extern fragS *frag_now;
185
186
187 static int paper_width = 200;
188 static int paper_height = 60;
189
190
191 /* this static array is used to keep the text of data to be printed
192 before the start of the line.
193 It is stored so we can give a bit more info on the next line. To much, and large
194 initialized arrays will use up lots of paper.
195 */
196
197 static char data_buffer[100];
198 static unsigned int data_buffer_size;
199
200
201 /* Prototypes. */
202 static void listing_message PARAMS ((const char *name, const char *message));
203 static file_info_type *file_info PARAMS ((const char *file_name));
204 static void new_frag PARAMS ((void));
205 static char *buffer_line PARAMS ((file_info_type *file,
206 char *line, unsigned int size));
207 static void listing_page PARAMS ((list_info_type *list));
208 static unsigned int calc_hex PARAMS ((list_info_type *list));
209 static void print_lines PARAMS ((list_info_type *list,
210 char *string,
211 unsigned int address));
212 static void list_symbol_table PARAMS ((void));
213 static void print_source PARAMS ((file_info_type *current_file,
214 list_info_type *list,
215 char *buffer,
216 unsigned int width));
217 static int debugging_pseudo PARAMS ((char *line));
218 static void listing_listing PARAMS ((char *name));
219
220
221 static void
222 listing_message (name, message)
223 const char *name;
224 const char *message;
225 {
226 unsigned int l = strlen (name) + strlen (message) + 1;
227 char *n = (char *) xmalloc (l);
228 strcpy (n, name);
229 strcat (n, message);
230 if (listing_tail != (list_info_type *) NULL)
231 {
232 listing_tail->message = n;
233 }
234
235 }
236
237
238
239
240 void
241 listing_warning (message)
242 const char *message;
243 {
244 listing_message ("Warning:", message);
245 }
246
247 void
248 listing_error (message)
249 const char *message;
250 {
251 listing_message ("Error:", message);
252 }
253
254
255
256
257 static file_info_type *file_info_head;
258
259 static file_info_type *
260 file_info (file_name)
261 const char *file_name;
262 {
263 /* Find an entry with this file name */
264 file_info_type *p = file_info_head;
265
266 while (p != (file_info_type *) NULL)
267 {
268 if (strcmp (p->filename, file_name) == 0)
269 return p;
270 p = p->next;
271 }
272
273 /* Make new entry */
274
275 p = (file_info_type *) xmalloc (sizeof (file_info_type));
276 p->next = file_info_head;
277 file_info_head = p;
278 p->filename = xmalloc (strlen (file_name) + 1);
279 strcpy (p->filename, file_name);
280 p->linenum = 0;
281 p->end_pending = 0;
282
283 p->file = fopen (p->filename, "rb");
284 if (p->file)
285 fgetc (p->file);
286
287 return p;
288 }
289
290
291 static void
292 new_frag ()
293 {
294
295 frag_wane (frag_now);
296 frag_new (0);
297
298 }
299
300 void
301 listing_newline (ps)
302 char *ps;
303 {
304 extern char *file_name;
305 static unsigned int last_line = 0xffff;
306
307
308 list_info_type *new;
309 if (physical_input_line != last_line)
310 {
311 last_line = physical_input_line;
312 new_frag ();
313
314 new = (list_info_type *) xmalloc (sizeof (list_info_type));
315 new->frag = frag_now;
316 new->line = physical_input_line;
317 new->file = file_info (file_name);
318
319 if (listing_tail)
320 {
321 listing_tail->next = new;
322 }
323 else
324 {
325 head = new;
326 }
327 listing_tail = new;
328 new->next = (list_info_type *) NULL;
329 new->message = (char *) NULL;
330 new->edict = EDICT_NONE;
331 new->hll_file = (file_info_type *) NULL;
332 new->hll_line = 0;
333 new_frag ();
334 }
335 }
336
337
338 /*
339 This function returns the next source line from the file supplied,
340 truncated to size. It appends a fake line to the end of each input
341 file to make
342 */
343
344 static char *
345 buffer_line (file, line, size)
346 file_info_type * file;
347 char *line;
348 unsigned int size;
349 {
350 unsigned int count = 0;
351 int c;
352
353 char *p = line;
354
355 /* If we couldn't open the file, return an empty line */
356 if (file->file == (FILE *) NULL)
357 {
358 return "";
359 }
360
361 if (file->linenum == 0)
362 rewind (file->file);
363
364 if (file->end_pending == 10)
365 {
366 *p++ = '\n';
367 fseek (file->file, 0, 0);
368 file->linenum = 0;
369 file->end_pending = 0;
370 }
371 c = fgetc (file->file);
372
373
374 size -= 1; /* leave room for null */
375
376 while (c != EOF && c != '\n')
377 {
378 if (count < size)
379 *p++ = c;
380 count++;
381
382 c = fgetc (file->file);
383
384 }
385 if (c == EOF)
386 {
387 file->end_pending++;
388 *p++ = '.';
389 *p++ = '.';
390 *p++ = '.';
391 }
392 file->linenum++;
393 *p++ = 0;
394 return line;
395 }
396
397
398 static const char *fn;
399
400 static unsigned int eject; /* Eject pending */
401 static unsigned int page; /* Current page number */
402 static char *title; /* current title */
403 static char *subtitle; /* current subtitle */
404 static unsigned int on_page; /* number of lines printed on current page */
405
406
407 static void
408 listing_page (list)
409 list_info_type *list;
410 {
411 /* Grope around, see if we can see a title or subtitle edict coming up
412 soon (we look down 10 lines of the page and see if it's there)*/
413 if ((eject || (on_page >= paper_height)) && paper_height != 0)
414 {
415 unsigned int c = 10;
416 int had_title = 0;
417 int had_subtitle = 0;
418
419 page++;
420
421 while (c != 0 && list)
422 {
423 if (list->edict == EDICT_SBTTL && !had_subtitle)
424 {
425 had_subtitle = 1;
426 subtitle = list->edict_arg;
427 }
428 if (list->edict == EDICT_TITLE && !had_title)
429 {
430 had_title = 1;
431 title = list->edict_arg;
432 }
433 list = list->next;
434 c--;
435 }
436
437
438 if (page > 1)
439 {
440 printf ("\f");
441 }
442
443 printf ("%s %s \t\t\tpage %d\n", LISTING_HEADER, fn, page);
444 printf ("%s\n", title);
445 printf ("%s\n", subtitle);
446 on_page = 3;
447 eject = 0;
448 }
449 }
450
451
452 static unsigned int
453 calc_hex (list)
454 list_info_type * list;
455 {
456 list_info_type *first = list;
457 unsigned int address = ~0;
458
459 fragS *frag;
460 fragS *frag_ptr;
461
462 unsigned int byte_in_frag = 0;
463
464
465 /* Find first frag which says it belongs to this line */
466 frag = list->frag;
467 while (frag && frag->line != list)
468 frag = frag->fr_next;
469
470 frag_ptr = frag;
471
472 data_buffer_size = 0;
473
474 /* Dump all the frags which belong to this line */
475 while (frag_ptr != (fragS *) NULL && frag_ptr->line == first)
476 {
477 /* Print as many bytes from the fixed part as is sensible */
478 while (byte_in_frag < frag_ptr->fr_fix && data_buffer_size < sizeof (data_buffer) - 10)
479 {
480 if (address == ~0)
481 {
482 address = frag_ptr->fr_address;
483 }
484
485 sprintf (data_buffer + data_buffer_size,
486 "%02X",
487 (frag_ptr->fr_literal[byte_in_frag]) & 0xff);
488 data_buffer_size += 2;
489 byte_in_frag++;
490 }
491 {
492 unsigned int var_rep_max = byte_in_frag;
493 unsigned int var_rep_idx = byte_in_frag;
494
495 /* Print as many bytes from the variable part as is sensible */
496 while (byte_in_frag < frag_ptr->fr_var * frag_ptr->fr_offset
497 && data_buffer_size < sizeof (data_buffer) - 10)
498 {
499 if (address == ~0)
500 {
501 address = frag_ptr->fr_address;
502 }
503 sprintf (data_buffer + data_buffer_size,
504 "%02X",
505 (frag_ptr->fr_literal[var_rep_idx]) & 0xff);
506 #if 0
507 data_buffer[data_buffer_size++] = '*';
508 data_buffer[data_buffer_size++] = '*';
509 #endif
510 data_buffer_size += 2;
511
512 var_rep_idx++;
513 byte_in_frag++;
514
515 if (var_rep_idx >= frag_ptr->fr_var)
516 var_rep_idx = var_rep_max;
517 }
518 }
519
520 frag_ptr = frag_ptr->fr_next;
521 }
522 data_buffer[data_buffer_size++] = 0;
523 return address;
524 }
525
526
527
528
529
530
531 static void
532 print_lines (list, string, address)
533 list_info_type *list;
534 char *string;
535 unsigned int address;
536 {
537 unsigned int idx;
538 unsigned int nchars;
539 unsigned int lines;
540 unsigned int byte_in_word = 0;
541 char *src = data_buffer;
542
543 /* Print the stuff on the first line */
544 listing_page (list);
545 nchars = (LISTING_WORD_SIZE * 2 + 1) * LISTING_LHS_WIDTH;
546 /* Print the hex for the first line */
547 if (address == ~0)
548 {
549 printf ("% 4d ", list->line);
550 for (idx = 0; idx < nchars; idx++)
551 printf (" ");
552
553 printf ("\t%s\n", string ? string : "");
554 on_page++;
555 listing_page (0);
556
557 }
558 else
559 {
560 if (had_errors ())
561 {
562 printf ("% 4d ???? ", list->line);
563 }
564 else
565 {
566 printf ("% 4d %04x ", list->line, address);
567 }
568
569 /* And the data to go along with it */
570 idx = 0;
571
572 while (*src && idx < nchars)
573 {
574 printf ("%c%c", src[0], src[1]);
575 src += 2;
576 byte_in_word++;
577 if (byte_in_word == LISTING_WORD_SIZE)
578 {
579 printf (" ");
580 idx++;
581 byte_in_word = 0;
582 }
583 idx += 2;
584 }
585
586 for (; idx < nchars; idx++)
587 printf (" ");
588
589 printf ("\t%s\n", string ? string : "");
590 on_page++;
591 listing_page (list);
592 if (list->message)
593 {
594 printf ("**** %s\n", list->message);
595 listing_page (list);
596 on_page++;
597 }
598
599 for (lines = 0;
600 lines < LISTING_LHS_CONT_LINES
601 && *src;
602 lines++)
603 {
604 nchars = ((LISTING_WORD_SIZE * 2) + 1) * LISTING_LHS_WIDTH_SECOND - 1;
605 idx = 0;
606 /* Print any more lines of data, but more compactly */
607 printf ("% 4d ", list->line);
608
609 while (*src && idx < nchars)
610 {
611 printf ("%c%c", src[0], src[1]);
612 src += 2;
613 idx += 2;
614 byte_in_word++;
615 if (byte_in_word == LISTING_WORD_SIZE)
616 {
617 printf (" ");
618 idx++;
619 byte_in_word = 0;
620 }
621 }
622
623 printf ("\n");
624 on_page++;
625 listing_page (list);
626
627 }
628
629
630 }
631 }
632
633
634 static void
635 list_symbol_table ()
636 {
637 extern symbolS *symbol_rootP;
638
639 symbolS *ptr;
640 eject = 1;
641 listing_page (0);
642 printf ("DEFINED SYMBOLS\n");
643 on_page++;
644
645 for (ptr = symbol_rootP; ptr != (symbolS *) NULL; ptr = symbol_next (ptr))
646 {
647 if (ptr->sy_frag->line)
648 {
649 if (S_GET_NAME (ptr))
650 {
651 char buf[30];
652 valueT val = S_GET_VALUE (ptr);
653
654 /* @@ Note that this is dependent on the compilation options,
655 not solely on the target characteristics. */
656 if (sizeof (val) == 4 && sizeof (int) == 4)
657 sprintf (buf, "%08lx", (unsigned long) val);
658 #if defined (BFD_ASSEMBLER) && defined (BFD64)
659 else if (sizeof (val) > 4)
660 {
661 char buf1[30];
662 sprintf_vma (buf1, val);
663 strcpy (buf, "00000000");
664 strcpy (buf + 8 - strlen (buf1), buf1);
665 }
666 #endif
667 else
668 abort ();
669
670 printf ("%20s:%-5d %s:%s %s\n",
671 ptr->sy_frag->line->file->filename,
672 ptr->sy_frag->line->line,
673 segment_name (S_GET_SEGMENT (ptr)),
674 buf, S_GET_NAME (ptr));
675
676 on_page++;
677 listing_page (0);
678 }
679 }
680
681 }
682 printf ("\n");
683 on_page++;
684 listing_page (0);
685 printf ("UNDEFINED SYMBOLS\n");
686 on_page++;
687 listing_page (0);
688
689 for (ptr = symbol_rootP; ptr != (symbolS *) NULL; ptr = symbol_next (ptr))
690 {
691 if (S_GET_NAME (ptr) && strlen (S_GET_NAME (ptr)) != 0)
692 {
693 if (ptr->sy_frag->line == 0)
694 {
695 printf ("%s\n", S_GET_NAME (ptr));
696 on_page++;
697 listing_page (0);
698 }
699 }
700 }
701 }
702
703 static void
704 print_source (current_file, list, buffer, width)
705 file_info_type *current_file;
706 list_info_type *list;
707 char *buffer;
708 unsigned int width;
709 {
710 if (current_file->file)
711 {
712 while (current_file->linenum < list->hll_line)
713 {
714 char *p = buffer_line (current_file, buffer, width);
715 printf ("%4d:%-13s **** %s\n", current_file->linenum, current_file->filename, p);
716 on_page++;
717 listing_page (list);
718 }
719 }
720 }
721
722 /* Sometimes the user doesn't want to be bothered by the debugging
723 records inserted by the compiler, see if the line is suspicious */
724
725 static int
726 debugging_pseudo (line)
727 char *line;
728 {
729 while (isspace (*line))
730 line++;
731
732 if (*line != '.')
733 return 0;
734
735 line++;
736
737 if (strncmp (line, "def", 3) == 0)
738 return 1;
739 if (strncmp (line, "val", 3) == 0)
740 return 1;
741 if (strncmp (line, "scl", 3) == 0)
742 return 1;
743 if (strncmp (line, "line", 4) == 0)
744 return 1;
745 if (strncmp (line, "endef", 5) == 0)
746 return 1;
747 if (strncmp (line, "ln", 2) == 0)
748 return 1;
749 if (strncmp (line, "type", 4) == 0)
750 return 1;
751 if (strncmp (line, "size", 4) == 0)
752 return 1;
753 if (strncmp (line, "dim", 3) == 0)
754 return 1;
755 if (strncmp (line, "tag", 3) == 0)
756 return 1;
757
758 if (strncmp (line, "stabs", 5) == 0)
759 return 1;
760 if (strncmp (line, "stabn", 5) == 0)
761 return 1;
762
763 return 0;
764
765 }
766
767 static void
768 listing_listing (name)
769 char *name;
770 {
771 list_info_type *list = head;
772 file_info_type *current_hll_file = (file_info_type *) NULL;
773 char *message;
774 char *buffer;
775 char *p;
776 int show_listing = 1;
777 unsigned int width;
778
779 buffer = xmalloc (LISTING_RHS_WIDTH);
780 eject = 1;
781 list = head;
782
783 while (list != (list_info_type *) NULL && 0)
784 {
785 if (list->next)
786 list->frag = list->next->frag;
787 list = list->next;
788
789 }
790
791 list = head->next;
792
793
794 while (list)
795 {
796 width = LISTING_RHS_WIDTH > paper_width ? paper_width :
797 LISTING_RHS_WIDTH;
798
799 switch (list->edict)
800 {
801 case EDICT_LIST:
802 show_listing++;
803 break;
804 case EDICT_NOLIST:
805 show_listing--;
806 break;
807 case EDICT_EJECT:
808 break;
809 case EDICT_NONE:
810 break;
811 case EDICT_TITLE:
812 title = list->edict_arg;
813 break;
814 case EDICT_SBTTL:
815 subtitle = list->edict_arg;
816 break;
817 default:
818 abort ();
819 }
820
821 if (show_listing > 0)
822 {
823 /* Scan down the list and print all the stuff which can be done
824 with this line (or lines). */
825 message = 0;
826
827 if (list->hll_file)
828 {
829 current_hll_file = list->hll_file;
830 }
831
832 if (current_hll_file && list->hll_line && listing & LISTING_HLL)
833 {
834 print_source (current_hll_file, list, buffer, width);
835 }
836
837 p = buffer_line (list->file, buffer, width);
838
839 if (!((listing & LISTING_NODEBUG) && debugging_pseudo (p)))
840 {
841 print_lines (list, p, calc_hex (list));
842 }
843
844 if (list->edict == EDICT_EJECT)
845 {
846 eject = 1;
847 }
848 }
849 else
850 {
851
852 p = buffer_line (list->file, buffer, width);
853 }
854
855 list = list->next;
856 }
857 free (buffer);
858 }
859
860 void
861 listing_print (name)
862 char *name;
863 {
864 title = "";
865 subtitle = "";
866
867 if (listing & LISTING_NOFORM)
868 {
869 paper_height = 0;
870 }
871
872 if (listing & LISTING_LISTING)
873 {
874 listing_listing (name);
875
876 }
877 if (listing & LISTING_SYMBOLS)
878 {
879 list_symbol_table ();
880 }
881 }
882
883
884 void
885 listing_file (name)
886 const char *name;
887 {
888 fn = name;
889 }
890
891 void
892 listing_eject ()
893 {
894 listing_tail->edict = EDICT_EJECT;
895 }
896
897 void
898 listing_flags ()
899 {
900 while ((*input_line_pointer++) && (*input_line_pointer != '\n'))
901 input_line_pointer++;
902
903 }
904
905 void
906 listing_list (on)
907 unsigned int on;
908 {
909 listing_tail->edict = on ? EDICT_LIST : EDICT_NOLIST;
910 }
911
912
913 void
914 listing_psize ()
915 {
916 paper_height = get_absolute_expression ();
917
918 if (paper_height < 0 || paper_height > 1000)
919 {
920 paper_height = 0;
921 as_warn ("strange paper height, set to no form");
922 }
923 if (*input_line_pointer == ',')
924 {
925 input_line_pointer++;
926 paper_width = get_absolute_expression ();
927 }
928 }
929
930
931 void
932 listing_title (depth)
933 unsigned int depth;
934 {
935 char *start;
936 char *title;
937 unsigned int length;
938
939 SKIP_WHITESPACE ();
940 if (*input_line_pointer == '\"')
941 {
942 input_line_pointer++;
943 start = input_line_pointer;
944
945 while (*input_line_pointer)
946 {
947 if (*input_line_pointer == '\"')
948 {
949 length = input_line_pointer - start;
950 title = xmalloc (length + 1);
951 memcpy (title, start, length);
952 title[length] = 0;
953 listing_tail->edict = depth ? EDICT_SBTTL : EDICT_TITLE;
954 listing_tail->edict_arg = title;
955 input_line_pointer++;
956 demand_empty_rest_of_line ();
957 return;
958 }
959 else if (*input_line_pointer == '\n')
960 {
961 as_bad ("New line in title");
962 demand_empty_rest_of_line ();
963 return;
964 }
965 else
966 {
967 input_line_pointer++;
968 }
969 }
970 }
971 else
972 {
973 as_bad ("expecting title in quotes");
974 }
975 }
976
977
978
979 void
980 listing_source_line (line)
981 unsigned int line;
982 {
983 new_frag ();
984 listing_tail->hll_line = line;
985 new_frag ();
986
987 }
988
989 void
990 listing_source_file (file)
991 const char *file;
992 {
993 listing_tail->hll_file = file_info (file);
994 }
995
996
997
998 #else
999
1000
1001 /* Dummy functions for when compiled without listing enabled */
1002
1003 void
1004 listing_flags ()
1005 {
1006 s_ignore (0);
1007 }
1008
1009 void
1010 listing_list (on)
1011 unsigned int on;
1012 {
1013 s_ignore (0);
1014 }
1015
1016 void
1017 listing_eject ()
1018 {
1019 s_ignore (0);
1020 }
1021
1022 void
1023 listing_psize ()
1024 {
1025 s_ignore (0);
1026 }
1027
1028 void
1029 listing_title (depth)
1030 unsigned int depth;
1031 {
1032 s_ignore (0);
1033 }
1034
1035 void
1036 listing_file (name)
1037 const char *name;
1038 {
1039
1040 }
1041
1042 void
1043 listing_newline (name)
1044 char *name;
1045 {
1046
1047 }
1048
1049 void
1050 listing_source_line (n)
1051 unsigned int n;
1052 {
1053
1054 }
1055 void
1056 listing_source_file (n)
1057 const char *n;
1058 {
1059
1060 }
1061
1062 #endif
This page took 0.051758 seconds and 4 git commands to generate.