Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] New substitute-path commands
Date: Fri, 07 Jul 2006 09:40:00 -0000	[thread overview]
Message-ID: <u8xn5rbx7.fsf@gnu.org> (raw)
In-Reply-To: <20060707052219.GA971@adacore.com> (message from Joel Brobecker 	on Thu, 6 Jul 2006 22:22:19 -0700)

> Date: Thu, 6 Jul 2006 22:22:19 -0700
> From: Joel Brobecker <brobecker@adacore.com>
> 
> Added bonus, I included a documentation patch for review.

Thanks.  My comments are below.

> -     A non valid file descriptor is returned. ( the return value is negitive ) 
> +     A non valid file descriptor is returned. ( the return value is negative ) 

"non valid"?  Is that correct English?  I think "invalid" is better.

> +Add a source path substitution rule. If a substitution rule was previously\n\
                                      ^^^
Two spaces here, please.

> +Remove the current source path substitution rule.  Has no effect\n\
> +if no path substitution rule was previously specified."),

"This has no effect" is better, I think.

> +In addition to the source path, @value{GDBN} provides a set of commands
> +that manage a source path substitution rule.

The term "substitution rule" should be explained somewhere.  I think
the best place to do so is where the command "set substitute-path" is
described (see below), in which case you should add here a
cross-reference to that description.

>                                                  Instead of attempting to
> +locate the source file using the original source path as described above,
> +it will first apply the substitution rule to that source path, and use
> +the resulting path instead.

If this was meant to explain what is a substitution rule, then it
doesn't explain enough.

> +were compiled. To define a source path substitution rule, use the
> +@code{set substitute-path} command.

A cross-reference here would be a good idea.

> +Using the previous example, suppose the @file{foo-1.0} tree has been
> +moved from @file{/usr/src} to @file{/mnt/cross}, then you can tell
> +GDB to replace @file{/usr/src} in all source path names with
> +@file{/mnt/cross}.  The first lookup will then be
> +@file{/mnt/cross/foo-1.0/lib/foo.c} in place of the original location
> +of @file{/usr/src/foo-1.0/lib/foo.c}.

This is a start, but it lacks the "set substitute-path" command to go
with the example.

> +@item set substitute-path @var{FROM} @var{TO}

The arguments of @var{} should not be in UPPER case.  They are
automatically upcased by makeinfo when it produces the Info manual,
but in other formats they come out in italics, so having them in upper
case in the source will produce less optimal results.

> +@kindex set substitute-path
> +Define a source path substitution rule.  The new substitution rule
> +replaces any rule previously defined.

As I said above, an explanation of what is a substitution rule is in
order here.  Something like this:

  A @dfn{substitution rule} specifies how to rewrite source
  directories stored in the program's debug information in case the
  sources were moved to a different directory between compilation and
  debugging.  @value{GDBN} does a simple string replacement of each
  occurrence of @var{from} with @var{to} in the directory part of the
  source file name, and uses the result instead of the original file
  name to look up the sources.

  For example, if the file @file{/foo/bar/baz.c} was moved to
  @file{mnt/cross/baz.c}, then the command

  @smallexample
  (@value{GDBP}) set substitute-path /usr/src /mnt/cross
  @end smallexample

  @noindent
  will tell @value{GDBN} to replace @samp{/usr/src} with
  @samp{/mnt/cross}, which will allow @value{GDBN} to find the file
  @file{baz.c} even though it was moved.


  reply	other threads:[~2006-07-07  9:40 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-05 21:58 Joel Brobecker
2006-07-05 22:49 ` Andreas Schwab
2006-07-05 23:01 ` Daniel Jacobowitz
2006-07-06  4:47   ` Joel Brobecker
2006-07-06 16:07     ` PAUL GILLIAM
2006-07-06 16:30       ` Daniel Jacobowitz
2006-07-06 21:28         ` Joel Brobecker
2006-07-07  5:22         ` Joel Brobecker
2006-07-07  9:40           ` Eli Zaretskii [this message]
2006-07-07 19:12             ` Joel Brobecker
2006-07-08 12:19               ` Eli Zaretskii
2006-07-10  5:40                 ` Joel Brobecker
2006-07-10 19:53                   ` Eli Zaretskii
2006-07-10 21:47                     ` Joel Brobecker
2006-07-10 21:51                       ` Daniel Jacobowitz
2006-07-10 21:56                         ` Joel Brobecker
2006-07-10 21:58                           ` Daniel Jacobowitz
2006-07-11  3:24                       ` Eli Zaretskii
2006-07-07 10:39           ` Andrew STUBBS
2006-07-07 16:12             ` Joel Brobecker
2006-07-07 16:45               ` Andrew STUBBS
2006-07-07 17:20                 ` Joel Brobecker
2006-07-11 12:47           ` Daniel Jacobowitz
2006-07-11 20:30             ` Joel Brobecker
2006-07-11 20:33               ` Daniel Jacobowitz
2006-07-11 20:45                 ` Joel Brobecker
2006-07-11 22:25             ` Joel Brobecker
2006-07-11 22:31               ` Christopher Faylor
2006-07-11 22:50               ` Daniel Jacobowitz
2006-07-11 23:00                 ` Joel Brobecker
2006-07-12  3:22                 ` Eli Zaretskii
2006-07-12  3:47                   ` Daniel Jacobowitz
2006-07-12  4:50                     ` Joel Brobecker
2006-07-12 14:09                       ` Daniel Jacobowitz
2006-07-06  3:31 ` Eli Zaretskii
2006-07-06  4:46   ` Joel Brobecker
2006-07-06  9:36 ` Andrew STUBBS
2006-07-06 21:19 ` Jason Molenda

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=u8xn5rbx7.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sources.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