Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simon.marchi@ericsson.com>,
	       Jan Kratochvil <jan.kratochvil@redhat.com>,
	       Simon Marchi <simon.marchi@polymtl.ca>
Cc: gdb-patches@sourceware.org
Subject: Re: [testsuite patch] i386 regression for funcargs.exp [Re: [PATCH 3/3] Remove HP-UX references fom testsuite]
Date: Mon, 11 Jan 2016 13:38:00 -0000	[thread overview]
Message-ID: <5693B046.60909@redhat.com> (raw)
In-Reply-To: <569026E5.4060502@ericsson.com>

On 01/08/2016 09:15 PM, Simon Marchi wrote:

> I also don't see this on Ubuntu 14.04.3 LTS, gdb master, gcc 4.8.4.
> 

I don't see it either on F20, gcc 4.8.3.  But I do see it with
gcc 6 (20151117, getting old, but what I had handy).

The difference is that with newer GCC there's an extra instruction
after the call which is still assigned to line 583:

$ diff -up /tmp/4.8.3 /tmp/6.0.0 -U 1000
--- /tmp/4.8.3  2016-01-11 12:37:39.611089156 +0000
+++ /tmp/6.0.0  2016-01-11 13:21:00.021127976 +0000
@@ -1,27 +1,30 @@
 583       (*pointer_to_call0a) (c, s, i, l);    /* First step into call0a.  */
    mov    0x804d060,%ebx
    mov    0x804d050,%ecx
    movzwl 0x804d040,%eax
    movswl %ax,%edx
    movzbl 0x804d030,%eax
    movsbl %al,%eax
-   mov    %ebx,0xc(%esp)
-   mov    %ecx,0x8(%esp)
-   mov    %edx,0x4(%esp)
-   mov    %eax,(%esp)
-   mov    0x7c(%esp),%eax
+   push   %ebx
+   push   %ecx
+   push   %edx
+   push   %eax
+   mov    -0x1c(%ebp),%eax
    call   *%eax
+   add    $0x10,%esp

 584       (*pointer_to_call0a) (c, s, i, l);    /* Second step into call0a.  */
    mov    0x804d060,%ebx
    mov    0x804d050,%ecx
    movzwl 0x804d040,%eax
    movswl %ax,%edx
    movzbl 0x804d030,%eax
    movsbl %al,%eax
-   mov    %ebx,0xc(%esp)
-   mov    %ecx,0x8(%esp)
-   mov    %edx,0x4(%esp)
-   mov    %eax,(%esp)
-   mov    0x7c(%esp),%eax
+   push   %ebx
+   push   %ecx
+   push   %edx
+   push   %eax
+   mov    -0x1c(%ebp),%eax
    call   *%eax
+   add    $0x10,%esp
+

I don't know why -m32 changed to push/add instead of mov while 64-bit hasn't.

> But if there is a configuration where this is needed, then yes, it should be re-added.

I agree.

On 01/08/2016 07:30 PM, Jan Kratochvil wrote:
>      gdb_test_multiple "finish" "finish from indirectly called function" {
> +	-re "\\(\\*pointer_to_call0a\\) \\(c, s, i, l\\);.*First.*$gdb_prompt $" {
> +	    # On i386, gdb finishes at one line earlier than on x86_64.
> +	    # Therefore, an extra "step" is necessary to continue the test.

This is most likely needed on non-x86 ports as well.
I think we should say:

 # If the branch instruction is not the last instruction in the function call
 # line, we'll stop at that line, and need an extra "step" to continue the test.

OK with that change.

Thanks,
Pedro Alves

> +	    send_gdb "step\n"
> +	    exp_continue
> +	}
>  	-re ".*\\(\\*pointer_to_call0a\\) \\(c, s, i, l\\);.*Second.*$gdb_prompt $" {
>  	    pass "finish from indirectly called function"
>  	}


  reply	other threads:[~2016-01-11 13:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-19 23:30 [PATCH 1/3] Remove HP-UX reference in testsuite/configure.ac Simon Marchi
2015-12-19 23:31 ` [PATCH 3/3] Remove HP-UX references fom testsuite Simon Marchi
2015-12-20  5:08   ` Joel Brobecker
2015-12-20 15:45     ` Simon Marchi
2015-12-21 12:48   ` Pedro Alves
2015-12-21 16:57     ` Simon Marchi
2015-12-21 17:07       ` Pedro Alves
2015-12-21 17:53         ` Simon Marchi
2016-01-08 19:30           ` [testsuite patch] i386 regression for funcargs.exp [Re: [PATCH 3/3] Remove HP-UX references fom testsuite] Jan Kratochvil
2016-01-08 21:15             ` Simon Marchi
2016-01-11 13:38               ` Pedro Alves [this message]
2016-01-11 21:29                 ` [commit] " Jan Kratochvil
2015-12-20  4:49 ` [PATCH 1/3] Remove HP-UX reference in testsuite/configure.ac Joel Brobecker
2015-12-20 15:00   ` Simon Marchi

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=5693B046.60909@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=simon.marchi@ericsson.com \
    --cc=simon.marchi@polymtl.ca \
    /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