Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #10075

Re: Debugger Recommendation

From yatremblay@bel1lin202.(none) (Yannick Tremblay)
Newsgroups comp.lang.c++
Subject Re: Debugger Recommendation
Date 2011-09-13 13:29 +0000
Organization A noiseless patient Spider
Message-ID <j4nlqs$ted$1@dont-email.me> (permalink)
References <HKSdnd4G7YNrOcbTnZ2dnUVZ_rCdnZ2d@giganews.com> <j4jddl$nvf$1@speranza.aioe.org> <slrnj6t03p.gtj.grahn+nntp@frailea.sa.invalid> <j4m2fd$fc4$1@speranza.aioe.org>

Show all headers | View raw


In article <j4m2fd$fc4$1@speranza.aioe.org>,
jacob navia  <jacob@jspamsink.org> 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


Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Debugger Recommendation Joseph Hesse <joeh@gmail.com> - 2011-08-29 09:40 -0500
  Re: Debugger Recommendation Victor Bazarov <v.bazarov@comcast.invalid> - 2011-08-29 11:01 -0400
  Re: Debugger Recommendation jacob navia <jacob@spamsink.net> - 2011-08-29 19:19 +0200
    Re: Debugger Recommendation "Waldek M." <wm@localhost.localdomain> - 2011-08-29 21:37 +0200
      Re: Debugger Recommendation Ian Collins <ian-news@hotmail.com> - 2011-08-30 07:51 +1200
        Re: Debugger Recommendation jacob navia <jacob@spamsink.net> - 2011-08-29 22:52 +0200
          Re: Debugger Recommendation Ian Collins <ian-news@hotmail.com> - 2011-08-30 08:56 +1200
            Re: Debugger Recommendation jacob navia <jacob@spamsink.net> - 2011-08-29 23:00 +0200
              Re: Debugger Recommendation Ian Collins <ian-news@hotmail.com> - 2011-08-30 09:21 +1200
              Re: Debugger Recommendation Nobody <nobody@nowhere.com> - 2011-08-30 04:58 +0100
        Re: Debugger Recommendation "Waldek M." <wm@localhost.localdomain> - 2011-08-31 21:45 +0200
          [OT] Re: Debugger Recommendation Paavo Helde <myfirstname@osa.pri.ee> - 2011-09-10 02:17 -0500
            Re: [OT] Re: Debugger Recommendation jacob navia <jacob@spamsink.net> - 2011-09-10 10:00 +0200
              Re: [OT] Re: Debugger Recommendation Ian Collins <ian-news@hotmail.com> - 2011-09-10 21:14 +1200
                Re: [OT] Re: Debugger Recommendation jacob navia <jacob@spamsink.net> - 2011-09-10 11:26 +0200
                Re: [OT] Re: Debugger Recommendation Ian Collins <ian-news@hotmail.com> - 2011-09-10 21:33 +1200
              Re: [OT] Re: Debugger Recommendation Paavo Helde <myfirstname@osa.pri.ee> - 2011-09-10 06:32 -0500
            Re: Debugger Recommendation Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-09-10 06:59 -0700
              Re: Debugger Recommendation Paavo Helde <myfirstname@osa.pri.ee> - 2011-09-10 09:39 -0500
      Re: Debugger Recommendation jacob navia <jacob@spamsink.net> - 2011-08-29 22:51 +0200
        Re: Debugger Recommendation "Waldek M." <wm@localhost.localdomain> - 2011-08-31 21:11 +0200
          Re: Debugger Recommendation jacob navia <jacob@spamsink.net> - 2011-08-31 22:17 +0200
            Re: Debugger Recommendation "Waldek M." <wm@localhost.localdomain> - 2011-09-01 07:26 +0200
        Re: Debugger Recommendation dan <dan.campbell+nospam@gmail.com> - 2011-09-09 21:30 -0500
    Re: Debugger Recommendation DeMarcus <use_my_alias_here@hotmail.com> - 2011-09-22 08:57 +0200
      Re: Debugger Recommendation jacob navia <jacob@spamsink.net> - 2011-09-22 09:16 +0200
        Re: Debugger Recommendation Ian Collins <ian-news@hotmail.com> - 2011-09-22 19:46 +1200
        Re: Debugger Recommendation DeMarcus <use_my_alias_here@hotmail.com> - 2011-09-22 11:15 +0200
  Re: Debugger Recommendation Paul <pchristor@yahoo.co.uk> - 2011-08-29 22:02 -0700
    Re: Debugger Recommendation jacob navia <jacob@spamsink.net> - 2011-08-30 11:09 +0200
      Re: Debugger Recommendation Paul <pchristor@yahoo.co.uk> - 2011-08-30 05:26 -0700
        Re: Debugger Recommendation Oliver Jackson <chexmofo@hotmail.com> - 2011-08-30 08:25 -0700
          Re: Debugger Recommendation Paul <pchristor@yahoo.co.uk> - 2011-08-30 10:34 -0700
  Re: Debugger Recommendation Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-09-11 20:37 +0000
    Re: Debugger Recommendation jacob navia <jacob@spamsink.net> - 2011-09-12 00:40 +0200
      Re: Debugger Recommendation Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-09-12 21:58 +0000
        Re: Debugger Recommendation jacob navia <jacob@spamsink.net> - 2011-09-13 00:52 +0200
          Re: Debugger Recommendation Juha Nieminen <nospam@thanks.invalid> - 2011-09-13 06:40 +0000
            Re: Debugger Recommendation Ian Collins <ian-news@hotmail.com> - 2011-09-15 10:26 +1200
              Re: Debugger Recommendation jacob navia <jacob@spamsink.net> - 2011-09-15 00:57 +0200
                Re: Debugger Recommendation Ian Collins <ian-news@hotmail.com> - 2011-09-15 11:13 +1200
                Re: Debugger Recommendation Lynn McGuire <lmc@winsim.com> - 2011-09-14 18:16 -0500
                Re: Debugger Recommendation Ian Collins <ian-news@hotmail.com> - 2011-09-15 11:36 +1200
                Re: Debugger Recommendation Juha Nieminen <nospam@thanks.invalid> - 2011-09-15 06:35 +0000
                Re: Debugger Recommendation jacob navia <jacob@spamsink.net> - 2011-09-15 09:29 +0200
                Re: Debugger Recommendation Juha Nieminen <nospam@thanks.invalid> - 2011-09-15 07:46 +0000
                Re: Debugger Recommendation jacob navia <jacob@spamsink.net> - 2011-09-15 09:58 +0200
                Re: Debugger Recommendation Juha Nieminen <nospam@thanks.invalid> - 2011-09-15 09:57 +0000
                Re: Debugger Recommendation Miles Bader <miles@gnu.org> - 2011-09-15 19:30 +0900
                Re: Debugger Recommendation jacob navia <jacob@spamsink.net> - 2011-09-15 14:28 +0200
          Re: Debugger Recommendation yatremblay@bel1lin202.(none) (Yannick Tremblay) - 2011-09-13 13:29 +0000
            Re: Debugger Recommendation Ian Collins <ian-news@hotmail.com> - 2011-09-14 08:42 +1200
            Re: Debugger Recommendation Rui Maciel <rui.maciel@gmail.com> - 2011-09-15 10:37 +0100
              Re: Debugger Recommendation Miles Bader <miles@gnu.org> - 2011-09-15 19:36 +0900
              Re: Debugger Recommendation yatremblay@bel1lin202.(none) (Yannick Tremblay) - 2011-09-19 09:42 +0000
                Re: Debugger Recommendation Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-09-19 10:59 +0000
          Re: Debugger Recommendation Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-09-13 20:09 +0000
        Re: Debugger Recommendation Rui Maciel <rui.maciel@gmail.com> - 2011-09-15 10:11 +0100
          Re: Debugger Recommendation Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-09-16 21:29 +0000
    Re: Debugger Recommendation Rui Maciel <rui.maciel@gmail.com> - 2011-09-15 10:08 +0100
      Re: Debugger Recommendation Ian Collins <ian-news@hotmail.com> - 2011-09-15 21:23 +1200
        Re: Debugger Recommendation jacob navia <jacob@spamsink.net> - 2011-09-15 11:38 +0200
          Re: Debugger Recommendation Ian Collins <ian-news@hotmail.com> - 2011-09-15 21:41 +1200
        Re: Debugger Recommendation Rui Maciel <rui.maciel@gmail.com> - 2011-09-15 10:43 +0100
      Re: Debugger Recommendation jacob navia <jacob@spamsink.net> - 2011-09-15 11:34 +0200
        Re: Debugger Recommendation Ian Collins <ian-news@hotmail.com> - 2011-09-15 21:54 +1200
        Re: Debugger Recommendation Rui Maciel <rui.maciel@gmail.com> - 2011-09-15 11:44 +0100
          Re: Debugger Recommendation jacob navia <jacob@spamsink.net> - 2011-09-15 18:56 +0200
            Re: Debugger Recommendation yatremblay@bel1lin202.(none) (Yannick Tremblay) - 2011-09-19 09:53 +0000
              Re: Debugger Recommendation Ian Collins <ian-news@hotmail.com> - 2011-09-19 22:34 +1200
                Re: Debugger Recommendation Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-09-19 11:13 +0000
                Re: Debugger Recommendation yatremblay@bel1lin202.(none) (Yannick Tremblay) - 2011-09-22 11:41 +0000
                Re: Debugger Recommendation Ian Collins <ian-news@hotmail.com> - 2011-09-23 07:45 +1200
        Re: Debugger Recommendation Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-09-16 21:24 +0000
      Re: Debugger Recommendation Miles Bader <miles@gnu.org> - 2011-09-15 18:55 +0900
        Re: Debugger Recommendation Ian Collins <ian-news@hotmail.com> - 2011-09-15 22:03 +1200
          Re: Debugger Recommendation Miles Bader <miles@gnu.org> - 2011-09-15 19:29 +0900
            Re: Debugger Recommendation Ian Collins <ian-news@hotmail.com> - 2011-09-15 23:13 +1200
              Re: Debugger Recommendation Miles Bader <miles@gnu.org> - 2011-09-15 20:15 +0900
                Re: Debugger Recommendation Ian Collins <ian-news@hotmail.com> - 2011-09-15 23:22 +1200
        Re: Debugger Recommendation Rui Maciel <rui.maciel@gmail.com> - 2011-09-15 11:52 +0100
          Re: Debugger Recommendation Miles Bader <miles@gnu.org> - 2011-09-15 20:13 +0900
          Re: Debugger Recommendation Marc <marc.glisse@gmail.com> - 2011-09-15 14:19 +0000

csiph-web