Public Group

## Recommended Posts

Posted (edited)

I am coding with C.  I just started using :  Code::Blocks 17.12 because there were to many errors in Visual Studio.  The problem is that I can't get it to stop at the breakpoints for just one of my projects.  There are six includes and then the typical :  int main(int argc, char **argv){

I am using GNU GDB for debugging.  The project has a dll  called cygwin1.dll.  The command prompt mentions that this is most likely the problem.  I deleted all the extra .dlls and this didn't help.

Has anyone run into this problem before ; or have any suggestions?

Really, I'd like to step in to the headers too.

Thank you,

Josheir

Edit: The program exits with an exception: Status_Stack_Overflow dump.  It's mostly Hexadecimal.

Edited by Josheir

##### Share on other sites

Probably a dumb suggestion, but are you building in release mode?

##### Share on other sites
Posted (edited)

Debug is set.

Says this :

Cannot open file: ../../../src/gcc-6.3.0/libgcc/config/i386/cygwin.S

Edited by Josheir

##### Share on other sites

Check that your included dlls and Libs are in the correct format for inclusion: x64/x32, static/dynamic, release/debug, multi/ single thread, etc. it can be easy to get incorrect sometimes.

##### Share on other sites

What errors did Visual Studio have exactly?  You know most game dev studios use Visual Studios for it's far superior debugger right?  Also deleting .dll's will rarely help you, where did you delete them from?

##### Share on other sites

I don't remember what I was thinking by removing the extra dlls, thanks though.  The error was a stack overflow message with the inablility to use breakpoints.

Josheir

##### Share on other sites
1 hour ago, Josheir said:

I don't remember what I was thinking by removing the extra dlls, thanks though.  The error was a stack overflow message with the inablility to use breakpoints.

Josheir

That is most likely a you error then, you were not setting the break point soon enough or trying to set it after the crash occurred.  All you have to do, before you run your code, is click on the left side of the code window on the line you want to break at and a little red dot will appear, that is a break point.  Visual studio has one of the most robust debuggers on the market today.  And no, I'm not a Microsoft fan boy by any stretch of the imagination.

https://msdn.microsoft.com/en-us/library/k80ex6de(v=vs.85).aspx
And a video tutorial (starts around 2:35 into the video, should be where this starts):

##### Share on other sites
Posted (edited)

Yes, this one can be a tricky one. Especially since the stack overflows so even the code before the i.e massive array will not run.

Something like:

void func()
{
printf("Hai\n"); <---- breakpoint here may not trigger
int largearray[999][999][999];
}

You may expect the breakpoint to at least trigger before the stack gets overrun but the way programs work means this is not the case. Good fun. Glad you got it solved

My gdb when run through the terminal, tells me that the crash is at the '{'. I guess that is correct but not always that helpful!

And GDB is a perfectly good debugger. Most gamedevs only use the Visual Studio inbuilt one because frankly... well they simply haven't researched alternatives like gdb, lldb, idb or dbx. The same with compilers, a lot of them simply use Microsoft's cl because it is all they have ever been taught.

Also being able to debug remotely (i.e on Android, iOS) via remote GDB has always been a much better solution than any Visual Studio debugger plugins I have had the misfortune to use.

Though I would mention that using Code::Blocks rather than Visual Studio purely because your code has too many errors is a bit strange. You might want to look a bit further into that XD.

Edited by kop0113

##### Share on other sites
2 hours ago, kop0113 said:

And GDB is a perfectly good debugger. Most gamedevs only use the Visual Studio inbuilt one because frankly... well they simply haven't researched alternatives like gdb, lldb, idb or dbx. The same with compilers, a lot of them simply use Microsoft's cl because it is all they have ever been taught.

That's not actually true, most programmers know how to use other compilers, heck visual studio even allows you to compile with clang or GCC now, you can even make Android and iOS program and run them in emulators and debug them remotely effortlessly (from my limited experience so far with Android builds).  I've actually yet to meet a programmer that went to post secondary that has only used one compiler, not saying I've met thousands, but a few hundred and I'm fairly certain your premise is quite wrong.  I switch between cl and clang at least once a week for the static analysis tools.  Each one finds different issues better then the other.  Though I can honestly say I rarely use GCC, but that is because cl and clang meet my needs currently.

2 hours ago, kop0113 said:

Also being able to debug remotely (i.e on Android, iOS) via remote GDB has always been a much better solution than any Visual Studio debugger plugins I have had the misfortune to use.

No plugins needed, it's native and works quite well as I mentioned.  Though I've not tested the iOS side of things, several friends said they moved from development on their macs to using Windows at home because of it.  YMMV.

And yes, switching IDE's and compilers to get around what is most likely a programmer bug is not a solution, it's just merely masking the underlying problem.  Learn the tools and they will help you greatly.  Learn proper debugging techniques first off too, there are plenty of tutorials, it's a mindset and not that hard to develop if you're a curious person.

##### Share on other sites
Posted (edited)
13 hours ago, Mike2343 said:

heck visual studio even allows you to compile with clang or GCC now

Yes, I may have been a bit unduly harsh but for a long time (i.e when I used to use it), Visual Studio did not integrate well with other compilers (until as recent as 2015 IMO). I have had first hand experience with developers whining that in order to port our software to i.e the web via Emscripten or Android via gcc (at the time) they couldn't use Visual Studio and almost refused to learn and use standard tools like CMake. This just added more workload onto myself and others.

It has just left me with the bad taste that Visual Studio caters for lazy coders. Obviously this is not always the case, John Carmack is an avid Visual Studio user but unlike some others has in the past tried many, many different development environments to see what worked for him.

Same reason why I am not a fan of Unity. It isnt Unity itself but if things go wrong and there is a complexity, the potentially lazy developer brought up learning nothing but Unity will just sit there blaming Unity rather than fixing it.

Also, I might add that the Visual Studio tools provided by the PS4 SDK are absolutely terrible. They don't provide it but if they did offer me remote GDB, I would be using it like a shot! Looking around at the community, it actually seems a lot of people don't like the debugger plugin. But this is going off topic

Edited by kop0113

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5

• 26
• 10
• 11
• 9
• 9
• ### Forum Statistics

• Total Topics
633717
• Total Posts
3013509
×