From: Pedro Alves <palves@redhat.com>
To: Gary Benson <gbenson@redhat.com>
Cc: Luis Machado <lgustavo@codesourcery.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Remote debugging without a binary (regression)
Date: Wed, 17 Feb 2016 14:40:00 -0000 [thread overview]
Message-ID: <56C48676.8070404@redhat.com> (raw)
In-Reply-To: <20160217135324.GC24631@blade.nx>
On 02/17/2016 01:53 PM, Gary Benson wrote:
> Pedro Alves wrote:
>> On 02/12/2016 10:31 AM, Gary Benson wrote:
>>> FWIW I tried this (both on the same machine):
>>>
>>> gdbserver :9999 /bin/ls
>>> gdb -q -ex "set sysroot /whatever" -ex "target remote :9999"
>>>
>>> and got this:
>>>
>>> Reading symbols from /bin/ls...(no debugging symbols found)...done.
>>>
>>> which I think is an error: the sysroot is being ignored.
>>
>> I agree. If you tell gdb about a sysroot, then I can't think why
>> you'd want it to try opening an absolute filename on the host,
>> outside the sysroot.
>>
>> (caching and buildid matching aside)
>
> There isn't any caching or buildid matching, the logic in
> exec_file_locate_attach is wrong.
Yes, what I meant was -- a valid reason I'd see gdb trying to open a file
on the host outside the sysroot would be for smarter buildid matching and
local caching of (hunks of) files. But we don't have that.
> It might even be the cause
> of the exception Luis is seeing so with luck we can avoid a
> try-catch in remote_add_inferior. I'm putting together a patch
> now.
Yes, if GDB ends up not trying to open any file, then it'll mask off
the exception Luis is seeing.
However, even if the sysroot points at the location with a
valid copy of the file, if the file is NOT readable, then we'll
still throw and close the connection.
Wait, actually, that's actually a good way to add a test to the testsuite
to cover Luis's use case, even without separate filesystems:
gdbserver:
$ ./gdbserver/gdbserver :9999 ~/gdb/tests/threads&
$ chmod 000 ~/gdb/tests/threads
gdb:
(gdb) tar remote :9999
Remote debugging using :9999
Reading /home/pedro/gdb/tests/threads from remote target...
warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.
"target:/home/pedro/gdb/tests/threads": could not open as an executable file: Permission denied.
(gdb) maint print target-stack
The current target stack is:
- None (None)
(gdb)
Above we dropped the connection...
Thanks,
Pedro Alves
next prev parent reply other threads:[~2016-02-17 14:40 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-11 14:19 Luis Machado
2016-02-11 16:35 ` Gary Benson
2016-02-11 17:06 ` Luis Machado
2016-02-11 17:31 ` Pedro Alves
2016-02-11 17:42 ` Luis Machado
2016-02-12 10:31 ` Gary Benson
2016-02-12 10:59 ` Luis Machado
2016-02-12 15:24 ` Pedro Alves
2016-02-17 13:53 ` Gary Benson
2016-02-17 14:40 ` Pedro Alves [this message]
2016-02-17 17:02 ` [OB PATCH] Add missing cleanup in exec_file_locate_attach Gary Benson
2016-02-17 17:05 ` Gary Benson
2016-02-17 18:11 ` Luis Machado
2016-02-18 9:54 ` Gary Benson
2016-02-18 17:05 ` [PATCH] Fix logic " Gary Benson
2016-02-18 17:28 ` Pedro Alves
2016-02-19 10:24 ` Gary Benson
2016-02-19 10:33 ` Luis Machado
2016-02-19 11:21 ` [PATCH v2] " Gary Benson
2016-02-19 15:38 ` Luis Machado
2016-02-22 10:40 ` Gary Benson
2016-02-22 11:37 ` Luis Machado
2016-02-22 13:51 ` Gary Benson
2016-02-22 22:00 ` Luis Machado
2016-02-22 22:50 ` Luis Machado
2016-02-22 23:00 ` Pedro Alves
2016-02-23 0:04 ` Luis Machado
2016-02-23 0:13 ` Pedro Alves
2016-02-23 0:16 ` Luis Machado
2016-02-23 11:27 ` Gary Benson
2016-02-23 11:43 ` Pedro Alves
2016-02-23 12:15 ` Gary Benson
2016-02-23 12:20 ` Pedro Alves
2016-02-23 11:55 ` Pedro Alves
2016-02-24 11:56 ` Gary Benson
2016-02-12 15:29 ` [PATCH] Remote debugging without a binary (regression) Pedro Alves
2016-02-12 16:08 ` Luis Machado
2016-02-12 16:36 ` Pedro Alves
2016-02-12 17:31 ` Luis Machado
2016-02-17 11:46 ` Pedro Alves
2016-02-18 12:30 ` Gary Benson
2016-02-18 12:40 ` Luis Machado
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=56C48676.8070404@redhat.com \
--to=palves@redhat.com \
--cc=gbenson@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=lgustavo@codesourcery.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).