aboutsummaryrefslogtreecommitdiff
path: root/gas/listing.c
diff options
context:
space:
mode:
authorSteve Chamberlain <sac@cygnus>1992-01-25 01:45:53 +0000
committerSteve Chamberlain <sac@cygnus>1992-01-25 01:45:53 +0000
commit3d38ac61cdcb079d7f53c114a0c93622bfba4013 (patch)
treef4215f536c66e7b5f8978ce56357eb7f2d8f13e6 /gas/listing.c
parentb3ca913f749156a7b1b99558dfcf1aab5bb30fdd (diff)
downloadgdb-3d38ac61cdcb079d7f53c114a0c93622bfba4013.zip
gdb-3d38ac61cdcb079d7f53c114a0c93622bfba4013.tar.gz
gdb-3d38ac61cdcb079d7f53c114a0c93622bfba4013.tar.bz2
Don't crash if a symbol has no name
Diffstat (limited to 'gas/listing.c')
-rw-r--r--gas/listing.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/gas/listing.c b/gas/listing.c
index 70b28b9..ce0983c 100644
--- a/gas/listing.c
+++ b/gas/listing.c
@@ -580,15 +580,18 @@ DEFUN_VOID(list_symbol_table)
{
if (ptr->sy_frag->line)
{
- printf("%20s:%-5d %2d:%08x %s \n",
- ptr->sy_frag->line->file->filename,
- ptr->sy_frag->line->line,
- S_GET_SEGMENT(ptr),
- S_GET_VALUE(ptr),
- S_GET_NAME(ptr));
- on_page++;
- listing_page(0);
-
+ if (strlen(S_GET_NAME(ptr)))
+ {
+ printf("%20s:%-5d %2d:%08x %s \n",
+ ptr->sy_frag->line->file->filename,
+ ptr->sy_frag->line->line,
+ S_GET_SEGMENT(ptr),
+ S_GET_VALUE(ptr),
+ S_GET_NAME(ptr));
+
+ on_page++;
+ listing_page(0);
+ }
}
}
@@ -601,11 +604,10 @@ DEFUN_VOID(list_symbol_table)
for (ptr = symbol_rootP; ptr != (symbolS*)NULL; ptr = symbol_next(ptr))
{
- if (strlen(S_GET_NAME(ptr)) != 0)
+ if (ptr && strlen(S_GET_NAME(ptr)) != 0)
{
if (ptr->sy_frag->line == 0)
{
-
printf("%s\n", S_GET_NAME(ptr));
on_page++;
listing_page(0);