• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ paddress函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中paddress函数的典型用法代码示例。如果您正苦于以下问题:C++ paddress函数的具体用法?C++ paddress怎么用?C++ paddress使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了paddress函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: fprint_auxv_entry

void
fprint_auxv_entry (struct ui_file *file, const char *name,
		   const char *description, enum auxv_format format,
		   CORE_ADDR type, CORE_ADDR val)
{
  fprintf_filtered (file, ("%-4s %-20s %-30s "),
		    plongest (type), name, description);
  switch (format)
    {
    case AUXV_FORMAT_DEC:
      fprintf_filtered (file, ("%s\n"), plongest (val));
      break;
    case AUXV_FORMAT_HEX:
      fprintf_filtered (file, ("%s\n"), paddress (target_gdbarch (), val));
      break;
    case AUXV_FORMAT_STR:
      {
	struct value_print_options opts;

	get_user_print_options (&opts);
	if (opts.addressprint)
	  fprintf_filtered (file, ("%s "), paddress (target_gdbarch (), val));
	val_print_string (builtin_type (target_gdbarch ())->builtin_char,
			  NULL, val, -1, file, &opts);
	fprintf_filtered (file, ("\n"));
      }
      break;
    }
}
开发者ID:simark,项目名称:binutils-gdb,代码行数:29,代码来源:auxv.c


示例2: uninsert_raw_breakpoint

static void
uninsert_raw_breakpoint (struct raw_breakpoint *bp)
{
  if (bp->inserted < 0)
    {
      if (debug_threads)
	debug_printf ("Breakpoint at %s is marked insert-disabled.\n",
		      paddress (bp->pc));
    }
  else if (bp->inserted > 0)
    {
      int err;

      bp->inserted = 0;

      err = the_target->remove_point (bp->raw_type, bp->pc, bp->size, bp);
      if (err != 0)
	{
	  bp->inserted = 1;

	  if (debug_threads)
	    debug_printf ("Failed to uninsert raw breakpoint at 0x%s.\n",
			  paddress (bp->pc));
	}
    }
}
开发者ID:dbl001,项目名称:binutils,代码行数:26,代码来源:mem-break.c


示例3: aarch64_show_debug_reg_state

static void
aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state,
			      const char *func, CORE_ADDR addr,
			      int len, enum target_hw_bp_type type)
{
  int i;

  fprintf (stderr, "%s", func);
  if (addr || len)
    fprintf (stderr, " (addr=0x%08lx, len=%d, type=%s)",
	     (unsigned long) addr, len,
	     type == hw_write ? "hw-write-watchpoint"
	     : (type == hw_read ? "hw-read-watchpoint"
		: (type == hw_access ? "hw-access-watchpoint"
		   : (type == hw_execute ? "hw-breakpoint"
		      : "??unknown??"))));
  fprintf (stderr, ":\n");

  fprintf (stderr, "\tBREAKPOINTs:\n");
  for (i = 0; i < aarch64_num_bp_regs; i++)
    fprintf (stderr, "\tBP%d: addr=0x%s, ctrl=0x%08x, ref.count=%d\n",
	     i, paddress (state->dr_addr_bp[i]),
	     state->dr_ctrl_bp[i], state->dr_ref_count_bp[i]);

  fprintf (stderr, "\tWATCHPOINTs:\n");
  for (i = 0; i < aarch64_num_wp_regs; i++)
    fprintf (stderr, "\tWP%d: addr=0x%s, ctrl=0x%08x, ref.count=%d\n",
	     i, paddress (state->dr_addr_wp[i]),
	     state->dr_ctrl_wp[i], state->dr_ref_count_wp[i]);
}
开发者ID:warelle,项目名称:binutils-aqua,代码行数:30,代码来源:linux-aarch64-low.c


示例4: set_raw_breakpoint_at

static struct raw_breakpoint *
set_raw_breakpoint_at (CORE_ADDR where)
{
  struct process_info *proc = current_process ();
  struct raw_breakpoint *bp;
  int err;
  unsigned char buf[MAX_BREAKPOINT_LEN];

  if (breakpoint_data == NULL)
    error ("Target does not support breakpoints.");

  bp = find_raw_breakpoint_at (where);
  if (bp != NULL)
    {
      bp->refcount++;
      return bp;
    }

  bp = xcalloc (1, sizeof (*bp));
  bp->pc = where;
  bp->refcount = 1;

  /* Note that there can be fast tracepoint jumps installed in the
     same memory range, so to get at the original memory, we need to
     use read_inferior_memory, which masks those out.  */
  err = read_inferior_memory (where, buf, breakpoint_len);
  if (err != 0)
    {
      if (debug_threads)
	fprintf (stderr,
		 "Failed to read shadow memory of"
		 " breakpoint at 0x%s (%s).\n",
		 paddress (where), strerror (err));
      free (bp);
      return NULL;
    }
  memcpy (bp->old_data, buf, breakpoint_len);

  err = (*the_target->write_memory) (where, breakpoint_data,
				     breakpoint_len);
  if (err != 0)
    {
      if (debug_threads)
	fprintf (stderr,
		 "Failed to insert breakpoint at 0x%s (%s).\n",
		 paddress (where), strerror (err));
      free (bp);
      return NULL;
    }

  /* Link the breakpoint in.  */
  bp->inserted = 1;
  bp->next = proc->raw_breakpoints;
  proc->raw_breakpoints = bp;
  return bp;
}
开发者ID:5kg,项目名称:gdb,代码行数:56,代码来源:mem-break.c


示例5: sparc64_linux_handle_segmentation_fault

void
sparc64_linux_handle_segmentation_fault (struct gdbarch *gdbarch,
				      struct ui_out *uiout)
{
  if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word != 64)
    return;

  CORE_ADDR addr = 0;
  long si_code = 0;

  try
    {
      /* Evaluate si_code to see if the segfault is ADI related.  */
      si_code = parse_and_eval_long ("$_siginfo.si_code\n");

      if (si_code >= SEGV_ACCADI && si_code <= SEGV_ADIPERR)
        addr = parse_and_eval_long ("$_siginfo._sifields._sigfault.si_addr");
    }
  catch (const gdb_exception &exception)
    {
      return;
    }

  /* Print out ADI event based on sig_code value */
  switch (si_code)
    {
    case SEGV_ACCADI:	/* adi not enabled */
      uiout->text ("\n");
      uiout->field_string ("sigcode-meaning", _("ADI disabled"));
      uiout->text (_(" while accessing address "));
      uiout->field_fmt ("bound-access", "%s", paddress (gdbarch, addr));
      break;
    case SEGV_ADIDERR:	/* disrupting mismatch */
      uiout->text ("\n");
      uiout->field_string ("sigcode-meaning", _("ADI deferred mismatch"));
      uiout->text (_(" while accessing address "));
      uiout->field_fmt ("bound-access", "%s", paddress (gdbarch, addr));
      break;
    case SEGV_ADIPERR:	/* precise mismatch */
      uiout->text ("\n");
      uiout->field_string ("sigcode-meaning", _("ADI precise mismatch"));
      uiout->text (_(" while accessing address "));
      uiout->field_fmt ("bound-access", "%s", paddress (gdbarch, addr));
      break;
    default:
      break;
    }

}
开发者ID:bminor,项目名称:binutils-gdb,代码行数:49,代码来源:sparc64-linux-tdep.c


示例6: uninsert_fast_tracepoint_jumps_at

void
uninsert_fast_tracepoint_jumps_at (CORE_ADDR pc)
{
  struct fast_tracepoint_jump *jp;
  int err;

  jp = find_fast_tracepoint_jump_at (pc);
  if (jp == NULL)
    {
      /* This can happen when we remove all breakpoints while handling
	 a step-over.  */
      if (debug_threads)
	fprintf (stderr,
		 "Could not find fast tracepoint jump at 0x%s "
		 "in list (uninserting).\n",
		 paddress (pc));
      return;
    }

  if (jp->inserted)
    {
      unsigned char *buf;

      jp->inserted = 0;

      /* Since there can be trap breakpoints inserted in the same
	 address range, we use use `write_inferior_memory', which
	 takes care of layering breakpoints on top of fast
	 tracepoints, and on top of the buffer we pass it.  This works
	 because we've already marked the fast tracepoint fast
	 tracepoint jump uninserted above.  Also note that we need to
	 pass the current shadow contents, because
	 write_inferior_memory updates any shadow memory with what we
	 pass here, and we want that to be a nop.  */
      buf = alloca (jp->length);
      memcpy (buf, fast_tracepoint_jump_shadow (jp), jp->length);
      err = write_inferior_memory (jp->pc, buf, jp->length);
      if (err != 0)
	{
	  jp->inserted = 1;

	  if (debug_threads)
	    fprintf (stderr,
		     "Failed to uninsert fast tracepoint jump at 0x%s (%s).\n",
		     paddress (pc), strerror (err));
	}
    }
}
开发者ID:5kg,项目名称:gdb,代码行数:48,代码来源:mem-break.c


示例7: print_unpacked_pointer

int
print_unpacked_pointer (struct type *type,
			CORE_ADDR address, CORE_ADDR addr,
			int format, struct ui_file *stream)
{
  struct type *elttype = check_typedef (TYPE_TARGET_TYPE (type));

  if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
    {
      /* Try to print what function it points to.  */
      print_function_pointer_address (addr, stream);
      /* Return value is irrelevant except for string pointers.  */
      return 0;
    }

  if (addressprint && format != 's')
    fputs_filtered (paddress (address), stream);

  /* For a pointer to char or unsigned char, also print the string
     pointed to, unless pointer is null.  */

  if (TYPE_LENGTH (elttype) == 1
      && TYPE_CODE (elttype) == TYPE_CODE_INT
      && (format == 0 || format == 's')
      && addr != 0)
      return val_print_string (addr, -1, TYPE_LENGTH (elttype), stream);
  
  return 0;
}
开发者ID:3125788,项目名称:android_toolchain_gdb,代码行数:29,代码来源:m2-valprint.c


示例8: print_variable_at_address

static void
print_variable_at_address (struct type *type,
			   const gdb_byte *valaddr,
			   struct ui_file *stream,
			   int recurse,
			   const struct value_print_options *options)
{
  struct gdbarch *gdbarch = get_type_arch (type);
  CORE_ADDR addr = unpack_pointer (type, valaddr);
  struct type *elttype = check_typedef (TYPE_TARGET_TYPE (type));

  fprintf_filtered (stream, "[");
  fputs_filtered (paddress (gdbarch, addr), stream);
  fprintf_filtered (stream, "] : ");
  
  if (TYPE_CODE (elttype) != TYPE_CODE_UNDEF)
    {
      struct value *deref_val =
	value_at (TYPE_TARGET_TYPE (type), unpack_pointer (type, valaddr));

      common_val_print (deref_val, stream, recurse, options, current_language);
    }
  else
    fputs_filtered ("???", stream);
}
开发者ID:Winter3un,项目名称:ctf_task,代码行数:25,代码来源:m2-valprint.c


示例9: print_variable_at_address

static void
print_variable_at_address (struct type *type, const gdb_byte *valaddr,
			   struct ui_file *stream, int format,
			   int deref_ref, int recurse,
			   enum val_prettyprint pretty)
{
  CORE_ADDR addr = unpack_pointer (type, valaddr);
  struct type *elttype = check_typedef (TYPE_TARGET_TYPE (type));

  fprintf_filtered (stream, "[");
  fputs_filtered (paddress (addr), stream);
  fprintf_filtered (stream, "] : ");
  
  if (TYPE_CODE (elttype) != TYPE_CODE_UNDEF)
    {
      struct value *deref_val =
	value_at
	(TYPE_TARGET_TYPE (type),
	 unpack_pointer (lookup_pointer_type (builtin_type_void),
			 valaddr));
      common_val_print (deref_val, stream, format, deref_ref,
			recurse, pretty);
    }
  else
    fputs_filtered ("???", stream);
}
开发者ID:3125788,项目名称:android_toolchain_gdb,代码行数:26,代码来源:m2-valprint.c


示例10: print_unpacked_pointer

static int
print_unpacked_pointer (struct type *type,
			CORE_ADDR address, CORE_ADDR addr,
			const struct value_print_options *options,
			struct ui_file *stream)
{
  struct gdbarch *gdbarch = get_type_arch (type);
  struct type *elttype = check_typedef (TYPE_TARGET_TYPE (type));

  if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
    {
      /* Try to print what function it points to.  */
      print_function_pointer_address (gdbarch, addr, stream,
				      options->addressprint);
      /* Return value is irrelevant except for string pointers.  */
      return 0;
    }

  if (options->addressprint && options->format != 's')
    fputs_filtered (paddress (gdbarch, address), stream);

  /* For a pointer to char or unsigned char, also print the string
     pointed to, unless pointer is null.  */

  if (TYPE_LENGTH (elttype) == 1
      && TYPE_CODE (elttype) == TYPE_CODE_INT
      && (options->format == 0 || options->format == 's')
      && addr != 0)
    return val_print_string (TYPE_TARGET_TYPE (type), addr, -1,
			     stream, options);
  
  return 0;
}
开发者ID:3125788,项目名称:android_toolchain_gdb,代码行数:33,代码来源:m2-valprint.c


示例11: stub_gnu_ifunc_resolve_addr

static CORE_ADDR
stub_gnu_ifunc_resolve_addr (struct gdbarch *gdbarch, CORE_ADDR pc)
{
  error (_("GDB cannot resolve STT_GNU_IFUNC symbol at address %s without "
	   "the ELF support compiled in."),
	 paddress (gdbarch, pc));
}
开发者ID:jon-turney,项目名称:binutils-gdb,代码行数:7,代码来源:minsyms.c


示例12: remove_memory_breakpoint

int
remove_memory_breakpoint (struct raw_breakpoint *bp)
{
  unsigned char buf[MAX_BREAKPOINT_LEN];
  int err;

  /* Since there can be trap breakpoints inserted in the same address
     range, we use `write_inferior_memory', which takes care of
     layering breakpoints on top of fast tracepoints, and on top of
     the buffer we pass it.  This works because the caller has already
     either unlinked the breakpoint or marked it uninserted.  Also
     note that we need to pass the current shadow contents, because
     write_inferior_memory updates any shadow memory with what we pass
     here, and we want that to be a nop.  */
  memcpy (buf, bp->old_data, breakpoint_len);
  err = write_inferior_memory (bp->pc, buf, breakpoint_len);
  if (err != 0)
    {
      if (debug_threads)
	debug_printf ("Failed to uninsert raw breakpoint "
		      "at 0x%s (%s) while deleting it.\n",
		      paddress (bp->pc), strerror (err));
    }
  return err != 0 ? -1 : 0;
}
开发者ID:dbl001,项目名称:binutils,代码行数:25,代码来源:mem-break.c


示例13: reinsert_breakpoints_at

void
reinsert_breakpoints_at (CORE_ADDR pc)
{
  struct process_info *proc = current_process ();
  struct raw_breakpoint *bp;
  int found = 0;

  for (bp = proc->raw_breakpoints; bp != NULL; bp = bp->next)
    if ((bp->raw_type == raw_bkpt_type_sw
	 || bp->raw_type == raw_bkpt_type_hw)
	&& bp->pc == pc)
      {
	found = 1;

	reinsert_raw_breakpoint (bp);
      }

  if (!found)
    {
      /* This can happen when we remove all breakpoints while handling
	 a step-over.  */
      if (debug_threads)
	debug_printf ("Could not find raw breakpoint at 0x%s "
		      "in list (reinserting).\n",
		      paddress (pc));
    }
}
开发者ID:dbl001,项目名称:binutils,代码行数:27,代码来源:mem-break.c


示例14: call_site_for_pc

struct call_site *
call_site_for_pc (struct gdbarch *gdbarch, CORE_ADDR pc)
{
  struct symtab *symtab;
  void **slot = NULL;

  /* -1 as tail call PC can be already after the compilation unit range.  */
  symtab = find_pc_symtab (pc - 1);

  if (symtab != NULL && symtab->call_site_htab != NULL)
    slot = htab_find_slot (symtab->call_site_htab, &pc, NO_INSERT);

  if (slot == NULL)
    {
      struct bound_minimal_symbol msym = lookup_minimal_symbol_by_pc (pc);

      /* DW_TAG_gnu_call_site will be missing just if GCC could not determine
	 the call target.  */
      throw_error (NO_ENTRY_VALUE_ERROR,
		   _("DW_OP_GNU_entry_value resolving cannot find "
		     "DW_TAG_GNU_call_site %s in %s"),
		   paddress (gdbarch, pc),
		   (msym.minsym == NULL ? "???"
		    : SYMBOL_PRINT_NAME (msym.minsym)));
    }

  return *slot;
}
开发者ID:5kg,项目名称:gdb,代码行数:28,代码来源:block.c


示例15: uninsert_raw_breakpoint

static void
uninsert_raw_breakpoint (struct raw_breakpoint *bp)
{
  if (bp->inserted)
    {
      int err;
      unsigned char buf[MAX_BREAKPOINT_LEN];

      bp->inserted = 0;
      /* Since there can be fast tracepoint jumps inserted in the same
	 address range, we use `write_inferior_memory', which takes
	 care of layering breakpoints on top of fast tracepoints, and
	 on top of the buffer we pass it.  This works because we've
	 already unlinked the fast tracepoint jump above.  Also note
	 that we need to pass the current shadow contents, because
	 write_inferior_memory updates any shadow memory with what we
	 pass here, and we want that to be a nop.  */
      memcpy (buf, bp->old_data, breakpoint_len);
      err = write_inferior_memory (bp->pc, buf, breakpoint_len);
      if (err != 0)
	{
	  bp->inserted = 1;

	  if (debug_threads)
	    fprintf (stderr,
		     "Failed to uninsert raw breakpoint at 0x%s (%s).\n",
		     paddress (bp->pc), strerror (err));
	}
    }
}
开发者ID:5kg,项目名称:gdb,代码行数:30,代码来源:mem-break.c


示例16: print_section_info

void
print_section_info (struct target_ops *t, bfd *abfd)
{
  struct target_section *p;
  /* FIXME: 16 is not wide enough when gdbarch_addr_bit > 64.  */
  int wid = gdbarch_addr_bit (gdbarch_from_bfd (abfd)) <= 32 ? 8 : 16;

  printf_filtered ("\t`%s', ", bfd_get_filename (abfd));
  wrap_here ("        ");
  printf_filtered (_("file type %s.\n"), bfd_get_target (abfd));
  if (abfd == exec_bfd)
    printf_filtered (_("\tEntry point: %s\n"),
                     paddress (bfd_get_start_address (abfd)));
  for (p = t->to_sections; p < t->to_sections_end; p++)
    {
      printf_filtered ("\t%s", hex_string_custom (p->addr, wid));
      printf_filtered (" - %s", hex_string_custom (p->endaddr, wid));

      /* FIXME: A format of "08l" is not wide enough for file offsets
	 larger than 4GB.  OTOH, making it "016l" isn't desirable either
	 since most output will then be much wider than necessary.  It
	 may make sense to test the size of the file and choose the
	 format string accordingly.  */
      /* FIXME: i18n: Need to rewrite this sentence.  */
      if (info_verbose)
	printf_filtered (" @ %s",
			 hex_string_custom (p->the_bfd_section->filepos, 8));
      printf_filtered (" is %s", bfd_section_name (p->bfd, p->the_bfd_section));
      if (p->bfd != abfd)
	printf_filtered (" in %s", bfd_get_filename (p->bfd));
      printf_filtered ("\n");
    }
}
开发者ID:davearrama,项目名称:gdb,代码行数:33,代码来源:exec.c


示例17: ax_print

/* Disassemble the expression EXPR, writing to F.  */
void
ax_print (struct ui_file *f, struct agent_expr *x)
{
    int i;

    fprintf_filtered (f, _("Scope: %s\n"), paddress (x->gdbarch, x->scope));
    fprintf_filtered (f, _("Reg mask:"));
    for (i = 0; i < x->reg_mask_len; ++i)
        fprintf_filtered (f, _(" %02x"), x->reg_mask[i]);
    fprintf_filtered (f, _("\n"));

    /* Check the size of the name array against the number of entries in
       the enum, to catch additions that people didn't sync.  */
    if ((sizeof (aop_map) / sizeof (aop_map[0]))
            != aop_last)
        error (_("GDB bug: ax-general.c (ax_print): opcode map out of sync"));

    for (i = 0; i < x->len;)
    {
        enum agent_op op = x->buf[i];

        if (op >= (sizeof (aop_map) / sizeof (aop_map[0]))
                || !aop_map[op].name)
        {
            fprintf_filtered (f, _("%3d  <bad opcode %02x>\n"), i, op);
            i++;
            continue;
        }
        if (i + 1 + aop_map[op].op_size > x->len)
        {
            fprintf_filtered (f, _("%3d  <incomplete opcode %s>\n"),
                              i, aop_map[op].name);
            break;
        }

        fprintf_filtered (f, "%3d  %s", i, aop_map[op].name);
        if (aop_map[op].op_size > 0)
        {
            fputs_filtered (" ", f);

            print_longest (f, 'd', 0,
                           read_const (x, i + 1, aop_map[op].op_size));
        }
        /* Handle the complicated printf arguments specially.  */
        else if (op == aop_printf)
        {
            int slen, nargs;

            i++;
            nargs = x->buf[i++];
            slen = x->buf[i++];
            slen = slen * 256 + x->buf[i++];
            fprintf_filtered (f, _(" \"%s\", %d args"),
                              &(x->buf[i]), nargs);
            i += slen - 1;
        }
        fprintf_filtered (f, "\n");
        i += 1 + aop_map[op].op_size;
    }
}
开发者ID:asdlei00,项目名称:gdb,代码行数:61,代码来源:ax-general.c


示例18: insert_memory_breakpoint

int
insert_memory_breakpoint (struct raw_breakpoint *bp)
{
  unsigned char buf[MAX_BREAKPOINT_LEN];
  int err;

  if (breakpoint_data == NULL)
    return 1;

  /* If the architecture treats the size field of Z packets as a
     'kind' field, then we'll need to be able to know which is the
     breakpoint instruction too.  */
  if (bp->size != breakpoint_len)
    {
      if (debug_threads)
	debug_printf ("Don't know how to insert breakpoints of size %d.\n",
		      bp->size);
      return -1;
    }

  /* Note that there can be fast tracepoint jumps installed in the
     same memory range, so to get at the original memory, we need to
     use read_inferior_memory, which masks those out.  */
  err = read_inferior_memory (bp->pc, buf, breakpoint_len);
  if (err != 0)
    {
      if (debug_threads)
	debug_printf ("Failed to read shadow memory of"
		      " breakpoint at 0x%s (%s).\n",
		      paddress (bp->pc), strerror (err));
    }
  else
    {
      memcpy (bp->old_data, buf, breakpoint_len);

      err = (*the_target->write_memory) (bp->pc, breakpoint_data,
					 breakpoint_len);
      if (err != 0)
	{
	  if (debug_threads)
	    debug_printf ("Failed to insert breakpoint at 0x%s (%s).\n",
			  paddress (bp->pc), strerror (err));
	}
    }
  return err != 0 ? -1 : 0;
}
开发者ID:dbl001,项目名称:binutils,代码行数:46,代码来源:mem-break.c


示例19: amd64_windows_frame_prev_register

static struct value *
amd64_windows_frame_prev_register (struct frame_info *this_frame,
				   void **this_cache, int regnum)
{
  struct gdbarch *gdbarch = get_frame_arch (this_frame);
  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
  struct amd64_windows_frame_cache *cache =
    amd64_windows_frame_cache (this_frame, this_cache);
  struct value *val;
  CORE_ADDR prev;

  if (frame_debug)
    fprintf_unfiltered (gdb_stdlog,
			"amd64_windows_frame_prev_register %s for sp=%s\n",
			gdbarch_register_name (gdbarch, regnum),
			paddress (gdbarch, cache->prev_sp));

  if (regnum >= AMD64_XMM0_REGNUM && regnum <= AMD64_XMM0_REGNUM + 15)
      prev = cache->prev_xmm_addr[regnum - AMD64_XMM0_REGNUM];
  else if (regnum == AMD64_RSP_REGNUM)
    {
      prev = cache->prev_rsp_addr;
      if (prev == 0)
	return frame_unwind_got_constant (this_frame, regnum, cache->prev_sp);
    }
  else if (regnum >= AMD64_RAX_REGNUM && regnum <= AMD64_R15_REGNUM)
    prev = cache->prev_reg_addr[regnum - AMD64_RAX_REGNUM];
  else if (regnum == AMD64_RIP_REGNUM)
    prev = cache->prev_rip_addr;
  else
    prev = 0;

  if (prev && frame_debug)
    fprintf_unfiltered (gdb_stdlog, "  -> at %s\n", paddress (gdbarch, prev));

  if (prev)
    {
      /* Register was saved.  */
      return frame_unwind_got_memory (this_frame, regnum, prev);
    }
  else
    {
      /* Register is either volatile or not modified.  */
      return frame_unwind_got_register (this_frame, regnum, regnum);
    }
}
开发者ID:CromFr,项目名称:gdb,代码行数:46,代码来源:amd64-windows-tdep.c


示例20: gcore_create_callback

static int
gcore_create_callback (CORE_ADDR vaddr, unsigned long size, int read,
		       int write, int exec, int modified, void *data)
{
  bfd *obfd = data;
  asection *osec;
  flagword flags = SEC_ALLOC | SEC_HAS_CONTENTS | SEC_LOAD;

  /* If the memory segment has no permissions set, ignore it, otherwise
     when we later try to access it for read/write, we'll get an error
     or jam the kernel.  */
  if (read == 0 && write == 0 && exec == 0 && modified == 0)
    {
      if (info_verbose)
        {
          fprintf_filtered (gdb_stdout, "Ignore segment, %s bytes at %s\n",
                            plongest (size), paddress (target_gdbarch (), vaddr));
        }

      return 0;
    }

  if (write == 0 && modified == 0 && !solib_keep_data_in_core (vaddr, size))
    {
      /* See if this region of memory lies inside a known file on disk.
	 If so, we can avoid copying its contents by clearing SEC_LOAD.  */
      struct objfile *objfile;
      struct obj_section *objsec;

      ALL_OBJSECTIONS (objfile, objsec)
	{
	  bfd *abfd = objfile->obfd;
	  asection *asec = objsec->the_bfd_section;
	  bfd_vma align = (bfd_vma) 1 << bfd_get_section_alignment (abfd,
								    asec);
	  bfd_vma start = obj_section_addr (objsec) & -align;
	  bfd_vma end = (obj_section_endaddr (objsec) + align - 1) & -align;

	  /* Match if either the entire memory region lies inside the
	     section (i.e. a mapping covering some pages of a large
	     segment) or the entire section lies inside the memory region
	     (i.e. a mapping covering multiple small sections).

	     This BFD was synthesized from reading target memory,
	     we don't want to omit that.  */
	  if (objfile->separate_debug_objfile_backlink == NULL
	      && ((vaddr >= start && vaddr + size <= end)
	          || (start >= vaddr && end <= vaddr + size))
	      && !(bfd_get_file_flags (abfd) & BFD_IN_MEMORY))
	    {
	      flags &= ~(SEC_LOAD | SEC_HAS_CONTENTS);
	      goto keep;	/* Break out of two nested for loops.  */
	    }
	}

    keep:;
    }
开发者ID:atgreen,项目名称:binutils-gdb,代码行数:57,代码来源:gcore.c



注:本文中的paddress函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ page函数代码示例发布时间:2022-05-30
下一篇:
C++ paddingTop函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap