mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 01:50:24 +08:00
* listing.c (struct file_info_struct): Rename end_pending field to
at_end. (file_info): Initialize at_end, not end_pending. (buffer_line): If at_end set, just return immediately. Don't worry about end_pending cases. Set at_end when EOF is read. (print_source): Check at_end, not end_pending. (listing_listing): Likewise. PR 6636.
This commit is contained in:
@ -1,5 +1,13 @@
|
|||||||
Thu Jul 6 12:54:27 1995 Ian Lance Taylor <ian@cygnus.com>
|
Thu Jul 6 12:54:27 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||||
|
|
||||||
|
* listing.c (struct file_info_struct): Rename end_pending field to
|
||||||
|
at_end.
|
||||||
|
(file_info): Initialize at_end, not end_pending.
|
||||||
|
(buffer_line): If at_end set, just return immediately. Don't
|
||||||
|
worry about end_pending cases. Set at_end when EOF is read.
|
||||||
|
(print_source): Check at_end, not end_pending.
|
||||||
|
(listing_listing): Likewise.
|
||||||
|
|
||||||
* config/tc-alpha.h (alpha_do_align): Don't declare.
|
* config/tc-alpha.h (alpha_do_align): Don't declare.
|
||||||
(md_do_align): Don't define.
|
(md_do_align): Don't define.
|
||||||
(tc_frob_label): Define.
|
(tc_frob_label): Define.
|
||||||
|
@ -128,7 +128,7 @@ typedef struct file_info_struct
|
|||||||
int linenum;
|
int linenum;
|
||||||
FILE *file;
|
FILE *file;
|
||||||
struct file_info_struct *next;
|
struct file_info_struct *next;
|
||||||
int end_pending;
|
int at_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
file_info_type;
|
file_info_type;
|
||||||
@ -273,7 +273,7 @@ file_info (file_name)
|
|||||||
p->filename = xmalloc ((unsigned long) strlen (file_name) + 1);
|
p->filename = xmalloc ((unsigned long) strlen (file_name) + 1);
|
||||||
strcpy (p->filename, file_name);
|
strcpy (p->filename, file_name);
|
||||||
p->linenum = 0;
|
p->linenum = 0;
|
||||||
p->end_pending = 0;
|
p->at_end = 0;
|
||||||
|
|
||||||
p->file = fopen (p->filename, "r");
|
p->file = fopen (p->filename, "r");
|
||||||
if (p->file)
|
if (p->file)
|
||||||
@ -303,7 +303,7 @@ listing_newline (ps)
|
|||||||
list_info_type *new;
|
list_info_type *new;
|
||||||
|
|
||||||
as_where (&file, &line);
|
as_where (&file, &line);
|
||||||
if (line != last_line || last_file && file && strcmp(file, last_file))
|
if (line != last_line || (last_file && file && strcmp(file, last_file)))
|
||||||
{
|
{
|
||||||
last_line = line;
|
last_line = line;
|
||||||
last_file = file;
|
last_file = file;
|
||||||
@ -379,7 +379,7 @@ buffer_line (file, line, size)
|
|||||||
char *p = line;
|
char *p = line;
|
||||||
|
|
||||||
/* If we couldn't open the file, return an empty line */
|
/* If we couldn't open the file, return an empty line */
|
||||||
if (file->file == (FILE *) NULL)
|
if (file->file == (FILE *) NULL || file->at_end)
|
||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@ -387,20 +387,8 @@ buffer_line (file, line, size)
|
|||||||
if (file->linenum == 0)
|
if (file->linenum == 0)
|
||||||
rewind (file->file);
|
rewind (file->file);
|
||||||
|
|
||||||
if (file->end_pending == 10)
|
|
||||||
{
|
|
||||||
*p++ = '\n';
|
|
||||||
#if 1
|
|
||||||
fseek (file->file, 0, 0);
|
|
||||||
file->linenum = 0;
|
|
||||||
#else
|
|
||||||
file->linenum = 9999999;
|
|
||||||
#endif
|
|
||||||
file->end_pending = 0;
|
|
||||||
}
|
|
||||||
c = fgetc (file->file);
|
c = fgetc (file->file);
|
||||||
|
|
||||||
|
|
||||||
size -= 1; /* leave room for null */
|
size -= 1; /* leave room for null */
|
||||||
|
|
||||||
while (c != EOF && c != '\n')
|
while (c != EOF && c != '\n')
|
||||||
@ -414,7 +402,7 @@ buffer_line (file, line, size)
|
|||||||
}
|
}
|
||||||
if (c == EOF)
|
if (c == EOF)
|
||||||
{
|
{
|
||||||
file->end_pending++;
|
file->at_end = 1;
|
||||||
*p++ = '.';
|
*p++ = '.';
|
||||||
*p++ = '.';
|
*p++ = '.';
|
||||||
*p++ = '.';
|
*p++ = '.';
|
||||||
@ -687,7 +675,8 @@ list_symbol_table ()
|
|||||||
sprintf (buf, "%08lx", (unsigned long) val);
|
sprintf (buf, "%08lx", (unsigned long) val);
|
||||||
else if (sizeof (val) <= sizeof (unsigned long))
|
else if (sizeof (val) <= sizeof (unsigned long))
|
||||||
{
|
{
|
||||||
sprintf (fmt, "%%0%dlx", sizeof (val) * 2);
|
sprintf (fmt, "%%0%lulx",
|
||||||
|
(unsigned long) (sizeof (val) * 2));
|
||||||
sprintf (buf, fmt, (unsigned long) val);
|
sprintf (buf, fmt, (unsigned long) val);
|
||||||
}
|
}
|
||||||
#if defined (BFD64)
|
#if defined (BFD64)
|
||||||
@ -773,7 +762,7 @@ print_source (current_file, list, buffer, width)
|
|||||||
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)
|
&& !current_file->at_end)
|
||||||
{
|
{
|
||||||
char *p = buffer_line (current_file, buffer, width);
|
char *p = buffer_line (current_file, buffer, width);
|
||||||
printf ("%4d:%-13s **** %s\n", current_file->linenum, current_file->filename, p);
|
printf ("%4d:%-13s **** %s\n", current_file->linenum, current_file->filename, p);
|
||||||
@ -900,7 +889,7 @@ listing_listing (name)
|
|||||||
|
|
||||||
while (list->file->file
|
while (list->file->file
|
||||||
&& list->file->linenum < list->line
|
&& list->file->linenum < list->line
|
||||||
&& !list->file->end_pending)
|
&& !list->file->at_end)
|
||||||
{
|
{
|
||||||
p = buffer_line (list->file, buffer, width);
|
p = buffer_line (list->file, buffer, width);
|
||||||
|
|
||||||
@ -919,7 +908,7 @@ listing_listing (name)
|
|||||||
{
|
{
|
||||||
while (list->file->file
|
while (list->file->file
|
||||||
&& list->file->linenum < list->line
|
&& list->file->linenum < list->line
|
||||||
&& !list->file->end_pending)
|
&& !list->file->at_end)
|
||||||
p = buffer_line (list->file, buffer, width);
|
p = buffer_line (list->file, buffer, width);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user