]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
fix PR python/15816
authorTom Tromey <tromey@redhat.com>
Tue, 20 Aug 2013 15:12:53 +0000 (15:12 +0000)
committerTom Tromey <tromey@redhat.com>
Tue, 20 Aug 2013 15:12:53 +0000 (15:12 +0000)
This fixes PR python/15816.

The bug here is that python-selftest.exp can fail:

    No symbol "RETURN_MASK_ALL" in current context.

RETURN_MASK_ALL is a macro, so if macros do not end up in the
debuginfo (very typical) then the test fails.

It seemed simplest to me to simply turn the RETURN_MASK_ defines into
enum constants.  This way they end up in the debuginfo and all is
well.

PR python/15816:
* exceptions.h (return_mask): Now an enum.
(RETURN_MASK_QUIT, RETURN_MASK_ERROR, RETURN_MASK_ALL): Now
enum constants.

Built and regtested on x86-64 Fedora 18.

gdb/ChangeLog
gdb/exceptions.h

index d11e2263f5bd1f8cf76d922ee882c8170ac74b45..2e0109e36bc5f3c2e6bfbde5270abb12e76a6b20 100644 (file)
@@ -1,3 +1,10 @@
+2013-08-20  Tom Tromey  <tromey@redhat.com>
+
+       PR python/15816:
+       * exceptions.h (return_mask): Now an enum.
+       (RETURN_MASK_QUIT, RETURN_MASK_ERROR, RETURN_MASK_ALL): Now
+       enum constants.
+
 2013-08-20  Tom Tromey  <tromey@redhat.com>
 
        * cp-namespace.c (cp_lookup_symbol_imports_or_template): Use
index bf41860844938f5ac1052aca583be9e836f86d7c..129d29a62ad764c0cd9798fe2104b66527351ca1 100644 (file)
@@ -38,10 +38,13 @@ enum return_reason
   };
 
 #define RETURN_MASK(reason)    (1 << (int)(-reason))
-#define RETURN_MASK_QUIT       RETURN_MASK (RETURN_QUIT)
-#define RETURN_MASK_ERROR      RETURN_MASK (RETURN_ERROR)
-#define RETURN_MASK_ALL                (RETURN_MASK_QUIT | RETURN_MASK_ERROR)
-typedef int return_mask;
+
+typedef enum
+{
+  RETURN_MASK_QUIT = RETURN_MASK (RETURN_QUIT),
+  RETURN_MASK_ERROR = RETURN_MASK (RETURN_ERROR),
+  RETURN_MASK_ALL = (RETURN_MASK_QUIT | RETURN_MASK_ERROR)
+} return_mask;
 
 /* Describe all exceptions.  */