Skip to content

Instantly share code, notes, and snippets.

@jessicah
Last active April 23, 2017 11:52
Show Gist options
  • Save jessicah/f227fde7761141748ee10fcb36b8f6ef to your computer and use it in GitHub Desktop.
Save jessicah/f227fde7761141748ee10fcb36b8f6ef to your computer and use it in GitHub Desktop.
if ! $pc_field_found; then
pc_fields=" eip" # Haiku (i386)
pc_fields="$pc_fields rip" # Haiku (x86_64)
for pc_field in $pc_fields; do
if ! $pc_field_found; then
AC_TRY_COMPILE([#include <signal.h>],
[ucontext_t u; return u.uc_mcontext.$pc_field == 0;],
AC_DEFINE_UNQUOTED(PC_FROM_UCONTEXT, $pc_field,
How to access the PC from a struct ucontext)
AC_MSG_RESULT([$pc_field])
pc_field_found=true)
fi
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment