diff options
author | Doug Evans <dje@google.com> | 2009-08-20 18:02:48 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2009-08-20 18:02:48 +0000 |
commit | 4efc6507960ac76505ebb1be9886f207ceb46c3a (patch) | |
tree | af68d7cb89746890d09bd44080fe6816ca12bb1c /gdb/infrun.c | |
parent | c469dcaa811e4c7d781f6ba9e9dd25fab234604f (diff) | |
download | gdb-4efc6507960ac76505ebb1be9886f207ceb46c3a.zip gdb-4efc6507960ac76505ebb1be9886f207ceb46c3a.tar.gz gdb-4efc6507960ac76505ebb1be9886f207ceb46c3a.tar.bz2 |
Add interface for JIT code generation.
* NEWS: Announce JIT interface.
* Makefile.in (SFILES): Add jit.c.
(HFILES_NO_SRCDIR): Add jit.h.
(COMMON_OBS): Add jit.o.
* jit.c: New file.
* jit.h: New file.
* breakpoint.h (enum bptype): Add bp_jit_event to enum.
* breakpoint.c:
(update_breakpoints_after_exec): Delete jit breakpoints after exec.
(bpstat_what): Update event table for bp_jit_event.
(print_it_typical): Added case for bp_jit_event.
(print_one_breakpoint_location): Added case for bp_jit_event.
(allocate_bp_location): Added case for bp_jit_event.
(mention): Added case for bp_jit_event.
(delete_command): Added case for bp_jit_event.
(breakpoint_re_set_one): Added case for bp_jit_event.
(breakpoint_re_set): Added call to jit_inferior_created_hook.
(create_jit_event_breakpoint): New.
* infrun.c (handle_inferior_event): Add handler for jit event.
(follow_exec): Add call to jit_inferior_created_hook.
* doc/gdb.texinfo: Add chapter on JIT interface.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r-- | gdb/infrun.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c index e3eddce..892e0d4 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -50,6 +50,7 @@ #include "event-top.h" #include "record.h" #include "inline-frame.h" +#include "jit.h" /* Prototypes for local functions */ @@ -544,6 +545,8 @@ follow_exec (ptid_t pid, char *execd_pathname) solib_create_inferior_hook (); #endif + jit_inferior_created_hook (); + /* Reinsert all breakpoints. (Those which were symbolic have been reset to the proper address in the new a.out, thanks to symbol_file_command...) */ @@ -3540,6 +3543,22 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (!gdbarch_get_longjmp_target)\n"); } break; + case BPSTAT_WHAT_CHECK_JIT: + if (debug_infrun) + fprintf_unfiltered (gdb_stdlog, "infrun: BPSTAT_WHAT_CHECK_JIT\n"); + + /* Switch terminal for any messages produced by breakpoint_re_set. */ + target_terminal_ours_for_output (); + + jit_event_handler (); + + target_terminal_inferior (); + + /* We want to step over this breakpoint, then keep going. */ + ecs->event_thread->stepping_over_breakpoint = 1; + + break; + case BPSTAT_WHAT_LAST: /* Not a real code, but listed here to shut up gcc -Wall. */ |