Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] Disable child VMA randomizations
Date: Sat, 07 Jun 2008 20:43:00 -0000	[thread overview]
Message-ID: <ud4mtm0xp.fsf@gnu.org> (raw)
In-Reply-To: <20080607195343.GA10039@host0.dyn.jankratochvil.net>

> Date: Sat, 7 Jun 2008 21:53:43 +0200
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
> 
> the processes map their addresses randomly by default.  It can make the
> debugging inconvenient as varous addresses are different on each run.
> 
> This feature was suggested by Jakub Jelinek.  One can also already wrap whole
> GDB by a script calling: setarch `uname -m` -R

Thanks.  I have a few comments.

> +static void
> +show_disable_randomization (struct ui_file *file, int from_tty,
> +			    struct cmd_list_element *c, const char *value)
> +{
> +  fprintf_filtered (file, _("\
> +Whether we disable the randomization of the virtual address space of\n\
> +a spawned child is %s.\n"),
> +		    value);

That longish sentence could be made both shorter and more clear.  How
about this one:

  "Disabling randomization of debuggee's virtual address space is %s."

> +  add_setshow_boolean_cmd ("disable-randomization", class_support,
> +			   &disable_randomization, _("\
> +Set mode for inserting breakpoints."), _("\
> +Show mode for inserting breakpoints."), _("\

"breakpoints"?  Copy/paste error, right?

> +When this mode is on (which is the default), the randomization of\n\
> +the virtual address space is disabled (turns on ADDR_NO_RANDOMIZE).\n\
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^
What is this supposed to tell Joe Random Hacker who uses GDB to debug
his/her program?  What is ADDR_NO_RANDOMIZE?

> +Standalone programs run with the randomization enabled by default."),

On some platforms, right?

>                                                       While the addresses
> +get assigned differently on each run some subtle bugs may be reproducible only
> +with specially assigned addresses possibly not reachable with the default
> +setting of @kbd{set disable-randomization on}.

Can you explain this sentence?  I'd like to suggest a better wording,
but I can't do that unless I understand what is it that you are trying
to say here.

> +PIE executables (type @code{ET_DYN}, compiled by @code{gcc -fPIE -pie}) have
> +randomized everything - the executable base address, shared libraries base
> +address (their prelinking is ignored), mmap areas, stack and heap.  Regular
> +executables (type @code{ET_EXEC}) do not have randomized their base address,
> +shared libraries base address is ranomized only for non-prelinked libraries,
> +mmap, stack and heap are still randomized.

There's too much unexplained technical details here, so much so that
this paragraph sounds like it was meant only for the initiated.  What
are ET_DYN and ET_EXEC types? why is prelinking relevant? etc.  Again,
please explain what you are trying to say here, and why it might be
useful for readers of the manual, and I will suggest an alternative
wording.

There are also Texinfo problems in the above: the GCC command should
have the @command markup, not @code; use 3 dashes in a row, as in
"---", to produce a dash, rather than a minus sign, in the manual; and
"ranomized" is a typo.

Other than that, the patch for the manual is okay.  Thanks.


  parent reply	other threads:[~2008-06-07 20:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-07 19:54 Jan Kratochvil
2008-06-07 20:41 ` Andreas Schwab
2008-06-08  9:43   ` Jan Kratochvil
2008-06-08 10:39     ` Eli Zaretskii
2008-06-08 11:38       ` Jan Kratochvil
2008-06-07 20:43 ` Eli Zaretskii [this message]
2008-06-08 15:14 ` Mark Kettenis
2008-06-08 16:44   ` Jan Kratochvil
2008-06-26 15:52     ` Daniel Jacobowitz
2008-06-27 23:19       ` Jan Kratochvil
2008-07-09 21:15         ` Daniel Jacobowitz
2008-07-10  9:34           ` Jan Kratochvil
2008-07-12 21:16         ` Ulrich Weigand
2008-07-13  6:55           ` Jan Kratochvil
2008-07-15 18:41             ` Ulrich Weigand

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ud4mtm0xp.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox