value to be printed, as long as "unsigned long" is at least as wide, after
handling the special case of 4-byte values.
+Fri Dec 30 18:21:41 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
+
+ * listing.c (list_symbol_table): Build a format string based on
+ the size of the value to be printed, as long as "unsigned long" is
+ at least as wide, after handling the special case of 4-byte
+ values.
+
Wed Dec 28 20:57:37 1994 Jeff Law (law@snake.cs.utah.edu)
* config/tc-hppa.c (pa_subspace): For sections with the ZERO
Wed Dec 28 20:57:37 1994 Jeff Law (law@snake.cs.utah.edu)
* config/tc-hppa.c (pa_subspace): For sections with the ZERO
FILE *file;
struct file_info_struct *next;
int end_pending;
FILE *file;
struct file_info_struct *next;
int end_pending;
{
listing_tail->message = n;
}
{
listing_tail->message = n;
}
void
listing_warning (message)
const char *message;
void
listing_warning (message)
const char *message;
p->linenum = 0;
p->end_pending = 0;
p->linenum = 0;
p->end_pending = 0;
- /* Do we really prefer binary mode for this?? */
- p->file = fopen (p->filename, FOPEN_RB);
+ p->file = fopen (p->filename, "r");
if (p->file)
fgetc (p->file);
if (p->file)
fgetc (p->file);
char *file;
unsigned int line;
static unsigned int last_line = 0xffff;
char *file;
unsigned int line;
static unsigned int last_line = 0xffff;
+ static char *last_file = NULL;
list_info_type *new;
as_where (&file, &line);
list_info_type *new;
as_where (&file, &line);
+ if (line != last_line || last_file && file && strcmp(file, last_file))
new_frag ();
new = (list_info_type *) xmalloc (sizeof (list_info_type));
new_frag ();
new = (list_info_type *) xmalloc (sizeof (list_info_type));
if (file->end_pending == 10)
{
*p++ = '\n';
if (file->end_pending == 10)
{
*p++ = '\n';
fseek (file->file, 0, 0);
file->linenum = 0;
fseek (file->file, 0, 0);
file->linenum = 0;
+#else
+ file->linenum = 9999999;
+#endif
file->end_pending = 0;
}
c = fgetc (file->file);
file->end_pending = 0;
}
c = fgetc (file->file);
list_symbol_table ()
{
extern symbolS *symbol_rootP;
list_symbol_table ()
{
extern symbolS *symbol_rootP;
symbolS *ptr;
eject = 1;
listing_page (0);
symbolS *ptr;
eject = 1;
listing_page (0);
- printf ("DEFINED SYMBOLS\n");
- on_page++;
for (ptr = symbol_rootP; ptr != (symbolS *) NULL; ptr = symbol_next (ptr))
{
for (ptr = symbol_rootP; ptr != (symbolS *) NULL; ptr = symbol_next (ptr))
{
{
if (S_GET_NAME (ptr))
{
{
if (S_GET_NAME (ptr))
{
valueT val = S_GET_VALUE (ptr);
/* @@ Note that this is dependent on the compilation options,
not solely on the target characteristics. */
if (sizeof (val) == 4 && sizeof (int) == 4)
sprintf (buf, "%08lx", (unsigned long) val);
valueT val = S_GET_VALUE (ptr);
/* @@ Note that this is dependent on the compilation options,
not solely on the target characteristics. */
if (sizeof (val) == 4 && sizeof (int) == 4)
sprintf (buf, "%08lx", (unsigned long) val);
-#if defined (BFD_ASSEMBLER) && defined (BFD64)
+ else if (sizeof (val) <= sizeof (unsigned long))
+ {
+ sprintf (fmt, "%%0%dlx", sizeof (val) * 2);
+ sprintf (buf, fmt, (unsigned long) val);
+ }
+#if defined (BFD64)
else if (sizeof (val) > 4)
{
char buf1[30];
else if (sizeof (val) > 4)
{
char buf1[30];
+ if (!got_some)
+ {
+ printf ("DEFINED SYMBOLS\n");
+ on_page++;
+ got_some = 1;
+ }
+
printf ("%20s:%-5d %s:%s %s\n",
ptr->sy_frag->line->file->filename,
ptr->sy_frag->line->line,
printf ("%20s:%-5d %s:%s %s\n",
ptr->sy_frag->line->file->filename,
ptr->sy_frag->line->line,
+ if (!got_some)
+ {
+ printf ("NO DEFINED SYMBOLS\n");
+ on_page++;
+ }
printf ("\n");
on_page++;
listing_page (0);
printf ("\n");
on_page++;
listing_page (0);
- printf ("UNDEFINED SYMBOLS\n");
- on_page++;
- listing_page (0);
for (ptr = symbol_rootP; ptr != (symbolS *) NULL; ptr = symbol_next (ptr))
{
if (S_GET_NAME (ptr) && strlen (S_GET_NAME (ptr)) != 0)
{
if (ptr->sy_frag->line == 0
for (ptr = symbol_rootP; ptr != (symbolS *) NULL; ptr = symbol_next (ptr))
{
if (S_GET_NAME (ptr) && strlen (S_GET_NAME (ptr)) != 0)
{
if (ptr->sy_frag->line == 0
+#ifdef S_IS_REGISTER
+ && !S_IS_REGISTER (ptr)
+#endif
&& S_GET_SEGMENT (ptr) != reg_section)
{
&& S_GET_SEGMENT (ptr) != reg_section)
{
+ if (!got_some)
+ {
+ got_some = 1;
+ printf ("UNDEFINED SYMBOLS\n");
+ on_page++;
+ listing_page (0);
+ }
printf ("%s\n", S_GET_NAME (ptr));
on_page++;
listing_page (0);
}
}
}
printf ("%s\n", S_GET_NAME (ptr));
on_page++;
listing_page (0);
}
}
}
+ if (!got_some)
+ {
+ printf ("NO UNDEFINED SYMBOLS\n");
+ on_page++;
+ listing_page (0);
+ }
{
if (current_file->file)
{
{
if (current_file->file)
{
- while (current_file->linenum < list->hll_line)
+ while (current_file->linenum < list->hll_line
+ && current_file->end_pending == 0)
{
char *p = buffer_line (current_file, buffer, width);
printf ("%4d:%-13s **** %s\n", current_file->linenum, current_file->filename, p);
{
char *p = buffer_line (current_file, buffer, width);
printf ("%4d:%-13s **** %s\n", current_file->linenum, current_file->filename, p);
print_source (current_hll_file, list, buffer, width);
}
print_source (current_hll_file, list, buffer, width);
}
- p = buffer_line (list->file, buffer, width);
-
- if (!((listing & LISTING_NODEBUG) && debugging_pseudo (p)))
+ while (list->file->file
+ && list->file->linenum < list->line
+ && !list->file->end_pending)
- print_lines (list, p, calc_hex (list));
+ p = buffer_line (list->file, buffer, width);
+
+ if (!((listing & LISTING_NODEBUG) && debugging_pseudo (p)))
+ {
+ print_lines (list, p, calc_hex (list));
+ }
}
if (list->edict == EDICT_EJECT)
}
if (list->edict == EDICT_EJECT)
-
- p = buffer_line (list->file, buffer, width);
+ while (list->file->file
+ && list->file->linenum < list->line
+ && !list->file->end_pending)
+ p = buffer_line (list->file, buffer, width);