This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] Debugging an srec file


Hi, 

This suppresses an error when you load a file (such as srec)
that doesn't have any symbols.

OK to commit?

Michael

2002-03-14  Michael Snyder  <msnyder@redhat.com>

	* symfile.c (syms_from_objfile): Return immediately if no syms.
	(symbol_file_add): Return immediately if no syms.
	(find_sym_fns): Return immediately if no syms.

Index: symfile.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile.c,v
retrieving revision 1.55
diff -c -3 -p -r1.55 symfile.c
*** symfile.c	2002/03/06 06:28:34	1.55
--- symfile.c	2002/03/14 19:48:53
*************** syms_from_objfile (struct objfile *objfi
*** 577,582 ****
--- 577,585 ----
    init_entry_point_info (objfile);
    find_sym_fns (objfile);
  
+   if (objfile->sf == NULL)
+     return;	/* No symbols. */
+ 
    /* Make sure that partially constructed symbol tables will be cleaned up
       if an error occurs during symbol reading.  */
    old_chain = make_cleanup_free_objfile (objfile);
*************** symbol_file_add (char *name, int from_tt
*** 858,863 ****
--- 861,869 ----
        syms_from_objfile (objfile, addrs, mainline, from_tty);
      }
  
+   if (objfile->sf == NULL)
+     return objfile;	/* No symbols. */
+ 
    /* We now have at least a partial symbol table.  Check to see if the
       user requested that all symbols be read on initial access via either
       the gdb startup command line or on a per symbol file basis.  Expand
*************** find_sym_fns (struct objfile *objfile)
*** 1133,1138 ****
--- 1139,1147 ----
    struct sym_fns *sf;
    enum bfd_flavour our_flavour = bfd_get_flavour (objfile->obfd);
    char *our_target = bfd_get_target (objfile->obfd);
+ 
+   if (our_flavour == bfd_target_srec_flavour)
+     return;	/* No symbols. */
  
    /* Special kludge for apollo.  See dstread.c.  */
    if (STREQN (our_target, "apollo", 6))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]