summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2017-06-06 12:25:33 +0100
committerPedro Alves <palves@redhat.com>2017-06-06 12:25:33 +0100
commit58aa785057d718c91f9db5e8b627687a01df14a2 (patch)
tree06fcc8db75fb4cd06c3bee4b03d47ce921da06b9
parent670b1a13351f34c38ea1abb6cb20e247fb002015 (diff)
downloadbinutils-gdb-users/palves/fix-objc-tests.tar.gz
-rw-r--r--gdb/testsuite/gdb.objc/basicclass.m7
-rw-r--r--gdb/testsuite/gdb.objc/nondebug.m7
-rw-r--r--gdb/testsuite/gdb.objc/objcdecode.m7
-rw-r--r--gdb/testsuite/lib/gdb.exp3
4 files changed, 14 insertions, 10 deletions
diff --git a/gdb/testsuite/gdb.objc/basicclass.m b/gdb/testsuite/gdb.objc/basicclass.m
index 0de12db25a1..eb62a351bc8 100644
--- a/gdb/testsuite/gdb.objc/basicclass.m
+++ b/gdb/testsuite/gdb.objc/basicclass.m
@@ -1,6 +1,7 @@
-#include <objc/Object.h>
+#import <Foundation/Foundation.h>
+#include <stdio.h>
-@interface BasicClass: Object
+@interface BasicClass: NSObject
{
id object;
}
@@ -74,7 +75,7 @@ const char *_NSPrintForDebugger(id object)
{
/* This is not really what _NSPrintForDebugger should do, but it
is a simple test if gdb can call this function */
- if (object && [object respondsTo: @selector(myDescription)])
+ if (object && [object respondsToSelector: @selector(myDescription)])
return [object myDescription];
return NULL;
diff --git a/gdb/testsuite/gdb.objc/nondebug.m b/gdb/testsuite/gdb.objc/nondebug.m
index dcbdde936c7..2daa9a21e86 100644
--- a/gdb/testsuite/gdb.objc/nondebug.m
+++ b/gdb/testsuite/gdb.objc/nondebug.m
@@ -1,10 +1,11 @@
-#include <objc/Object.h>
+#import <Foundation/Foundation.h>
+#include <stdio.h>
-@interface NonDebug: Object
+@interface NonDebug: NSObject
{
}
@end
-@interface NonDebug2: Object
+@interface NonDebug2: NSObject
{
}
@end
diff --git a/gdb/testsuite/gdb.objc/objcdecode.m b/gdb/testsuite/gdb.objc/objcdecode.m
index 5e99618d115..5485337fff1 100644
--- a/gdb/testsuite/gdb.objc/objcdecode.m
+++ b/gdb/testsuite/gdb.objc/objcdecode.m
@@ -1,6 +1,7 @@
-#include <objc/Object.h>
+#import <Foundation/Foundation.h>
+#include <stdio.h>
-@interface Decode: Object
+@interface Decode: NSObject
{
}
- multipleDef;
@@ -42,7 +43,7 @@ const char *_NSPrintForDebugger(id object)
{
/* This is not really what _NSPrintForDebugger should do, but it
is a simple test if gdb can call this function */
- if (object && [object respondsTo: @selector(myDescription)])
+ if (object && [object respondsToSelector: @selector(myDescription)])
return [object myDescription];
return NULL;
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 6633d242965..34dad6ebdb0 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -3742,7 +3742,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"
- foreach lib {-lobjc -lpthreads -lpthread -lthread solaris} {
+ foreach lib {-lgnustep-base -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.
if { $lib == "solaris" } {
@@ -3751,6 +3751,7 @@ proc gdb_compile_objc {source dest type options} {
if { $lib != "-lobjc" } {
set lib "-lobjc $lib"
}
+
set options_with_lib [concat $options [list libs=$lib quiet]]
set ccout [gdb_compile $source $dest $type $options_with_lib]
switch -regexp -- $ccout {