From: Eli Zaretskii <eliz@gnu.org>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 13775@debbugs.gnu.org
Subject: bug#13775: 24.3.50; Omissions in documentation for crash reporting
Date: Fri, 22 Feb 2013 11:24:04 +0200 [thread overview]
Message-ID: <83k3q0n1l7.fsf@gnu.org> (raw)
In-Reply-To: <5126CA8B.6040705@yandex.ru>
> Date: Fri, 22 Feb 2013 05:31:55 +0400
> From: Dmitry Gutov <dgutov@yandex.ru>
> CC: 13775@debbugs.gnu.org
>
> > There's no way we can teach everybody the basics of GNU-style
> > configure scripts, including how to discover the available switches
> > and override compiler and linker options. You need to learn that\
>
> If by discovering switches you mean calling ./configure --help, then it
> wasn't my problem.
I meant both the switches of configure and the compiler/linker
switches and options.
> The ./configure --help output tells how to override switches in general,
> my complaint is about insufficient detail. Is the "Some influential
> environment variables" part provided by autoconf or somesuch?
I don't understand the question. The relevant part of the help text
is this:
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
LIBS libraries to pass to the linker, e.g. -l<library>
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
XMKMF Path to xmkmf, Makefile generator for X Window System
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
Which part(s) of this are unclear?
In any case, this is a standard text shown by every configure script
out there, so if you think it should be clarified, please complain to
the Autoconf developers.
> >> 1. Calling `xbacktrace' requires src/.gdbinit to be loaded. It
> >> a) requires the user to run gdb exactly from src/ (not `gdb src/emacs'),
> >
> > The file etc/DEBUG tells you that at the beginning:
> >
> > ** When you debug Emacs with GDB, you should start it in the directory
> > where the executable was made. That directory has a .gdbinit file
> > that defines various "user-defined" commands for debugging Emacs.
> > (These commands are described below under "Examining Lisp object
> > values" and "Debugging Emacs Redisplay problems".)
>
> Um, yes, I read that. Maybe I should've skipped this part of the
> complaint. But is this exact wording ("the directory where the
> executable was made") important? If it just said "./src", that would be
> more obvious.
I added that (revision 111290 on the emacs-24 branch).
> >> b) requires them to modify the `auto-load safe-path', or that .gdbinit
> >> is ignored.
> >
> > This "feature" entered GDB only recently. Versions of GDB before 7.5
> > don't need that, and will barf if you use this command. I don't see
> > any reasonable way of dealing with this without confusing newbies even
> > more (while veteran GDB users already know how to negotiate this
> > obstacle).
>
> If the feature isn't considered for removal, this argument will become
> less and less important over time. And the odds of a newbie being
> confused by safe-path will approach 100%.
But GDB already tells you how to allow .gdbinit to be auto-loaded, and
also points to the GDB manual. If the text displayed by GDB is not
clear or confusing, I suggest to report that to GDB maintainers.
> I'm not specifically asking to list the exact commands or ~/.gdbinit
> contents to work around safe-path. Maybe just mention the feature and,
> optionally, suggest consulting GDB manual, if that isn't obvious
> already?
I added that to etc/DEBUG.
> But specifying exactly what to do if GDB version is >= 7.5
> would also work.
That's hard to do, because the solution depends on the end-user's
preferences regarding security and on the degree of their machine's
exposure to other users and to the outside world. The GDB manual
discusses the possible solutions, so a pointer to it will allow the
user to make up her mind.
> >> a) Do I set the variable when calling `make', or do I have to re-run
> >> ./configure? Not obvious, the answer is "the latter".
> >
> > Actually, both will work.
>
> Not exactly.
>
> 'CFLAGS="-g3" ./configure' works.
> 'CFLAGS="-g3" make' doesn't.
>
> 'make CFLAGS="-g3"' does work, but AFAIK that's not the usual way of
> binding an environment variable value.
CFLAGS is a Make variable. Make normally initializes all its
variables by looking at the environment. But 'CFLAGS="-g3" make'
doesn't export the value of CFLAGS for Make to see it, it only inserts
CFLAGS into the shell's own environment. That is why the command
'CFLAGS="-g3" make' doesn't work, while 'make CFLAGS="-g3"' does.
This is all standard shell and Make stuff, I don't think it's
reasonable to expect Emacs documentation to teach all that.
> I think "compile without optimizations" or "compile for debugging" is a
> sufficiently common special case to warrant listing the recommended
> command somewhere in etc/DEBUG. That will take a few lines at the most.
It's already there, it just didn't mention the -O0 option explicitly;
I added that. (Again, this is a basic compiler option, not something
specific to Emacs.)
next prev parent reply other threads:[~2013-02-22 9:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-21 7:27 bug#13775: 24.3.50; Omissions in documentation for crash reporting Dmitry Gutov
2013-02-21 8:31 ` Andreas Schwab
2013-02-21 17:24 ` Eli Zaretskii
2013-02-22 1:31 ` Dmitry Gutov
2013-02-22 9:24 ` Eli Zaretskii [this message]
2013-02-22 21:53 ` Dmitry Gutov
2013-02-22 9:37 ` Andreas Schwab
2013-02-22 21:26 ` Dmitry Gutov
2013-02-22 21:44 ` Eli Zaretskii
2013-02-22 22:00 ` Dmitry Gutov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83k3q0n1l7.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=13775@debbugs.gnu.org \
--cc=dgutov@yandex.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).