GCC Middle and Back End API Reference
gcov-dump.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "version.h"
#include "intl.h"
#include "diagnostic.h"
#include <getopt.h>
#include "gcov-io.h"
#include "gcov-io.cc"
#include "gcov-counter.def"
Include dependency graph for gcov-dump.cc:

Data Structures

struct  tag_format
 

Macros

#define INCLUDE_VECTOR
 
#define IN_GCOV   (-1)
 
#define VALUE_PADDING_PREFIX   " "
 
#define VALUE_PREFIX   "%2d: "
 
#define DEF_GCOV_COUNTER(COUNTER, NAME, MERGE_FN)   NAME,
 

Typedefs

typedef struct tag_format tag_format_t
 

Functions

static void dump_gcov_file (const char *)
 
static void print_prefix (const char *, unsigned, gcov_position_t)
 
static void print_usage (void)
 
static void print_version (void)
 
static void tag_function (const char *, unsigned, int, unsigned)
 
static void tag_blocks (const char *, unsigned, int, unsigned)
 
static void tag_arcs (const char *, unsigned, int, unsigned)
 
static void tag_conditions (const char *, unsigned, int, unsigned)
 
static void tag_lines (const char *, unsigned, int, unsigned)
 
static void tag_counters (const char *, unsigned, int, unsigned)
 
static void tag_summary (const char *, unsigned, int, unsigned)
 
int main (int, char **)
 

Variables

static int flag_dump_contents = 0
 
static int flag_dump_positions = 0
 
static int flag_dump_raw = 0
 
static int flag_dump_stable = 0
 
static const struct option options []
 
static const tag_format_t tag_table []
 

Macro Definition Documentation

◆ DEF_GCOV_COUNTER

#define DEF_GCOV_COUNTER ( COUNTER,
NAME,
MERGE_FN )   NAME,

◆ IN_GCOV

#define IN_GCOV   (-1)

◆ INCLUDE_VECTOR

#define INCLUDE_VECTOR
Dump a gcov file, for debugging use.
   Copyright (C) 2002-2024 Free Software Foundation, Inc.
   Contributed by Nathan Sidwell <nathan@codesourcery.com>

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

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

You should have received a copy of the GNU General Public License
along with Gcov; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   

◆ VALUE_PADDING_PREFIX

#define VALUE_PADDING_PREFIX   " "

◆ VALUE_PREFIX

#define VALUE_PREFIX   "%2d: "

Referenced by tag_counters().

Typedef Documentation

◆ tag_format_t

Function Documentation

◆ dump_gcov_file()

◆ main()

◆ print_prefix()

static void print_prefix ( const char * filename,
unsigned depth,
gcov_position_t position )
static

◆ print_usage()

static void print_usage ( void )
static

References ggc_alloc().

Referenced by main(), main(), process_args(), and process_args().

◆ print_version()

static void print_version ( void )
static

References ggc_alloc().

Referenced by main().

◆ tag_arcs()

◆ tag_blocks()

static void tag_blocks ( const char * filename,
unsigned tag,
int length,
unsigned depth )
static

◆ tag_conditions()

static void tag_conditions ( const char * filename,
unsigned ,
int length,
unsigned depth )
static
Print number of conditions (not outcomes, i.e. if (x && y) is 2, not 4).   

References flag_dump_contents, gcov_position(), gcov_read_unsigned(), GCOV_TAG_CONDS_NUM, ggc_alloc(), print_prefix(), and VALUE_PADDING_PREFIX.

◆ tag_counters()

◆ tag_function()

static void tag_function ( const char * filename,
unsigned tag,
int length,
unsigned depth )
static

◆ tag_lines()

◆ tag_summary()

static void tag_summary ( const char * filename,
unsigned tag,
int length,
unsigned depth )
static

Variable Documentation

◆ flag_dump_contents

int flag_dump_contents = 0
static

◆ flag_dump_positions

int flag_dump_positions = 0
static

Referenced by main(), and print_prefix().

◆ flag_dump_raw

int flag_dump_raw = 0
static

Referenced by main(), and tag_counters().

◆ flag_dump_stable

int flag_dump_stable = 0
static

Referenced by main(), and tag_counters().

◆ options

const struct option options[]
static
Initial value:
=
{
{ "help", no_argument, NULL, 'h' },
{ "version", no_argument, NULL, 'v' },
{ "long", no_argument, NULL, 'l' },
{ "positions", no_argument, NULL, 'o' },
{ "raw", no_argument, NULL, 'r' },
{ "stable", no_argument, NULL, 's' },
{}
}
T * ggc_alloc(ALONE_CXX_MEM_STAT_INFO)
Definition ggc.h:184
#define NULL
Definition system.h:50

◆ tag_table

const tag_format_t tag_table[]
static
Initial value:
=
{
{0, "NOP", NULL},
{0, "UNKNOWN", NULL},
{0, "COUNTERS", tag_counters},
{GCOV_TAG_ARCS, "ARCS", tag_arcs},
{GCOV_TAG_CONDS, "CONDITIONS", tag_conditions},
{GCOV_TAG_OBJECT_SUMMARY, "OBJECT_SUMMARY", tag_summary},
{0, NULL, NULL}
}
static void tag_conditions(const char *, unsigned, int, unsigned)
Definition gcov-dump.cc:399
static void tag_arcs(const char *, unsigned, int, unsigned)
Definition gcov-dump.cc:356
static void tag_blocks(const char *, unsigned, int, unsigned)
Definition gcov-dump.cc:348
static void tag_function(const char *, unsigned, int, unsigned)
Definition gcov-dump.cc:312
static void tag_summary(const char *, unsigned, int, unsigned)
Definition gcov-dump.cc:541
static void tag_lines(const char *, unsigned, int, unsigned)
Definition gcov-dump.cc:420
static void tag_counters(const char *, unsigned, int, unsigned)
Definition gcov-dump.cc:465
#define GCOV_TAG_OBJECT_SUMMARY
Definition gcov-io.h:271
#define GCOV_TAG_FUNCTION
Definition gcov-io.h:257
#define GCOV_TAG_ARCS
Definition gcov-io.h:261
#define GCOV_TAG_CONDS
Definition gcov-io.h:264
#define GCOV_TAG_BLOCKS
Definition gcov-io.h:259
#define GCOV_TAG_LINES
Definition gcov-io.h:267

Referenced by dump_gcov_file().