Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Advanced c++ debugging techniques on Unix

43 views
Skip to first unread message

Maitre Bart

unread,
Oct 30, 2006, 4:14:05 PM10/30/06
to
One said: "The more time you'll spend on designing your app, the less
you'll spend time debugging it." I agree with that, but chances are,
you'll still need to debug it anyway! And the larger the app, the
higher the chances, yours or not.

There are many books that teach C++, but not so many that teach how to
debug C++ apps. Like there are some "must read" for the first category,

I imagine there likely to exist some "must read" too for the second.


So, here I am polling for those of you that have been impressed by
books, tools or libs on advanced c++ debugging techniques on Unix.
Those books that reveals "what, how and why using this tool/lib (open
source or commercial) when faced with this kind of problems". Or books
that teach "You did it wrong, man! Here is how to do this."

Michael Rasmussen

unread,
Oct 30, 2006, 5:00:22 PM10/30/06
to
On Mon, 30 Oct 2006 13:14:05 -0800, Maitre Bart wrote:

>
> So, here I am polling for those of you that have been impressed by
> books, tools or libs on advanced c++ debugging techniques on Unix.
> Those books that reveals "what, how and why using this tool/lib (open
> source or commercial) when faced with this kind of problems". Or books
> that teach "You did it wrong, man! Here is how to do this."

Unit tests? CppUnit ->
http://cppunit.sourceforge.net/cppunit-wiki/FrontPage

--
Hilsen/Regards
Michael Rasmussen
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE3E80917

Grant Edwards

unread,
Oct 30, 2006, 5:22:13 PM10/30/06
to
On 2006-10-30, Maitre Bart <maitr...@excite.com> wrote:

The most advanced C++ debuggin technique on Unix?

Writing your app in Python.

--
Grant Edwards grante Yow! Hold the MAYO & pass
at the COSMIC AWARENESS...
visi.com

Binary

unread,
Oct 30, 2006, 7:14:52 PM10/30/06
to
seems you are python addict. :)

Carlos Moreno

unread,
Oct 30, 2006, 8:10:27 PM10/30/06
to
Binary wrote:
> seems you are python addict. :)

More like borderline spammer....

(and BTW, please avoid top-posting)

Carlos
--

Paul Pluzhnikov

unread,
Oct 30, 2006, 10:18:07 PM10/30/06
to
"Maitre Bart" <maitr...@excite.com> writes:

> There are many books that teach C++, but not so many that teach how to
> debug C++ apps.

You debug C++ apps in just the same way you debug apps in any other
language (C, Python, Java, etc.).

IMHO, a "must read" for debugging in general is this one:
http://www.amazon.com/Debugging-Indispensable-Software-Hardware-Problems/dp/0814471684

> So, here I am polling for those of you that have been impressed by
> books, tools or libs on advanced c++ debugging techniques on Unix.

The most advanced (free) C++ debugging tools on linux are valgrind,
gdb and compiling with -D_GLIBCXX_DEBUG.

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.

Bernhard Agthe

unread,
Oct 31, 2006, 2:34:34 AM10/31/06
to
Hi,

> I imagine there likely to exist some "must read" too for the second.
>
> So, here I am polling for those of you that have been impressed by
> books, tools or libs on advanced c++ debugging techniques on Unix.

It looks like debugging is some kind of "black art" ;-) There is not
much on that topic in general.

For me it works best to first resolve all compiler errors and warnings
(gcc/g++ is very informative ;-) and then to test the program
extensively. Segmentation faults are relatively easy to debug (using gdb
or valgrind), logical faults require lots of printf/cout.

But mostly debugging depends on program design - I write my programs so
that errors will lead to an immediate chrash (segmentation fault) and
get my program so safe that this doesn't occur ;-) Also using several
small modules instead of few large ones helps if you can identify by the
nature of the error which module is concerned...

Doing step-by-step debugging seems not very efficient for me - a
professor at university said about it "you debug the CPU, not your program."

> Those books that reveals "what, how and why using this tool/lib (open
> source or commercial) when faced with this kind of problems". Or books
> that teach "You did it wrong, man! Here is how to do this."

Go ahead, set up a wiki invite some people in this group and you'll be
able to produce some "Debugging C and C++ Howto"...

Ciao...

Grant Edwards

unread,
Oct 31, 2006, 11:56:27 AM10/31/06
to
On 2006-10-31, Binary <binar...@gmail.com> wrote:

> seems you are python addict. :)

For the majority of run-of-the mill user-space applications,
I'm pretty much a convert. For stuff like kernels, device
drivers, and other low level stuff, I'm sticking with C.

--
Grant Edwards grante Yow! .. My pants just went
at on a wild rampage through a
visi.com Long Island Bowling Alley!!

Grant Edwards

unread,
Oct 31, 2006, 11:57:18 AM10/31/06
to
On 2006-10-31, Carlos Moreno <moreno_at_mo...@mailinator.com> wrote:
> Binary wrote:
>> seems you are python addict. :)
>
> More like borderline spammer....

You think I'm a spammer?!?!

I rarely even make the top-10 posters list.

--
Grant Edwards grante Yow! WHOA!! I'm having
at a RELIGIOUS EXPERIENCE
visi.com right NOW!!

Carlos Moreno

unread,
Oct 31, 2006, 2:10:18 PM10/31/06
to
Grant Edwards wrote:

>>>seems you are python addict. :)
>>
>>More like borderline spammer....
>
> You think I'm a spammer?!?!
>
> I rarely even make the top-10 posters list.

As with many other things, spam can be characterized either by
quantity or by quality --- it's not like one is a spammer if and
only if we post a certain *quantity*. *A single* message can be
spam, if it has *spam quality*.

Your advice, in this particular thread, and in the particular
reply you gave, was grotesquely unsolicited, unrelated to the
thread, extremely pushy, and an entirely gratuitous plug.
Those are some of the main characteristics that define spam.

The *borderline* part is because of the touch of humor that it
has --- and I'm giving you the benefit of the doubt in assuming
that it was your intention to post that with such touch of
humor.

Language wars are ok, when they're "solicited" --- if the OP
had said something about debugging C++ being easier or better
than with other languages, or how does it compare to other
languages, then of course your post would not qualify as spam.

Carlos
--

Grant Edwards

unread,
Oct 31, 2006, 3:12:53 PM10/31/06
to
On 2006-10-31, Carlos Moreno <moreno_at_mo...@mailinator.com> wrote:

> Your advice, in this particular thread, and in the particular
> reply you gave, was grotesquely unsolicited, unrelated to the
> thread, extremely pushy, and an entirely gratuitous plug.

It was a joke.

> The *borderline* part is because of the touch of humor that it
> has --- and I'm giving you the benefit of the doubt in assuming
> that it was your intention to post that with such touch of
> humor.

I guess I should have included the smiley.

--
Grant Edwards grante Yow! does your DRESSING
at ROOM have enough ASPARAGUS?
visi.com

Maitre Bart

unread,
Oct 31, 2006, 3:17:13 PM10/31/06
to

First, thank you very much for all of you that contributed to this
thread with their meaningful inputs. I really appreciate.

Though I forgot to specify that in most of my cases, I have to debug
others' applications and others' libs. I'm working in a big place where
there are big apps/libs, and it is sometimes very intimidating to start
debugging those monsters. I have to deal with what the "accomplished
fact".

It seems Berhnard is right when he says it's a "black art". I suspected
this too when I realized there wasn't much books on the Net on this
subject.

Thanks for your suggestions, hints and tips. They will certainly be
useful in my future.

I will continue to look around.

Carlos Moreno

unread,
Oct 31, 2006, 5:38:34 PM10/31/06
to
Grant Edwards wrote:

>>Your advice, in this particular thread, and in the particular
>>reply you gave, was grotesquely unsolicited, unrelated to the
>>thread, extremely pushy, and an entirely gratuitous plug.
>
> It was a joke.
>
>>The *borderline* part is because of the touch of humor that it
>>has --- and I'm giving you the benefit of the doubt in assuming
>>that it was your intention to post that with such touch of
>>humor.
>
> I guess I should have included the smiley.

It did have the appearance of a joke / humor-filled-remark....
I guess some of us have the humor/irony/sarcasm detector a bit
out of alignment ;-)

Carlos
--

Grant Edwards

unread,
Nov 1, 2006, 12:18:53 AM11/1/06
to

sarcasm/irony on Usenet is always a risky proposition.

--
Grant Edwards grante Yow! ... or were you
at driving the PONTIAC that
visi.com HONKED at me in MIAMI last
Tuesday?

Bernhard Agthe

unread,
Nov 2, 2006, 4:56:10 AM11/2/06
to
Hi,

the discussion here reminds me of an idea I recently had:

Legalize spam!

Provided the following conditions are fulfilled, spam should be legalized:

- the email is sent legally (not via bot-net or with false From:)

- no illegal content (abuse...)

- no malicious software contained

- The subject starts with a tag like this: (PR:US) meaning "Promotion"
(PR) for US area (or EU or UK or DE or CN or global whatever area code).

Thus each user could decide for him-/herself whether to read or react to
this advertisement. If known to a reasonably large part of internet
users, I do think this could lead to higher-quality ads sent by email
and less stupid spam ;-) So a higher cultural level of communication
could be reached...

Have a nice day...

.

John Hasler

unread,
Nov 2, 2006, 9:24:15 AM11/2/06
to
Bernard Agthe writes:
> - the email is sent legally (not via bot-net or with false From:)

But most spam is sent via bot-net and/or with forged From.

> - The subject starts with a tag like this: (PR:US) meaning "Promotion" (PR)
> for US area (or EU or UK or DE or CN or global whatever area code).

> Thus each user could decide for him-/herself whether to read or react to
> this advertisement. If known to a reasonably large part of internet
> users, I do think this could lead to higher-quality ads sent by email and
> less stupid spam ;-)

It would lead to no reduction at all. Note that most spams contain
features intended to evade filters and have misleading subject lines.
Spammers would not use such tags because they would be caught by filters.

Note that spam with "opt-out" is already legal in the US, but most spam
does not comply.
--
John Hasler
jo...@dhh.gt.org
Dancing Horse Hill
Elmwood, WI USA

Bernhard Agthe

unread,
Nov 2, 2006, 10:32:46 AM11/2/06
to
Hi,

>>- the email is sent legally (not via bot-net or with false From:)
>
> But most spam is sent via bot-net and/or with forged From.

That's part of the reason of my proposal ;-)

>>- The subject starts with a tag like this: (PR:US) meaning "Promotion" (PR)
>>for US area (or EU or UK or DE or CN or global whatever area code).

...


> It would lead to no reduction at all. Note that most spams contain
> features intended to evade filters and have misleading subject lines.
> Spammers would not use such tags because they would be caught by filters.

That's the other part of my proposal ;-)

The third part is: I hope that this will lead to PR-emails being
accepted as a "normal" way of product placement (instead of promoting
only half-legal stuff) and that the "bad" spam will disappear over time...

> Note that spam with "opt-out" is already legal in the US, but most spam
> does not comply.

Oh, I didn't know. And I guess, most users and spammer don't know,
either. The main effect of my proposal is the public announcement of a
regulation how to mark spam, so users will accept "good" spam while
rejecting "bad spam" ;-)

Actually I would read PR messages if they promoted something I was
interested in and do so in a convincing way. Doesn't mean I've got to
buy... Many people would do so, as they watch TV ads, I expect.

Ciao

.

Carlos Moreno

unread,
Nov 2, 2006, 10:48:24 AM11/2/06
to
John Hasler wrote:

> Note that spam with "opt-out" is already legal in the US, but most spam
> does not comply.

Plus, the saddest part of that is that for educated users, spam with
legitimate opt-out is exactly the same as without --- given that you
can not distinguish (*) legitimate opt-out from malicious
"pose-as-opt-out" traps with the only intent to verify that the target
e-mail address is good *and it's being read* and thus increase its
market value, then the opt-out is the most useless of features.

Sad that legislators are so profoundly stupid to make this useless
feature a condition for spam to be legally accepted.

(*) I guess in some cases they might be distinguishable, but in the
general case, it's not.


Carlos
--

Jordan Abel

unread,
Nov 2, 2006, 11:02:54 AM11/2/06
to
2006-11-02 <eid32v$9j$1...@daniel-new.mch.sbs.de>,

Bernhard Agthe wrote:
> The third part is: I hope that this will lead to PR-emails being
> accepted as a "normal" way of product placement (instead of promoting
> only half-legal stuff) and that the "bad" spam will disappear over time...

Why would the bad spam disappear over time?

drat, where's that form when i need it.

Ah!

Your post advocates a

( ) technical (@) legislative ( ) market-based ( ) vigilante

approach to fighting spam. Your idea will not work. Here is why it won't
work. (One or more of the following may apply to your particular idea,
and it may have other flaws which used to vary from state to state
before a bad federal law was passed.)

( ) Spammers can easily use it to harvest email addresses
( ) Mailing lists and other legitimate email uses would be affected
( ) No one will be able to find the guy or collect the money
( ) It is defenseless against brute force attacks
( ) It will stop spam for two weeks and then we'll be stuck with it
( ) Users of email will not put up with it
( ) Microsoft will not put up with it
( ) The police will not put up with it
(@) Requires too much cooperation from spammers
( ) Requires immediate total cooperation from everybody at once
( ) Many email users cannot afford to lose business or alienate
potential employers
( ) Spammers don't care about invalid addresses in their lists
( ) Anyone could anonymously destroy anyone else's career or business

Specifically, your plan fails to account for

( ) Laws expressly prohibiting it
( ) Lack of centrally controlling authority for email
( ) Open relays in foreign countries
( ) Ease of searching tiny alphanumeric address space of all email addresses
(@) Asshats
(@) Jurisdictional problems
( ) Unpopularity of weird new taxes
( ) Public reluctance to accept weird new forms of money
( ) Huge existing software investment in SMTP
( ) Susceptibility of protocols other than SMTP to attack
( ) Willingness of users to install OS patches received by email
(@) Armies of worm riddled broadband-connected Windows boxes
( ) Eternal arms race involved in all filtering approaches
(@) Extreme profitability of spam
( ) Joe jobs and/or identity theft
( ) Technically illiterate politicians
( ) Extreme stupidity on the part of people who do business with spammers
(@) Dishonesty on the part of spammers themselves
(@) Bandwidth costs that are unaffected by client filtering
( ) Outlook

and the following philosophical objections may also apply:

(@) Ideas similar to yours are easy to come up with, yet none have ever
been shown practical
(@) Any scheme based on opt-out is unacceptable
(@) SMTP headers should not be the subject of legislation
( ) Blacklists suck
( ) Whitelists suck
( ) We should be able to talk about Viagra without being censored
( ) Countermeasures should not involve wire fraud or credit card fraud
( ) Countermeasures should not involve sabotage of public networks
( ) Countermeasures must work if phased in gradually
( ) Sending email should be free
( ) Why should we have to trust you and your servers?
( ) Incompatiblity with open source or open source licenses
(@) Feel-good measures do nothing to solve the problem
( ) Temporary/one-time email addresses are cumbersome
( ) I don't want the government reading my email
( ) Killing them that way is not slow and painful enough

Furthermore, this is what I think about you:

(@) Sorry dude, but I don't think it would work.
( ) This is a stupid idea, and you're a stupid person for suggesting it.
( ) Nice try, assh0le! I'm going to find out where you live and burn your
house down!

John Hasler

unread,
Nov 2, 2006, 11:32:22 AM11/2/06
to
Bernhard Agthe writes:
> The third part is: I hope that this will lead to PR-emails being accepted
> as a "normal" way of product placement (instead of promoting only
> half-legal stuff) and that the "bad" spam will disappear over time...

Why would that happen?

> And I guess, most users and spammer don't know, either.

Of course most spammers know about "opt-out". They either don't care or
use it to harvest known-good addresses.

> The main effect of my proposal is the public announcement of a regulation
> how to mark spam, so users will accept "good" spam while rejecting "bad
> spam"

Users would simply block all marked spam.

> Actually I would read PR messages if they promoted something I was
> interested in and do so in a convincing way.

But 99.999% don't.

> Many people would do so, as they watch TV ads, I expect.

If most people could program their TVs to suppress all advertising they
would. Especially if TV was 90% advertising.

John Hasler

unread,
Nov 2, 2006, 11:34:25 AM11/2/06
to
Carlos writes:
> Sad that legislators are so profoundly stupid to make this useless
> feature a condition for spam to be legally accepted.

Stupidity is only a minor factor here.

Bernhard Agthe

unread,
Nov 3, 2006, 4:17:31 AM11/3/06
to
Hi,

Thanks for all your answers, I still think it's a good idea, but I won't
pursue it any further.

Actually The form is quite interesting ;-) Thanks for your time.

> Furthermore, this is what I think about you:
>
> (@) Sorry dude, but I don't think it would work.

Accepted.

> ( ) This is a stupid idea, and you're a stupid person for suggesting it.
> ( ) Nice try, assh0le! I'm going to find out where you live and burn your
> house down!

I'm glad it's neither of the last two ;-)

Ciao

.

Immanuel Litzroth

unread,
Nov 7, 2006, 4:52:49 AM11/7/06
to
Grant Edwards <gra...@visi.com> writes:

> Writing your app in Python.

Get real. There is nothing in Python that has not been done better
in at least one other language before Python was created. Python is an
exercise in futility. Be sure to give send me a message though when the
python debugger can debug it's own threads. I have some legacy stuff
that is in serious need of debugging.
Immanuel

0 new messages