Print this page
10822 ctfdump -c should include non-root types
Reviewed by: Robert Mustacchi <rm@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/ctfdump/ctfdump.c
          +++ new/usr/src/cmd/ctfdump/ctfdump.c
↓ open down ↓ 2 lines elided ↑ open up ↑
   3    3   * Common Development and Distribution License ("CDDL"), version 1.0.
   4    4   * You may only use this file in accordance with the terms of version
   5    5   * 1.0 of the CDDL.
   6    6   *
   7    7   * A full copy of the text of the CDDL should have accompanied this
   8    8   * source.  A copy of the CDDL is also available via the Internet at
   9    9   * http://www.illumos.org/license/CDDL.
  10   10   */
  11   11  
  12   12  /*
  13      - * Copyright (c) 2018, Joyent, Inc.
       13 + * Copyright (c) 2019, Joyent, Inc.
  14   14   */
  15   15  
  16   16  /*
  17   17   * Dump information about CTF containers.
  18   18   */
  19   19  
  20   20  #include <stdio.h>
  21   21  #include <unistd.h>
  22   22  #include <libctf.h>
  23   23  #include <libgen.h>
↓ open down ↓ 951 lines elided ↑ open up ↑
 975  975          ctf_id_t max_id = ctf_max_id(g_fp);
 976  976          size_t count = 0;
 977  977  
 978  978          (void) printf("/* Types */\n\n");
 979  979  
 980  980          if ((idnames = calloc(max_id + 1, sizeof (idnames[0]))) == NULL) {
 981  981                  ctfdump_fatal("failed to alloc idnames: %s\n",
 982  982                      strerror(errno));
 983  983          }
 984  984  
 985      -        if (ctf_type_iter(g_fp, B_FALSE, ctfsrc_collect_types_cb,
      985 +        if (ctf_type_iter(g_fp, B_TRUE, ctfsrc_collect_types_cb,
 986  986              idnames) == CTF_ERR) {
 987  987                  warnx("failed to collect types: %s",
 988  988                      ctf_errmsg(ctf_errno(g_fp)));
 989  989                  g_exit = 1;
 990  990          }
 991  991  
 992  992          qsort(idnames, max_id, sizeof (ctf_idname_t), idname_compare);
 993  993  
 994  994          for (size_t i = 0; i < max_id; i++) {
 995  995                  if (idnames[i].ci_id != 0)
↓ open down ↓ 240 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX