Can't run project anymore - iphone

My project used to be called "TextFieldDemo", then I renamed it to "ShiftCipher". I cannot launch the project anymore. This is the message I'm getting. Can so please help?
GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Mon Aug 8 20:32:45
UTC 2011) Copyright 2004 Free Software Foundation, Inc. GDB is free
software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions. Type "show copying" to see the conditions. There is
absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".sharedlibrary
apply-load-rules all Attaching to process 2285. 2011-10-30
19:35:49.914 ShiftCipher[2285:f803] * Terminating app due to
uncaught exception 'NSInternalInconsistencyException', reason: 'Could
not load NIB in bundle: 'NSBundle (loaded)' with name 'TextFieldDemoViewController''
* First throw call stack: (0x14ce052 0x11b9d0a 0x1476a78 0x14769e9 0x585838 0x42ce2c 0x42d3a9 0x42d5cb 0x38da73 0x38e0b8 0x230b 0x3659d6
0x3668a6 0x375743 0x3761f8 0x369aa9 0x1bc4fa9 0x14a21c5 0x1407022
0x140590a 0x1404db4 0x1404ccb 0x3662a7 0x367a9b 0x225d 0x21d5)
terminate called throwing an exceptionCurrent language: auto;
currently objective-c (gdb)
TextFieldDemoViewController is now called ShiftCipherViewController. I don't know why it's looking for it with the old name.

Look in the XIB file that you're attempting to load and see what the "File's Owner" is listed as.
My guess is that it is still set to "TextFieldDemoViewController" instead of "ShiftCipherViewController". That's where you would need to make your change.

You have a nib that use to be named TextFieldDemoViewController.xib. The file was probably renamed to something like ShiftCipherViewController.xib. You are likely still referencing TextFieldDemoViewController in your initWithNibName.

Related

Eclipse remote debugging arm-linux library

I am running:
Eclipse 3.8.1 (Build id: deb build).
On Ubuntu 16.04 LTS in a VM and UbuntuMATE 16.04 LTS on target Raspberry Pi 3.
gdb-multiarch(architecture set to arm in .gdbinit) locally andgdbserver` on the target.
Cross compilation and remote deployment is successful. However, there appears to be some library issue when I run on the remote target. Output from gdb-multiarch below (superfluous text removed):
GNU gdb (Ubuntu 7.11-0ubuntu1) 7.11 Copyright (C) 2016 Free Software
Foundation, Inc. License GPLv3+: GNU GPL version 3 or later
http://gnu.org/licenses/gpl.html This GDB was configured as
"x86_64-linux-gnu".
Program stopped. 0x76fd7a40 in ?? () from
/home/fred/raspberrypi/rootfs/lib/arm-linux-gnueabihf/ld-2.23.so
Execution stops at main. However, it doesn't appear to stop due to a breakpoint. The stop appears to be the result of some library issue possibly and unresolved symbol (or something more serious) resulting in the ??.
I have set sysroot in the .gdbinit file to indicate where the shared libraries can be found. The StepIn, StepOut icons are hi-lighted in Eclipse, and I can read ARM registers if I press pause and see which core is being used to run the process (with process ID)!
After further resume & pause operations a segmentation fault occurs:
Program stopped. 0x76fe2e92 in ?? () from
/home/fred/raspberrypi/rootfs/lib/arm-linux-gnueabihf/ld-2.23.so
Program received signal SIGSEGV, Segmentation fault. 0x76fd905e in ??
() from
/home/fred/raspberrypi/rootfs/lib/arm-linux-gnueabihf/ld-2.23.so
Program terminated with signal SIGSEGV, Segmentation fault. The
program no longer exists.
Any ideas? (I am very much new to Linux as it probably shows.)
Thanks for the questions which have resulted in further exploration below:
In Eclipse I started GDB by selecting Debug Configuration and then choosing the remote configuration that I had set up.
The code is very simple, consisting of a stream operator to output some text and then a loop, however it is never reached. I think I have just managed to reproduce the issue from the command line. Incidentally I started the target going first. (Again superfluous text was removed for clarity.)
gdb-multiarch Hello_Raspberry_Pi
Reading symbols from Hello_Raspberry_Pi...done.
The target architecture is assumed to be arm
(gdb) target remote ubuntumate-pi
(gdb) target remote 192.168.0.12:2345
Remote debugging using 192.168.0.12:2345
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initialisers
and track explicitly loaded dynamic code.
0x76fd7a40 in ?? ()
(gdb) set architecture arm
The target architecture is assumed to be arm
(gdb) set sysroot /home/fred/raspberrypi/rootfs/lib/arm-linux-gnueabihf
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initialisers
and track explicitly loaded dynamic code.
(gdb)
The target side behaved as would be expected:
fred#UbuntuMATE-Pi:~/Hello_Raspberry_Pi$ gdbserver 192.168.0.7:2345 Hello_Raspberry_Pi
Process Hello_Raspberry_Pi created; pid = 17363
Listening on port 2345
Remote debugging from host 192.168.0.7
So perhaps Unable to find dynamic linker breakpoint function. is a big clue?
It would appear that I had defined Shared Libraries incorrectly. When I deleted this setting something closer to expected behaviour occurred. As shown below, however I there is still a warning that I would like to remove:
For help, type "help".
Type "apropos word" to search for commands related to "word".
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initialisers
and track explicitly loaded dynamic code.
0x76fd7a40 in ?? ()
Breakpoint 2, main () at ../src/Hello_Raspberry_Pi.cpp:18
18 cout << "I'm in the While loop and the value of variable i is: " << i << endl;
Breakpoint 1, main () at ../src/Hello_Raspberry_Pi.cpp:20
20 usleep(1000000); //wait for 1 seconds
So now Eclipse does breakpoint at main and permit stepping - finally!
I also faced problems similar to this, getting segmentation fault from ld.so. Did the following steps to fix it.
Install libc6-dbg package in both sysroot and target.
create a folder /lib/.debug in both sysroot and target.
copy /usr/lib/debug/lib/arm-linux-gnueabihf/ld-2.23.so to /lib/.debug in both sysroot and target.

Is Eclipse Mars CDT support C++11 thread?

I have the following setup:
Eclipse Mars 4.5 (Build id:20150621-1200)
MinGW 201310 with g++ 4.8.1
Windows 10
I followed few post to add std=c++11 in Project property and make sure __cplusplus is 201103L. Here is the result:
I can see that std::map compile and run ok.
If I #include , there is no syntax error. But the declaration of thread in main() shows error "Type thread could not be resolved". Then I open up thread header file located in c:/MinGW/lib/gcc/mingw32/4.8.1/include/c++/thread, it seems that the whole class is dimmed due to that _GLIBCXX_HAS_GTHREADS is undefined. If I manually define it in the path and symbols, then the thread class is fully defined. But there comes more errors in the thread itself. Did I missed something? Or if the C++11 thread isn't ready on eclipse+MinGW? Thank you!
To get support for std::thread, you will want a MinGW build equipped with posix threading model support.
I'm not sure if there's a "classic" MinGW build with that feature,
but it's available with MinGW-w64.
You can get a MinGW-w64 installation in a number of ways, but the installer under the "Mingw-builds" link should be sufficient to get you started (and will let you pick which release GCC you want).

GDB: unable to read symbols

When trying to run my iOS app on a device, I get the following from GDB, and resulting in my app exiting just right after it started so I never get the chance to debug it. Anyone knows what I'm doing wrong or what I can do to fix it?
GNU gdb 6.3.50-20050815 (Apple version gdb-1470) (Thu May 27 05:54:06 UTC 2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "--host=i386-apple-darwin --target=arm-apple-darwin".tty /dev/ttys002
sharedlibrary apply-load-rules all
warning: Unable to read symbols from "dyld" (prefix __dyld_) (not yet mapped into memory).
warning: Unable to read symbols for "(null)/Library/Frameworks/UIKit.framework/UIKit" (file not found).
warning: Unable to read symbols from "UIKit" (not yet mapped into memory).
warning: Unable to read symbols from "Foundation" (not yet mapped into memory).
warning: Unable to read symbols for "(null)/Library/Frameworks/CoreGraphics.framework/CoreGraphics" (file not found).
warning: Unable to read symbols from "CoreGraphics" (not yet mapped into memory).
warning: Unable to read symbols from "AudioToolbox" (not yet mapped into memory).
warning: Unable to read symbols from "libgcc_s.1.dylib" (not yet mapped into memory).
warning: Unable to read symbols from "libSystem.B.dylib" (not yet mapped into memory).
warning: Unable to read symbols from "libobjc.A.dylib" (not yet mapped into memory).
warning: Unable to read symbols from "CoreFoundation" (not yet mapped into memory).
target remote-mobile /tmp/.XcodeGDBRemote-4572-43
Switching to remote-macosx protocol
mem 0x1000 0x3fffffff cache
mem 0x40000000 0xffffffff none
mem 0x00000000 0x0fff none
[Switching to thread 11523]
[Switching to thread 11523]
gdb stack crawl at point of internal error:
/SourceCache/gdb/gdb-1470/src/gdb/macosx/macosx-nat-dyld.c:1547: internal-error: unrecognized shared library breakpoint
A problem internal to GDB has been detected,
further debugging may prove unreliable.
0 gdb-arm-apple-darwin 0x0013117d internal_vproblem + 316
I have the same problem at the moment, but I believe it is to do with your frameworks.
Maybe try removing them and re-adding them to your project. Sorry I couldn't be more help, if I find a solution I will let you know.
*EDIT
Ignore the whole framework issue, the real problem is your IOS on your development screen. Make sure you have the latest version and that this matches your iphone's IOS.

CLANG giving errors complaining about defective header file UILocalizedIndexedCollation.h

I ran into this error when building my code with CLANG:
In file included from /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:31,
from /Users/waspfish/Documents/NanaimoStudio/Projects/iPhoneMonk/Projects/IdeaOrganizer/IdeaOrganizer_Prefix.pch:13,
from :1:
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILocalizedIndexedCollation.h:13: error: syntax error before ‘AT_NAME’ token
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILocalizedIndexedCollation.h:21: error: syntax error before ‘}’ token
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILocalizedIndexedCollation.h:23: fatal error: method definition not in #implementation context
compilation terminated.
{standard input}:32:FATAL:.abort detected. Assembly stopping.
I ended up having to exclude the UILocalizedIndexedCollation.h from UIKit.h and everything built fine. Any idea what could have caused the problem? I can't imagine Apple is shipping a defective header file.
The problem comes from SDK 3.0 which now use gcc 4.2 but scan-build still use /usr/bin/gcc. So you need to tell scan-build to use /usr/bin/gcc-4.2 instead.
scan-build --use-cc=/usr/bin/gcc-4.2 xcodebuild -configuration Debug
Et voila!
Apple’s engineer had confirmed that they had a bug in UIKit framework:
We do have a simple workaround for this UIKit bug. In UILocalizedIndexedCollation.h change this:
UIKIT_EXTERN #interface UILocalizedIndexedCollation : NSObject
to
UIKIT_EXTERN_CLASS #interface UILocalizedIndexedCollation : NSObject
Denis2342
Usually when I see something like this I clean the build and restart Xcode, then things were fine. With GCC 4.2 sometimes a bad pch could cuase hiccups like this, but clang uses a totoally different pch implementation. You may want t completely delete the build dir while Xcode is not running.
Technically clang is not supported for iPhone development, but I use it for simulator compiles , and I do not see the compile errors you are seeing, so (at least for me) it works. One thing sticks out in my head, you refer to editing your UIKit.h. I understand what you did that, but tweaking system headers is big no-no. Is there a chance you have done that for other reasons, because if you are not running stock headers there any number of reasons this could be happening.

Unable to read symbols error

I get these errors when I build and run for the device. Should I be worried about them? The app runs fine.
run
Running…
[Switching to thread 10755]
[Switching to thread 10755]
warning: Couldn't raise load state for requested shlib: "libobjc.A.dylib" for breakpoint 1.
(gdb) continue
warning: Unable to read symbols for ""/Users/tim/Code/Cat War/build/Debug-iphoneos"/Tiger War.app/Tiger War" (file not found).
warning: Unable to read symbols for ""/Users/tim/Code/Cat War/build/Debug-iphoneos"/Tiger War.app/Tiger War" (file not found).
You probably turned off debug symbols in the build settings. They should be off for release but they are helpful for debuging.
Hmm. I get this as well, but only when testing on the iPhone or iPod touch. Also, for my Debug Target Config settings, "Generate Debug Symbols" is set. (Not much in the Xcode project was changed in terms of the build settings, and I suspect it wasn't in yours either ... ?)
By any chance do you have an objc_exception_throw breakpoint in play? I have these two in my global breakpoints group:
[NSException raise] (CoreFoundation)
objc_exception_throw (libobjc.A.dylib)
Perhaps there's a correlation?