gdb/jit.h - gdb

Data types defined

Macros defined

Source code

  1. /* JIT declarations for GDB, the GNU Debugger.

  2.    Copyright (C) 2009-2015 Free Software Foundation, Inc.

  3.    This file is part of GDB.

  4.    This program is free software; you can redistribute it and/or modify
  5.    it under the terms of the GNU General Public License as published by
  6.    the Free Software Foundation; either version 3 of the License, or
  7.    (at your option) any later version.

  8.    This program is distributed in the hope that it will be useful,
  9.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11.    GNU General Public License for more details.

  12.    You should have received a copy of the GNU General Public License
  13.    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

  14. #ifndef JIT_H
  15. #define JIT_H

  16. /* When the JIT breakpoint fires, the inferior wants us to take one of
  17.    these actions.  These values are used by the inferior, so the
  18.    values of these enums cannot be changed.  */

  19. typedef enum
  20. {
  21.   JIT_NOACTION = 0,
  22.   JIT_REGISTER,
  23.   JIT_UNREGISTER
  24. } jit_actions_t;

  25. /* This struct describes a single symbol file in a linked list of
  26.    symbol files describing generated code.  As the inferior generates
  27.    code, it adds these entries to the list, and when we attach to the
  28.    inferior, we read them all.  For the first element prev_entry
  29.    should be NULL, and for the last element next_entry should be
  30.    NULL.  */

  31. struct jit_code_entry
  32. {
  33.   CORE_ADDR next_entry;
  34.   CORE_ADDR prev_entry;
  35.   CORE_ADDR symfile_addr;
  36.   ULONGEST symfile_size;
  37. };

  38. /* This is the global descriptor that the inferior uses to communicate
  39.    information to the debugger.  To alert the debugger to take an
  40.    action, the inferior sets the action_flag to the appropriate enum
  41.    value, updates relevant_entry to point to the relevant code entry,
  42.    and calls the function at the well-known symbol with our
  43.    breakpoint.  We then read this descriptor from another global
  44.    well-known symbol.  */

  45. struct jit_descriptor
  46. {
  47.   uint32_t version;
  48.   /* This should be jit_actions_t, but we want to be specific about the
  49.      bit-width.  */
  50.   uint32_t action_flag;
  51.   CORE_ADDR relevant_entry;
  52.   CORE_ADDR first_entry;
  53. };

  54. /* Looks for the descriptor and registration symbols and breakpoints
  55.    the registration function.  If it finds both, it registers all the
  56.    already JITed code.  If it has already found the symbols, then it
  57.    doesn't try again.  */

  58. extern void jit_inferior_created_hook (void);

  59. /* Re-establish the jit breakpoint(s).  */

  60. extern void jit_breakpoint_re_set (void);

  61. /* This function is called by handle_inferior_event when it decides
  62.    that the JIT event breakpoint has fired.  */

  63. extern void jit_event_handler (struct gdbarch *gdbarch);

  64. #endif /* JIT_H */