Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Re: More on debuggers

Reply
Thread Tools

Re: More on debuggers

 
 
Seebs
Guest
Posts: n/a
 
      12-14-2010
On 2010-12-14, Richard Harter <> wrote:
> Be that as it may, I agree that debuggers are valuable for rumaging
> through core dumps. The question I had in mind is more like this. If
> you are working with instrumented code that generates substantial
> error reports on failures when does a debugger offer significant
> advantage?


Usually in things like looking at what contents something has before
it's supposed to be initialized.

I guess... My rough experience is:

* Logic errors are fastest-fixed by good logging and studying logs.
* Pure-code-errors are fastest-fixed by a debugger.

The distinction I'm making is between "we initialized this, but we did
the initializations in the wrong order" and "we only partially initialized
this, and one field was still being set to stack garbage". Stack garbage
type problems, buffer overruns, and the like, I tend to find easier to
spot with a debugger. Pure logic flaws, by contrast, I tend to find easier
to spot with good logging.

-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.
 
Reply With Quote
 
 
 
 
Nick Keighley
Guest
Posts: n/a
 
      12-15-2010
On Dec 14, 1:13*pm, Richard <rgrd...@gmail.com> wrote:
> Malcolm McLean <malcolm.mcle...@btinternet.com> writes:
> > On Dec 14, 10:35*am, Seebs <usenet-nos...@seebs.net> wrote:
> >> On 2010-12-14, Ian Collins <ian-n...@hotmail.com> wrote:

>
> >> That said, just about everyone I know uses debugging messages as a diagnostic
> >> tool sometimes. *There are things they're better at, and things they're worse
> >> at, than debuggers. *If you have to run something a couple hundred thousand
> >> times to see a failure, diagnostic messages may be more useful than single
> >> stepping. *

>
> > I'd agree. However "is better in some situations" doesn't always
> > equate to "is useful".

>
> > When I used a debugger I used it a lot. It fitted very intimately into
> > the way I worked. So being deprived of it was a shock, but it made me
> > a better programmer, because I had to follow through logic in my
> > head.

>
> Total nonsense. A good programmer uses the tools that are
> available. "Following things through in your head" is NOT efficient
> debugging or data flow analysing. It is error prone and silly. A good
> debugger facilitates your understanding it does not hinder it. You can
> still "think it through" of course, but how much more convenient to set
> a conditional break point at some data see that cause instability and
> THEN "thinking it through".


we might be in agreement that thinking is good
 
Reply With Quote
 
 
 
 
Nick Keighley
Guest
Posts: n/a
 
      12-15-2010
On Dec 14, 1:15*pm, Richard <rgrd...@gmail.com> wrote:
> Richard <rgrd...@gmail.com> writes:
> > Seebs <usenet-nos...@seebs.net> writes:

>
> >> On 2010-12-14, Ian Collins <ian-n...@hotmail.com> wrote:
> >>> On 12/14/10 03:33 PM, Richard wrote:
> >>>> c...@tiac.net (Richard Harter) writes:
> >>>>> I wouldn't wait for references if I were you. *Most of Richard's
> >>>>> discussion consisted of misrepresenting what other people said.

>
> >>>> I could produce all sorts of links but then I would lower myself to that
> >>>> of the childish "regs".

>
> >> (Yes, yes, how horrible to lower yourself to supporting your claims?)

>
> >>>> The arch-deacon of c.l.c claimed debuggers were unnecessary.

>
> >>> Who?

>
> >> I have no clue. *I guess the term "necessary" is a questionable one. *I
> >> would argue that, strictly speaking, C compilers are "unnecessary", it's just
> >> that they're so very useful...

>
> >>> I think most posts on this thread are claiming the debuggers are a
> >>> useful tool, with one descenting voice.

>
> >> Pretty much.

>
> > If only it were always so. Many seemed to have actually learnt what they
> > can do.

>
> >> That said, just about everyone I know uses debugging messages as a diagnostic
> >> tool sometimes. *There are things they're better at, and things they're worse
> >> at, than debuggers. *If you have to run something a couple hundred
> >> thousand

>
> > They can be useful in a framework when using log files.

>
> >> times to see a failure, diagnostic messages may be more useful than single
> >> stepping. *

>
> >> -s

>
> > What are you talking about???

>
> > Single stepping????

>
> > Do you even know how to use a debugger?

>
> > If you can put a log message in there you can set a conditional break
> > point. far less intrusive. no need to recompile. no risk of heisenbugs.

>
> > As I said .... some people dont really seem to understand what good
> > debuggers can do.

>
> Please note that the comment above is in the context of DEBUGGING. Not
> collecting run time stats. Clearly logging can be important then. This
> is NOT the same as sticking in log messages for arbitrary
> checks/debugging



you clearly use a debugger for more than "debugging"

single stepping to "learn how the program works" seems to be one of
the things you recommend
 
Reply With Quote
 
Nick Keighley
Guest
Posts: n/a
 
      12-15-2010
On Dec 14, 7:47*pm, c...@tiac.net (Richard Harter) wrote:
> On Sun, 12 Dec 2010 15:50:44 -0800 (PST), Nick Keighley
>
>
>
>
>
> <nick_keighley_nos...@hotmail.com> wrote:
> >On Dec 12, 5:12=A0pm, c...@tiac.net (Richard Harter) wrote:
> >> On Sun, 12 Dec 2010 06:59:03 -0800 (PST), Nick Keighley

>
> >> <nick_keighley_nos...@hotmail.com> wrote:

>
> >> (Some very sensible comments.)

>
> >> >On Dec 11, 11:25=3DA0pm, Richard <rgrd...@gmail.com> wrote:
> >> >> "Default User" <defaultuse...@yahoo.com> writes:
> >> >> This has been discussed numerous times and at length here.

>
> >> >so you'll have no trouble producing cites.

>
> >> >what most people are saying is that there are more ways to skin a cat
> >> >than are dreamt of in your philosophy.

>
> >> >In some cases debuggers are simply not available. The end-users'
> >> >environment is significantly different from the developers'
> >> >environment. =A0Then other things like logs and traces can be handy..

>
> >> >There are others who sing the Unit Test cause. They apparently don't
> >> >bebug because their stuff doesn't break (perhaps they only nearly
> >> >achieve this).

>
> >> >I think many of us find the practice of "just stepping through" the
> >> >code peculiar. Perhaps you should consider the idea that not everyone
> >> >who disgrees with you is a moron or only writes software for himself
> >> >in his back bedroom.

>
> >> >The fact that you retrigger this discussion with the same...
> >> >misleading... claims every six months is an indication that you
> >> >sometimes enjoy a good troll.

>
> >> That could be, but I opine that he actually believes what he says.
> >> Sad, really.

>
> >> There are discussable issues here.

>
> >though probably not with richard <noname>

>
> >> =A0Frex, in what environments are
> >> debuggers particularly useful and when are they not useful. =A0

>
> >> People accustomed to working without debuggers (either by need or by
> >> preference) use techniques such as log files, traces, options to
> >> generate debug printouts, unit tests, regression testing, incremental
> >> development, modular coding, etc.

>
> >I meant to put the humble assert() in my original list. Of course
> >*that* gets on richard <noname>'s goat as well.

>
> >Reasoning about code.

>
> To be fair, by his report Richard <noname> is in an environment where
> reasoning about code may not be of much value.


and also the release environment is very like the development
environment. I'm guessing he only has desk top stuff to deal with.


>*Before you can reason
> about code you have to find the code to reason about. *If you have a
> huge code base with code from various sources finding the right place
> is a major task.
>
>
>
> >> How much does having a debugger at
> >> hand buy you if you have those resources in place?

>
> >going through core dumps and finding out what actually happened when
> >the other things let you down. Sometimes you don't manage to think of
> >every possible failure mode in advance.

>
> I never have core dumps. *What never? *No never! *What never? *Well,
> hardly ever. *
>
> Seriously, I have worked in environments where core dumps are pretty
> much a no-no. *You can't think of every possible failure mode in
> advance, but if you are oriented towards preservation of data
> integrity and graceful failure (and maybe never getting to see the
> core dump) you can go a long way in that direction. *However that's
> just me.
>
> Be that as it may, I agree that debuggers are valuable for rumaging
> through core dumps. *The question I had in mind is more like this. *If
> you are working with instrumented code that generates substantial
> error reports on failures when does a debugger offer significant
> advantage?


richard <noname> will just assume you're lieing or only write text
games in your back bedroom
 
Reply With Quote
 
luser- -droog
Guest
Posts: n/a
 
      12-15-2010
On Dec 14, 1:15*pm, Kenneth Brody <kenbr...@spamcop.net> wrote:
> On 12/14/2010 8:11 AM, Richard wrote:
>
> > Seebs<usenet-nos...@seebs.net> *writes:

> [...]
> >> That said, just about everyone I know uses debugging messages as a diagnostic
> >> tool sometimes. *There are things they're better at, and things they're worse
> >> at, than debuggers. *If you have to run something a couple hundred
> >> thousand
> >> times to see a failure, diagnostic messages may be more useful than single
> >> stepping. *


[...]

> Sometimes, you need all three -- logs, debugger, and single-stepping.
>


My own humble technique is, I think, such a hybrid.
I'll often enable automatic display of several variables;
single-step a few lines; and then hold down enter for a
few seconds to fill the xterm buffer; and then peruse the
'debug' "log".


--
$0.02
 
Reply With Quote
 
Chris H
Guest
Posts: n/a
 
      12-15-2010
In message <>, Kenneth Brody
<> writes
>
>Yes, you may be able to do without the logs, and use some hardware-
>assisted debugging, such as a trap-on-write to the "can't happen"
>value's address. But, even on those platforms that support such traps,
>the speed impact is often too great.
>


All the ICE I have used are non intrusive.

--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/



 
Reply With Quote
 
Tim Rentsch
Guest
Posts: n/a
 
      01-02-2011
(Richard Harter) writes:

> [discussion about when it's good or bad to use debuggers]
>
> There are discussable issues here. Frex, in what environments are
> debuggers particularly useful and when are they not useful.
>
> People accustomed to working without debuggers (either by need or by
> preference) use techniques such as log files, traces, options to
> generate debug printouts, unit tests, regression testing, incremental
> development, modular coding, etc. How much does having a debugger at
> hand buy you if you have those resources in place?


Winner: "Best in Thread" award.
 
Reply With Quote
 
JG
Guest
Posts: n/a
 
      01-07-2011
On Dec 12 2010, 3:20*am, gaze...@shell.xmission.com (Kenny McCormack)
wrote:
> In article <4d044deb.43771...@text.giganews.com>,
> Richard Harter <c...@tiac.net> blathered:
> ...
>
> >I wouldn't wait for references if I were you. *Most of Richard's
> >discussion consisted of misrepresenting what other people said.

>
> Liar!
>
> --
> One of the best lines I've heard lately:
>
> * * Obama could cure cancer tomorrow, and the Republicans would be
> * * complaining that he had ruined the pharmaceutical business.
>

Stephanie Miller=

Nuremberg prosecutor and Nixon/Reagan Ringmaster ??
"William Edward "Bill" Miller ...chairman of the Republican National
Committee from 1961 to 1964."


 
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: More on debuggers BartC C Programming 82 12-19-2010 07:34 PM
Re: More on debuggers Lew Pitcher C Programming 8 12-01-2010 03:49 PM
Re: More on debuggers Chris H C Programming 4 12-01-2010 02:59 PM
Re: More on debuggers Magno C Programming 3 12-01-2010 08:02 AM
JDWP/JPDA - Often VM stops listening for debuggers connnection Marco Lorenzini Java 0 05-13-2004 04:03 PM



Advertisments