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]

[patch KFAIL] Re: FAILing new testcase for -fdebug-types-section (PR symtab/14148)


On Sat, 05 May 2012 09:13:06 +0200, Jan Kratochvil wrote:
> On Sat, 05 May 2012 09:10:44 +0200, Siva Chandra wrote:
> > If you feel there
> > is no urgency in eliminating the failure you are seeing, I will dig a
> > little more into this and start a discussion in a few days.
> 
> A patch should go in only if it is understood why.

I have filed:
	-fdebug-types-section regresses ststic scope of types
	http://sourceware.org/bugzilla/show_bug.cgi?id=14148

As I do not intend to fix it proposing KFAIL below.  The fix needs to start
tracking types signatures during psymtab building to look up the type name
during psymtab-scanning DW_TAG_variable.


Thanks,
Jan


2012-05-23  Siva Chandra Reddy  <sivachandra@gmail.com>
	    Jan Kratochvil  <jan.kratochvil@redhat.com>

	Setup KFAIL symtab/14148.
	* py-symbol.c (static_func): New static function.
	(main): New variable result1, call static_func.
	* py-symtab.exp (Test static_func in static symbols): New test.
	(Test simple_struct in static symbols): KFAIL it with .debug_types.

diff --git a/gdb/testsuite/gdb.python/py-symbol.c b/gdb/testsuite/gdb.python/py-symbol.c
index 8c6cdb1..92eb7cd 100644
--- a/gdb/testsuite/gdb.python/py-symbol.c
+++ b/gdb/testsuite/gdb.python/py-symbol.c
@@ -49,18 +49,25 @@ struct simple_struct
   int a;
 };
 
+static int
+static_func (int a, int b)
+{
+  return a + b;
+}
+
 int main (int argc, char *argv[])
 {
 #ifdef __cplusplus
   SimpleClass sclass;
 #endif
   int a = 0;
-  int result;
+  int result, result1;
   struct simple_struct ss = { 10 };
   enum tag {one, two, three};
   enum tag t = one;
 
   result = func (42);
+  result1 = static_func (5, 10);
 
 #ifdef __cplusplus
   sclass.seti (42);
diff --git a/gdb/testsuite/gdb.python/py-symtab.exp b/gdb/testsuite/gdb.python/py-symtab.exp
index 6eec611..689b42a 100644
--- a/gdb/testsuite/gdb.python/py-symtab.exp
+++ b/gdb/testsuite/gdb.python/py-symtab.exp
@@ -71,6 +71,17 @@ gdb_test "python print \"func\" in global_symbols" "True" "Test func in global s
 gdb_test "python print \"main\" in global_symbols" "True" "Test main in global symbols"
 gdb_test "python print \"int\" in static_symbols" "True" "Test int in static symbols"
 gdb_test "python print \"char\" in static_symbols" "True" "Test char in static symbols"
+gdb_test "python print \"static_func\" in static_symbols" "True" "Test static_func in static symbols"
+
+set readelf_program [transform readelf]
+set command "exec $readelf_program -WS $binfile"
+verbose -log "command is $command"
+set result [catch $command output]
+verbose -log "result is $result"
+verbose -log "output is $output"
+if {$result == 0 && [regexp { \.debug_types } $output]} {
+    setup_kfail symtab/14148 "*-*-*"
+}
 gdb_test "python print \"simple_struct\" in static_symbols" "True" "Test simple_struct in static symbols"
 
 # Test is_valid when the objfile is unloaded.  This must be the last


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