]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
doc: fix false claim about second argument to gdb
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 18 Jun 2019 16:40:13 +0000 (12:40 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 18 Jun 2019 16:40:13 +0000 (12:40 -0400)
commit4ed4690fc21b1d052092299f820f48694f3ef3eb
treea62a922e607484fa66c2872a719215515d46df85
parentd20ed5fd574ce1b72543c2963fa53946eb2225de
doc: fix false claim about second argument to gdb

Section "Invoking GDB" of the manual states that if you try to launch
gdb with:

  gdb program 1234

it will try to attach to the process with id 1234, unless there is a
file named 1234 in the current working directory, in which case it will
try to open that file as a core.  In fact, when the second argument
starts with a digit, GDB tries to attach to process 1234 first, before
trying to open file 1234 as a core.  So that last remark is not true and
therefore this patch removes it.

The same remark is present in the man page, so it is removed there too.

Section "Choosing Files" correctly states:

  If the second argument begins with a decimal digit, GDB will first
  attempt to attach to it as a process, and if that fails, attempt to
  open it as a corefile.

so it is unchanged.

Finally, the man page has an additional detail compared to section
"Invoking GDB", regarding the use of the -p switch, so I added the same
detail to the "Invoking GDB" section.

gdb/doc/ChangeLog:

* gdb.texinfo (Invoking GDB): Remove sentence about how GDB
deals with a file that has the same name as the specified pid to
attach to.  Add example using -p option.
(gdb man): Remove same sentence as in previous item.
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo