Re: [PATCH 4/4] Activate JIT code unwinder for i386.

Mark Kettenis
2011-07-05T15:24:42Z

> From: Sanjoy Das <sanjoy@playingwithpointers.com>
> Date: Tue, 5 Jul 2011 12:01:29 +0530
>
> Registers the (pseudo) unwinder for JIT code for i386. This can
> probably be expanded to other architectures after some testing and
> review.

What's your motivation for putting the JIT unwinder at that spot in
the list of unwinders? I'd put it behind the DWARF CFI unwinders
since those are the ones that most people will hit.

> gdb/ChangeLog:
> * i386-tdep.c: Activate JIT unwinder for i386.
> ---
> gdb/ChangeLog | 4 ++++
> gdb/i386-tdep.c | 4 ++++
> 2 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/gdb/ChangeLog b/gdb/ChangeLog
> index 306a0a5..1f0bd19 100644
> --- a/gdb/ChangeLog
> +++ b/gdb/ChangeLog
> @@ -1,5 +1,9 @@
> 2011-07-04 Sanjoy Das <sanjoy@playingwithpointers.com>
>
> + * i386-tdep.c: Activate JIT unwinder for i386.
> +
> +2011-07-04 Sanjoy Das <sanjoy@playingwithpointers.com>
> +
> * jit.c: Add JIT frame unwinding code.
> * jit-reader.h: Added jit_prepend_unwinder.
>
> diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
> index 366d0fa..66626ab 100644
> --- a/gdb/i386-tdep.c
> +++ b/gdb/i386-tdep.c
> @@ -30,6 +30,7 @@
> #include "frame-base.h"
> #include "frame-unwind.h"
> #include "inferior.h"
> +#include "jit.h"
> #include "gdbcmd.h"
> #include "gdbcore.h"
> #include "gdbtypes.h"
> @@ -7330,6 +7331,9 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
> CFI info will be used if it is available. */
> dwarf2_append_unwinders (gdbarch);
>
> + /* JIT reader pseudo-unwinder. */
> + jit_prepend_unwinder (gdbarch);
> +
> frame_base_set_default (gdbarch, &i386_frame_base);
>
> /* Pseudo registers may be changed by amd64_init_abi. */
> --
> 1.7.5.3
>
>