[Bug testsuite/24760] New: [gdb/testsuite] gdb.objc/basicclass.exp has bitrotted

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug testsuite/24760] New: [gdb/testsuite] gdb.objc/basicclass.exp has bitrotted

Martin.Jansa at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24760

            Bug ID: 24760
           Summary: [gdb/testsuite] gdb.objc/basicclass.exp has bitrotted
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: testsuite
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

I.

Currently when running gdb.objc/basicclass.exp, we get:
...
Running /data/gdb_versions/devel/src/gdb/testsuite/gdb.objc/basicclass.exp ...

                === gdb Summary ===

# of unsupported tests          1
...

Compilation fails because we run into a bunch of warnings:
...
/data/gdb_versions/devel/src/gdb/testsuite/gdb.objc/basicclass.m: In function
'+[BasicClass newWithArg:]':
/data/gdb_versions/devel/src/gdb/testsuite/gdb.objc/basicclass.m:22:3: warning:
'BasicClass' may not respond to '+new'
   id obj = [self new];
   ^~
/data/gdb_versions/devel/src/gdb/testsuite/gdb.objc/basicclass.m:22:3: warning:
(Messages without a matching method signature
/data/gdb_versions/devel/src/gdb/testsuite/gdb.objc/basicclass.m:22:3: warning:
will be assumed to return 'id' and accept
/data/gdb_versions/devel/src/gdb/testsuite/gdb.objc/basicclass.m:22:3: warning:
'...' as arguments.)
/data/gdb_versions/devel/src/gdb/testsuite/gdb.objc/basicclass.m: In function
'-[BasicClass printHi]':
/data/gdb_versions/devel/src/gdb/testsuite/gdb.objc/basicclass.m:41:3: warning:
incompatible implicit declaration of built-in function 'printf'
   printf("Hi\n");
   ^~~~~~
/data/gdb_versions/devel/src/gdb/testsuite/gdb.objc/basicclass.m:41:3: note:
include '<stdio.h>' or provide a declaration of 'printf'
/data/gdb_versions/devel/src/gdb/testsuite/gdb.objc/basicclass.m: In function
'-[BasicClass printNumber:]':
/data/gdb_versions/devel/src/gdb/testsuite/gdb.objc/basicclass.m:47:3: warning:
incompatible implicit declaration of built-in function 'printf'
   printf("%d\n", number);
   ^~~~~~
/data/gdb_versions/devel/src/gdb/testsuite/gdb.objc/basicclass.m:47:3: note:
include '<stdio.h>' or provide a declaration of 'printf'
/data/gdb_versions/devel/src/gdb/testsuite/gdb.objc/basicclass.m: In function
'main':
/data/gdb_versions/devel/src/gdb/testsuite/gdb.objc/basicclass.m:68:3: warning:
'BasicClass' may not respond to '+new'
   obj = [BasicClass new];
   ^~~
/data/gdb_versions/devel/src/gdb/testsuite/gdb.objc/basicclass.m: In function
'_NSPrintForDebugger':
/data/gdb_versions/devel/src/gdb/testsuite/gdb.objc/basicclass.m:77:3: warning:
no '-respondsTo:' method found
   if (object && [object respondsTo: @selector(myDescription)])
   ^~
...


II.

When bypassing these warnings using:
...
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index da36ec0d4a..6b81585296 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -3938,6 +3938,7 @@ proc gdb_compile_shlib_pthreads {sources dest options} {
 proc gdb_compile_objc {source dest type options} {
     set built_binfile 0
     set why_msg "unrecognized error"
+    lappend options "nowarnings"
     foreach lib {-lobjc -lpthreads -lpthread -lthread solaris} {
         # This kind of wipes out whatever libs the caller may have
         # set.  Or maybe theirs will override ours.  How infelicitous.
...
we run into:
...
Running /data/gdb_versions/devel/src/gdb/testsuite/gdb.objc/basicclass.exp ...
FAIL: gdb.objc/basicclass.exp: continue until method breakpoint
ERROR: tcl error sourcing
/data/gdb_versions/devel/src/gdb/testsuite/gdb.objc/basicclass.exp.
ERROR: extra characters after close-quote
    while executing
"gdb_test "" "Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:.*"
"resetting breakpoints when r

#
# Continue until breakpoint (test re-setting..."
    (file "/data/gdb_versions/devel/src/gdb/testsuite/gdb.objc/basicclass.exp"
line 122)
    invoked from within
"source /data/gdb_versions/devel/src/gdb/testsuite/gdb.objc/basicclass.exp"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 source
/data/gdb_versions/devel/src/gdb/testsuite/gdb.objc/basicclass.exp"
    invoked from within
"catch "uplevel #0 source $test_file_name""

                === gdb Summary ===

# of expected passes            7
# of unexpected failures        1
...


III.

If we fix this (broken since 2014):
...
diff --git a/gdb/testsuite/gdb.objc/basicclass.exp
b/gdb/testsuite/gdb.objc/basicclass.exp
index d88655afb5..43b93cdaf9 100644
--- a/gdb/testsuite/gdb.objc/basicclass.exp
+++ b/gdb/testsuite/gdb.objc/basicclass.exp
@@ -119,7 +119,7 @@ gdb_test continue \
 # Test resetting breakpoints when re-running program
 #
 gdb_run_cmd
-gdb_test "" "Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:.*"
"resetting breakpoints when r
+gdb_test "" "Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:.*"
"resetting breakpoints when rerunning"

 #
 # Continue until breakpoint (test re-setting breakpoint)
...
we get:
...
FAIL: gdb.objc/basicclass.exp: continue until method breakpoint
FAIL: gdb.objc/basicclass.exp: continue until method breakpoint
FAIL: gdb.objc/basicclass.exp: print an ivar of self
FAIL: gdb.objc/basicclass.exp: print self
FAIL: gdb.objc/basicclass.exp: print contents of self
FAIL: gdb.objc/basicclass.exp: continue until category method
FAIL: gdb.objc/basicclass.exp: call an Objective-C method with no arguments
FAIL: gdb.objc/basicclass.exp: call an Objective-C method with one argument
FAIL: gdb.objc/basicclass.exp: use of the print-object command
FAIL: gdb.objc/basicclass.exp: use of the po (print-object) command

                === gdb Summary ===

# of expected passes            9
# of unexpected failures        10
...

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug testsuite/24760] [gdb/testsuite] gdb.objc/basicclass.exp has bitrotted

Martin.Jansa at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24760

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |iains at sourceware dot org

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug testsuite/24760] [gdb/testsuite] gdb.objc/basicclass.exp has bitrotted

Martin.Jansa at gmail dot com
In reply to this post by Martin.Jansa at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24760

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <[hidden email]>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=da73816739483bac537403262cef1c460e43319f

commit da73816739483bac537403262cef1c460e43319f
Author: Tom de Vries <[hidden email]>
Date:   Sun Jul 14 13:23:04 2019 +0200

    [gdb/testsuite] Fix unterminated string in gdb.objc/basicclass.exp

    The test-case gdb.objc/basicclass.exp contains an unterminated string,
    introduced in refactoring commit fa43b1d7ca "after gdb_run_cmd, gdb_expect
->
    gdb_test_multiple/gdb_test".

    Fix the unterminated string.

    gdb/testsuite/ChangeLog:

    2019-07-14  Tom de Vries  <[hidden email]>

        PR testsuite/24760
        * gdb.objc/basicclass.exp: Fix unterminated string.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug testsuite/24760] [gdb/testsuite] gdb.objc/basicclass.exp has bitrotted

Martin.Jansa at gmail dot com
In reply to this post by Martin.Jansa at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24760

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
Filed PR24807 - "gdb.objc FAILs" for remaining FAILs.

Fixed unterminated string in test-case, marking resolved-fixed.

--
You are receiving this mail because:
You are on the CC list for the bug.