+2014-05-02 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/16886
+ * config.in: Regenerated.
+ * configure: Likewise.
+ * configure.in: Check if sigsetjmp is available.
+ * h8500-dis.c (private): Replace jmp_buf with OPCODES_SIGJMP_BUF.
+ (fetch_data): Replace longjmp with OPCODES_SIGLONGJMP.
+ (print_insn_h8500): Replace setjmp with OPCODES_SIGSETJMP.
+ * i386-dis.c (dis_private): Replace jmp_buf with OPCODES_SIGJMP_BUF.
+ (fetch_data): Replace longjmp with OPCODES_SIGLONGJMP.
+ (print_insn): Replace setjmp with OPCODES_SIGSETJMP.
+ * ns32k-dis.c (private): Replace jmp_buf with OPCODES_SIGJMP_BUF.
+ (fetch_data): Replace longjmp with OPCODES_SIGLONGJMP.
+ (print_insn_ns32k): Replace setjmp with OPCODES_SIGSETJMP.
+ * sysdep.h (OPCODES_SIGJMP_BUF): New macro.
+ (OPCODES_SIGSETJMP): Likewise.
+ (OPCODES_SIGLONGJMP): Likewise.
+ * vax-dis.c (private): Replace jmp_buf with OPCODES_SIGJMP_BUF.
+ (fetch_data): Replace longjmp with OPCODES_SIGLONGJMP.
+ (print_insn_vax): Replace setjmp with OPCODES_SIGSETJMP.
+ * xtensa-dis.c (dis_private): Replace jmp_buf with
+ OPCODES_SIGJMP_BUF.
+ (fetch_data): Replace longjmp with OPCODES_SIGLONGJMP.
+ (print_insn_xtensa): Replace setjmp with OPCODES_SIGSETJMP.
+ * z8k-dis.c(instr_data_s): Replace jmp_buf with OPCODES_SIGJMP_BUF.
+ (fetch_data): Replace longjmp with OPCODES_SIGLONGJMP.
+ (print_insn_z8k): Replace setjmp with OPCODES_SIGSETJMP.
+
2014-05-01 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/16891
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
+/* Define if sigsetjmp is available. */
+#undef HAVE_SIGSETJMP
+
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
_ACEOF
+# Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do
+# since sigsetjmp might only be defined as a macro.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigsetjmp" >&5
+$as_echo_n "checking for sigsetjmp... " >&6; }
+if test "${gdb_cv_func_sigsetjmp+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <setjmp.h>
+
+int
+main ()
+{
+sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ bfd_cv_func_sigsetjmp=yes
+else
+ bfd_cv_func_sigsetjmp=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gdb_cv_func_sigsetjmp" >&5
+$as_echo "$gdb_cv_func_sigsetjmp" >&6; }
+if test $bfd_cv_func_sigsetjmp = yes; then
+
+$as_echo "#define HAVE_SIGSETJMP 1" >>confdefs.h
+
+fi
+
cgen_maint=no
cgendir='$(srcdir)/../cgen'
AC_CHECK_DECLS([basename, stpcpy])
+# Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do
+# since sigsetjmp might only be defined as a macro.
+AC_CACHE_CHECK([for sigsetjmp], gdb_cv_func_sigsetjmp,
+[AC_TRY_COMPILE([
+#include <setjmp.h>
+], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
+bfd_cv_func_sigsetjmp=yes, bfd_cv_func_sigsetjmp=no)])
+if test $bfd_cv_func_sigsetjmp = yes; then
+ AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ])
+fi
+
cgen_maint=no
cgendir='$(srcdir)/../cgen'
bfd_byte *max_fetched;
bfd_byte the_buffer[MAXLEN];
bfd_vma insn_start;
- jmp_buf bailout;
+ OPCODES_SIGJMP_BUF bailout;
};
/* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive)
if (status != 0)
{
(*info->memory_error_func) (status, start, info);
- longjmp (priv->bailout, 1);
+ OPCODES_SIGLONGJMP (priv->bailout, 1);
}
else
priv->max_fetched = addr;
info->private_data = (PTR) & priv;
priv.max_fetched = priv.the_buffer;
priv.insn_start = addr;
- if (setjmp (priv.bailout) != 0)
+ if (OPCODES_SIGSETJMP (priv.bailout) != 0)
/* Error return. */
return -1;
bfd_byte the_buffer[MAX_MNEM_SIZE];
bfd_vma insn_start;
int orig_sizeflag;
- jmp_buf bailout;
+ OPCODES_SIGJMP_BUF bailout;
};
enum address_mode
STATUS. */
if (priv->max_fetched == priv->the_buffer)
(*info->memory_error_func) (status, start, info);
- longjmp (priv->bailout, 1);
+ OPCODES_SIGLONGJMP (priv->bailout, 1);
}
else
priv->max_fetched = addr;
start_codep = priv.the_buffer;
codep = priv.the_buffer;
- if (setjmp (priv.bailout) != 0)
+ if (OPCODES_SIGSETJMP (priv.bailout) != 0)
{
const char *name;
bfd_byte *max_fetched;
bfd_byte the_buffer[MAXLEN];
bfd_vma insn_start;
- jmp_buf bailout;
+ OPCODES_SIGJMP_BUF bailout;
};
if (status != 0)
{
(*info->memory_error_func) (status, start, info);
- longjmp (priv->bailout, 1);
+ OPCODES_SIGLONGJMP (priv->bailout, 1);
}
else
priv->max_fetched = addr;
info->private_data = & priv;
priv.max_fetched = priv.the_buffer;
priv.insn_start = memaddr;
- if (setjmp (priv.bailout) != 0)
+ if (OPCODES_SIGSETJMP (priv.bailout) != 0)
/* Error return. */
return -1;
#if !HAVE_DECL_STPCPY
extern char *stpcpy (char *__dest, const char *__src);
#endif
+
+/* Use sigsetjmp/siglongjmp without saving the signal mask if possible.
+ It is faster than setjmp/longjmp on systems where the signal mask is
+ saved. */
+
+#if defined(HAVE_SIGSETJMP)
+#define OPCODES_SIGJMP_BUF sigjmp_buf
+#define OPCODES_SIGSETJMP(buf) sigsetjmp((buf), 0)
+#define OPCODES_SIGLONGJMP(buf,val) siglongjmp((buf), (val))
+#else
+#define OPCODES_SIGJMP_BUF jmp_buf
+#define OPCODES_SIGSETJMP(buf) setjmp(buf)
+#define OPCODES_SIGLONGJMP(buf,val) longjmp((buf), (val))
+#endif
bfd_byte * max_fetched;
bfd_byte the_buffer[MAXLEN];
bfd_vma insn_start;
- jmp_buf bailout;
+ OPCODES_SIGJMP_BUF bailout;
};
/* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive)
if (status != 0)
{
(*info->memory_error_func) (status, start, info);
- longjmp (priv->bailout, 1);
+ OPCODES_SIGLONGJMP (priv->bailout, 1);
}
else
priv->max_fetched = addr;
parsed_disassembler_options = TRUE;
}
- if (setjmp (priv.bailout) != 0)
+ if (OPCODES_SIGSETJMP (priv.bailout) != 0)
/* Error return. */
return -1;
struct dis_private
{
bfd_byte *byte_buf;
- jmp_buf bailout;
+ OPCODES_SIGJMP_BUF bailout;
};
return length;
}
(*info->memory_error_func) (status, memaddr, info);
- longjmp (priv->bailout, 1);
+ OPCODES_SIGLONGJMP (priv->bailout, 1);
/*NOTREACHED*/
}
priv.byte_buf = byte_buf;
info->private_data = (void *) &priv;
- if (setjmp (priv.bailout) != 0)
+ if (OPCODES_SIGSETJMP (priv.bailout) != 0)
/* Error return. */
return -1;
/* Nibble number of first word not yet fetched. */
int max_fetched;
bfd_vma insn_start;
- jmp_buf bailout;
+ OPCODES_SIGJMP_BUF bailout;
int tabl_index;
char instr_asmsrc[80];
if (status != 0)
{
(*info->memory_error_func) (status, priv->insn_start, info);
- longjmp (priv->bailout, 1);
+ OPCODES_SIGLONGJMP (priv->bailout, 1);
}
{
info->private_data = (PTR) &instr_data;
instr_data.max_fetched = 0;
instr_data.insn_start = addr;
- if (setjmp (instr_data.bailout) != 0)
+ if (OPCODES_SIGSETJMP (instr_data.bailout) != 0)
/* Error return. */
return -1;