This is the mail archive of the gdb-patches@sourceware.org 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]

Re: [PATCH] fix symbol-file crash


Jim Blandy wrote:
I think this is obvious; please go ahead and commit it.

However, instead of using <unknown> when symfile_objfile is NULL, just
use two distinct prompt strings: "Discard symbol table from `%s'? "
and "Discard symbol table? ".

Thanks I committed the attached.


Andrew
2005-12-02  Andrew Stubbs  <andrew.stubbs@st.com>

	* symfile.c (symbol_file_clear): Test symfile_objfile is not NULL
	before dereferencing it.
	Gettextize the query.

Index: src/gdb/symfile.c
===================================================================
--- src.orig/gdb/symfile.c	2005-12-01 17:35:14.000000000 +0000
+++ src/gdb/symfile.c	2005-12-02 10:49:45.000000000 +0000
@@ -1085,8 +1085,10 @@ symbol_file_clear (int from_tty)
 {
   if ((have_full_symbols () || have_partial_symbols ())
       && from_tty
-      && !query ("Discard symbol table from `%s'? ",
-		 symfile_objfile->name))
+      && (symfile_objfile
+	  ? !query (_("Discard symbol table from `%s'? "),
+		    symfile_objfile->name)
+	  : !query (_("Discard symbol table? "))))
     error (_("Not confirmed."));
     free_all_objfiles ();
 

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