Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andreas Tobler <andreast-list@fgznet.ch>
To: gdb-patches@sourceware.org
Subject: [patch] testsuite gdb.base/jit-main.c
Date: Thu, 24 Feb 2011 21:49:00 -0000	[thread overview]
Message-ID: <4D66CD47.7010206@fgznet.ch> (raw)

[-- Attachment #1: Type: text/plain, Size: 291 bytes --]

Hi all,

on non Linux platforms (FreeBSD for example) this test case fails due to 
ElfW being not defined.

The below tries to achieve this shortcoming.

Tested on FreeBSD x86_64/amd64 (64-bit), FreeBSD powerpc (32-bit) and 
also on linux-ppc (32-bit).

What do you think?

Thanks,
Andreas


[-- Attachment #2: jit-main.diff --]
[-- Type: text/plain, Size: 793 bytes --]

Index: jit-main.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/jit-main.c,v
retrieving revision 1.1
diff -u -r1.1 jit-main.c
--- jit-main.c	31 Jan 2011 21:44:52 -0000	1.1
+++ jit-main.c	24 Feb 2011 20:45:39 -0000
@@ -29,6 +29,19 @@
 #include <sys/mman.h>
 #include <sys/stat.h>
 
+/* ElfW is coming from linux. On other platforms it does not exist.
+   Let us define it here. */
+#ifndef ElfW
+# if (defined  (_LP64) || defined (__LP64__)) 
+#   define WORDSIZE 64
+# else
+#   define WORDSIZE 32
+# endif /* _LP64 || __LP64__  */
+#define ElfW(type)      _ElfW (Elf, WORDSIZE, type)
+#define _ElfW(e,w,t)    _ElfW_1 (e, w, _##t)
+#define _ElfW_1(e,w,t)  e##w##t
+#endif /* !ElfW  */
+
 typedef enum
 {
   JIT_NOACTION = 0,

             reply	other threads:[~2011-02-24 21:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-24 21:49 Andreas Tobler [this message]
2011-02-24 23:01 ` Mark Kettenis
2011-02-24 23:51   ` Andreas Tobler

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=4D66CD47.7010206@fgznet.ch \
    --to=andreast-list@fgznet.ch \
    --cc=gdb-patches@sourceware.org \
    /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