I am working with eclipse using C++. It was working fine till yesterday. Now when I use break points and debug I get a stopped,reason="breakpoint-hit" error and then eclipse stops. Has anyone seen this error and anyone know how to fix it?
I have used breakpoints before to help me debug. Instead of the step into, step over, and step out options, Eclipse stops running. I am not doing anything out of the usual with breakpoints, I tried them at several different points and got the same problem.
Eclipse obviously has problems with debugging while you use the console for typing in input. Is that your case? I had that problem and while googling for a solution, I finally came upon a recommendation that while debugging, you should pass input to your program from a file rather than typing it to the console.
The recommendation can be found here:
http://webcourse.cs.technion.ac.il/234122/Spring2011/en/faq_Working%20with%20Eclipse%20CDT.html
(It's the question that starts with "I have a problem with debugging in Eclipse.".)
Hope this helps.
Related
So my code compiles on Dev C++ but when it runs, it gives a blank output screen for a few seconds then the program terminates. The code on Dev shows no errors or warnings. It works perfectly on VS. I have tried re-installing Dev but that doesn't work. I know Dev is outdated but i'm forced to check my code on it since its a project and will be checked and graded on Dev. I did not feel like posting the whole code since it is around 400 lines but since it might or might not help in understanding the problem, i have attached it. I don't know which part might cause this issue so i've attached the whole thing. I hope you don't mind. This is my first post here so if I've made any mistakes in asking a question please let me know. Thanks.
Thank you so much to #LouisGo and #molbdnilo for the help. I've found the reason for the segmentation error in Dev C++ through debugging. This part:
*hashArray = NULL;//SET ARRAY INDEXES TO NULL was the problem. Dev C++ doesn't allow initializations in this way while VS does. So I had to initialize it this way:
for(int i=0; i<20; i++)
{
hashArray[i]=NULL;
}
It works fine now.
I have a problem regarding the result of my program. I have a bi winforms application that makes a lot of things. One of them is visualizing a bunch of data I have stored in several .txt files in a given directory. It takes one, read it, close it and then visualize it before reading the next one.
My problem is that if I just execute the program, tell it the directory of the files and ask for visualizing, after reading 2 or 3 files it crashes because a memory access violation. But if I reproduce the exact steps while executing from the debugger of visual studio there is not any error nor warning nor nothing, it just works fine.
I know that the debugger is exactly that, a debugger, and thing execute differently in a debugger, but I dont have any idea why this happens.
Any idea why my program crashes? Or what should I do for avoiding a crash?
I know my question may be too ambiguous, but I don't have other method to show you my problem, unless you want me to post a 20.000 lines code :) .
Thanks in advance.
Attach the debugger after the crash (JIT debugging).
http://msdn.microsoft.com/en-us/library/5hs4b7a6(v=vs.80).aspx
I'm having problems getting gdb to pause execution flow under NetBeans. The pause button doesn't appear to work at all. From this answer, I suspect it may be a problem with what text gdb is actually receiving as input (I'm under Windows/Mingw32 using IIRC msys bash). But this is just a guess.
I don't know where to view what is happening with gdb (input or output). I see a few mentions of it in the debugger console but not sure if that counts for anything. I'd post that log here but it is rather large.
This is apparently a general problem with Windows/Netbeans, for which detail can be found on one of the NetBeans site pages (can't remember which).
sorry, I was looking for information about this topic but I did not find anything useful so I post here the probably trivial question.
I use eclipse galileo cdt in mac os x. I create watchpoints, and for some of them I am able to specify that the debug run stops when the variable takes some value, for instance aaa==10. But I want now what the debug run stops when aaa less than -50. So I tried aaa<-50 but nothing. Am I doing something wrong here?
Thanks in advance
Someone seems to have had exactly the same probl... oh wait, it is you;)
Could this be a side-effect of bug 213076?
In short, modifying an existing breakpoint could lead to some extra quotes around the new condition, making it not running properly.
Do you have the same symptom with a new breakpoint?
I am debugging an Iphone program with the simulator in xCode and I have one last issue to resolve but I need help resolving it for the following reason: when it happens the program goes into debugging mode but no errors appear (no BAD ACCESS appears) and it does not show where the code fails. Putting some variables as global helps me to see their values to start pin pointing where the bug is but before I go into this fully I would like to know what techniques/tools you guys use to debug these situations.
If it helps Im debugging the following: I merged some code into the SpeakHere demo. The code was added in the C++ modules of the program (AQRecorder.h and .mm). I seem to have pinpointed the problem code in a function I wrote.
My favourite is always to add debugging code and log it to a file. This allows me so report any and all information I need to resolve the issue if the debugger is not working properly.
I normally control the debugging code by use of a flag which I can manipulate at run time or by the command line.
If the error is (and it probably is) a memory management issue, printing log entries is really not going to help.
I would reccomend learning how to use Instruments, and use its tools to track down the memory leak when it occurs rather than waiting until the application crashes later on.