Xcode 3.0 debugger keeps skipping breakpoints. - c++

I'm using Xcode 3.0 on a PowerBook G4. I needed to test some code to see how it runs on a big endian host. I already had it set up to go so got it out to test.
I first created an empty project and added my binary as a custom executable as well as loading in some source files. This seemed to be working fine. The code is a C++ terminal application and I had already setup a Makefile with CMake.
In the beginning I set up some breakpoints and started up the debugger. And it worked well. Stopping at my breakpoints. But then something happened that I don't know what and it started ignoring them.
I setup a new project like before and started from scratch again. Loaded the debugger. And once again it ignored them!
So then I managed to get CMake (2.8.12) to generate an Xcode project file. Which didn't go too easy as it didn't know what compiler I had. Looks like I stumbled onto another bug there. I eventually got past it by going between the CMake GUI and terminal.
I then closed all windows in Xcode and quit it. I then opened up the new project to start afresh. I set up some new breakpoints and loaded up the debugger. The code fell through again but then I realised I didn't set any arguments. So I did that and tried again. It ran through again! I looked up how to reset Xcode prefs and did so. Try again and it keeps ignoring my breakpoints!
I know it's kinda bad to setup an account to ask a question. And I hate to do that. But I'm really over this and don't know what is wrong with it. I've Googled for answers, got some hits here, and tried suggestions like disabling lazy symbols, making sure strip doesn't kill debug symbols and other symbol stuff but none has any affect. I've wasted hours trying to fix it instead of testing code I need too.
What's disconcerting is that no source is loading into the [GDB] debugger either. I actually forced it to stop by doing an implicit read from location zero in my source. And even this wasn't right. It didn't even load up the source but just gave me a disassembly. Even though I had it set to show only source. There's something wrong with it. :-?
Well thanks for any help. I don't know if I'm getting old or what. But this is getting as annoying as a small hidden bug in code that brings the whole house down! ;-)

Related

CodeLite closes terminal instantly

I'm a beginner in C++ and I started an Udemy course. In that course they recommend using CodeLite as IDE, so I decided to give it a try. In the course, they write a basic program that displays "Hello world!" to show how the IDE works. They compile then execute it, and a terminal window opens with the "Hello world!" message like normal.
In my case, after following the setup process step by step and using the exact same code as them, when I compile and execute the code, my terminal flashes for a split second and then disappears. In their video the terminal remains open but I thought that since they have an older version of CodeLite maybe in the newer one that I have, the terminal is supposed to close by default.
I went online and found people saying that a way of keeping the terminal open is by adding #include and system("pause"); on Windows, but in my case the terminal keeps behaving the same, and CodeLite doesn't report any problems. I've also tried cin.get(); with no success.
Any idea what could be causing this problem?
I had the same problem and I did these steps to solve the problem:
Uninstalled CodeLite.
Installed MinGW correctly.
Then reinstalled CodeLite.
Then did tutorial steps: Click Scan then select MinGW.
After I did these steps, it worked normally.
I had the same problem running Codelite on OpenSuse Leap 15.1. I eventually found a very simple answer. Go to the Settings menu, select Preferences and then Terminal, on the left towards the bottom. Change it to konsole to use the standard terminal, rather than the codelite-terminal.
I know this is an old question, but did not see the answer that worked for me. Debugging (F5) will close the terminal after completion.
However, running/executing (CTRL+F5) will not. Leaves terminal open. At least this is the case for me, and hopefully this helps someone out.
I know this is an old question, but CodeLite has a Project-level setting for "pause when execution ends" which will pause the program before the terminal closes so that you can see outputs and the like.
To turn on just right click on your project, go to settings, and it should be in the center of the general tab.
I went online and found people saying that a way of keeping the terminal open is by adding #include and system("pause");
And this is the wrong way to do it - the desire to leave the window open/closed is not meant to be controlled by your program; but the thing calling it. For example, you break the ability to run it as part of a headless script.
Much better would be to run it in debug and put a break point at the return of main, or to find the configuration option in your IDE that stops it closing the window.
I am not aware why CodeLite would behave like that. If you really added some pause or blocking call and it still closes, it looks like it is not really running the program (e.g. something breaks before that or something is misconfigured).
First, try to open a terminal yourself (e.g. cmd or PowerShell on Windows), and execute your compiled program there -- that way, the terminal will remain open. If that works, then compilation went fine, but something is wrong with CodeLite's configuration, most likely.
Otherwise, as a last resort, since using CodeLite is not strictly required, simply switch to another IDE/toolchain, e.g. Visual Studio (on Windows).
For some reason, after closing and reopening CodeLite, it now works, the terminal remains open when I run it from the IDE. I don't know what solved the problem since I've closed and reopened CodeLite at least 5 times before this without anything happening. Thanks for the help though.
I had the same issue. What I found wrong was that the compiler that I installed was 32bit and I was using the 64bit CodeLite version . Try Installing the 32bit CodeLite version and it should work fine.
It worked for me.
I had this problem also, I tried uninstalling and reinstalling code lite but the problem still occurred.
I went back and checked the Environment Variables in control panel and I had placed the systems variables in "Path" to the incorrect Bin directory.
I corrected the entry, uninstalled and reinstalled code lite again and the problem was resolved.
Hey I also had the same problem, doing the same course! What I did was to relocate my mingw-w64 folder, deleted the earlier path from environment variables and added the new path. I uninstalled CodeLite; not saving the user information. I actually downloaded the 14.0.0(64-bit) instead of the newer version 14.0.1(64 bit) . Then I did the steps that Frank tells you and it worked out for me.
I am completing the same Udemy course and encountered a similar problem of the console closing immediately. I encountered the problem for a workspace with 1.) a long name and 2.) ending with an underscore "_". I reduced the size of the folder name which also involved deleting the trailing underscore. This appears to have solved the problem. I encountered this problem with one of Frank's provided workspaces so I knew it was not a compiler issue.
I had an issue with section 20 of my Udemy course because it had parenthesis in the workspace folder name. "(STL)" at the end. Once I got rid of the special characters, it worked fine.
If pause("system"); or cin or restarting Program and whole PC solutions are not working, then make sure to:
Copy your code.
Create new Project and past your code there.
Make sure the new project is selected before trying to double-click it.
Notes:
You can now delete the old not working project and rename your new project.
I don't know what's the reason of the problem, but I did that and it worked for me.
You need to make sure if it is 64bits CodeLite then you have installed 64bits MinGW. Through the IDE itself, you can re-run the setup wizard
Restarting Codelite worked for me ...

Xcode 7 beta 2 continuously crashing

I am developing a C++ project with Xcode.
My Xcode keeps crashing out of nowhere. It does so often that it is nearly impossible to work at all. I have been using Xcode 6 until now. Since it kept crashing, I just thought I would format everything. I did a clean install of Yosemite and then downloaded Xcode 7 beta 2 from the official Apple Developer page. I installed it on my clean system, then pulled my repo and tried to work. Still the same problem.
Here is the log of the crash:
http://pastebin.com/t4gMWa95
I have looked around SO and many answers suggested that this could be related to source control. However, I tried to disable source control from my settings and still it crashes as often as before.
Anyone can give me an idea on what is going on? This is frustrating...!
Hmm the crash is in clang::DiagnosticRenderer::emitDiagnostic which presumably is redering errors and warnings. Could there be something odd about your warnings? Or something that is echoed in warnings classnames, scource file names, paths to source files? Does it happen when there is so little code as to have no or few diagnostics? But first - make a new XCode project and add your source to that, see if the new one works better.
Go to Users>[UserName]>Library>Preferences
Search for "xcode" inside the "Preferences" folder
Move all the resulting files (I had 6 files when I searched) to Desktop
Restart your Mac
Now open Xcode and see if its crashing
These steps solved my problem. Hope this helps...

Making C/C++ eclipse working

I do use to work in Eclipse cause i find it pretty good, but every day i am encountering this problem..."'Cleaning all projects has encountered a problem'. Errors occured during the build." when I hit the "clean projects" button. I have win 7 64 bit.
The only solution for this issue to work is to restart my computer. But I don't find it that good, because even if I restart my computer in the next 5 minutes when I compile a certain program it gets stuck again, it shows the same annoying message.
Please give me a solution to make this work. I wouldn't like to switch to visual studio...
It's hard to tell for sure, but your application might have some unreleased resources which 'clean' command can't remove. Did executable process terminate? If not, you whould have this error. You could try to remove binaries from build folder manually and see what file causes and error.

Eclipse not building properly

Okay so basically I'm working on recursion. And I recently switched from a mac to a PC, so I'm now using eclipse instead of XCode for programming c++. now this has happened to me a couple times, and I still have no idea why its doing it. When this happens I do not get an error code, I've searched far and wide for this solution but haven't found one yet, so i'm hoping you guys could help. So everything was going great (almost finished), but i realized a bug, so I fix it, then I save it, then I build it, run it, then it doesn't build properly (i'm assuming), like it didn't build my new code, it just rebuilt my old code and ran that, im using MinGW, I've also tried to import my old code via copy and paste, but it did the same thing, please help.
*let me know if I left anything out that might be needed to know
**update on my project file it does have a error sign on it, but there isn't one in my code
***update update I looked through the errors and found that it doesnt have permission to open output file "recursive.exe" (my project name)
OK solution: run eclipse as admin

Error (mingw32/bin/ld.exe final link failed: No space left on device) building C++ project

Basically, yesterday I could program in C++ and today I cannot.
I'm trying to write a simple hello world program in Eclipse Helios using the MinGW C/C++ compiler and I'm running into several problems, and I believe this one to be the root of it.
At first the program compiled and built, but when I tried to run it, an error dialogue said the FirstProject.exe file could not be found/does not exist in the launch configuration. However, I got no errors building and I could clearly see the binaries in Debug/FirstProject.exe in my project explorer. I tried refreshing my project explorer and alas, the file disappeared before my eyes.
I tried building the program again, and that's when I get this error:
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe: final link failed: No space left on device
I don't know what device it's talking about. I have more than 1TB left on this hard drive, so it can't be that. I tried emptying my %Temp% folder and recycling bin (suggestions I found trying to search for a solution for this problem) but to no avail.
It may be worth noting that C++ programs I have written in the past are still running. I'm very new to programming, so I don't know how much information you need, but I'll gladly add anything you need if you think you can help me out.
I just solved this on one of the computers at work which had the same issue when compiling through Codelite. Moving workspaces, rebooting, and reinstalling Codelite didn't fix the problem. I also checked permissions on the /temp folder which were fine.
It turns out there were permission issues/other issues with the disk. Running a disk check fixed a few issues on the disk and that allowed the program to compile. If this doesn't solve your issue you may also want to try disabling any anti-virus/spyware programs and try again.
I just solved this problem on my PC. Actually what the problem in my case was that my windows defender (or any antivirus in someone's case) was blocking ld.exe from accessing the protected folder that is the source code folder. You can correct this by going into the Virus and threat protection settings of your PC and then find there for blocked history. You will definitely find there a history record of that blockage. Then just go and allow on this device it. And boom 😁