Mercurial > hg > CbC > CbC_gcc
comparison gcc/gcov-dump.c @ 55:77e2b8dfacca gcc-4.4.5
update it from 4.4.3 to 4.5.0
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 12 Feb 2010 23:39:51 +0900 |
parents | 3bfb6c00c1e0 |
children | b7f97abdc517 |
comparison
equal
deleted
inserted
replaced
52:c156f1bd5cd9 | 55:77e2b8dfacca |
---|---|
1 /* Dump a gcov file, for debugging use. | 1 /* Dump a gcov file, for debugging use. |
2 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 | 2 Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 |
3 Free Software Foundation, Inc. | 3 Free Software Foundation, Inc. |
4 Contributed by Nathan Sidwell <nathan@codesourcery.com> | 4 Contributed by Nathan Sidwell <nathan@codesourcery.com> |
5 | 5 |
6 Gcov is free software; you can redistribute it and/or modify | 6 Gcov is free software; you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
119 | 119 |
120 static void | 120 static void |
121 print_version (void) | 121 print_version (void) |
122 { | 122 { |
123 printf ("gcov-dump %s%s\n", pkgversion_string, version_string); | 123 printf ("gcov-dump %s%s\n", pkgversion_string, version_string); |
124 printf ("Copyright (C) 2010 Free Software Foundation, Inc.\n"); | 124 printf ("Copyright (C) 2009 Free Software Foundation, Inc.\n"); |
125 printf ("This is free software; see the source for copying conditions.\n" | 125 printf ("This is free software; see the source for copying conditions.\n" |
126 "There is NO warranty; not even for MERCHANTABILITY or \n" | 126 "There is NO warranty; not even for MERCHANTABILITY or \n" |
127 "FITNESS FOR A PARTICULAR PURPOSE.\n\n"); | 127 "FITNESS FOR A PARTICULAR PURPOSE.\n\n"); |
128 } | 128 } |
129 | 129 |
155 unsigned magic = gcov_read_unsigned (); | 155 unsigned magic = gcov_read_unsigned (); |
156 unsigned version; | 156 unsigned version; |
157 const char *type = NULL; | 157 const char *type = NULL; |
158 int endianness = 0; | 158 int endianness = 0; |
159 char m[4], v[4]; | 159 char m[4], v[4]; |
160 | 160 |
161 if ((endianness = gcov_magic (magic, GCOV_DATA_MAGIC))) | 161 if ((endianness = gcov_magic (magic, GCOV_DATA_MAGIC))) |
162 type = "data"; | 162 type = "data"; |
163 else if ((endianness = gcov_magic (magic, GCOV_NOTE_MAGIC))) | 163 else if ((endianness = gcov_magic (magic, GCOV_NOTE_MAGIC))) |
164 type = "note"; | 164 type = "note"; |
165 else | 165 else |
169 return; | 169 return; |
170 } | 170 } |
171 version = gcov_read_unsigned (); | 171 version = gcov_read_unsigned (); |
172 GCOV_UNSIGNED2STRING (v, version); | 172 GCOV_UNSIGNED2STRING (v, version); |
173 GCOV_UNSIGNED2STRING (m, magic); | 173 GCOV_UNSIGNED2STRING (m, magic); |
174 | 174 |
175 printf ("%s:%s:magic `%.4s':version `%.4s'%s\n", filename, type, | 175 printf ("%s:%s:magic `%.4s':version `%.4s'%s\n", filename, type, |
176 m, v, endianness < 0 ? " (swapped endianness)" : ""); | 176 m, v, endianness < 0 ? " (swapped endianness)" : ""); |
177 if (version != GCOV_VERSION) | 177 if (version != GCOV_VERSION) |
178 { | 178 { |
179 char e[4]; | 179 char e[4]; |
180 | 180 |
181 GCOV_UNSIGNED2STRING (e, GCOV_VERSION); | 181 GCOV_UNSIGNED2STRING (e, GCOV_VERSION); |
182 printf ("%s:warning:current version is `%.4s'\n", filename, e); | 182 printf ("%s:warning:current version is `%.4s'\n", filename, e); |
183 } | 183 } |
184 } | 184 } |
185 | 185 |
187 { | 187 { |
188 unsigned stamp = gcov_read_unsigned (); | 188 unsigned stamp = gcov_read_unsigned (); |
189 | 189 |
190 printf ("%s:stamp %lu\n", filename, (unsigned long)stamp); | 190 printf ("%s:stamp %lu\n", filename, (unsigned long)stamp); |
191 } | 191 } |
192 | 192 |
193 while (1) | 193 while (1) |
194 { | 194 { |
195 gcov_position_t base, position = gcov_position (); | 195 gcov_position_t base, position = gcov_position (); |
196 unsigned tag, length; | 196 unsigned tag, length; |
197 tag_format_t const *format; | 197 tag_format_t const *format; |