public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Vyacheslav Barinov <v.barinov@samsung.com>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Check if /proc is usable on gdbserver start
Date: Wed, 04 Jul 2018 11:19:00 -0000	[thread overview]
Message-ID: <20180704111926eucas1p13d4a3f7ef6ca0341162da4dab2b80770~_Jmt0fTkD2770727707eucas1p1K@eucas1p1.samsung.com> (raw)
In-Reply-To: <85d64cca-716b-b098-dc1c-b5a3e978fe3e@redhat.com> (Pedro	Alves's message of "Wed, 4 Jul 2018 10:57:13 +0100")

Pedro Alves <palves@redhat.com> writes:
> On 07/04/2018 08:34 AM, Vyacheslav Barinov wrote:
>> Hello,
>> 
>> Just lost a couple of hours trying to find while gdb can't connect to gdbserver
>> in my debug session.
>> 
>> There's a buildroot where I want to debug a binary, and I tried to connect to
>> it from outside, but got very weird errors like architecture mismatch or
>> protocol errors. At last, after switching on '--debug' for gdbserver I found a
>> message 'Can't open /proc/pid/' message and suddenly found that I forgot to
>> mount procfs in my buildroot.
>> 
>> I think it's better to check this before running gdbserver.
> I'm not certain that it's a good idea to absolute require a /proc mount.
> Even though we gradually moved into relying on /proc more (or better said, on
> libthread_db less), over the years we've also tried to be tolerant to
> missing /proc.  I believe people had use cases for that (very constrained
> containers or embedded systems?  I don't recall exactly though...)
>
> I assume that you're on either Aarch64 or x86_64 and that the architecture
> mismatch is because gdbserver couldn't determine whether the process
> was a 64-bit process, because that is done by reading the /proc/PID/exe
> file.  Maybe other 32-bit- or 64-bit-only archs still minimally work
> without /proc.
>
> I'm thinking that it may be prudent to downgrade this to a warning.
> Would that work for you?
>
> Thanks,
> Pedro Alves
You are right, I use x86_64 architecture.

Okay, if the gdbserver can work without /proc, then just warning for cases
like this is enough.

Best Regards,
Vyacheslav Barinov

  reply	other threads:[~2018-07-04 11:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20180704073447eucas1p1541c2021074eb8faa58e49f1abe8d733@eucas1p1.samsung.com>
2018-07-04  7:34 ` Vyacheslav Barinov
2018-07-04  9:57   ` Pedro Alves
2018-07-04 11:19     ` Vyacheslav Barinov [this message]
2018-07-04 15:23       ` [pushed] Warn if /proc is not accessible (was: Re: [PATCH] Check if /proc is usable on gdbserver start) Pedro Alves

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='20180704111926eucas1p13d4a3f7ef6ca0341162da4dab2b80770~_Jmt0fTkD2770727707eucas1p1K@eucas1p1.samsung.com' \
    --to=v.barinov@samsung.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).