From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
To: <tromey@redhat.com>, "'Doug Evans'" <dje@google.com>
Cc: "'Hui Zhu'" <teawater@gmail.com>, <gdb-patches@sourceware.org>,
"'Pedro Alves'" <pedro@codesourcery.com>,
"'Stan Shebs'" <stan@codesourcery.com>,
"'Eli Zaretskii'" <eliz@gnu.org>,
"'Michael Snyder'" <msnyder@vmware.com>
Subject: RE: [RFA-new version][gdbserver] x86 agent expression bytecode compiler (speed up conditional tracepoints)
Date: Sun, 20 Jun 2010 20:36:00 -0000 [thread overview]
Message-ID: <004b01cb10b8$3be5e4a0$b3b1ade0$@muller@ics-cnrs.unistra.fr> (raw)
In-Reply-To: <m3eig1lf7s.fsf@fleche.redhat.com>
This patch fixes compilation on gcc16.
May I commit this?
Pierre
gdbserver/ChangeLog entry:
2010-06-20 Ian Lance Taylor <iant@google.com>
Pierre Muller <muller@ics.u-strasbg.fr>
* linux-x86-low.c (always_true): Delete function.
(EMIT_ASM, EMIT_ASM32): Use `do ... while (0)' to avoid
code been optimzed out.
Index: src/gdb/gdbserver/linux-x86-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-x86-low.c,v
retrieving revision 1.19
diff -u -p -r1.19 linux-x86-low.c
--- src/gdb/gdbserver/linux-x86-low.c 15 Jun 2010 10:44:48 -0000
1.19
+++ src/gdb/gdbserver/linux-x86-low.c 20 Jun 2010 06:25:07 -0000
@@ -1484,14 +1484,6 @@ add_insns (unsigned char *start, int len
current_insn_ptr = buildaddr;
}
-/* A function used to trick optimizers. */
-
-int
-always_true (void)
-{
- return 1;
-}
-
/* Our general strategy for emitting code is to avoid specifying raw
bytes whenever possible, and instead copy a block of inline asm
that is embedded in the function. This is a little messy, because
@@ -1499,26 +1491,20 @@ always_true (void)
code, plus suppress various warnings. */
#define EMIT_ASM(NAME,INSNS) \
- { extern unsigned char start_ ## NAME, end_ ## NAME; \
+ do { extern unsigned char start_ ## NAME, end_ ## NAME; \
add_insns (&start_ ## NAME, &end_ ## NAME - &start_ ## NAME); \
- if (always_true ()) \
- goto skipover ## NAME; \
__asm__ ("start_" #NAME ":\n\t" INSNS "\n\tend_" #NAME ":\n\t"); \
- skipover ## NAME: \
- ; }
+ ; } while (0)
#ifdef __x86_64__
#define EMIT_ASM32(NAME,INSNS) \
- { extern unsigned char start_ ## NAME, end_ ## NAME; \
+ do { extern unsigned char start_ ## NAME, end_ ## NAME; \
add_insns (&start_ ## NAME, &end_ ## NAME - &start_ ## NAME); \
- if (always_true ()) \
- goto skipover ## NAME; \
__asm__ (".code32\n\tstart_" #NAME ":\n\t" INSNS "\n\tend_" #NAME ":\n"
\
"\t.code64\n\t"); \
- skipover ## NAME: \
- ; }
+ ; } while (0)
#else
next prev parent reply other threads:[~2010-06-20 20:36 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-07 16:00 [gdbserver] " Pedro Alves
2010-06-07 16:04 ` Michael Snyder
2010-06-07 16:35 ` Joel Brobecker
2010-06-10 17:28 ` Tom Tromey
2010-06-10 17:36 ` Pedro Alves
2010-06-10 18:43 ` Tom Tromey
2010-06-14 11:15 ` [NEWS/RFA] " Pedro Alves
2010-06-14 17:29 ` Eli Zaretskii
2010-06-14 22:19 ` Pedro Alves
2010-06-16 18:57 ` Doug Evans
2010-06-16 19:13 ` Stan Shebs
2010-06-16 19:16 ` Pedro Alves
2010-06-16 19:21 ` Doug Evans
2010-06-16 23:58 ` Ian Lance Taylor
2010-06-20 22:27 ` Pedro Alves
2010-06-16 19:31 ` Stan Shebs
2010-06-17 18:03 ` Michael Snyder
2010-06-19 16:13 ` Hui Zhu
2010-06-19 16:16 ` Doug Evans
2010-06-19 17:13 ` Hui Zhu
2010-06-19 17:26 ` Doug Evans
2010-06-20 9:30 ` [RFA-new version][gdbserver] " Pierre Muller
[not found] ` <-3945058798826177264@unknownmsgid>
2010-06-20 15:30 ` Doug Evans
2010-06-20 17:02 ` Pierre Muller
[not found] ` <-1673004315710326113@unknownmsgid>
2010-06-20 17:11 ` Doug Evans
2010-06-20 18:41 ` Tom Tromey
2010-06-20 20:36 ` Pierre Muller [this message]
2010-06-20 21:07 ` Pierre Muller
2010-06-21 1:47 ` Tom Tromey
2010-06-21 6:31 ` Pierre Muller
2010-06-20 18:31 ` [NEWS/RFA] Re: [gdbserver] " Tom Tromey
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='004b01cb10b8$3be5e4a0$b3b1ade0$@muller@ics-cnrs.unistra.fr' \
--to=pierre.muller@ics-cnrs.unistra.fr \
--cc=dje@google.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=msnyder@vmware.com \
--cc=pedro@codesourcery.com \
--cc=stan@codesourcery.com \
--cc=teawater@gmail.com \
--cc=tromey@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