This is the mail archive of the gdb-cvs@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]

src/gdb ChangeLog symfile.c symtab.c symtab.h ...


CVSROOT:	/cvs/src
Module name:	src
Changes by:	tromey@sourceware.org	2013-08-07 20:03:52

Modified files:
	gdb            : ChangeLog symfile.c symtab.c symtab.h 
	gdb/testsuite  : ChangeLog 
	gdb/testsuite/gdb.base: maint.exp 

Log message:
	use language of the main symbol
	
	With "dwz -m", "main" appears in both the PU and the importing CU when
	running anon-struct.exp.  However, the PU does not have a file name.
	So, find_main_filename returns the empty string, making
	deduce_language_from_filename return language_unknown.
	
	This patch fixes this problem by changing gdb to use the ordinary
	symbol-lookup functions to find "main"'s symbol.  Then, it examines the
	symbol's language.
	
	I think this is cleaner than the current approach.  For one thing it
	avoids trying to guess the language based on the source file name,
	instead deferring to the presumably more reliable debuginfo.
	
	Another possible fix would have been to change how the file name is
	found via the "qf" methods.  However, I think the approach given is
	preferable for the reason outlined above.
	
	This required a minor test suite change, as now a symtab is expanded
	during the search for "main".
	
	Built and regtested (both ways) on x86-64 Fedora 18.
	
	* symfile.c (set_initial_language): Look up "main" symbol
	and use its language.
	* symtab.c (find_main_filename): Remove.
	* symtab.h (find_main_filename): Remove.
	
	* gdb.base/maint.exp: Allow zero symtabs to be expanded.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.15870&r2=1.15871
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/symfile.c.diff?cvsroot=src&r1=1.382&r2=1.383
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/symtab.c.diff?cvsroot=src&r1=1.366&r2=1.367
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/symtab.h.diff?cvsroot=src&r1=1.238&r2=1.239
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3759&r2=1.3760
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.base/maint.exp.diff?cvsroot=src&r1=1.68&r2=1.69


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