From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: gdb-patches@sourceware.org
Subject: Re: ping: [patch 2/2] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 #5
Date: Tue, 12 Jun 2012 07:37:00 -0000 [thread overview]
Message-ID: <20120612073654.GA4374@host2.jankratochvil.net> (raw)
In-Reply-To: <201206112129.q5BLT8ck007831@glazunov.sibelius.xs4all.nl>
On Mon, 11 Jun 2012 23:29:08 +0200, Mark Kettenis wrote:
> > On Tue, 27 Mar 2012 20:53:37 +0200, Mark Kettenis wrote:
> > > Also, if i386_push_dummy_call() doesn't preserve alignment (and it sure
> > > looks like it doesn't), then aligning the stack here doesn't help.
> >
> > The patch helps (it makes working cases which did not work before), I am
> > unable to find a user visible problem with it.
>
> Sorry, but that must be sheer luck.
Here is no luck, your patch also does not do anything good with the alignment
as the new KFAIL tdep/14222 proves. 16 bytes shift is still better than
1 byte shift (as was in amd64-dicos-tdep.c and i386-dicos-tdep.c) as 1 byte
shift always breaks SSE inferiors. But whether 16 bytes subtraction or
16 bytes modulo works is just the "sheer luck" depending on this or that case.
I will check GCC parameters alignment and fix PR tdep/14222 first otherwise
the code does not make sense.
> Like I said, that probably requires i386_push_dummy_call() to properly
> align the stack just like amd64_push_dummy_call() does.
Yes, PR tdep/14222.
> > It is again about different coding style.
>
> Well, KISS is an important engineering principle if you ask me.
(a) The previous code in amd64-dicos-tdep.c and i386-dicos-tdep.c already used
gdbarch_breakpoint_from_pc. So moving a code is more simple patch than
moving + changing the code.
(b) Your code:
*bp_addr = sp - 1;
I find definitely less readable than
gdbarch_breakpoint_from_pc (gdbarch, &bppc, &bplen);
What is "- 1" there? There is no comment for it. If anything you should
have written:
/* 1 is size of the i386 breakpoint instruction. */
*bp_addr = sp - 1;
But in such case I find more obvious it is more readable to put there just:
gdbarch_breakpoint_from_pc (gdbarch, &bppc, &bplen);
Jan
prev parent reply other threads:[~2012-06-12 7:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-09 21:01 Jan Kratochvil
2012-03-26 19:04 ` ping: " Jan Kratochvil
2012-03-27 18:53 ` Mark Kettenis
2012-06-11 15:24 ` Joel Brobecker
2012-06-11 19:10 ` Jan Kratochvil
2012-06-11 21:29 ` Mark Kettenis
2012-06-12 7:37 ` Jan Kratochvil [this message]
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=20120612073654.GA4374@host2.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=mark.kettenis@xs4all.nl \
/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