aboutsummaryrefslogtreecommitdiff
path: root/gas/listing.c
diff options
context:
space:
mode:
authorSteve Chamberlain <sac@cygnus>1992-05-01 21:27:34 +0000
committerSteve Chamberlain <sac@cygnus>1992-05-01 21:27:34 +0000
commit7143f43cfa729f280a9863b7a026d5aa72a2bde0 (patch)
tree041b686fad192656c2ca2c408cbd728f31193eba /gas/listing.c
parentdc4726c23606eee0dddf49dbd6130c5c2ac7d97a (diff)
downloadgdb-7143f43cfa729f280a9863b7a026d5aa72a2bde0.zip
gdb-7143f43cfa729f280a9863b7a026d5aa72a2bde0.tar.gz
gdb-7143f43cfa729f280a9863b7a026d5aa72a2bde0.tar.bz2
f
Added some more pseudo ops listing.c: lint as.c: ignore -w option
Diffstat (limited to 'gas/listing.c')
-rw-r--r--gas/listing.c41
1 files changed, 33 insertions, 8 deletions
diff --git a/gas/listing.c b/gas/listing.c
index 04fef6b..49d24f6 100644
--- a/gas/listing.c
+++ b/gas/listing.c
@@ -92,10 +92,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
*/
#include "as.h"
+
#include <obstack.h>
#include "input-file.h"
#include "targ-cpu.h"
+char *malloc();
+
#ifndef NO_LISTING
#ifndef LISTING_HEADER
#define LISTING_HEADER "GAS LISTING"
@@ -199,7 +202,7 @@ DEFUN(listing_message,(name, message),
char *message)
{
unsigned int l = strlen(name) + strlen(message)+1;
- char *n = malloc(l);
+ char *n = (char*)malloc(l);
strcpy(n,name);
strcat(n,message);
if(listing_tail != (list_info_type *)NULL)
@@ -255,7 +258,11 @@ DEFUN(file_info, (file_name),
p->linenum = 0;
p->end_pending = 0;
- p->file = fopen(p->filename,"r");
+ p->file = fopen(p->filename,"rb");
+if (p->file) fgetc(p->file);
+
+
+
return p;
}
@@ -334,11 +341,13 @@ DEFUN(buffer_line,(file, line, size),
if (file->end_pending == 10) {
*p ++ = '\n';
- rewind(file->file);
+ fseek(file->file, 0,0 );
file->linenum = 0;
file->end_pending = 0;
}
c = fgetc(file->file);
+
+
size -= 1; /* leave room for null */
while (c != EOF && c != '\n')
@@ -348,13 +357,14 @@ DEFUN(buffer_line,(file, line, size),
count++;
c= fgetc(file->file);
+
}
if (c == EOF)
{
file->end_pending ++;
- *p++ = 'E';
- *p++ = 'O';
- *p++ = 'F';
+ *p++ = '.';
+ *p++ = '.';
+ *p++ = '.';
}
file->linenum++;
*p++ = 0;
@@ -618,6 +628,9 @@ DEFUN_VOID(list_symbol_table)
{
if (ptr->sy_frag->line)
{
+ if (S_GET_NAME(ptr))
+ {
+
if (strlen(S_GET_NAME(ptr)))
{
printf("%20s:%-5d %2d:%08x %s \n",
@@ -626,7 +639,19 @@ DEFUN_VOID(list_symbol_table)
S_GET_SEGMENT(ptr),
S_GET_VALUE(ptr),
S_GET_NAME(ptr));
+ }
+
+ else
+ {
+ printf("%20s:%-5d %2d:%08x\n",
+ ptr->sy_frag->line->file->filename,
+ ptr->sy_frag->line->line,
+ S_GET_SEGMENT(ptr),
+ S_GET_VALUE(ptr));
+
+ }
+
on_page++;
listing_page(0);
}
@@ -642,7 +667,7 @@ DEFUN_VOID(list_symbol_table)
for (ptr = symbol_rootP; ptr != (symbolS*)NULL; ptr = symbol_next(ptr))
{
- if (ptr && strlen(S_GET_NAME(ptr)) != 0)
+ if (S_GET_NAME(ptr) && strlen(S_GET_NAME(ptr)) != 0)
{
if (ptr->sy_frag->line == 0)
{
@@ -856,7 +881,7 @@ DEFUN_VOID(listing_psize)
if (paper_height < 0 || paper_height > 1000)
{
paper_height = 0;
- as_warn("strantge paper height, set to no form");
+ as_warn("strange paper height, set to no form");
}
if (*input_line_pointer == ',')
{