Re: debug in release mode
Why debug in release mode?
Did you compile and link to include debug info?
Is there a reason you're using attach rather than starting the app in the debugger?
Re: debug in release mode
Re-build the soultion using Debug mode. Release mode strips away debug info etc and does code optimisation. You should only compile as Release when you're happy with the solution - for final testing as Release build. Debug mode is what you use when you are developing and debugging. Release (as it's name implies) is for the 'final' release build. Note that Debug build can run slower than Release build - so don't do performance testing with Debug build.
Re: debug in release mode
@ kaud and GCDEF : Thanks a lot for the comments and inputs:
Yes, I usually debug in debug mode. But this is special case, where i need to use the third party tool (with lot of settings). that can only be attached in Release mode. I am new to this project (so collegues had told me, that i can only use Release mode for this setup). So what they tell must be true.
So i want to debug in Release mode, only this particular case.
My collegue had told me earlier, i can still put breakpoint and debug in release mode.
Re: debug in release mode
Quote:
Originally Posted by
pdk5
@ kaud and GCDEF : Thanks a lot for the comments and inputs:
Yes, I usually debug in debug mode. But this is special case, where i need to use the third party tool (with lot of settings). that can only be attached in Release mode. I am new to this project (so collegues had told me, that i can only use Release mode for this setup). So what they tell must be true.
So i want to debug in Release mode, only this particular case.
My collegue had told me earlier, i can still put breakpoint and debug in release mode.
Are you trying to debug a third party tool? You can't do that unless you have a debug version of it including their pdb file.
Re: debug in release mode
Quote:
Originally Posted by
pdk5
Any suggestions will help me a lot
It's perfectly possible to debug without a debugger. Just put traces in the (release mode) code and go with the flow. :)
Re: debug in release mode
Im not debugging third party tool. Third party tool produces some kind of input to our application.
Re: debug in release mode
@pdk5. Read up on the differences between debug and release builds. The release build is usually optimized (e.g. the compiled binary may not match the source code). The debug build isn't optimized and debug symbols are generated. The symbols are essentally pointers from the binary to the code.
There's a lot going on when you are debugging and what happens when break points are set, how the symbols are used to find the positions in the code and so on, but what is imoprtant is the symbols match the binaries.
Now it is an option to create a release build with symbols, but with optimizations, you'll often be stepping through blamk lines of code (because the optimizations are performed by the compiler amd not reflected by the code).
At any rate it is curious that the 3rd party dll can't be compiled in anything but the release build. That seems odd to me as it should be able to be compiled in debug or release.
Re: debug in release mode
Quote:
Originally Posted by
pdk5
Im not debugging third party tool. Third party tool produces some kind of input to our application.
Can you explain in more detail what you're trying to do? If you're not debugging the third-party app, why not just debug yours? Why the need to attach to anything?
Re: debug in release mode
@Arjay: Thanks a lot for the info and patience to explain in detail helped a lot
I am just still almost new comer in the company who have quite exp people around in same company.
As per them, the third party application will only work with the Release version of our application (I donot know the history).
Anyway (I am now able to get to the point where the exception is thrown with the Release build). I didnot have to do anything as our build setup had already setup to generate min debug info for the Release mode. I was giving the debug exe name and i figured out this issue.
Now at least i have the call stack . I need to debug further ofcourse with the help of others (I am not familiar in that part of the code)
@Kaud, GCDEF and Arjay: It was very helpful to discuss and correct my opions. Thankyou again
Re: debug in release mode
Quote:
Originally Posted by
pdk5
As per them, the third party application will only work with the Release version of our application (I donot know the history).
That doesn't make much sense either.
Re: debug in release mode
Thankyou GCDEF, I'll update the thread if i come to know about this ..
It is difficult to get clarifications (on all my doubts)when working remotely and collegues are bit busy :)
Thankyou ,
Re: debug in release mode
Quote:
Originally Posted by
pdk5
It is difficult to get clarifications (on all my doubts)when working remotely and collegues are bit busy
I seems you've disregarded my advice (in #6) completely. That's a mistake. Ask a college familiar with the application for the most likely bug location. With a little bit of luck a few narrowing traces will lead you to the exact spot.
Narrowing traces works like a binary search, logarithmically by successive halving. It allows you to quickly track down any bug in large unfamiliar code bases and at the same time get a feel for the overall structure of the application. Tracing really is the ultimate debugger.
My advice is to stop struggling with the tools. Put your doubts aside and concentrate on tracing down the bug instead.
I know my position is somewhat controversial but my point is that just because there's a tool called debugger doesn't mean it's the only way to debug code. Using a debugger is often the easiest and fastest way to find bugs but not always.
Re: debug in release mode
@wolle: Thanks a lot :) for the advice, will try that.
Somehow I missed it, very sorry about it .
Thankyou very much for the inputs and very helpful for me.
Re: debug in release mode
Quote:
Originally Posted by
pdk5
will try that.
Tracing means you temporarily modify the source code. Make sure you're permitted to do so.
Tag all traces you put in with comments so they can be easily located later and removed/commented out when the bug is fixed.
Good luck!