Re: default -g ??!?

2010-11-22 Thread Warren Young

On 11/20/2010 1:05 PM, MK wrote:

I do not
think the exception (a need for debugging) should make the rule
(general use, production grade software).  I'd bet 99%+ of the time
those compiled in debugging symbols never even get used a single time.


The black box on an airplane doesn't get much use, either.  That's no 
reason to strip (*cough*) it out, though is it?  That would make 
figuring out the cause of a crash much more difficult.


I don't need to connect the dots for you, do I?


much, much rather have it work in as streamlined a manner day to day,
*by default*, then if I run into a problem, I can build CFLAGS=-g to
diagnose.


That's great when your problems are easily reproducible.

One of the goals of a good software development process is to find and 
fix all the easily reproducible bugs before binaries ship to customers. 
 If not on first release, certainly soon after.


Having achieved that, you're left with nothing but blue-moon crashers, 
and there's nothing better for diagnosing the cause of such things than 
a core dump.


Sometimes, though, a core dump doesn't tell you anything when you copy 
it to your development station.  You need to debug the problem in place.


If the debugging symbols are already present on the production system, 
life is easy.  (Well, as easy as debugging ever gets.)


If not, now you have to figure out how to build debug binaries in a 
state exactly like how they shipped to that one customer, who, if you 
have an agile development process, probably has a different version than 
almost any other site, simply depending on when their system was last 
upgraded.  (If you can always upgrade every customer to the latest 
version just to debug a problem, you must work in a very different 
business environment than I find myself in.)  If the rebuilt debug 
binaries don't match the shipped binaries, the core dump will be 
useless, because it will have pointers that refer to incorrect locations 
in the new program text.


No doubt you have a good version numbering system so you can figure out 
how to rebuild those binariesgiven maybe an hour or so.  An hour you 
probably don't have, because the customer is calling every ten minutes 
wanting to know when you'll have their system back up.  An hour you 
could have spent debugging the problem in situ using the debugging 
symbols you had the forethought to leave in the shipping binaries.



If I put a device in your car that ran the battery down and lowered the
gas mileage, the purpose of which was to diagnose problems *when there
aren't any*, then said you should leave it on all the time anyway, what
would you think?


Bad analogy.

Debugging symbols don't affect a program when it's sitting there not 
running.  You can't usefully compare this to a fictional car device that 
runs the battery down when the car isn't running.


Such a device would necessarily take power when the car is running, and 
conservation of energy being the inviolable law it is, it will reduce 
your gas mileage slightly.  (So does turning on the headlights, but you 
wouldn't advocate leaving them off at night to improve gas mileage.)


The correct analogy is volume and weight: such a device takes room under 
the dash somewhere and makes the car slightly heavier, even when the car 
isn't running.  Big deal.


Debugging symbols take a bit of cheap disk space, they take a bit more 
cheap bandwidth to download, and they might possibly cause an extra disk 
seek or two as the program loader skips over the executable sections 
holding the unused debugging symbols.  Big deal here, too.



I understand the argument that by always using the -g version, you can
avoid having complications whereby the exe compiled without debugging
symbols may demonstrate problems the -g does not.  However, by again
letting this exception set the rule, you are condemning all software to
run wastefully.


If storage space and CPU time were the only considerations, every 
program would still be hand-coded in assembly language.


Ever since computers came down out of the multimillion dollar 
stratosphere, human costs have usually swamped storage and computation 
costs.  So, we have not only debugging symbols in production binaries, 
but also very high-level language compilers, managed memory runtimes, 
and vast, powerful, and wasteful third-party code libraries.  These 
things all make programming easier, so programs cost less.


The tradeoff being, we can no longer get a word processor, OS, and the 
document being edited to fit into 48 KB.


If you really want to return to those days, they're still selling cheap, 
working Apple ][+es on eBay.


Before you make your choice, you might want to listen to an old timer's 
recollections that such crude word processors cost about $220 in today's 
money.  For that, you'd get a product that does less than Microsoft's 
Wordpad.  (Or Apple's TextEdit, or KDE's KWord, or...)  This old-timer 
remembers add-on packages costing more than the word 

Re: on Windows, BUILT_SOURCES does not append .exe

2010-11-22 Thread Vincent Torri



On Mon, 22 Nov 2010, Ralf Wildenhues wrote:


* Dave Hart wrote on Mon, Nov 22, 2010 at 12:34:47AM CET:

On Sun, Nov 21, 2010 at 22:44 UTC, Vincent Torri vto...@univ-evry.fr wrote:

On Sun, 21 Nov 2010, Ralf Wildenhues wrote:

* Vincent Torri wrote on Sun, Nov 21, 2010 at 11:14:23PM CET:

If I don't use BUILT_SOURCES, cmapdump binary is not built before
libcmaps, hence cmap_tounicode.c is not created, and compilation of
libcmaps fails.

Is there another solution ?


Yes: just specify cmapdump$(EXEEXT) as prerequisite to cmap_tounicode.c.


isn't what the line:

cmap_tounicode.c: cmapdump $(cmap_tounicode_files)

does ? Note that having that rule is not sufficient on linux (that is, even
if $(EXEEXT) 'should' (but not 'must', as .exe suffix is not necessary) be
added on widnows, it does not work on linux)


In that case you may need to add cmap_tounicode.c to BUILT_SOURCES,
leaving cmapdump out of same.


That shouldn't be necessary; you generally only need to list headers
there for which automake cannot know that they are generated and needed
early.  On GNU/Linux, the example code from the second post from Vincent
should just work.  Vincent, I'm afraid you might just have to debug the
makefile (make -d etc); maybe there is a 'cmapdump' file that make finds
to be matching?


Hmm, i tried with parallal build (make -j 4) and it fails without 
BUILT_SOURCES.


Vincent Torri



Re: reword documentation about symbol stripping

2010-11-22 Thread Karl Berry
it addresses an issue that
some people may not know about, so maybe it would be good to briefly
explain further?

I agree, thanks.  I changed the text to look like this:

  By default, the Make rules should compile and link with @samp{-g}, so
  that executable programs have debugging symbols.  Otherwise, you are
  essentially helpless in the face of a crash, and it is often far from
  easy to reproduce with a fresh build.


Best,
karl