当前位置: 首页>>代码示例>>C++>>正文


C++ printf_filtered函数代码示例

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


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

示例1: annotate_error

void
annotate_error (void)
{
  if (annotation_level > 1)
    printf_filtered (("\n\032\032error\n"));
}
开发者ID:OpenInkpot-archive,项目名称:iplinux-gdb,代码行数:6,代码来源:annotate.c

示例2: darwin_debug_regions

static void
darwin_debug_regions (task_t task, mach_vm_address_t address, int max)
{
  kern_return_t kret;
  vm_region_basic_info_data_64_t info, prev_info;
  mach_vm_address_t prev_address;
  mach_vm_size_t size, prev_size;

  mach_port_t object_name;
  mach_msg_type_number_t count;

  int nsubregions = 0;
  int num_printed = 0;

  count = VM_REGION_BASIC_INFO_COUNT_64;
  kret = mach_vm_region (task, &address, &size, VM_REGION_BASIC_INFO_64,
			 (vm_region_info_t) &info, &count, &object_name);
  if (kret != KERN_SUCCESS)
    {
      printf_filtered (_("No memory regions."));
      return;
    }
  memcpy (&prev_info, &info, sizeof (vm_region_basic_info_data_64_t));
  prev_address = address;
  prev_size = size;
  nsubregions = 1;

  for (;;)
    {
      int print = 0;
      int done = 0;

      address = prev_address + prev_size;

      /* Check to see if address space has wrapped around.  */
      if (address == 0)
        print = done = 1;

      if (!done)
        {
          count = VM_REGION_BASIC_INFO_COUNT_64;
          kret =
            mach_vm_region (task, &address, &size, VM_REGION_BASIC_INFO_64,
                 	      (vm_region_info_t) &info, &count, &object_name);
          if (kret != KERN_SUCCESS)
            {
              size = 0;
              print = done = 1;
            }
        }

      if (address != prev_address + prev_size)
        print = 1;

      if ((info.protection != prev_info.protection)
          || (info.max_protection != prev_info.max_protection)
          || (info.inheritance != prev_info.inheritance)
          || (info.shared != prev_info.reserved)
          || (info.reserved != prev_info.reserved))
        print = 1;

      if (print)
        {
          printf_filtered (_("%s-%s %s/%s  %s %s %s"),
                           paddress (target_gdbarch (), prev_address),
                           paddress (target_gdbarch (), prev_address + prev_size),
                           unparse_protection (prev_info.protection),
                           unparse_protection (prev_info.max_protection),
                           unparse_inheritance (prev_info.inheritance),
                           prev_info.shared ? _("shrd") : _("priv"),
                           prev_info.reserved ? _("reserved") : _("not-rsvd"));

          if (nsubregions > 1)
            printf_filtered (_(" (%d sub-rgn)"), nsubregions);

          printf_filtered (_("\n"));

          prev_address = address;
          prev_size = size;
          memcpy (&prev_info, &info, sizeof (vm_region_basic_info_data_64_t));
          nsubregions = 1;

          num_printed++;
        }
      else
        {
          prev_size += size;
          nsubregions++;
        }

      if ((max > 0) && (num_printed >= max))
        done = 1;

      if (done)
        break;
    }
}
开发者ID:Winter3un,项目名称:ctf_task,代码行数:97,代码来源:darwin-nat-info.c

示例3: find_command

static void
find_command (char *args, int from_tty)
{
    /* Command line parameters.
       These are initialized to avoid uninitialized warnings from -Wall.  */
    ULONGEST max_count = 0;
    char *pattern_buf = 0;
    ULONGEST pattern_len = 0;
    CORE_ADDR start_addr = 0;
    ULONGEST search_space_len = 0;
    /* End of command line parameters.  */
    unsigned int found_count;
    CORE_ADDR last_found_addr;
    struct cleanup *old_cleanups;

    parse_find_args (args, &max_count, &pattern_buf, &pattern_len,
                     &start_addr, &search_space_len);

    old_cleanups = make_cleanup (free_current_contents, &pattern_buf);

    /* Perform the search.  */

    found_count = 0;
    last_found_addr = 0;

    while (search_space_len >= pattern_len
            && found_count < max_count)
    {
        /* Offset from start of this iteration to the next iteration.  */
        ULONGEST next_iter_incr;
        CORE_ADDR found_addr;
        int found = target_search_memory (start_addr, search_space_len,
                                          pattern_buf, pattern_len, &found_addr);

        if (found <= 0)
            break;

        print_address (found_addr, gdb_stdout);
        printf_filtered ("\n");
        ++found_count;
        last_found_addr = found_addr;

        /* Begin next iteration at one byte past this match.  */
        next_iter_incr = (found_addr - start_addr) + 1;

        /* For robustness, we don't let search_space_len go -ve here.  */
        if (search_space_len >= next_iter_incr)
            search_space_len -= next_iter_incr;
        else
            search_space_len = 0;
        start_addr += next_iter_incr;
    }

    /* Record and print the results.  */

    set_internalvar_integer (lookup_internalvar ("numfound"), found_count);
    if (found_count > 0)
    {
        struct gdbarch *gdbarch = current_gdbarch;
        struct type *ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
        set_internalvar (lookup_internalvar ("_"),
                         value_from_pointer (ptr_type, last_found_addr));
    }

    if (found_count == 0)
        printf_filtered ("Pattern not found.\n");
    else
        printf_filtered ("%d pattern%s found.\n", found_count,
                         found_count > 1 ? "s" : "");

    do_cleanups (old_cleanups);
}
开发者ID:OpenInkpot-archive,项目名称:iplinux-gdb,代码行数:72,代码来源:findcmd.c

示例4: annotate_array_section_end

void
annotate_array_section_end (void)
{
  if (annotation_level == 2)
    printf_filtered (("\n\032\032array-section-end\n"));
}
开发者ID:OpenInkpot-archive,项目名称:iplinux-gdb,代码行数:6,代码来源:annotate.c

示例5: annotate_starting

void
annotate_starting (void)
{
  if (annotation_level > 1)
    printf_filtered (("\n\032\032starting\n"));
}
开发者ID:OpenInkpot-archive,项目名称:iplinux-gdb,代码行数:6,代码来源:annotate.c

示例6: annotate_frame_end

void
annotate_frame_end (void)
{
  if (annotation_level == 2)
    printf_filtered (("\n\032\032frame-end\n"));
}
开发者ID:OpenInkpot-archive,项目名称:iplinux-gdb,代码行数:6,代码来源:annotate.c

示例7: annotate_elt_rep_end

void
annotate_elt_rep_end (void)
{
  if (annotation_level == 2)
    printf_filtered (("\n\032\032elt-rep-end\n"));
}
开发者ID:OpenInkpot-archive,项目名称:iplinux-gdb,代码行数:6,代码来源:annotate.c

示例8: annotate_display_end

void
annotate_display_end (void)
{
  if (annotation_level == 2)
    printf_filtered (("\n\032\032display-end\n"));
}
开发者ID:OpenInkpot-archive,项目名称:iplinux-gdb,代码行数:6,代码来源:annotate.c

示例9: annotate_arg_begin

void
annotate_arg_begin (void)
{
  if (annotation_level == 2)
    printf_filtered (("\n\032\032arg-begin\n"));
}
开发者ID:OpenInkpot-archive,项目名称:iplinux-gdb,代码行数:6,代码来源:annotate.c

示例10: annotate_display_expression

void
annotate_display_expression (void)
{
  if (annotation_level == 2)
    printf_filtered (("\n\032\032display-expression\n"));
}
开发者ID:OpenInkpot-archive,项目名称:iplinux-gdb,代码行数:6,代码来源:annotate.c

示例11: annotate_display_value

void
annotate_display_value (void)
{
  if (annotation_level == 2)
    printf_filtered (("\n\032\032display-value\n"));
}
开发者ID:OpenInkpot-archive,项目名称:iplinux-gdb,代码行数:6,代码来源:annotate.c

示例12: annotate_display_format

void
annotate_display_format (void)
{
  if (annotation_level == 2)
    printf_filtered (("\n\032\032display-format\n"));
}
开发者ID:OpenInkpot-archive,项目名称:iplinux-gdb,代码行数:6,代码来源:annotate.c

示例13: annotate_display_begin

void
annotate_display_begin (void)
{
  if (annotation_level == 2)
    printf_filtered (("\n\032\032display-begin\n"));
}
开发者ID:OpenInkpot-archive,项目名称:iplinux-gdb,代码行数:6,代码来源:annotate.c

示例14: annotate_value_history_end

void
annotate_value_history_end (void)
{
  if (annotation_level == 2)
    printf_filtered (("\n\032\032value-history-end\n"));
}
开发者ID:OpenInkpot-archive,项目名称:iplinux-gdb,代码行数:6,代码来源:annotate.c

示例15: annotate_frame_source_line

void
annotate_frame_source_line (void)
{
  if (annotation_level == 2)
    printf_filtered (("\n\032\032frame-source-line\n"));
}
开发者ID:OpenInkpot-archive,项目名称:iplinux-gdb,代码行数:6,代码来源:annotate.c


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