Message ID | CAPmGMvhNHp0EbEKhPA3Pu9S7NF-mp_hk36-Y=doJYwGjyxpbSw@mail.gmail.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 130324 invoked by alias); 19 Aug 2019 19:26:11 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 130312 invoked by uid 89); 19 Aug 2019 19:26:11 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy=Reading, quit, H*c:alternative X-HELO: pb-smtp20.pobox.com Received: from pb-smtp20.pobox.com (HELO pb-smtp20.pobox.com) (173.228.157.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 19 Aug 2019 19:26:10 +0000 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 510077D7F2 for <gdb-patches@sourceware.org>; Mon, 19 Aug 2019 15:26:08 -0400 (EDT) (envelope-from jonah@kichwacoders.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=mime-version :references:in-reply-to:from:date:message-id:subject:to:cc :content-type; s=sasl; bh=lkeTcouakeRAD0kxUsUxEMYBACE=; b=unCcGQ 4fFft3QqeIFIBV4EEq9SuGLHyLho4bWp24/IwPhC1EaTpYiJeqiE0xDZGjeU/vIZ chyM0yJ/48gumw9+LBRZ/OpeJR9lP3lUftcp5UL4sVQ1bYl8qmi0zULthcI4vpp3 fN7YECijlpCXwy9JApZ8XZ5kTBUEqLfcff8mA= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 485697D7F1 for <gdb-patches@sourceware.org>; Mon, 19 Aug 2019 15:26:08 -0400 (EDT) (envelope-from jonah@kichwacoders.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kichwacoders.com; h=mime-version:references:in-reply-to:from:date:message-id:subject:to:cc:content-type; s=mesmtp; bh=g76xWFtJzaqXJzZDJnRsCh2GMhuY90GY6FEkir+xP9s=; b=P8ni2fOzWbiv2z7lZ0ljT7kGczPBavEUDgna4lzLvoFKMKhz6utf3Z5/nzXkuSh/sJ9Dihj+8v1nVEobxvzJayST1UoSedtUTD/UFxAs87of7Axmazr9dW7WJJPiqUIAaC8TiPYkRUosJf/PbNIH5kpbyIEEuhDs5GYdVOXV8AU= Received: from mail-qt1-f171.google.com (unknown [209.85.160.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id F1AD27D7EF for <gdb-patches@sourceware.org>; Mon, 19 Aug 2019 15:26:04 -0400 (EDT) (envelope-from jonah@kichwacoders.com) Received: by mail-qt1-f171.google.com with SMTP id b11so3177431qtp.10 for <gdb-patches@sourceware.org>; Mon, 19 Aug 2019 12:26:04 -0700 (PDT) MIME-Version: 1.0 References: <20190530170315.9938-1-tromey@adacore.com> <87zhmkme75.fsf@tromey.com> In-Reply-To: <87zhmkme75.fsf@tromey.com> From: Jonah Graham <jonah@kichwacoders.com> Date: Mon, 19 Aug 2019 15:25:27 -0400 Message-ID: <CAPmGMvhNHp0EbEKhPA3Pu9S7NF-mp_hk36-Y=doJYwGjyxpbSw@mail.gmail.com> Subject: Re: [RFC] Only compute realpath when basenames_may_differ is set To: Tom Tromey <tromey@adacore.com> Cc: gdb-patches@sourceware.org X-Pobox-Relay-ID: 2FE82FD0-C2B7-11E9-9CB3-B0405B776F7B-18936988!pb-smtp20.pobox.com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes |
Commit Message
Jonah Graham
Aug. 19, 2019, 7:25 p.m. UTC
On Fri, 14 Jun 2019 at 10:31, Tom Tromey <tromey@adacore.com> wrote: > I'm checking this in now. > > Tom > Hi Tom, This causes an error with Eclipse CDT's default use case. In CDT the compile lines are basically "gcc -g -c -o file.o ../file.c" with the pwd being a directory under the source: root/ file.c Debug/ Makefile file.o program.elf I have modified the fullname.exp test with a testcase that shows the failure, see the patch below. Here is also a short trace of a session showing the problem: /tmp $ mkdir test && cd test /tmp/test $ echo 'int main() {}' > testcase.c /tmp/test $ mkdir build && cd build /tmp/test/build $ gcc -g ../testcase.c -o testcase /tmp/test/build $ gdb -q testcase Reading symbols from testcase...done. (gdb) b /tmp/test/testcase.c:1 Breakpoint 1 at 0x603: file ../testcase.c, line 1. (gdb) quit /tmp/test/build $ /scratch/gdb/binutils-gdb/gdb/gdb -q testcase Reading symbols from testcase... (gdb) b /tmp/test/testcase.c:1 No source file named /tmp/test/testcase.c. Make breakpoint pending on future shared library load? (y or [n]) n (gdb) quit /tmp/test/build $ gdb --version | head -1 GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git /tmp/test/build $ /scratch/gdb/binutils-gdb/gdb/gdb --version | head -1 GNU gdb (GDB) 8.3.50.20190819-git Thanks, Jonah --- gdb/testsuite/gdb.base/fullname.exp | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) + } +} + # Build the test executable using relative paths not relative to the directory # we'll run GDB from.
Comments
bump. On Mon, 19 Aug 2019 at 15:25, Jonah Graham <jonah@kichwacoders.com> wrote: > > On Fri, 14 Jun 2019 at 10:31, Tom Tromey <tromey@adacore.com> wrote: > >> I'm checking this in now. >> >> Tom >> > > Hi Tom, > > This causes an error with Eclipse CDT's default use case. In CDT the > compile lines are basically "gcc -g -c -o file.o ../file.c" with the pwd > being a directory under the source: > > root/ > file.c > Debug/ > Makefile > file.o > program.elf > > I have modified the fullname.exp test with a testcase that shows the > failure, see the patch below. Here is also a short trace of a session > showing the problem: > > /tmp $ mkdir test && cd test > /tmp/test $ echo 'int main() {}' > testcase.c > /tmp/test $ mkdir build && cd build > /tmp/test/build $ gcc -g ../testcase.c -o testcase > /tmp/test/build $ gdb -q testcase > Reading symbols from testcase...done. > (gdb) b /tmp/test/testcase.c:1 > Breakpoint 1 at 0x603: file ../testcase.c, line 1. > (gdb) quit > /tmp/test/build $ /scratch/gdb/binutils-gdb/gdb/gdb -q testcase > Reading symbols from testcase... > (gdb) b /tmp/test/testcase.c:1 > No source file named /tmp/test/testcase.c. > Make breakpoint pending on future shared library load? (y or [n]) n > (gdb) quit > /tmp/test/build $ gdb --version | head -1 > GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git > /tmp/test/build $ /scratch/gdb/binutils-gdb/gdb/gdb --version | head -1 > GNU gdb (GDB) 8.3.50.20190819-git > > Thanks, > Jonah > > --- > gdb/testsuite/gdb.base/fullname.exp | 30 +++++++++++++++++++++++++++++ > 1 file changed, 30 insertions(+) > > diff --git a/gdb/testsuite/gdb.base/fullname.exp > b/gdb/testsuite/gdb.base/fullname.exp > index 07d6245d15..e306400b2b 100644 > --- a/gdb/testsuite/gdb.base/fullname.exp > +++ b/gdb/testsuite/gdb.base/fullname.exp > @@ -96,6 +96,36 @@ if { [gdb_breakpoint [standard_output_file > tmp-${srcfile}]:${line} {no-message}] > fail $msg > } > > +# Build the test executable using a relative path with /../ . > +file mkdir [standard_output_file ""]/build > +with_cwd [standard_output_file ""]/build { > + if { [gdb_compile ../tmp-${srcfile} \ > + "${binfile}" executable {debug}] != "" } { > + return -1 > + } > + > + gdb_exit > + gdb_start > + gdb_load ${binfile} > + > + set msg "set breakpoint by full path before loading symbols - built > relative with .." > + if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} > {no-message}] != 0 } { > + pass $msg > + } else { > + fail $msg > + } > + > + gdb_test "break main" \ > + "Breakpoint.*at.*line.*" "set breakpoint at main - built relative > with .." > + > + set msg "set breakpoint by full path after loading symbols - built > relative with .." > + if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} > {no-message}] != 0 } { > + pass $msg > + } else { > + fail $msg > + } > +} > + > # Build the test executable using relative paths not relative to the > directory > # we'll run GDB from. > > -- > 2.22.0 >
On Thu, 12 Sep 2019 at 13:47, Jonah Graham <jonah@kichwacoders.com> wrote: > bump. > > > On Mon, 19 Aug 2019 at 15:25, Jonah Graham <jonah@kichwacoders.com> wrote: > >> >> On Fri, 14 Jun 2019 at 10:31, Tom Tromey <tromey@adacore.com> wrote: >> >>> I'm checking this in now. >>> >>> Tom >>> >> >> Hi Tom, >> >> This causes an error with Eclipse CDT's default use case. In CDT the >> compile lines are basically "gcc -g -c -o file.o ../file.c" with the pwd >> being a directory under the source: >> >> root/ >> file.c >> Debug/ >> Makefile >> file.o >> program.elf >> >> I have modified the fullname.exp test with a testcase that shows the >> failure, see the patch below. Here is also a short trace of a session >> showing the problem: >> >> /tmp $ mkdir test && cd test >> /tmp/test $ echo 'int main() {}' > testcase.c >> /tmp/test $ mkdir build && cd build >> /tmp/test/build $ gcc -g ../testcase.c -o testcase >> /tmp/test/build $ gdb -q testcase >> Reading symbols from testcase...done. >> (gdb) b /tmp/test/testcase.c:1 >> Breakpoint 1 at 0x603: file ../testcase.c, line 1. >> (gdb) quit >> /tmp/test/build $ /scratch/gdb/binutils-gdb/gdb/gdb -q testcase >> Reading symbols from testcase... >> (gdb) b /tmp/test/testcase.c:1 >> No source file named /tmp/test/testcase.c. >> Make breakpoint pending on future shared library load? (y or [n]) n >> (gdb) quit >> /tmp/test/build $ gdb --version | head -1 >> GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git >> /tmp/test/build $ /scratch/gdb/binutils-gdb/gdb/gdb --version | head -1 >> GNU gdb (GDB) 8.3.50.20190819-git >> >> Thanks, >> Jonah >> >> --- >> gdb/testsuite/gdb.base/fullname.exp | 30 +++++++++++++++++++++++++++++ >> 1 file changed, 30 insertions(+) >> >> diff --git a/gdb/testsuite/gdb.base/fullname.exp >> b/gdb/testsuite/gdb.base/fullname.exp >> index 07d6245d15..e306400b2b 100644 >> --- a/gdb/testsuite/gdb.base/fullname.exp >> +++ b/gdb/testsuite/gdb.base/fullname.exp >> @@ -96,6 +96,36 @@ if { [gdb_breakpoint [standard_output_file >> tmp-${srcfile}]:${line} {no-message}] >> fail $msg >> } >> >> +# Build the test executable using a relative path with /../ . >> +file mkdir [standard_output_file ""]/build >> +with_cwd [standard_output_file ""]/build { >> + if { [gdb_compile ../tmp-${srcfile} \ >> + "${binfile}" executable {debug}] != "" } { >> + return -1 >> + } >> + >> + gdb_exit >> + gdb_start >> + gdb_load ${binfile} >> + >> + set msg "set breakpoint by full path before loading symbols - built >> relative with .." >> + if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} >> {no-message}] != 0 } { >> + pass $msg >> + } else { >> + fail $msg >> + } >> + >> + gdb_test "break main" \ >> + "Breakpoint.*at.*line.*" "set breakpoint at main - built >> relative with .." >> + >> + set msg "set breakpoint by full path after loading symbols - built >> relative with .." >> + if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} >> {no-message}] != 0 } { >> + pass $msg >> + } else { >> + fail $msg >> + } >> +} >> + >> # Build the test executable using relative paths not relative to the >> directory >> # we'll run GDB from. >> >> -- >> 2.22.0 >> > Tom de Vries has fixed the behaviour as part of PR24687. Can the testcase I wrote for this case (that best represents CDT's use case) be added to GDB testsuite. The original email with the testcase that can be added to gdb.base/fullname.exp is https://sourceware.org/ml/gdb-patches/2019-08/msg00421.html Thank you, Jonah
diff --git a/gdb/testsuite/gdb.base/fullname.exp b/gdb/testsuite/gdb.base/fullname.exp index 07d6245d15..e306400b2b 100644 --- a/gdb/testsuite/gdb.base/fullname.exp +++ b/gdb/testsuite/gdb.base/fullname.exp @@ -96,6 +96,36 @@ if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}] fail $msg } +# Build the test executable using a relative path with /../ . +file mkdir [standard_output_file ""]/build +with_cwd [standard_output_file ""]/build { + if { [gdb_compile ../tmp-${srcfile} \ + "${binfile}" executable {debug}] != "" } { + return -1 + } + + gdb_exit + gdb_start + gdb_load ${binfile} + + set msg "set breakpoint by full path before loading symbols - built relative with .." + if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}] != 0 } { + pass $msg + } else { + fail $msg + } + + gdb_test "break main" \ + "Breakpoint.*at.*line.*" "set breakpoint at main - built relative with .." + + set msg "set breakpoint by full path after loading symbols - built relative with .." + if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}] != 0 } { + pass $msg + } else { + fail $msg