Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Don Breazeal <donb@codesourcery.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	"palves@redhat.com" <palves@redhat.com>
Subject: Re: [PATCH 1/5] Extended-remote exec events
Date: Thu, 16 Jul 2015 17:06:00 -0000	[thread overview]
Message-ID: <55A7E4A0.2030203@codesourcery.com> (raw)
In-Reply-To: <55A7DD57.3030205@gmail.com>

On 7/16/2015 9:35 AM, Yao Qi wrote:
> On 16/07/15 16:51, Don Breazeal wrote:
>> You make a good point, GDBserver doesn't handle that case.  I assume
>> that's what this is about:
>> ---
>> warning: Selected architecture i386 is not compatible with reported
>> target architecture i386:x86-64
>> ---
>> I'll investigate.
> 
> This messages shows that GDB (rather than GDBserver) doesn't handle
> that case.  AFAIK, GDBserver doesn't handle that case either.
> 
> I am working on patches create target description at the right time
> in GDBserver, derived from this patch
> https://sourceware.org/ml/gdb-patches/2015-07/msg00403.html
> Current GDBserver creates target description too early, if we use
> --wrapper option, GDBserver created target description according
> to wrapper program, instead of the program we want to debug, which
> is wrong.
> 

There is a difference between the native and gdbserver behavior with
multi-arch exec.  Native seems to handle multi-arch exec events:
-------------------------------------------------------------------
Reading symbols from ./execler64...done.
(gdb) b main
Breakpoint 1 at 0x4006a4: file execler.c, line 19.
(gdb) r
Starting program: /home/dbreazea/junk/execler64

Breakpoint 1, main (argc=1, argv=0x7fffffffe848) at execler.c:19
19	  printf ("starting %s\n", argv[0]);
(gdb) info reg
rax            0x7ffff7dd9ea8	140737351884456
rbx            0x0	0
rcx            0x0	0
---etc---
(gdb) catch exec
Catchpoint 2 (exec)
(gdb) c
Continuing.
starting /home/dbreazea/junk/execler64
in execler
process 5588 is executing new program: /home/dbreazea/junk/execee32
warning: the debug information found in "/lib/ld-2.11.1.so" does not
match "/lib/ld-linux.so.2" (CRC mismatch).


Catchpoint 2 (exec'd /home/dbreazea/junk/execee32), 0xf7fe0850 in ?? ()
   from /lib/ld-linux.so.2
(gdb) info reg
eax            0x0	0
ecx            0x0	0
---etc---
---------------------------------------------------------------------

While the gdbserver case looks like this, unfortunately:

---------------------------------------------------------------------
Reading symbols from ./execler64...done.
(gdb) tar ext localhost:51111
Remote debugging using localhost:51111
Reading symbols from target:/lib64/ld-linux-x86-64.so.2...(no debugging
symbols found)...done.
0x00007ffff7dddaf0 in ?? () from target:/lib64/ld-linux-x86-64.so.2
(gdb) b main
Breakpoint 1 at 0x4006a4: file execler.c, line 19.
(gdb) c
Continuing.

Breakpoint 1, main (argc=1, argv=0x7fffffffe9d8) at execler.c:19
19	  printf ("starting %s\n", argv[0]);
(gdb) info reg
rax            0x7ffff7dd9ea8	140737351884456
rbx            0x0	0
rcx            0x0	0
---etc---
(gdb) catch exec
Catchpoint 2 (exec)
(gdb) c
Continuing.
Thread 5561.5561 is executing new program: /home/dbreazea/junk/execee32
warning: Selected architecture i386 is not compatible with reported
target architecture i386:x86-64
warning: the debug information found in "target:/lib/ld-2.11.1.so" does
not match "target:/lib/ld-linux.so.2" (CRC mismatch).

Remote 'g' packet reply is too long: 000000000000000000000000000000...
---several 'g' packet errors
(gdb) q
A debugging session is active.

	Inferior 1 [process 5561] will be killed.

Quit anyway? (y or n) y
warning: Selected architecture i386 is not compatible with reported
target architecture i386:x86-64
--------------------------------------------------------------------

At first glance it looks like in linux_low_filter_event, the execing
inferior needs to be marked as a 'new_inferior'
(proc->priv->new_inferior) in order to do the right thing and call
the_low_target.arch_setup ().  That may require some re-ordering of
things in linux-low.c:linux_low_filter_event, since handle_extended_wait
and the exec event handling happen after the arch setup.

Do you think the work you are doing will address this, or should I
continue looking at a fix for the problem above?  They seem like they
are related, but separate issues.

thanks
--Don


  reply	other threads:[~2015-07-16 17:06 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-15 21:49 [PATCH 0/5] Extended-remote follow exec Don Breazeal
2015-07-15 21:50 ` [PATCH 1/5] Extended-remote exec events Don Breazeal
2015-07-16 14:01   ` Yao Qi
2015-07-16 15:52     ` Don Breazeal
2015-07-16 16:35       ` Yao Qi
2015-07-16 17:06         ` Don Breazeal [this message]
2015-07-17 11:55           ` Yao Qi
2015-07-15 21:50 ` [PATCH 2/5] Extended-remote exec catchpoints Don Breazeal
2015-08-13 15:00   ` Pedro Alves
2015-07-15 21:50 ` [PATCH 3/5] Extended-remote support for exec event tests Don Breazeal
2015-07-15 21:51 ` [PATCH 4/5] Eliminate spurious warnings from remote exec Don Breazeal
2015-07-15 21:51 ` [PATCH 5/5] Extended-remote exec event docs Don Breazeal
2015-07-16  2:39   ` Eli Zaretskii
2015-07-30 23:19 ` [PATCH v2 0/5] Extended-remote exec events Don Breazeal
2015-07-30 23:19   ` [PATCH v2 1/5] Extended-remote follow exec Don Breazeal
2015-08-13 14:50     ` Pedro Alves
2015-07-30 23:19   ` [PATCH v2 2/5] Extended-remote exec catchpoints Don Breazeal
2015-07-30 23:20   ` [PATCH v2 4/5] Eliminate spurious warnings from remote exec Don Breazeal
2015-08-13 15:38     ` Pedro Alves
2015-07-30 23:20   ` [PATCH v2 5/5] Extended-remote exec event docs Don Breazeal
2015-07-31  6:36     ` Eli Zaretskii
2015-07-31 17:06       ` Don Breazeal
2015-08-13 15:43     ` Pedro Alves
2015-07-30 23:20   ` [PATCH v2 3/5] Extended-remote support for exec event tests Don Breazeal
2015-08-13 15:22     ` Pedro Alves
2015-09-09 23:05   ` [PATCH v3 0/4] Extended-remote exec events Don Breazeal
2015-09-09 23:06     ` [PATCH v3 3/4] Extended-remote support for exec event tests Don Breazeal
2015-09-10 13:26       ` Pedro Alves
2015-09-09 23:06     ` [PATCH v3 1/4] Extended-remote follow exec Don Breazeal
     [not found]       ` <55F17AFA.5080102@redhat.com>
2015-09-10 22:56         ` Don Breazeal
2015-09-10 23:00           ` Don Breazeal
2015-09-11  8:34           ` Pedro Alves
2015-09-11 18:38             ` [pushed][PATCH " Don Breazeal
2015-09-11 18:38               ` [pushed][PATCH v3 2/4] Extended-remote exec catchpoints Don Breazeal
2015-09-11 18:38               ` [pushed][PATCH v3 3/4] Extended-remote exec test Don Breazeal
2015-09-15 15:45                 ` Pedro Alves
2015-09-15 15:53                   ` Don Breazeal
2015-09-15 15:58                     ` Pedro Alves
2015-09-15 16:00                       ` Breazeal, Don
2015-09-15 16:28                         ` Pedro Alves
2015-09-11 18:39               ` [pushed][PATCH v3 4/4] Extended-remote exec event docs Don Breazeal
2015-09-15  8:56               ` [pushed][PATCH v3 1/4] Extended-remote follow exec Yao Qi
2015-09-15 16:12                 ` Don Breazeal
2015-09-15 16:31                   ` Yao Qi
2015-09-30 16:20               ` Pedro Alves
2015-09-30 16:22                 ` Breazeal, Don
2016-12-08 11:54               ` Thomas Schwinge
2017-02-17 16:45                 ` Pedro Alves
2019-02-14 16:42                   ` Thomas Schwinge
2019-02-14 17:26                     ` Tom Tromey
2019-02-14 23:11                       ` Tom Tromey
2015-09-09 23:06     ` [PATCH v3 2/4] Extended-remote exec catchpoints Don Breazeal
2015-09-09 23:06     ` [PATCH v3 4/4] Extended-remote exec event docs Don Breazeal
2015-09-10 15:23       ` Eli Zaretskii

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=55A7E4A0.2030203@codesourcery.com \
    --to=donb@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=qiyaoltc@gmail.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