~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/resolve_stack_dump.cc

  • Committer: Padraig O'Sullivan
  • Date: 2009-09-17 00:08:20 UTC
  • mto: (1126.9.3 captain-20090915-01)
  • mto: This revision was merged to the branch mainline in revision 1133.
  • Revision ID: osullivan.padraig@gmail.com-20090917000820-urd6p46qngi1okjp
Updated calls to some dtrace probes to cast the parameter to const char *
appropriately. Also, removed the additional variable in places that I was
using.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
   versions into symbolic names. By Sasha Pachev <sasha@mysql.com>
18
18
 */
19
19
 
20
 
#include "config.h"
21
 
 
22
 
#include <cstdio>
23
 
#include <cerrno>
24
 
 
25
 
#include "drizzled/charset_info.h"
26
 
#include "drizzled/internal/my_sys.h"
27
 
#include "drizzled/internal/m_string.h"
28
 
#include "drizzled/option.h"
29
 
 
30
 
using namespace drizzled;
 
20
#include <drizzled/global.h>
 
21
#include <mystrings/m_ctype.h>
 
22
#include <mysys/my_sys.h>
 
23
#include <mystrings/m_string.h>
 
24
#include <errno.h>
 
25
#include <mysys/my_getopt.h>
 
26
#include <stdio.h>
31
27
 
32
28
#define INIT_SYM_TABLE  4096
33
29
#define INC_SYM_TABLE  4096
35
31
#define DUMP_VERSION "1.4"
36
32
#define HEX_INVALID  (unsigned char)255
37
33
 
 
34
extern "C" bool get_one_option(int optid, const struct my_option *, char *);
 
35
 
38
36
typedef struct sym_entry
39
37
{
40
38
  char symbol[MAX_SYM_SIZE];
46
44
static DYNAMIC_ARRAY sym_table; /* how do you like this , static DYNAMIC ? */
47
45
static FILE* fp_dump, *fp_sym = 0, *fp_out;
48
46
 
49
 
static struct option my_long_options[] =
 
47
static struct my_option my_long_options[] =
50
48
{
51
49
  {"help", 'h', "Display this help and exit.",
52
50
   0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
65
63
 
66
64
static void print_version(void)
67
65
{
68
 
  printf("%s  Ver %s Distrib %s, for %s-%s (%s)\n",internal::my_progname,DUMP_VERSION,
 
66
  printf("%s  Ver %s Distrib %s, for %s-%s (%s)\n",my_progname,DUMP_VERSION,
69
67
         VERSION,HOST_VENDOR,HOST_OS,HOST_CPU);
70
68
}
71
69
 
77
75
  printf("This software comes with ABSOLUTELY NO WARRANTY\n\n");
78
76
  printf("Resolve numeric stack strace dump into symbols.\n\n");
79
77
  printf("Usage: %s [OPTIONS] symbols-file [numeric-dump-file]\n",
80
 
         internal::my_progname);
 
78
         my_progname);
81
79
  my_print_help(my_long_options);
82
80
  my_print_variables(my_long_options);
83
81
  printf("\n\
90
88
{
91
89
  va_list args;
92
90
  va_start(args, fmt);
93
 
  fprintf(stderr, "%s: ", internal::my_progname);
 
91
  fprintf(stderr, "%s: ", my_progname);
94
92
  vfprintf(stderr, fmt, args);
95
93
  fprintf(stderr, "\n");
96
94
  va_end(args);
98
96
}
99
97
 
100
98
 
101
 
static int get_one_option(int optid, const struct option *, char *)
 
99
bool get_one_option(int optid, const struct my_option *, char *)
102
100
{
103
101
  switch(optid) {
104
102
  case 'V':