~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to test/resolve_stack_dump.c

  • Committer: Brian Aker
  • Date: 2008-07-09 15:38:43 UTC
  • mfrom: (77.1.44 codestyle)
  • Revision ID: brian@tangent.org-20080709153843-tu7d42yrjq6fd00k
Merging patch from Monty.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
   along with this program; if not, write to the Free Software
14
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
 
/* Resolve numeric stack dump produced by mysqld 3.23.30 and later
 
16
/* Resolve numeric stack dump produced by drizzled 3.23.30 and later
17
17
   versions into symbolic names. By Sasha Pachev <sasha@mysql.com>
18
18
 */
19
19
 
21
21
#include <m_ctype.h>
22
22
#include <my_sys.h>
23
23
#include <m_string.h>
24
 
#include <mysql_version.h>
 
24
#include <drizzle_version.h>
25
25
#include <errno.h>
26
26
#include <my_getopt.h>
27
27
 
61
61
};
62
62
 
63
63
 
64
 
static void verify_sort();
 
64
static void verify_sort(void);
65
65
 
66
66
 
67
67
#include <help_start.h>
73
73
}
74
74
 
75
75
 
76
 
static void usage()
 
76
static void usage(void)
77
77
{
78
78
  print_version();
79
79
  printf("MySQL AB, by Sasha Pachev\n");
84
84
  my_print_help(my_long_options);
85
85
  my_print_variables(my_long_options);
86
86
  printf("\n\
87
 
The symbols-file should include the output from:  'nm --numeric-sort mysqld'.\n\
88
 
The numeric-dump-file should contain a numeric stack trace from mysqld.\n\
 
87
The symbols-file should include the output from:  'nm --numeric-sort drizzled'.\n\
 
88
The numeric-dump-file should contain a numeric stack trace from drizzled.\n\
89
89
If the numeric-dump-file is not given, the stack trace is read from stdin.\n");
90
90
}
91
91
 
158
158
}
159
159
 
160
160
 
161
 
static void open_files()
 
161
static void open_files(void)
162
162
{
163
163
  fp_out = stdout;
164
164
  fp_dump = stdin;
168
168
  /* if name not given, assume stdin*/
169
169
 
170
170
  if (!sym_fname)
171
 
    die("Please run nm --numeric-sort on mysqld binary that produced stack \
 
171
    die("Please run nm --numeric-sort on drizzled binary that produced stack \
172
172
trace dump and specify the path to it with -s or --symbols-file");
173
173
  if (!(fp_sym = my_fopen(sym_fname, O_RDONLY, MYF(MY_WME))))
174
174
    die("Could not open %s", sym_fname);
222
222
  return 0;
223
223
}
224
224
 
225
 
static void init_sym_table()
 
225
static void init_sym_table(void)
226
226
{
227
227
  char buf[512];
228
228
  if (my_init_dynamic_array(&sym_table, sizeof(SYM_ENTRY), INIT_SYM_TABLE,
241
241
  verify_sort();
242
242
}
243
243
 
244
 
static void clean_up()
 
244
static void clean_up(void)
245
245
{
246
246
  delete_dynamic(&sym_table);
247
247
}
284
284
}
285
285
 
286
286
 
287
 
static void do_resolve()
 
287
static void do_resolve(void)
288
288
{
289
289
  char buf[1024], *p;
290
290
  while (fgets(buf, sizeof(buf), fp_dump))