Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Re: Debugger Recommendation

Reply
Thread Tools

Re: Debugger Recommendation

 
 
Jorgen Grahn
Guest
Posts: n/a
 
      09-11-2011
On Mon, 2011-08-29, Joseph Hesse wrote:
> Hi,
>
> I have never used a debugger and would like to know which one(s) are the
> best. I prefer one with a graphic interface.
>
> I use gnu c++ and Linux.


You might want to know that many C++ users rarely or never use a
traditional debugger[1]. I'm one of them -- I used gdb for a while last
Friday, but the time before that was many years ago.

On Unix, you need to be able to debug core dumps but when dealing with
*running* programs it's more important to know tools like
- the compiler
- valgrind
- strace and ltrace,
and knowing how to write unit tests. All of that is IMHO more
important than live debugging.

/Jorgen

[1] Not trying to start the debugger-versus-no-debugger war again. Just
stating a fact. And no, I don't have any idea how many "many" is.

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
 
Reply With Quote
 
 
 
 
jacob navia
Guest
Posts: n/a
 
      09-11-2011
Le 11/09/11 22:37, Jorgen Grahn a écrit :
> On Mon, 2011-08-29, Joseph Hesse wrote:
>> Hi,
>>
>> I have never used a debugger and would like to know which one(s) are the
>> best. I prefer one with a graphic interface.
>>
>> I use gnu c++ and Linux.

>
> You might want to know that many C++ users rarely or never use a
> traditional debugger[1]. I'm one of them -- I used gdb for a while last
> Friday, but the time before that was many years ago.
>


WOW Batman!!!

You are just GREAT Batman.

I have always looked in awe when you passed dressed in black,
going to fight the forces of the evil bugs, without a debugger,
just with your resolve and heroic lack of fear.

Thanks for saving us Batman!
 
Reply With Quote
 
 
 
 
Jorgen Grahn
Guest
Posts: n/a
 
      09-12-2011
On Sun, 2011-09-11, jacob navia wrote:
> Le 11/09/11 22:37, Jorgen Grahn a écrit :
>> On Mon, 2011-08-29, Joseph Hesse wrote:
>>> Hi,
>>>
>>> I have never used a debugger and would like to know which one(s) are the
>>> best. I prefer one with a graphic interface.
>>>
>>> I use gnu c++ and Linux.

>>
>> You might want to know that many C++ users rarely or never use a
>> traditional debugger[1]. I'm one of them -- I used gdb for a while last
>> Friday, but the time before that was many years ago.
>>

>
> WOW Batman!!!
>
> You are just GREAT Batman.
>
> I have always looked in awe when you passed dressed in black,
> going to fight the forces of the evil bugs, without a debugger,
> just with your resolve and heroic lack of fear.
>
> Thanks for saving us Batman!


Do you have a point of some kind? Let me also repeat the part you
neglected to quote:

[1] Not trying to start the debugger-versus-no-debugger war again. Just
stating a fact. And no, I don't have any idea how many "many" is.

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
 
Reply With Quote
 
jacob navia
Guest
Posts: n/a
 
      09-12-2011
Le 12/09/11 23:58, Jorgen Grahn a écrit :
> On Sun, 2011-09-11, jacob navia wrote:
>> Le 11/09/11 22:37, Jorgen Grahn a écrit :
>>> On Mon, 2011-08-29, Joseph Hesse wrote:
>>>> Hi,
>>>>
>>>> I have never used a debugger and would like to know which one(s) are the
>>>> best. I prefer one with a graphic interface.
>>>>
>>>> I use gnu c++ and Linux.
>>>
>>> You might want to know that many C++ users rarely or never use a
>>> traditional debugger[1]. I'm one of them -- I used gdb for a while last
>>> Friday, but the time before that was many years ago.
>>>

>>
>> WOW Batman!!!
>>
>> You are just GREAT Batman.
>>
>> I have always looked in awe when you passed dressed in black,
>> going to fight the forces of the evil bugs, without a debugger,
>> just with your resolve and heroic lack of fear.
>>
>> Thanks for saving us Batman!

>
> Do you have a point of some kind? Let me also repeat the part you
> neglected to quote:
>
> [1] Not trying to start the debugger-versus-no-debugger war again. Just
> stating a fact. And no, I don't have any idea how many "many" is.
>

Look Jorgen, I can't really stand people that tell:

> On Unix, you need to be able to debug core dumps but when dealing with
> *running* programs it's more important to know tools like
> - the compiler
> - valgrind
> - strace and ltrace,
> and knowing how to write unit tests. All of that is IMHO more
> important than live debugging.


Implicitly you say that people that use a debugger are kind of
slightly moronic, being unable to use
- the compiler
- valgrind
- strace and ltrace
and (of course) they do not know how to write unit tests.

THAT is what bothers me, that condescending tone (On Unix... etc)
as windows wouldn't have compilers, tools even better than valgrind,
and windows programmers do not know what unit tests are.

Anyway, as you yourself said, you used a debugger last Friday so
it can't be kind of useless even for great programmers like you
isn't it?

 
Reply With Quote
 
Juha Nieminen
Guest
Posts: n/a
 
      09-13-2011
jacob navia <(E-Mail Removed)> wrote:
> tools even better than valgrind,


Are there any free ones? Because last time I chekced, there weren't
(as incredible as that might sound).

(Granted, this was quite some years ago. The situation might have changed
since then.)
 
Reply With Quote
 
none
Guest
Posts: n/a
 
      09-13-2011
In article <j4m2fd$fc4$(E-Mail Removed)>,
jacob navia <(E-Mail Removed)> wrote:
>Le 12/09/11 23:58, Jorgen Grahn a écrit :
>> On Sun, 2011-09-11, jacob navia wrote:
>>> Le 11/09/11 22:37, Jorgen Grahn a écrit :
>>>> You might want to know that many C++ users rarely or never use a
>>>> traditional debugger[1]. I'm one of them -- I used gdb for a while last
>>>> Friday, but the time before that was many years ago.
>>>>
>>>
>>> WOW Batman!!!
>>>
>>> You are just GREAT Batman.
>>>
>>> I have always looked in awe when you passed dressed in black,
>>> going to fight the forces of the evil bugs, without a debugger,
>>> just with your resolve and heroic lack of fear.
>>>
>>> Thanks for saving us Batman!

>>
>> Do you have a point of some kind? Let me also repeat the part you
>> neglected to quote:
>>
>> [1] Not trying to start the debugger-versus-no-debugger war again. Just
>> stating a fact. And no, I don't have any idea how many "many" is.
>>

>Look Jorgen, I can't really stand people that tell:
>
> > On Unix, you need to be able to debug core dumps but when dealing with
> > *running* programs it's more important to know tools like
> > - the compiler
> > - valgrind
> > - strace and ltrace,
> > and knowing how to write unit tests. All of that is IMHO more
> > important than live debugging.

>
>Implicitly you say that people that use a debugger are kind of
>slightly moronic, being unable to use
>- the compiler
>- valgrind
>- strace and ltrace
>and (of course) they do not know how to write unit tests.
>
>THAT is what bothers me, that condescending tone (On Unix... etc)
>as windows wouldn't have compilers, tools even better than valgrind,
>and windows programmers do not know what unit tests are.


You chose to read it as condescending and then chose to reply in an
extremely rude and childish manner. That's unfortunate.

If we try to get the conversation back on track:

I use debuggers. I find them useful. However, one thing that I
strongly believe and that I have observed in some professional
developpers is a far too great readiness to resort to the debugger as
a first port of call.

I believe the point that Jorgen was trying to make is that:

- You should use compilers capabilities to help verify your code.
- You should write unit tests and try to have high code coverage.
With good unit test, a lot less debugging is required.
- You should use tools like valgrind on your unit test and on your
full program. Valgrind will often detect errors in one short run
that will only be noticed after a "long time" in the field.

Once you have done the above, a lot of the basic bugs have already
been detected and fixed. That often leaves you with more difficult to
find and more difficult to reproduce bugs. For these, stepping
through with a debugger is often far from efficient (and often useless
if there is a timing issue involved). In addition, for complex
application, running through a debugger is often an extremely
labourious task.

For hard to find / hard to recreate bug, often observing the system
using tools like strace, ltrace or even just high log level (it's a
good idea to build in adjustable logging levels). By analysing what
you observe for the above, you then figure out the location of the
bug. At which point, often you can find more by improving your local
unit tests but if you want, you can then finally open up the debugger
and place a breakpoint near the area of interest.

Maybe the above sound condescending to you but I have far too often
seen a developper start with a debugger immediately and try to use a
debugger to locate a problem in a >100Kloc multithreaded application.

Yannick



 
Reply With Quote
 
Jorgen Grahn
Guest
Posts: n/a
 
      09-13-2011
On Mon, 2011-09-12, jacob navia wrote:
> Le 12/09/11 23:58, Jorgen Grahn a écrit :
>> On Sun, 2011-09-11, jacob navia wrote:
>>> Le 11/09/11 22:37, Jorgen Grahn a écrit :
>>>> On Mon, 2011-08-29, Joseph Hesse wrote:
>>>>> Hi,
>>>>>
>>>>> I have never used a debugger and would like to know which one(s) are the
>>>>> best. I prefer one with a graphic interface.
>>>>>
>>>>> I use gnu c++ and Linux.
>>>>
>>>> You might want to know that many C++ users rarely or never use a
>>>> traditional debugger[1]. I'm one of them -- I used gdb for a while last
>>>> Friday, but the time before that was many years ago.
>>>>
>>>
>>> WOW Batman!!!
>>>
>>> You are just GREAT Batman.

....
>>
>> Do you have a point of some kind? Let me also repeat the part you
>> neglected to quote:
>>
>> [1] Not trying to start the debugger-versus-no-debugger war again. Just
>> stating a fact. And no, I don't have any idea how many "many" is.
>>

> Look Jorgen, I can't really stand people that tell:
>
> > On Unix, you need to be able to debug core dumps but when dealing with
> > *running* programs it's more important to know tools like
> > - the compiler
> > - valgrind
> > - strace and ltrace,
> > and knowing how to write unit tests. All of that is IMHO more
> > important than live debugging.

>
> Implicitly you say that people that use a debugger are kind of
> slightly moronic, being unable to use
>
> - the compiler
> - valgrind
> - strace and ltrace
> and (of course) they do not know how to write unit tests.
>
> THAT is what bothers me, that condescending tone (On Unix... etc)
> as windows wouldn't have compilers, tools even better than valgrind,
> and windows programmers do not know what unit tests are.


Ironically, I wrote "on Unix" so that people wouldn't call me a Unix
bigot when I mentioned Unix-specific tools.

On another day and in another mood I might have said the above
condescendingly. But here I just tried to state facts as I see them.

Remember the original poster? Yes, I believe that if he's familiar
with none of the tools mentioned above, the interactive debugger
shouldn't be at the top of his list.

(BTW, I *do* know at least two programmers who are better at it than
me, and who use the Visual Studio interactive debugger as one of their
main tools.)

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      09-13-2011
On 09/14/11 01:29 AM, none Yannick Tremblay wrote:
> jacob navia<(E-Mail Removed)> wrote:
>>
>> THAT is what bothers me, that condescending tone (On Unix... etc)
>> as windows wouldn't have compilers, tools even better than valgrind,
>> and windows programmers do not know what unit tests are.

>
> You chose to read it as condescending and then chose to reply in an
> extremely rude and childish manner. That's unfortunate.
>
> If we try to get the conversation back on track:
>
> I use debuggers. I find them useful. However, one thing that I
> strongly believe and that I have observed in some professional
> developpers is a far too great readiness to resort to the debugger as
> a first port of call.
>
> I believe the point that Jorgen was trying to make is that:
>
> - You should use compilers capabilities to help verify your code.
> - You should write unit tests and try to have high code coverage.
> With good unit test, a lot less debugging is required.
> - You should use tools like valgrind on your unit test and on your
> full program. Valgrind will often detect errors in one short run
> that will only be noticed after a "long time" in the field.


I agree with all of the above, with the slight difference that on my
platform of choice (OpenSolaris derivatives), the functionality of
valgrind in a component of the debugger (dbx).

In most of my work, tools that allow me to selectively observe a running
system are more important that a debugger. It's only when you use a
tool like Solaris' dtrace
(http://hub.opensolaris.org/bin/view/...+Group+dtrace/) that you
realise how useful they are.

In my new code, I work to the rule that if I have to use the debugger to
find a bug, my unit tests aren't good enough...

As a tool for understanding someone else's code, the debugger is invaluable.

--
Ian Collins
 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      09-14-2011
On 09/13/11 06:40 PM, Juha Nieminen wrote:
> jacob navia<(E-Mail Removed)> wrote:
>> tools even better than valgrind,

>
> Are there any free ones? Because last time I chekced, there weren't
> (as incredible as that might sound).


Are you (Jacob) going to answer this?

--
Ian Collins
 
Reply With Quote
 
jacob navia
Guest
Posts: n/a
 
      09-14-2011
Le 15/09/11 00:26, Ian Collins a écrit :
> On 09/13/11 06:40 PM, Juha Nieminen wrote:
>> jacob navia<(E-Mail Removed)> wrote:
>>> tools even better than valgrind,

>>
>> Are there any free ones? Because last time I chekced, there weren't
>> (as incredible as that might sound).

>
> Are you (Jacob) going to answer this?
>


http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

The following Microsoft tools provide more-detailed information and can
help to detect and diagnose leaks for the various allocation types in
your application:

Performance Monitor and Resource Monitor are part of Windows 7 and can
monitor and graph resource use over time
The latest version of Application Verifier can diagnose heap leaks on
Windows 7
UMDH, which is part of the Debugging Tools for Windows, analyzes the
heap memory allocations for a given process and can help find leaks and
other unusual usage patterns
Xperf is a sophisticated performance analysis tool with support for heap
allocation traces
CRT Debug Heap tracks heap allocations and can help build your own heap
debugging features


http://channel9.msdn.com/Shows/Going...Leak-Detection

I didn't look the video but it looks promising.

Another memory leak tool:
http://winleak.sourceforge.net/

All of those are free. Of course you can BUY maybe better tools,
something you can't do under linux.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Debugger Recommendation jacob navia C++ 21 09-22-2011 09:15 AM
Re: Debugger Recommendation Paul C++ 4 08-30-2011 05:34 PM
Need Help getting a debugger going for IE - any free debugger aflat362 Javascript 7 12-07-2006 10:51 PM
Neither IE-Debugger or Mozilla/Venkman debugger can step through dynamically added code? Robert Oschler Javascript 1 09-05-2005 07:17 AM
Debugger question Derek Goto Perl 1 08-25-2003 09:56 AM



Advertisments