}
/* Helper function for reading the global JIT descriptor from remote
- memory. Returns 1 if all went well, 0 otherwise. */
+ memory. Returns true if all went well, false otherwise. */
-static int
+static bool
jit_read_descriptor (struct gdbarch *gdbarch,
struct jit_descriptor *descriptor,
struct jit_program_space_data *ps_data)
struct jit_objfile_data *objf_data;
if (ps_data->objfile == NULL)
- return 0;
+ return false;
objf_data = get_jit_objfile_data (ps_data->objfile);
if (objf_data->descriptor == NULL)
- return 0;
+ return false;
if (jit_debug)
fprintf_unfiltered (gdb_stdlog,
{
printf_unfiltered (_("Unable to read JIT descriptor from "
"remote memory\n"));
- return 0;
+ return false;
}
/* Fix the endianness to match the host. */
descriptor->first_entry =
extract_typed_address (&desc_buf[8 + ptr_size], ptr_type);
- return 1;
+ return true;
}
/* Helper function for reading a JITed code entry from remote memory. */
}
/* (Re-)Initialize the jit breakpoint if necessary.
- Return 0 if the jit breakpoint has been successfully initialized. */
+ Return true if the jit breakpoint has been successfully initialized. */
-static int
+static bool
jit_breakpoint_re_set_internal (struct gdbarch *gdbarch,
struct jit_program_space_data *ps_data)
{
reg_symbol = lookup_bound_minimal_symbol (jit_break_name);
if (reg_symbol.minsym == NULL
|| BMSYMBOL_VALUE_ADDRESS (reg_symbol) == 0)
- return 1;
+ return false;
desc_symbol = lookup_minimal_symbol (jit_descriptor_name, NULL,
reg_symbol.objfile);
if (desc_symbol.minsym == NULL
|| BMSYMBOL_VALUE_ADDRESS (desc_symbol) == 0)
- return 1;
+ return false;
objf_data = get_jit_objfile_data (reg_symbol.objfile);
objf_data->register_code = reg_symbol.minsym;
paddress (gdbarch, addr));
if (ps_data->cached_code_address == addr)
- return 0;
+ return true;
/* Delete the old breakpoint. */
if (ps_data->jit_breakpoint != NULL)
ps_data->cached_code_address = addr;
ps_data->jit_breakpoint = create_jit_event_breakpoint (gdbarch, addr);
- return 0;
+ return true;
}
/* The private data passed around in the frame unwind callback
jit_prepend_unwinder (gdbarch);
ps_data = get_jit_program_space_data ();
- if (jit_breakpoint_re_set_internal (gdbarch, ps_data) != 0)
+ if (!jit_breakpoint_re_set_internal (gdbarch, ps_data))
return;
/* Read the descriptor so we can check the version number and load