More Char/HChar fixes and constification.
authorflorian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Sat, 27 Oct 2012 18:39:11 +0000 (18:39 +0000)
committerflorian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Sat, 27 Oct 2012 18:39:11 +0000 (18:39 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13088 a5019735-40e9-0310-863c-91ae7b9d1cf9

46 files changed:
cachegrind/cg_main.c
cachegrind/cg_sim.c
callgrind/dump.c
callgrind/events.c
callgrind/events.h
callgrind/fn.c
callgrind/global.h
callgrind/main.c
callgrind/sim.c
coregrind/m_aspacemgr/aspacemgr-common.c
coregrind/m_aspacemgr/aspacemgr-linux.c
coregrind/m_aspacemgr/priv_aspacemgr.h
coregrind/m_coredump/coredump-elf.c
coregrind/m_debugger.c
coregrind/m_debuglog.c
coregrind/m_errormgr.c
coregrind/m_gdbserver/server.c
coregrind/m_hashtable.c
coregrind/m_libcassert.c
coregrind/m_libcfile.c
coregrind/m_libcprint.c
coregrind/m_main.c
coregrind/m_scheduler/scheduler.c
coregrind/m_tooliface.c
coregrind/m_translate.c
coregrind/m_vkiscnums.c
coregrind/pub_core_aspacemgr.h
coregrind/pub_core_debuglog.h
coregrind/pub_core_libcfile.h
coregrind/pub_core_scheduler.h
coregrind/pub_core_tooliface.h
drd/drd_error.c
drd/tests/unit_vc.c
exp-bbv/bbv_main.c
exp-sgcheck/pc_common.c
exp-sgcheck/pc_common.h
helgrind/hg_errors.c
helgrind/hg_errors.h
include/pub_tool_hashtable.h
include/pub_tool_libcprint.h
include/pub_tool_tooliface.h
include/pub_tool_vkiscnums.h
massif/ms_main.c
memcheck/mc_errors.c
memcheck/mc_include.h
memcheck/mc_main.c

index 78c9d6062719c5851d3f3dc4993c48775e1455a5..c161177d9316f078905c03449f959d825dbed2c6 100644 (file)
@@ -1259,7 +1259,8 @@ static void fprint_CC_table_and_calc_totals(void)
 {
    Int     i, fd;
    SysRes  sres;
-   Char    buf[512], *currFile = NULL, *currFn = NULL;
+   HChar    buf[512];
+   Char    *currFile = NULL, *currFn = NULL;
    LineCC* lineCC;
 
    // Setup output filename.  Nb: it's important to do this now, ie. as late
@@ -1464,7 +1465,7 @@ static UInt ULong_width(ULong n)
 
 static void cg_fini(Int exitcode)
 {
-   static Char buf1[128], buf2[128], buf3[128], buf4[123];
+   static HChar buf1[128], buf2[128], buf3[128], buf4[123];
    static HChar fmt[128];
 
    CacheCC  D_total;
index 152e5dd711b54ae6fe1673d32138c633fba5156a..ec3fa29f548902609edb6f9185bdaa81e69be747 100644 (file)
@@ -46,7 +46,7 @@ typedef struct {
    Int          sets_min_1;
    Int          line_size_bits;
    Int          tag_shift;
-   Char         desc_line[128];
+   HChar        desc_line[128];
    UWord*       tags;
 } cache_t2;
 
index 93f711deb5234266394fb21188939b79b0969ce2..e923783a78c1d23823e37a49d9286f16e2af78a3 100644 (file)
@@ -41,7 +41,7 @@ static Char* out_directory = 0;
 static Bool dumps_initialized = False;
 
 /* Command */
-static Char cmdbuf[BUF_LEN];
+static HChar cmdbuf[BUF_LEN];
 
 /* Total reads/writes/misses sum over all dumps and threads.
  * Updated during CC traversal at dump time.
@@ -55,7 +55,7 @@ EventMapping* CLG_(dumpmap) = 0;
  *  print_fn_pos, fprint_apos, fprint_fcost, fprint_jcc,
  *  fprint_fcc_ln, dump_run_info, dump_state_info
  */
-static Char outbuf[FILENAME_LEN + FN_NAME_LEN + OBJ_NAME_LEN + COSTS_LEN];
+static HChar outbuf[FILENAME_LEN + FN_NAME_LEN + OBJ_NAME_LEN + COSTS_LEN];
 
 Int CLG_(get_dump_counter)(void)
 {
@@ -145,15 +145,15 @@ void init_fpos(FnPos* p)
 
 #if 0
 static __inline__
-static void my_fwrite(Int fd, Char* buf, Int len)
+static void my_fwrite(Int fd, HChar* buf, Int len)
 {
-       VG_(write)(fd, (void*)buf, len);
+       VG_(write)(fd, buf, len);
 }
 #else
 
 #define FWRITE_BUFSIZE 32000
 #define FWRITE_THROUGH 10000
-static Char fwrite_buf[FWRITE_BUFSIZE];
+static HChar fwrite_buf[FWRITE_BUFSIZE];
 static Int fwrite_pos;
 static Int fwrite_fd = -1;
 
@@ -161,11 +161,11 @@ static __inline__
 void fwrite_flush(void)
 {
     if ((fwrite_fd>=0) && (fwrite_pos>0))
-       VG_(write)(fwrite_fd, (void*)fwrite_buf, fwrite_pos);
+       VG_(write)(fwrite_fd, fwrite_buf, fwrite_pos);
     fwrite_pos = 0;
 }
 
-static void my_fwrite(Int fd, Char* buf, Int len)
+static void my_fwrite(Int fd, HChar* buf, Int len)
 {
     if (fwrite_fd != fd) {
        fwrite_flush();
@@ -173,7 +173,7 @@ static void my_fwrite(Int fd, Char* buf, Int len)
     }
     if (len > FWRITE_THROUGH) {
        fwrite_flush();
-       VG_(write)(fd, (void*)buf, len);
+       VG_(write)(fd, buf, len);
        return;
     }
     if (FWRITE_BUFSIZE - fwrite_pos <= len) fwrite_flush();
@@ -183,7 +183,7 @@ static void my_fwrite(Int fd, Char* buf, Int len)
 #endif
 
 
-static void print_obj(Char* buf, obj_node* obj)
+static void print_obj(HChar* buf, obj_node* obj)
 {
     //int n;
 
@@ -212,7 +212,7 @@ static void print_obj(Char* buf, obj_node* obj)
 #endif
 }
 
-static void print_file(Char* buf, file_node* file)
+static void print_file(HChar* buf, file_node* file)
 {
     if (CLG_(clo).compress_strings) {
        CLG_ASSERT(file_dumped != 0);
@@ -231,7 +231,7 @@ static void print_file(Char* buf, file_node* file)
 /*
  * tag can be "fn", "cfn", "jfn"
  */
-static void print_fn(Int fd, Char* buf, const HChar* tag, fn_node* fn)
+static void print_fn(Int fd, HChar* buf, const HChar* tag, fn_node* fn)
 {
     int p;
     p = VG_(sprintf)(buf, "%s=",tag);
@@ -251,7 +251,7 @@ static void print_fn(Int fd, Char* buf, const HChar* tag, fn_node* fn)
     my_fwrite(fd, buf, p);
 }
 
-static void print_mangled_fn(Int fd, Char* buf, const HChar* tag, 
+static void print_mangled_fn(Int fd, HChar* buf, const HChar* tag, 
                             Context* cxt, int rec_index)
 {
     int p, i;
@@ -346,7 +346,7 @@ static Bool print_fn_pos(int fd, FnPos* last, BBCC* bbcc)
     if (!CLG_(clo).mangle_names) {
        if (last->rec_index != bbcc->rec_index) {
            VG_(sprintf)(outbuf, "rec=%d\n\n", bbcc->rec_index);
-           my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+           my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
            last->rec_index = bbcc->rec_index;
            last->cxt = 0; /* reprint context */
            res = True;
@@ -361,7 +361,7 @@ static Bool print_fn_pos(int fd, FnPos* last, BBCC* bbcc)
                if (last_from != 0) {
                    /* switch back to no context */
                    VG_(sprintf)(outbuf, "frfn=(spontaneous)\n");
-                   my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+                   my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
                    res = True;
                }
            }
@@ -376,7 +376,7 @@ static Bool print_fn_pos(int fd, FnPos* last, BBCC* bbcc)
     if (last->obj != bbcc->cxt->fn[0]->file->obj) {
        VG_(sprintf)(outbuf, "ob=");
        print_obj(outbuf+3, bbcc->cxt->fn[0]->file->obj);
-       my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+       my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
        last->obj = bbcc->cxt->fn[0]->file->obj;
        res = True;
     }
@@ -384,7 +384,7 @@ static Bool print_fn_pos(int fd, FnPos* last, BBCC* bbcc)
     if (last->file != bbcc->cxt->fn[0]->file) {
        VG_(sprintf)(outbuf, "fl=");
        print_file(outbuf+3, bbcc->cxt->fn[0]->file);
-       my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+       my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
        last->file = bbcc->cxt->fn[0]->file;
        res = True;
     }
@@ -534,13 +534,13 @@ static void fprint_apos(Int fd, AddrPos* curr, AddrPos* last, file_node* func_fi
        else
            VG_(sprintf)(outbuf, "fi=");
        print_file(outbuf+3, curr->file);
-       my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+       my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
     }
 
     if (CLG_(clo).dump_bbs) {
        if (curr->line != last->line) {
            VG_(sprintf)(outbuf, "ln=%d\n", curr->line);
-           my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+           my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
        }
     }
 }
@@ -606,7 +606,7 @@ void fprint_pos(Int fd, AddrPos* curr, AddrPos* last)
                VG_(sprintf)(outbuf+p, "%u ", curr->line);
        }
     }
-    my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+    my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
 }
 
 
@@ -619,7 +619,7 @@ void fprint_cost(int fd, EventMapping* es, ULong* cost)
 {
   int p = CLG_(sprint_mappingcost)(outbuf, es, cost);
   VG_(sprintf)(outbuf+p, "\n");
-  my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+  my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
   return;
 }
 
@@ -692,7 +692,7 @@ static void fprint_jcc(Int fd, jCC* jcc, AddrPos* curr, AddrPos* last, ULong eco
        if (last->file != target.file) {
            VG_(sprintf)(outbuf, "jfi=");
            print_file(outbuf+4, target.file);
-           my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+           my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
        }
        
        if (jcc->from->cxt != jcc->to->cxt) {
@@ -713,7 +713,7 @@ static void fprint_jcc(Int fd, jCC* jcc, AddrPos* curr, AddrPos* last, ULong eco
            VG_(sprintf)(outbuf, "jump=%llu ",
                         jcc->call_counter);
        }
-       my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+       my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
                
        fprint_pos(fd, &target, last);
        my_fwrite(fd, "\n", 1);
@@ -731,14 +731,14 @@ static void fprint_jcc(Int fd, jCC* jcc, AddrPos* curr, AddrPos* last, ULong eco
     if (jcc->from->cxt->fn[0]->file->obj != obj) {
        VG_(sprintf)(outbuf, "cob=");
        print_obj(outbuf+4, obj);
-       my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+       my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
     }
 
     /* file of called position different to current file? */
     if (last->file != file) {
        VG_(sprintf)(outbuf, "cfi=");
        print_file(outbuf+4, file);
-       my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+       my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
     }
 
     if (CLG_(clo).mangle_names)
@@ -749,7 +749,7 @@ static void fprint_jcc(Int fd, jCC* jcc, AddrPos* curr, AddrPos* last, ULong eco
     if (!CLG_(is_zero_cost)( CLG_(sets).full, jcc->cost)) {
       VG_(sprintf)(outbuf, "calls=%llu ", 
                   jcc->call_counter);
-       my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+       my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
 
        fprint_pos(fd, &target, last);
        my_fwrite(fd, "\n", 1); 
@@ -893,7 +893,7 @@ static Bool fprint_bbcc(Int fd, BBCC* bbcc, AddrPos* last)
                              currCost->cost, bbcc->skipped );
 #if 0
       VG_(sprintf)(outbuf, "# Skipped\n");
-      my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+      my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
 #endif
       fprint_fcost(fd, currCost, last);
     }
@@ -915,7 +915,7 @@ static Bool fprint_bbcc(Int fd, BBCC* bbcc, AddrPos* last)
       fprint_apos(fd, &(currCost->p), last, bbcc->cxt->fn[0]->file);
       fprint_fcost(fd, currCost, last);
     }
-    if (CLG_(clo).dump_bbs) my_fwrite(fd, (void*)"\n", 1);
+    if (CLG_(clo).dump_bbs) my_fwrite(fd, "\n", 1);
     
     /* when every cost was immediatly written, we must have done so,
      * as this function is only called when there's cost in a BBCC
@@ -1259,11 +1259,11 @@ static void fprint_cost_ln(int fd, const HChar* prefix,
     p = VG_(sprintf)(outbuf, "%s", prefix);
     p += CLG_(sprint_mappingcost)(outbuf + p, em, cost);
     VG_(sprintf)(outbuf + p, "\n");
-    my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+    my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
 }
 
 static ULong bbs_done = 0;
-static Char* filename = 0;
+static HChar* filename = 0;
 
 static
 void file_err(void)
@@ -1283,7 +1283,7 @@ void file_err(void)
  *
  * Returns the file descriptor, and -1 on error (no write permission)
  */
-static int new_dumpfile(Char buf[BUF_LEN], int tid, const HChar* trigger)
+static int new_dumpfile(HChar buf[BUF_LEN], int tid, const HChar* trigger)
 {
     Bool appending = False;
     int i, fd;
@@ -1331,27 +1331,27 @@ static int new_dumpfile(Char buf[BUF_LEN], int tid, const HChar* trigger)
     if (!appending) {
        /* version */
        VG_(sprintf)(buf, "version: 1\n");
-       my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+       my_fwrite(fd, buf, VG_(strlen)(buf));
 
        /* creator */
        VG_(sprintf)(buf, "creator: callgrind-" VERSION "\n");
-       my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+       my_fwrite(fd, buf, VG_(strlen)(buf));
 
        /* "pid:" line */
        VG_(sprintf)(buf, "pid: %d\n", VG_(getpid)());
-       my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+       my_fwrite(fd, buf, VG_(strlen)(buf));
 
        /* "cmd:" line */
        VG_(strcpy)(buf, "cmd: ");
-       my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
-       my_fwrite(fd, (void*)cmdbuf, VG_(strlen)(cmdbuf));
+       my_fwrite(fd, buf, VG_(strlen)(buf));
+       my_fwrite(fd, cmdbuf, VG_(strlen)(cmdbuf));
     }
 
     VG_(sprintf)(buf, "\npart: %d\n", out_counter);
-    my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+    my_fwrite(fd, buf, VG_(strlen)(buf));
     if (CLG_(clo).separate_threads) {
        VG_(sprintf)(buf, "thread: %d\n", tid);
-       my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+       my_fwrite(fd, buf, VG_(strlen)(buf));
     }
 
     /* "desc:" lines */
@@ -1362,36 +1362,36 @@ static int new_dumpfile(Char buf[BUF_LEN], int tid, const HChar* trigger)
        /* Global options changing the tracing behaviour */
        VG_(sprintf)(buf, "\ndesc: Option: --skip-plt=%s\n",
                     CLG_(clo).skip_plt ? "yes" : "no");
-       my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+       my_fwrite(fd, buf, VG_(strlen)(buf));
        VG_(sprintf)(buf, "desc: Option: --collect-jumps=%s\n",
                     CLG_(clo).collect_jumps ? "yes" : "no");
-       my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+       my_fwrite(fd, buf, VG_(strlen)(buf));
        VG_(sprintf)(buf, "desc: Option: --separate-recs=%d\n",
                     CLG_(clo).separate_recursions);
-       my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+       my_fwrite(fd, buf, VG_(strlen)(buf));
        VG_(sprintf)(buf, "desc: Option: --separate-callers=%d\n",
                     CLG_(clo).separate_callers);
-       my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+       my_fwrite(fd, buf, VG_(strlen)(buf));
 
        VG_(sprintf)(buf, "desc: Option: --dump-bbs=%s\n",
                     CLG_(clo).dump_bbs ? "yes" : "no");
-       my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+       my_fwrite(fd, buf, VG_(strlen)(buf));
        VG_(sprintf)(buf, "desc: Option: --separate-threads=%s\n",
                     CLG_(clo).separate_threads ? "yes" : "no");
-       my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+       my_fwrite(fd, buf, VG_(strlen)(buf));
 #endif
 
        (*CLG_(cachesim).getdesc)(buf);
-       my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+       my_fwrite(fd, buf, VG_(strlen)(buf));
     }
 
     VG_(sprintf)(buf, "\ndesc: Timerange: Basic block %llu - %llu\n",
                 bbs_done, CLG_(stat).bb_executions);
 
-    my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+    my_fwrite(fd, buf, VG_(strlen)(buf));
     VG_(sprintf)(buf, "desc: Trigger: %s\n",
                 trigger ? trigger : "Program termination");
-    my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+    my_fwrite(fd, buf, VG_(strlen)(buf));
 
 #if 0
    /* Output function specific config
@@ -1401,27 +1401,27 @@ static int new_dumpfile(Char buf[BUF_LEN], int tid, const HChar* trigger)
        while (fnc) {
           if (fnc->skip) {
               VG_(sprintf)(buf, "desc: Option: --fn-skip=%s\n", fnc->name);
-              my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+              my_fwrite(fd, buf, VG_(strlen)(buf));
           }
           if (fnc->dump_at_enter) {
               VG_(sprintf)(buf, "desc: Option: --fn-dump-at-enter=%s\n",
                            fnc->name);
-              my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+              my_fwrite(fd, buf, VG_(strlen)(buf));
           }   
           if (fnc->dump_at_leave) {
               VG_(sprintf)(buf, "desc: Option: --fn-dump-at-leave=%s\n",
                            fnc->name);
-              my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+              my_fwrite(fd, buf, VG_(strlen)(buf));
           }
           if (fnc->separate_callers != CLG_(clo).separate_callers) {
               VG_(sprintf)(buf, "desc: Option: --separate-callers%d=%s\n",
                            fnc->separate_callers, fnc->name);
-              my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+              my_fwrite(fd, buf, VG_(strlen)(buf));
           }   
           if (fnc->separate_recursions != CLG_(clo).separate_recursions) {
               VG_(sprintf)(buf, "desc: Option: --separate-recs%d=%s\n",
                            fnc->separate_recursions, fnc->name);
-              my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+              my_fwrite(fd, buf, VG_(strlen)(buf));
           }   
           fnc = fnc->next;
        }
@@ -1433,12 +1433,12 @@ static int new_dumpfile(Char buf[BUF_LEN], int tid, const HChar* trigger)
                CLG_(clo).dump_instr ? " instr" : "",
                CLG_(clo).dump_bb    ? " bb" : "",
                CLG_(clo).dump_line  ? " line" : "");
-   my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+   my_fwrite(fd, buf, VG_(strlen)(buf));
 
    /* "events:" line */
    i = VG_(sprintf)(buf, "events: ");
    CLG_(sprint_eventmapping)(buf+i, CLG_(dumpmap));
-   my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+   my_fwrite(fd, buf, VG_(strlen)(buf));
    my_fwrite(fd, "\n", 1);
 
    /* summary lines */
@@ -1504,7 +1504,7 @@ static void close_dumpfile(int fd)
 
 static Int   print_fd;
 static const HChar* print_trigger;
-static Char  print_buf[BUF_LEN];
+static HChar print_buf[BUF_LEN];
 
 static void print_bbccs_of_thread(thread_info* ti)
 {
@@ -1541,7 +1541,7 @@ static void print_bbccs_of_thread(thread_info* ti)
        /* switch back to file of function */
        VG_(sprintf)(print_buf, "fe=");
        print_file(print_buf+3, lastFnPos.cxt->fn[0]->file);
-       my_fwrite(print_fd, (void*)print_buf, VG_(strlen)(print_buf));
+       my_fwrite(print_fd, print_buf, VG_(strlen)(print_buf));
       }
       my_fwrite(print_fd, "\n", 1);
     }
@@ -1571,7 +1571,7 @@ static void print_bbccs_of_thread(thread_info* ti)
        VG_(sprintf)(print_buf+pos, "%d %llu\n", 
                     (*p)->bb->instr_count,
                     ecounter);
-       my_fwrite(print_fd, (void*)print_buf, VG_(strlen)(print_buf));
+       my_fwrite(print_fd, print_buf, VG_(strlen)(print_buf));
     }
     
     fprint_bbcc(print_fd, *p, &lastAPos);
index b942e5d96e6c4c03a4afc2ce4317f1bac0c5565f..566b5e8b0cb40dab213ce48e5422641f819ea002 100644 (file)
@@ -192,7 +192,7 @@ EventSet* CLG_(add_event_set)(EventSet* es1, EventSet* es2)
     return eventset_from_mask(es1->mask | es2->mask);
 }
 
-Int CLG_(sprint_eventset)(Char* buf, EventSet* es)
+Int CLG_(sprint_eventset)(HChar* buf, EventSet* es)
 {
     Int i, j, pos;
     UInt mask;
@@ -446,7 +446,7 @@ Bool CLG_(add_diff_cost_lz)(EventSet* es, ULong** pdst, ULong* old, ULong* new_c
 
 
 /* Returns number of characters written */
-Int CLG_(sprint_cost)(Char* buf, EventSet* es, ULong* c)
+Int CLG_(sprint_cost)(HChar* buf, EventSet* es, ULong* c)
 {
     Int i, pos, skipped = 0;
 
@@ -518,7 +518,7 @@ void CLG_(append_event)(EventMapping* em, const HChar* n)
 
 
 /* Returns number of characters written */
-Int CLG_(sprint_eventmapping)(Char* buf, EventMapping* em)
+Int CLG_(sprint_eventmapping)(HChar* buf, EventMapping* em)
 {
     Int i, pos = 0;
     EventGroup* eg;
@@ -537,7 +537,7 @@ Int CLG_(sprint_eventmapping)(Char* buf, EventMapping* em)
 }
 
 /* Returns number of characters written */
-Int CLG_(sprint_mappingcost)(Char* buf, EventMapping* em, ULong* c)
+Int CLG_(sprint_mappingcost)(HChar* buf, EventMapping* em, ULong* c)
 {
     Int i, pos, skipped = 0;
 
index f110110a266ccb2463292ac9e2c14756cbb2e554..37bc7cc9e0092267e76248778d069496ebd51d30 100644 (file)
@@ -79,7 +79,7 @@ EventSet* CLG_(add_event_group)(EventSet*, Int id);
 EventSet* CLG_(add_event_group2)(EventSet*, Int id1, Int id2);
 EventSet* CLG_(add_event_set)(EventSet*, EventSet*);
 /* Writes event names into buf. Returns number of characters written */
-Int CLG_(sprint_eventset)(Char* buf, EventSet*);
+Int CLG_(sprint_eventset)(HChar* buf, EventSet*);
 
 
 /* Operations on costs. A cost pointer of 0 means zero cost.
@@ -106,7 +106,7 @@ Bool CLG_(add_and_zero_cost2)(EventSet*,ULong* dst,EventSet*,ULong* src);
 Bool CLG_(add_diff_cost)(EventSet*,ULong* dst, ULong* old, ULong* new_cost);
 Bool CLG_(add_diff_cost_lz)(EventSet*,ULong** pdst, ULong* old, ULong* new_cost);
 /* Returns number of characters written */
-Int CLG_(sprint_cost)(Char* buf, EventSet*, ULong*);
+Int CLG_(sprint_cost)(HChar* buf, EventSet*, ULong*);
 
 /* EventMapping: An ordered subset of events from an event set.
  * This is used to print out part of an EventSet, or in another order.
@@ -128,8 +128,8 @@ struct _EventMapping {
 EventMapping* CLG_(get_eventmapping)(EventSet*);
 void CLG_(append_event)(EventMapping*, const HChar*);
 /* Returns number of characters written */
-Int CLG_(sprint_eventmapping)(Char* buf, EventMapping*);
+Int CLG_(sprint_eventmapping)(HChar* buf, EventMapping*);
 /* Returns number of characters written */
-Int CLG_(sprint_mappingcost)(Char* buf, EventMapping*, ULong*);
+Int CLG_(sprint_mappingcost)(HChar* buf, EventMapping*, ULong*);
 
 #endif /* CLG_EVENTS */
index bd05ee41503586171240ca42267458019c1f96ab..09546f3bb9a4c2a9c89ff44c3a073d94161aa0b8 100644 (file)
@@ -488,7 +488,7 @@ static BB* exit_bb = 0;
  */
 fn_node* CLG_(get_fn_node)(BB* bb)
 {
-    Char       filename[FILENAME_LEN], fnname[FN_NAME_LEN];
+    HChar      filename[FILENAME_LEN], fnname[FN_NAME_LEN];
     DebugInfo* di;
     UInt       line_num;
     fn_node*   fn;
index 1ed0b2fdba8955dd8a37ee3b987ee2966bf0767a..e51f2108eebb96586d5119287fcae578f19c7aa9 100644 (file)
@@ -660,7 +660,7 @@ struct cachesim_if
     Bool (*parse_opt)(Char* arg);
     void (*post_clo_init)(void);
     void (*clear)(void);
-    void (*getdesc)(Char* buf);
+    void (*getdesc)(HChar* buf);
     void (*printstat)(Int,Int,Int);
     void (*add_icost)(SimCost, BBCC*, InstrInfo*, ULong);
     void (*finish)(void);
index 22919137a01c105bd31194d41b0f9c815b657d26..2cae802364fc8f2310c7f7b2fa4bbe500d3203db 100644 (file)
@@ -1403,7 +1403,7 @@ void CLG_(set_instrument_state)(const HChar* reason, Bool state)
 /* helper for dump_state_togdb */
 static void dump_state_of_thread_togdb(thread_info* ti)
 {
-    static Char buf[512];
+    static HChar buf[512];
     static FullCost sum = 0, tmp = 0;
     Int t, p, i;
     BBCC *from, *to;
@@ -1449,7 +1449,7 @@ static void dump_state_of_thread_togdb(thread_info* ti)
 /* Dump current state */
 static void dump_state_togdb(void)
 {
-    static Char buf[512];
+    static HChar buf[512];
     thread_info** th;
     int t, p;
     Int orig_tid = CLG_(current_tid);
@@ -1700,7 +1700,7 @@ static UInt ULong_width(ULong n)
 static
 void branchsim_printstat(int l1, int l2, int l3)
 {
-    static Char buf1[128], buf2[128], buf3[128];
+    static HChar buf1[128], buf2[128], buf3[128];
     static HChar fmt[128];
     FullCost total;
     ULong Bc_total_b, Bc_total_mp, Bi_total_b, Bi_total_mp;
index f252cd7c60d2231c03fcd32b245660c8fa42dee8..eb6ba42bbadfdcccd5d98c5015deba42283697be 100644 (file)
@@ -66,7 +66,7 @@ typedef struct {
 
 /* Cache state */
 typedef struct {
-   char*        name;
+   const HChar* name;
    int          size;                   /* bytes */
    int          assoc;
    int          line_size;              /* bytes */
@@ -76,7 +76,7 @@ typedef struct {
    int          line_size_bits;
    int          tag_shift;
    UWord        tag_mask;
-   char         desc_line[128];
+   HChar        desc_line[128];
    UWord*       tags;
 
   /* for cache use */
@@ -1418,7 +1418,7 @@ void cachesim_clear(void)
 }
 
 
-static void cachesim_getdesc(Char* buf)
+static void cachesim_getdesc(HChar* buf)
 {
   Int p;
   p = VG_(sprintf)(buf, "\ndesc: I1 cache: %s\n", I1.desc_line);
@@ -1472,7 +1472,7 @@ static Bool cachesim_parse_opt(Char* arg)
 /* Adds commas to ULong, right justifying in a field field_width wide, returns
  * the string in buf. */
 static
-Int commify(ULong n, int field_width, char* buf)
+Int commify(ULong n, int field_width, HChar* buf)
 {
    int len, n_commas, i, j, new_len, space;
 
@@ -1502,7 +1502,7 @@ Int commify(ULong n, int field_width, char* buf)
 }
 
 static
-void percentify(Int n, Int ex, Int field_width, char buf[]) 
+void percentify(Int n, Int ex, Int field_width, HChar buf[]) 
 {
    int i, len, space;
     
@@ -1796,4 +1796,3 @@ struct cachesim_if CLG_(cachesim) = {
 /*--------------------------------------------------------------------*/
 /*--- end                                                 ct_sim.c ---*/
 /*--------------------------------------------------------------------*/
-
index 07b630359345f44e9f568bae623add97bb8dcab9..45d7d086d3eee1702cc72eab08a803a3a9fa1a22 100644 (file)
@@ -64,14 +64,14 @@ void ML_(am_exit)( Int status )
    aspacem_assert(2+2 == 5);
 }
 
-void ML_(am_barf) ( HChar* what )
+void ML_(am_barf) ( const HChar* what )
 {
    VG_(debugLog)(0, "aspacem", "Valgrind: FATAL: %s\n", what);
    VG_(debugLog)(0, "aspacem", "Exiting now.\n");
    ML_(am_exit)(1);
 }
 
-void ML_(am_barf_toolow) ( HChar* what )
+void ML_(am_barf_toolow) ( const HChar* what )
 {
    VG_(debugLog)(0, "aspacem", 
                     "Valgrind: FATAL: %s is too low.\n", what);
@@ -81,9 +81,9 @@ void ML_(am_barf_toolow) ( HChar* what )
 }
 
 void ML_(am_assert_fail)( const HChar* expr,
-                          const Char* file,
+                          const HChar* file,
                           Int line, 
-                          const Char* fn )
+                          const HChar* fn )
 {
    VG_(debugLog)(0, "aspacem", 
                     "Valgrind: FATAL: aspacem assertion failed:\n");
@@ -115,7 +115,7 @@ static
 UInt local_vsprintf ( HChar* buf, const HChar *format, va_list vargs )
 {
    Int ret;
-   Char *aspacem_sprintf_ptr = buf;
+   HChar *aspacem_sprintf_ptr = buf;
 
    ret = VG_(debugLog_vprintf)
             ( local_add_to_aspacem_sprintf_buf, 
@@ -240,7 +240,7 @@ SysRes ML_(am_do_relocate_nooverlap_mapping_NO_NOTIFY)(
 
 /* --- Pertaining to files --- */
 
-SysRes ML_(am_open) ( const Char* pathname, Int flags, Int mode )
+SysRes ML_(am_open) ( const HChar* pathname, Int flags, Int mode )
 {  
    SysRes res = VG_(do_syscall3)(__NR_open, (UWord)pathname, flags, mode);
    return res;
index b56da6a335eedb8906f9aa0cff5518e970a29ccf..77d9d5f5b67885c39d1cf3e152bc76120584c2fc 100644 (file)
@@ -334,7 +334,7 @@ static Int  find_nsegment_idx ( Addr a );
 static void parse_procselfmaps (
       void (*record_mapping)( Addr addr, SizeT len, UInt prot,
                               ULong dev, ULong ino, Off64T offset, 
-                              const UChar* filename ),
+                              const HChar* filename ),
       void (*record_gap)( Addr addr, SizeT len )
    );
 
@@ -419,7 +419,7 @@ static Int allocate_segname ( const HChar* name )
 /*---                                                           ---*/
 /*-----------------------------------------------------------------*/
 
-static HChar* show_SegKind ( SegKind sk )
+static const HChar* show_SegKind ( SegKind sk )
 {
    switch (sk) {
       case SkFree:  return "    ";
@@ -433,7 +433,7 @@ static HChar* show_SegKind ( SegKind sk )
    }
 }
 
-static HChar* show_ShrinkMode ( ShrinkMode sm )
+static const HChar* show_ShrinkMode ( ShrinkMode sm )
 {
    switch (sm) {
       case SmLower: return "SmLower";
@@ -445,7 +445,7 @@ static HChar* show_ShrinkMode ( ShrinkMode sm )
 
 static void show_len_concisely ( /*OUT*/HChar* buf, Addr start, Addr end )
 {
-   HChar* fmt;
+   const HChar* fmt;
    ULong len = ((ULong)end) - ((ULong)start) + 1;
 
    if (len < 10*1000*1000ULL) {
@@ -477,7 +477,7 @@ static void __attribute__ ((unused))
             show_nsegment_full ( Int logLevel, Int segNo, NSegment* seg )
 {
    HChar len_buf[20];
-   HChar* name = "(none)";
+   const HChar* name = "(none)";
 
    if (seg->fnIdx >= 0 && seg->fnIdx < segnames_used
                        && segnames[seg->fnIdx].inUse
@@ -570,7 +570,7 @@ static void show_nsegment ( Int logLevel, Int segNo, NSegment* seg )
 }
 
 /* Print out the segment array (debugging only!). */
-void VG_(am_show_nsegments) ( Int logLevel, HChar* who )
+void VG_(am_show_nsegments) ( Int logLevel, const HChar* who )
 {
    Int i;
    VG_(debugLog)(logLevel, "aspacem",
@@ -862,7 +862,7 @@ static Bool sync_check_ok = False;
 
 static void sync_check_mapping_callback ( Addr addr, SizeT len, UInt prot,
                                           ULong dev, ULong ino, Off64T offset, 
-                                          const UChar* filename )
+                                          const HChar* filename )
 {
    Int  iLo, iHi, i;
    Bool sloppyXcheck;
@@ -990,7 +990,7 @@ static void sync_check_mapping_callback ( Addr addr, SizeT len, UInt prot,
             prot & VKI_PROT_READ  ? 'r' : '-',
             prot & VKI_PROT_WRITE ? 'w' : '-',
             prot & VKI_PROT_EXEC  ? 'x' : '-',
-            dev, ino, offset, filename ? (HChar*)filename : "(none)" );
+            dev, ino, offset, filename ? filename : "(none)" );
 
          return;
       }
@@ -1535,7 +1535,7 @@ static void init_resvn ( /*OUT*/NSegment* seg, Addr start, Addr end )
 
 static void read_maps_callback ( Addr addr, SizeT len, UInt prot,
                                  ULong dev, ULong ino, Off64T offset, 
-                                 const UChar* filename )
+                                 const HChar* filename )
 {
    NSegment seg;
    init_nsegment( &seg );
@@ -3098,14 +3098,14 @@ Bool VG_(am_relocate_nooverlap_client)( /*OUT*/Bool* need_discard,
 #define M_PROCMAP_BUF 100000
 
 /* static ... to keep it out of the stack frame. */
-static Char procmap_buf[M_PROCMAP_BUF];
+static HChar procmap_buf[M_PROCMAP_BUF];
 
 /* Records length of /proc/self/maps read into procmap_buf. */
 static Int  buf_n_tot;
 
 /* Helper fns. */
 
-static Int hexdigit ( Char c )
+static Int hexdigit ( HChar c )
 {
    if (c >= '0' && c <= '9') return (Int)(c - '0');
    if (c >= 'a' && c <= 'f') return 10 + (Int)(c - 'a');
@@ -3113,20 +3113,20 @@ static Int hexdigit ( Char c )
    return -1;
 }
 
-static Int decdigit ( Char c )
+static Int decdigit ( HChar c )
 {
    if (c >= '0' && c <= '9') return (Int)(c - '0');
    return -1;
 }
 
-static Int readchar ( const Char* buf, Char* ch )
+static Int readchar ( const HChar* buf, HChar* ch )
 {
    if (*buf == 0) return 0;
    *ch = *buf;
    return 1;
 }
 
-static Int readhex ( const Char* buf, UWord* val )
+static Int readhex ( const HChar* buf, UWord* val )
 {
    /* Read a word-sized hex number. */
    Int n = 0;
@@ -3138,7 +3138,7 @@ static Int readhex ( const Char* buf, UWord* val )
    return n;
 }
 
-static Int readhex64 ( const Char* buf, ULong* val )
+static Int readhex64 ( const HChar* buf, ULong* val )
 {
    /* Read a potentially 64-bit hex number. */
    Int n = 0;
@@ -3150,7 +3150,7 @@ static Int readhex64 ( const Char* buf, ULong* val )
    return n;
 }
 
-static Int readdec64 ( const Char* buf, ULong* val )
+static Int readdec64 ( const HChar* buf, ULong* val )
 {
    Int n = 0;
    *val = 0;
@@ -3219,14 +3219,14 @@ static void read_procselfmaps_into_buf ( void )
 static void parse_procselfmaps (
       void (*record_mapping)( Addr addr, SizeT len, UInt prot,
                               ULong dev, ULong ino, Off64T offset, 
-                              const UChar* filename ),
+                              const HChar* filename ),
       void (*record_gap)( Addr addr, SizeT len )
    )
 {
    Int    i, j, i_eol;
    Addr   start, endPlusOne, gapStart;
-   UChar* filename;
-   UChar  rr, ww, xx, pp, ch, tmp;
+   HChar* filename;
+   HChar  rr, ww, xx, pp, ch, tmp;
    UInt          prot;
    UWord  maj, min;
    ULong  foffset, dev, ino;
@@ -3428,7 +3428,7 @@ static UInt stats_machcalls = 0;
 static void parse_procselfmaps (
       void (*record_mapping)( Addr addr, SizeT len, UInt prot,
                               ULong dev, ULong ino, Off64T offset, 
-                              const UChar* filename ),
+                              const HChar* filename ),
       void (*record_gap)( Addr addr, SizeT len )
    )
 {
@@ -3486,7 +3486,7 @@ static Addr Addr__min ( Addr a, Addr b ) { return a < b ? a : b; }
 
 static void add_mapping_callback(Addr addr, SizeT len, UInt prot, 
                                  ULong dev, ULong ino, Off64T offset, 
-                                 const UChar *filename)
+                                 const HChar *filename)
 {
    // derived from sync_check_mapping_callback()
 
index daa2d8cc1b7445fa22d7502405b557d2c9f7a48c..cb48bdce314de436d21805b416c6c42889a299f5 100644 (file)
 
 __attribute__ ((noreturn))
 extern void   ML_(am_exit) ( Int status );
-extern void   ML_(am_barf) ( HChar* what );
-extern void   ML_(am_barf_toolow) ( HChar* what );
+extern void   ML_(am_barf) ( const HChar* what );
+extern void   ML_(am_barf_toolow) ( const HChar* what );
 
 __attribute__ ((noreturn))
 extern void   ML_(am_assert_fail) ( const HChar* expr,
-                                    const Char* file,
+                                    const HChar* file,
                                     Int line, 
-                                    const Char* fn );
+                                    const HChar* fn );
 
 #define aspacem_assert(expr)                              \
   ((void) ((expr) ? 0 :                                   \
@@ -105,7 +105,7 @@ extern SysRes ML_(am_do_relocate_nooverlap_mapping_NO_NOTIFY)(
 /* There is also VG_(do_mmap_NO_NOTIFY), but that's not declared
    here (obviously). */
 
-extern SysRes ML_(am_open)  ( const Char* pathname, Int flags, Int mode );
+extern SysRes ML_(am_open)  ( const HChar* pathname, Int flags, Int mode );
 extern void   ML_(am_close) ( Int fd );
 extern Int    ML_(am_read)  ( Int fd, void* buf, Int count);
 extern Int    ML_(am_readlink) ( HChar* path, HChar* buf, UInt bufsiz );
index 42a1965b7790e840faf785d29533a7990a3b296c..1f8f0c131b0a8dab9497ebaf1c703d266b79785b 100644 (file)
@@ -150,7 +150,7 @@ typedef
 struct note {
    struct note *next;
    ESZ(Nhdr) note;
-   Char name[0];
+   HChar name[0];
 };
 
 static UInt note_size(const struct note *n)
@@ -160,7 +160,7 @@ static UInt note_size(const struct note *n)
 }
 
 #if !defined(VGPV_arm_linux_android) && !defined(VGPV_x86_linux_android)
-static void add_note(struct note **list, const Char *name, UInt type,
+static void add_note(struct note **list, const HChar *name, UInt type,
                      const void *data, UInt datasz)
 {
    Int namelen = VG_(strlen)(name)+1;
@@ -191,7 +191,7 @@ static void write_note(Int fd, const struct note *n)
 static void fill_prpsinfo(const ThreadState *tst,
                           struct vki_elf_prpsinfo *prpsinfo)
 {
-   static Char name[VKI_PATH_MAX];
+   static HChar name[VKI_PATH_MAX];
 
    VG_(memset)(prpsinfo, 0, sizeof(*prpsinfo));
 
@@ -219,7 +219,7 @@ static void fill_prpsinfo(const ThreadState *tst,
    prpsinfo->pr_gid = 0;
    
    if (VG_(resolve_filename)(VG_(cl_exec_fd), name, VKI_PATH_MAX)) {
-      Char *n = name+VG_(strlen)(name)-1;
+      HChar *n = name+VG_(strlen)(name)-1;
 
       while (n > name && *n != '/')
         n--;
@@ -395,7 +395,7 @@ static void fill_fpu(const ThreadState *tst, vki_elf_fpregset_t *fpu)
    ThreadArchState* arch = (ThreadArchState*)&tst->arch;
 
 #if defined(VGP_x86_linux)
-//:: static void fill_fpu(vki_elf_fpregset_t *fpu, const Char *from)
+//:: static void fill_fpu(vki_elf_fpregset_t *fpu, const HChar *from)
 //:: {
 //::    if (VG_(have_ssestate)) {
 //::       UShort *to;
@@ -413,7 +413,7 @@ static void fill_fpu(const ThreadState *tst, vki_elf_fpregset_t *fpu)
 //::       VG_(memcpy)(fpu, from, sizeof(*fpu));
 //:: }
 
-//::    fill_fpu(fpu, (const Char *)&arch->m_sse);
+//::    fill_fpu(fpu, (const HChar *)&arch->m_sse);
 
 #elif defined(VGP_amd64_linux)
 //::    fpu->cwd = ?;
@@ -504,9 +504,9 @@ static void fill_xfpu(const ThreadState *tst, vki_elf_fpxregset_t *xfpu)
 static
 void make_elf_coredump(ThreadId tid, const vki_siginfo_t *si, UInt max_size)
 {
-   Char* buf = NULL;
-   Char *basename = "vgcore";
-   Char *coreext = "";
+   HChar* buf = NULL;
+   const HChar *basename = "vgcore";
+   const HChar *coreext = "";
    Int seq = 0;
    Int core_fd;
    NSegment const * seg;
index 4fc636a72e80f6b9e8d81f7c51b333048f7b51e2..ede0fbce0ba4a156d22ef595cbb070f776cc903e 100644 (file)
@@ -379,11 +379,11 @@ void VG_(start_debugger) ( ThreadId tid )
           VG_(kill)(pid, VKI_SIGSTOP) == 0 &&
           VG_(ptrace)(VKI_PTRACE_DETACH, pid, NULL, 0) == 0)
       {
-         Char pidbuf[15];
-         Char file[50];
-         Char buf[N_BUF];
-         Char *bufptr;
-         Char *cmdptr;
+         HChar pidbuf[15];
+         HChar file[50];
+         HChar buf[N_BUF];
+         HChar *bufptr;
+         HChar *cmdptr;
          
          VG_(sprintf)(pidbuf, "%d", pid);
          VG_(sprintf)(file, "/proc/%d/fd/%d", pid, VG_(cl_exec_fd));
index f817b59bd53094e69a1887eef99d5ec090ea38d7..4baffc73074ad037b0338ea14b0a29b556b462db 100644 (file)
@@ -71,7 +71,7 @@ void VG_(debugLog_setXml)(Bool xml)
 
 #if defined(VGP_x86_linux)
 
-static UInt local_sys_write_stderr ( HChar* buf, Int n )
+static UInt local_sys_write_stderr ( const HChar* buf, Int n )
 {
    Int result;
 
@@ -104,7 +104,7 @@ static UInt local_sys_getpid ( void )
 
 #elif defined(VGP_amd64_linux)
 __attribute__((noinline))
-static UInt local_sys_write_stderr ( HChar* buf, Int n )
+static UInt local_sys_write_stderr ( const HChar* buf, Int n )
 {
    volatile Long block[2];
    block[0] = (Long)buf;
@@ -147,7 +147,7 @@ static UInt local_sys_getpid ( void )
 
 #elif defined(VGP_ppc32_linux)
 
-static UInt local_sys_write_stderr ( HChar* buf, Int n )
+static UInt local_sys_write_stderr ( const HChar* buf, Int n )
 {
    volatile Int block[2];
    block[0] = (Int)buf;
@@ -190,7 +190,7 @@ static UInt local_sys_getpid ( void )
 
 #elif defined(VGP_ppc64_linux)
 
-static UInt local_sys_write_stderr ( HChar* buf, Int n )
+static UInt local_sys_write_stderr ( const HChar* buf, Int n )
 {
    volatile Long block[2];
    block[0] = (Long)buf;
@@ -233,7 +233,7 @@ static UInt local_sys_getpid ( void )
 
 #elif defined(VGP_arm_linux)
 
-static UInt local_sys_write_stderr ( HChar* buf, Int n )
+static UInt local_sys_write_stderr ( const HChar* buf, Int n )
 {
    volatile Int block[2];
    block[0] = (Int)buf;
@@ -274,7 +274,7 @@ static UInt local_sys_getpid ( void )
    asm code.  Both macros give the same results for Unix-class syscalls (which
    these all are, as identified by the use of 'int 0x80'). */
 __attribute__((noinline))
-static UInt local_sys_write_stderr ( HChar* buf, Int n )
+static UInt local_sys_write_stderr ( const HChar* buf, Int n )
 {
    UInt __res;
    __asm__ volatile (
@@ -316,7 +316,7 @@ static UInt local_sys_getpid ( void )
 #elif defined(VGP_amd64_darwin)
 
 __attribute__((noinline))
-static UInt local_sys_write_stderr ( HChar* buf, Int n )
+static UInt local_sys_write_stderr ( const HChar* buf, Int n )
 {
    UInt __res;
    __asm__ volatile (
@@ -350,12 +350,12 @@ static UInt local_sys_getpid ( void )
 }
 
 #elif defined(VGP_s390x_linux)
-static UInt local_sys_write_stderr ( HChar* buf, Int n )
+static UInt local_sys_write_stderr ( const HChar* buf, Int n )
 {
-   register Int    r2     asm("2") = 2;      /* file descriptor STDERR */
-   register HChar* r3     asm("3") = buf;
-   register ULong  r4     asm("4") = n;
-   register ULong  r2_res asm("2");
+   register Int          r2     asm("2") = 2;      /* file descriptor STDERR */
+   register const HChar* r3     asm("3") = buf;
+   register ULong        r4     asm("4") = n;
+   register ULong        r2_res asm("2");
    ULong __res;
 
    __asm__ __volatile__ (
@@ -391,7 +391,7 @@ static UInt local_sys_getpid ( void )
 }
 
 #elif defined(VGP_mips32_linux)
-static UInt local_sys_write_stderr ( HChar* buf, Int n )
+static UInt local_sys_write_stderr ( const HChar* buf, Int n )
 {
    volatile Int block[2];
    block[0] = (Int)buf;
@@ -453,7 +453,7 @@ static HChar local_toupper ( HChar c )
 
 /* Emit buf[0 .. n-1] to stderr.  Unfortunately platform-specific. 
 */
-static void emit ( HChar* buf, Int n )
+static void emit ( const HChar* buf, Int n )
 {
    if (n >= 1)
       (void)local_sys_write_stderr(buf, n);
@@ -489,7 +489,7 @@ UInt myvprintf_str ( void(*send)(HChar,void*),
                      void* send_arg2,
                      Int flags, 
                      Int width, 
-                     HChar* str, 
+                     const HChar* str, 
                      Bool capitalise )
 {
 #  define MAYBE_TOUPPER(ch) (capitalise ? local_toupper(ch) : (ch))
@@ -535,12 +535,12 @@ UInt myvprintf_str ( void(*send)(HChar,void*),
 static 
 UInt myvprintf_str_XML_simplistic ( void(*send)(HChar,void*),
                                     void* send_arg2,
-                                    HChar* str )
+                                    const HChar* str )
 {
    UInt   ret = 0;
    Int    i;
    Int    len = local_strlen(str);
-   HChar* alt;
+   const HChar* alt;
 
    for (i = 0; i < len; i++) {
       switch (str[i]) {
@@ -585,7 +585,7 @@ UInt myvprintf_int64 ( void(*send)(HChar,void*),
    Int    ind = 0;
    Int    i, nc = 0;
    Bool   neg = False;
-   HChar* digits = capitalised ? "0123456789ABCDEF" : "0123456789abcdef";
+   const HChar* digits = capitalised ? "0123456789ABCDEF" : "0123456789abcdef";
    UInt   ret = 0;
 
    if (base < 2 || base > 16)
@@ -762,15 +762,15 @@ VG_(debugLog_vprintf) (
                i++;
                /* %pS, like %s but escaping chars for XML safety */
                /* Note: simplistic; ignores field width and flags */
-               char *str = va_arg (vargs, char *);
-               if (str == (char*) 0)
+               HChar *str = va_arg (vargs, HChar *);
+               if (str == NULL)
                   str = "(null)";
                ret += myvprintf_str_XML_simplistic(send, send_arg2, str);
             } else if (format[i+1] == 's') {
                i++;
                /* %ps, synonym for %s with --xml=no / %pS with --xml=yes */
-               char *str = va_arg (vargs, char *);
-               if (str == (char*) 0)
+               HChar *str = va_arg (vargs, HChar *);
+               if (str == NULL)
                   str = "(null)";
                if (clo_xml)
                   ret += myvprintf_str_XML_simplistic(send, send_arg2, str);
@@ -806,8 +806,8 @@ VG_(debugLog_vprintf) (
             send(va_arg (vargs, int), send_arg2);
             break;
          case 's': case 'S': { /* %s */
-            char *str = va_arg (vargs, char *);
-            if (str == (char*) 0) str = "(null)";
+            HChar *str = va_arg (vargs, HChar *);
+            if (str == NULL) str = "(null)";
             ret += myvprintf_str(send, send_arg2, 
                                  flags, width, str, format[i]=='S');
             break;
@@ -849,7 +849,7 @@ static Int loglevel = 0;
 
 /* Module startup. */
 /* EXPORTED */
-void VG_(debugLog_startup) ( Int level, HChar* who )
+void VG_(debugLog_startup) ( Int level, const HChar* who )
 {
    if (level < 0)  level = 0;
    if (level > 10) level = 10;
@@ -925,7 +925,7 @@ void VG_(debugLog) ( Int level, const HChar* modulename,
    (void)myvprintf_str ( add_to_buf, &buf, 0, 1, ":", False );
    (void)myvprintf_int64 ( add_to_buf, &buf, 0, 10, 1, False, (ULong)level );
    (void)myvprintf_str ( add_to_buf, &buf, 0, 1, ":", False );
-   (void)myvprintf_str ( add_to_buf, &buf, 0, 8, (HChar*)modulename, False );
+   (void)myvprintf_str ( add_to_buf, &buf, 0, 8, modulename, False );
    (void)myvprintf_str ( add_to_buf, &buf, 0, indent, "", False );
 
    va_start(vargs,format);
index fe34d015a172c4dd0437359380cbc83f7ae3c81c..84bf89187b0a4ff86622d80b1a4716d6d22935c9 100644 (file)
@@ -348,7 +348,7 @@ static void gen_suppression(Error* err)
 {
    Char        xtra[256]; /* assumed big enough (is overrun-safe) */
    Bool        anyXtra;
-   Char*       name;
+   const HChar* name;
    ExeContext* ec;
    XArray* /* HChar */ text;
 
index 64db90d6873d287bc11e290265be9ad614077fbe..736bd914afb34ddb1a5be9b17efd0d20684f18b6 100644 (file)
@@ -27,6 +27,7 @@
 #include "pub_core_translate.h"
 #include "pub_core_mallocfree.h"
 #include "pub_core_initimg.h"
+#include "pub_core_syswrap.h"      // VG_(show_open_fds)
 
 unsigned long cont_thread;
 unsigned long general_thread;
index 96b8902aaa7092fa37aa21d98276a17b8ceb6d93..abf1df04523d7eeb9b43654bd4bfcb2bad239664 100644 (file)
@@ -47,7 +47,7 @@ struct _VgHashTable {
    UInt         iterChain;  // next chain to be traversed by the iterator
    VgHashNode** chains;     // expanding array of hash chains
    Bool         iterOK;     // table safe to iterate over?
-   HChar*       name;       // name of table (for debugging only)
+   const HChar* name;       // name of table (for debugging only)
 };
 
 #define N_HASH_PRIMES 20
@@ -64,7 +64,7 @@ static SizeT primes[N_HASH_PRIMES] = {
 /*--- Functions                                                    ---*/
 /*--------------------------------------------------------------------*/
 
-VgHashTable VG_(HT_construct) ( HChar* name )
+VgHashTable VG_(HT_construct) ( const HChar* name )
 {
    /* Initialises to zero, ie. all entries NULL */
    SizeT       n_chains = primes[0];
index 93d333d35793a2dd2e80e297e73e0c289517fa07..8e555f10b1729d8518ca54a3bea8e3e2663fa0f7 100644 (file)
@@ -271,7 +271,7 @@ void VG_(assert_fail) ( Bool isCore, const HChar* expr, const HChar* file,
                         Int line, const HChar* fn, const HChar* format, ... )
 {
    va_list vargs;
-   Char buf[256];
+   HChar buf[256];
    const HChar* component;
    const HChar* bugs_to;
 
index 51e8de848a6280e85862eed3e43a69fdb1a9e5b3..4f76c83ff85cf693fd6355efecafff060b0ef964 100644 (file)
@@ -919,7 +919,7 @@ Int my_connect ( Int sockfd, struct vki_sockaddr_in* serv_addr, Int addrlen )
 #  endif
 }
 
-Int VG_(write_socket)( Int sd, void *msg, Int count )
+Int VG_(write_socket)( Int sd, const void *msg, Int count )
 {
    /* This is actually send(). */
 
index 8f0b520b5146595ce4d569f8d9fffa54561468fa..b4a6c2b707e6c67392144a6f1a9e0fe216034385 100644 (file)
@@ -57,7 +57,7 @@ OutputSink VG_(xml_output_sink) = { -1, False }; /* disabled */
  
 /* Do the low-level send of a message to the logging sink. */
 static
-void send_bytes_to_logging_sink ( OutputSink* sink, Char* msg, Int nbytes )
+void send_bytes_to_logging_sink ( OutputSink* sink, const HChar* msg, Int nbytes )
 {
    if (sink->is_socket) {
       Int rc = VG_(write_socket)( sink->fd, msg, nbytes );
@@ -179,7 +179,7 @@ static void add_to__sprintf_buf ( HChar c, void *p )
    *(*b)++ = c;
 }
 
-UInt VG_(vsprintf) ( Char* buf, const HChar *format, va_list vargs )
+UInt VG_(vsprintf) ( HChar* buf, const HChar *format, va_list vargs )
 {
    Int ret;
    HChar* sprintf_ptr = buf;
@@ -193,7 +193,7 @@ UInt VG_(vsprintf) ( Char* buf, const HChar *format, va_list vargs )
    return ret;
 }
 
-UInt VG_(sprintf) ( Char* buf, const HChar *format, ... )
+UInt VG_(sprintf) ( HChar* buf, const HChar *format, ... )
 {
    UInt ret;
    va_list vargs;
@@ -226,7 +226,7 @@ static void add_to__snprintf_buf ( HChar c, void* p )
    } 
 }
 
-UInt VG_(vsnprintf) ( Char* buf, Int size, const HChar *format, va_list vargs )
+UInt VG_(vsnprintf) ( HChar* buf, Int size, const HChar *format, va_list vargs )
 {
    snprintf_buf_t b;
    b.buf      = buf;
@@ -239,7 +239,7 @@ UInt VG_(vsnprintf) ( Char* buf, Int size, const HChar *format, va_list vargs )
    return b.buf_used;
 }
 
-UInt VG_(snprintf) ( Char* buf, Int size, const HChar *format, ... )
+UInt VG_(snprintf) ( HChar* buf, Int size, const HChar *format, ... )
 {
    UInt ret;
    va_list vargs;
@@ -267,11 +267,11 @@ void VG_(vcbprintf)( void(*char_sink)(HChar, void* opaque),
 
 // Percentify n/m with d decimal places.  Includes the '%' symbol at the end.
 // Right justifies in 'buf'.
-void VG_(percentify)(ULong n, ULong m, UInt d, Int n_buf, char buf[]) 
+void VG_(percentify)(ULong n, ULong m, UInt d, Int n_buf, HChar buf[]) 
 {
    Int i, len, space;
    ULong p1;
-   Char fmt[32];
+   HChar fmt[32];
 
    if (m == 0) {
       // Have to generate the format string in order to be flexible about
index 8af79ba828d38e59af97f2f2b0af475205c5501a..6658a7055620bed5212fcb56f2dbe58926e1c5f6 100644 (file)
@@ -1415,7 +1415,7 @@ static
 void show_BB_profile ( BBProfEntry tops[], UInt n_tops, ULong score_total )
 {
    ULong score_cumul,   score_here;
-   Char  buf_cumul[10], buf_here[10];
+   HChar buf_cumul[10], buf_here[10];
    Char  name[64];
    Int   r;
 
index 75f28b22ffbb7cc914906ac7ba9700864c4b350f..24ff106cadcc5c8276876f4c858e46c0e01b2e05 100644 (file)
@@ -172,7 +172,7 @@ static struct sched_lock *the_BigLock;
    ------------------------------------------------------------------ */
 
 static
-void print_sched_event ( ThreadId tid, Char* what )
+void print_sched_event ( ThreadId tid, const HChar* what )
 {
    VG_(message)(Vg_DebugMsg, "  SCHED[%d]: %s\n", tid, what );
 }
@@ -253,7 +253,7 @@ ThreadId VG_(alloc_ThreadState) ( void )
 
    When this returns, we'll actually be running.
  */
-void VG_(acquire_BigLock)(ThreadId tid, HChar* who)
+void VG_(acquire_BigLock)(ThreadId tid, const HChar* who)
 {
    ThreadState *tst;
 
@@ -301,7 +301,8 @@ void VG_(acquire_BigLock)(ThreadId tid, HChar* who)
    but it may mean that we remain in a Runnable state and we're just
    yielding the CPU to another thread).
  */
-void VG_(release_BigLock)(ThreadId tid, ThreadStatus sleepstate, HChar* who)
+void VG_(release_BigLock)(ThreadId tid, ThreadStatus sleepstate,
+                          const HChar* who)
 {
    ThreadState *tst = VG_(get_ThreadState)(tid);
 
@@ -316,7 +317,7 @@ void VG_(release_BigLock)(ThreadId tid, ThreadStatus sleepstate, HChar* who)
    VG_(running_tid) = VG_INVALID_THREADID;
 
    if (VG_(clo_trace_sched)) {
-      Char buf[200];
+      HChar buf[200];
       vg_assert(VG_(strlen)(who) <= 200-100);
       VG_(sprintf)(buf, "releasing lock (%s) -> %s",
                         who, VG_(name_of_ThreadStatus)(sleepstate));
@@ -341,13 +342,13 @@ static void deinit_BigLock(void)
 }
 
 /* See pub_core_scheduler.h for description */
-void VG_(acquire_BigLock_LL) ( HChar* who )
+void VG_(acquire_BigLock_LL) ( const HChar* who )
 {
    ML_(acquire_sched_lock)(the_BigLock);
 }
 
 /* See pub_core_scheduler.h for description */
-void VG_(release_BigLock_LL) ( HChar* who )
+void VG_(release_BigLock_LL) ( const HChar* who )
 {
    ML_(release_sched_lock)(the_BigLock);
 }
@@ -1830,7 +1831,7 @@ void do_client_request ( ThreadId tid )
 
       case VG_USERREQ__MAP_IP_TO_SRCLOC: {
          Addr   ip    = arg[1];
-         UChar* buf64 = (UChar*)arg[2];
+         HChar* buf64 = (HChar*)arg[2];
 
          VG_(memset)(buf64, 0, 64);
          UInt linenum = 0;
@@ -1907,8 +1908,8 @@ void do_client_request ( ThreadId tid )
            if (!whined && VG_(clo_verbosity) > 2) {
                // Allow for requests in core, but defined by tools, which
                // have 0 and 0 in their two high bytes.
-               Char c1 = (arg[0] >> 24) & 0xff;
-               Char c2 = (arg[0] >> 16) & 0xff;
+               HChar c1 = (arg[0] >> 24) & 0xff;
+               HChar c2 = (arg[0] >> 16) & 0xff;
                if (c1 == 0) c1 = '_';
                if (c2 == 0) c2 = '_';
               VG_(message)(Vg_UserMsg, "Warning:\n"
index 1b9522cc8ec36d25e1bfa6809fbacaf1aead64fc..b9229ca0879872356a167692e6c4c1a3860baa2b 100644 (file)
@@ -234,7 +234,7 @@ void VG_(needs_tool_errors)(
    Bool (*read_extra) (Int, Char**, SizeT*, Supp*),
    Bool (*matches)    (Error*, Supp*),
    const HChar* (*name) (Error*),
-   Bool (*get_xtra_si)(Error*,/*OUT*/Char*,Int)
+   Bool (*get_xtra_si)(Error*,/*OUT*/HChar*,Int)
 )
 {
    VG_(needs).tool_errors = True;
index 016d93112203884fa7bc729c5e6fbdd59972f13e..db53b46293b810baa36fad949c64fc3d2bb029d9 100644 (file)
@@ -73,7 +73,7 @@ static UInt n_SP_updates_generic_unknown = 0;
 
 void VG_(print_translation_stats) ( void )
 {
-   Char buf[7];
+   HChar buf[7];
    UInt n_SP_updates = n_SP_updates_fast + n_SP_updates_generic_known
                                          + n_SP_updates_generic_unknown;
    VG_(percentify)(n_SP_updates_fast, n_SP_updates, 1, 6, buf);
index dbd1f840937559a1daaaab43d0b02cc8b8b57724..f7fddcbb4d55c847e2d7eecbf89e1f72702da78a 100644 (file)
 #if defined(VGO_linux)
 //---------------------------------------------------------------------------
 
-Char* VG_(sysnum_string)(Word sysnum, SizeT n_buf, Char* buf)
+HChar* VG_(sysnum_string)(Word sysnum, SizeT n_buf, HChar* buf)
 {
    VG_(snprintf)(buf, n_buf, "%3ld", sysnum);
    return buf;
 }
 
-Char* VG_(sysnum_string_extra)(Word sysnum, SizeT n_buf, Char* buf)
+HChar* VG_(sysnum_string_extra)(Word sysnum, SizeT n_buf, HChar* buf)
 {
    return VG_(sysnum_string)(sysnum, n_buf, buf);
 }
@@ -61,9 +61,9 @@ Char* VG_(sysnum_string_extra)(Word sysnum, SizeT n_buf, Char* buf)
 #elif defined(VGO_darwin)
 //---------------------------------------------------------------------------
 
-Char* VG_(sysnum_string)(Word sysnum, SizeT n_buf, Char* buf)
+HChar* VG_(sysnum_string)(Word sysnum, SizeT n_buf, HChar* buf)
 {
-   Char* classname = NULL;
+   const HChar* classname = NULL;
    switch (VG_DARWIN_SYSNO_CLASS(sysnum)) {
       case VG_DARWIN_SYSCALL_CLASS_MACH: classname = "mach"; break;
       case VG_DARWIN_SYSCALL_CLASS_UNIX: classname = "unix"; break;
@@ -76,7 +76,7 @@ Char* VG_(sysnum_string)(Word sysnum, SizeT n_buf, Char* buf)
    return buf;
 }
 
-Char* VG_(sysnum_string_extra)(Word sysnum, SizeT n_buf, Char* buf)
+HChar* VG_(sysnum_string_extra)(Word sysnum, SizeT n_buf, HChar* buf)
 {
    return VG_(sysnum_string)(sysnum, n_buf, buf);
 }
index 45cac3c8aca86614944abc84b97327642fc8e33b..0ed1c4af0dfc8d23cb0b9afa592a2caa7040a24a 100644 (file)
@@ -98,7 +98,7 @@ extern Bool VG_(am_is_valid_for_client_or_free_or_resvn)
 extern ULong VG_(am_get_anonsize_total)( void );
 
 /* Show the segment array on the debug log, at given loglevel. */
-extern void VG_(am_show_nsegments) ( Int logLevel, HChar* who );
+extern void VG_(am_show_nsegments) ( Int logLevel, const HChar* who );
 
 /* Get the filename corresponding to this segment, if known and if it
    has one.  The returned name's storage cannot be assumed to be
index 6b2a5a3eee85b9f5c83770e5155712be7586e28f..c49f8ae3493785c5e4f9a789fe377c148092ada7 100644 (file)
@@ -56,7 +56,7 @@
 
 /* Module startup. */
 extern 
-void VG_(debugLog_startup) ( Int level, HChar* who );
+void VG_(debugLog_startup) ( Int level, const HChar* who );
 
 
 /* Whether %ps should escape XML metacharacters. */
index 265b280d2f2ce4ee1ee196120c1a3265fb5cf8ef..8e7c20b359137233836e84f76fcafcf8e2178352 100644 (file)
@@ -65,7 +65,7 @@ extern UShort VG_(ntohs) ( UShort x );
 
 extern Int VG_(socket) ( Int domain, Int type, Int protocol );
 
-extern Int VG_(write_socket)( Int sd, void *msg, Int count );
+extern Int VG_(write_socket)( Int sd, const void *msg, Int count );
 extern Int VG_(getsockname) ( Int sd, struct vki_sockaddr *name, Int *namelen );
 extern Int VG_(getpeername) ( Int sd, struct vki_sockaddr *name, Int *namelen );
 extern Int VG_(getsockopt)  ( Int sd, Int level, Int optname, 
index 81045625bf89eed9bdfd438e08340c5b12baf64c..60d8c87520510ef4cac76069a58778dd9c16c95f 100644 (file)
@@ -57,12 +57,12 @@ extern void VG_(nuke_all_threads_except) ( ThreadId me,
    thread state to VgTs_Runnable, and the thread will attempt to take
    the CPU lock.  By the time it returns, tid will be the running
    thread. */
-extern void VG_(acquire_BigLock) ( ThreadId tid, HChar* who );
+extern void VG_(acquire_BigLock) ( ThreadId tid, const HChar* who );
 
 /* Simple version, which simply acquires the lock, but does not mess
    with the guest state in the same way as the non _LL version
    does. */
-extern void VG_(acquire_BigLock_LL) ( HChar* who );
+extern void VG_(acquire_BigLock_LL) ( const HChar* who );
 
 /* Set a thread into a sleeping state.  Before the call, the thread
    must be runnable, and holding the CPU lock.  When this call
@@ -73,10 +73,10 @@ extern void VG_(acquire_BigLock_LL) ( HChar* who );
    the caller's responsibility to actually block until the thread is
    ready to run again. */
 extern void VG_(release_BigLock) ( ThreadId tid,
-                                   ThreadStatus state, HChar* who );
+                                   ThreadStatus state, const HChar* who );
 
 /* Matching function to acquire_BigLock_LL. */
-extern void VG_(release_BigLock_LL) ( HChar* who );
+extern void VG_(release_BigLock_LL) ( const HChar* who );
 
 /* Whether the specified thread owns the big lock. */
 extern Bool VG_(owns_BigLock_LL) ( ThreadId tid );
index 05d62a7e8a2127a4b9e35123e2590ddc32014273..10a6a75b5ae242321b8ece866e31ec9475042f29 100644 (file)
@@ -125,7 +125,7 @@ typedef struct {
    Bool  (*tool_read_extra_suppression_info) (Int, Char**, SizeT*, Supp*);
    Bool  (*tool_error_matches_suppression)   (Error*, Supp*);
    const HChar* (*tool_get_error_name)       (Error*);
-   Bool  (*tool_get_extra_suppression_info)  (Error*,/*OUT*/Char*,Int);
+   Bool  (*tool_get_extra_suppression_info)  (Error*,/*OUT*/HChar*,Int);
 
    // VG_(needs).superblock_discards
    void (*tool_discard_superblock_info)(Addr64, VexGuestExtents);
index 85304d04a41c3cbee7fb61087ef632df649f01bf..feb1494025cd5da23e6f96462e9e94e5e2b64fed 100644 (file)
@@ -602,7 +602,7 @@ static const HChar* drd_get_error_name(Error* e)
  */
 static
 Bool drd_get_extra_suppression_info(Error* e,
-                                    /*OUT*/Char* buf, Int nBuf)
+                                    /*OUT*/HChar* buf, Int nBuf)
 {
    return False;
 }
index d9d9bb5dd62a151e452c420678b0dea509a1e257..1e0b984f86f937795abc915d840365b8b8f8a7dc 100644 (file)
@@ -40,7 +40,7 @@ Int VG_(memcmp)(const void* s1, const void* s2, SizeT n)
 { return memcmp(s1, s2, n); }
 UInt VG_(printf)(const HChar *format, ...)
 { UInt ret; va_list vargs; va_start(vargs, format); ret = vprintf(format, vargs); va_end(vargs); return ret; }
-UInt VG_(snprintf)(Char* buf, Int size, const HChar *format, ...)
+UInt VG_(snprintf)(HChar* buf, Int size, const HChar *format, ...)
 { UInt ret; va_list vargs; va_start(vargs, format); ret = vsnprintf(buf, size, format, vargs); va_end(vargs); return ret; }
 SizeT VG_(strlen)(const Char* str) { return strlen(str); }
 UInt VG_(message)(VgMsgKind kind, const HChar* format, ...)
index f0b492aa397f8109efea973e28c55303e290a663..43b8d8f5c28127c051886cf51191d46387e6fbbc 100644 (file)
@@ -66,7 +66,7 @@ static Bool instr_count_only=False;
 static Bool generate_pc_file=False;
 
    /* write buffer */
-static UChar buf[1024];
+static HChar buf[1024];
 
    /* Global values */
 static OSet* instr_info_table;  /* table that holds the basic block info */
@@ -137,7 +137,7 @@ static void dumpPcFile(void)
 static Int open_tracefile(Int thread_num)
 {
    SysRes  sres;
-   UChar temp_string[2048];
+   HChar temp_string[2048];
 
       /* For thread 1, don't append any thread number  */
       /* This lets the single-thread case not have any */
index 7f8db6c39326ea3bda14c26d1f2a6c7b2e7290d9..dc608a89d714c597d291dc33cdf6079ad1116c8f 100644 (file)
@@ -268,7 +268,7 @@ void pc_before_pp_Error ( Error* err ) {
 /* Do a printf-style operation on either the XML or normal output
    channel, depending on the setting of VG_(clo_xml).
 */
-static void emit_WRK ( HChar* format, va_list vargs )
+static void emit_WRK ( const HChar* format, va_list vargs )
 {
    if (VG_(clo_xml)) {
       VG_(vprintf_xml)(format, vargs);
@@ -276,15 +276,15 @@ static void emit_WRK ( HChar* format, va_list vargs )
       VG_(vmessage)(Vg_UserMsg, format, vargs);
    }
 }
-static void emit ( HChar* format, ... ) PRINTF_CHECK(1, 2);
-static void emit ( HChar* format, ... )
+static void emit ( const HChar* format, ... ) PRINTF_CHECK(1, 2);
+static void emit ( const HChar* format, ... )
 {
    va_list vargs;
    va_start(vargs, format);
    emit_WRK(format, vargs);
    va_end(vargs);
 }
-static void emiN ( HChar* format, ... ) /* With NO FORMAT CHECK */
+static void emiN ( const HChar* format, ... ) /* With NO FORMAT CHECK */
 {
    va_list vargs;
    va_start(vargs, format);
@@ -293,7 +293,7 @@ static void emiN ( HChar* format, ... ) /* With NO FORMAT CHECK */
 }
 
 
-static HChar* readwrite(SSizeT sszB)
+static const HChar* readwrite(SSizeT sszB)
 {
    return ( sszB < 0 ? "write" : "read" );
 }
@@ -348,7 +348,7 @@ void pc_pp_Error ( Error* err )
 
    //----------------------------------------------------------
    case XE_Heap: {
-      HChar *place, *legit, *how_invalid;
+      const HChar *place, *legit, *how_invalid;
       Addr a    = xe->XE.Heap.addr;
       Seg* vseg = xe->XE.Heap.vseg;
 
@@ -468,7 +468,7 @@ void pc_pp_Error ( Error* err )
    case XE_Arith: {
       Seg*   seg1   = xe->XE.Arith.seg1;
       Seg*   seg2   = xe->XE.Arith.seg2;
-      HChar*  which;
+      const HChar*  which;
 
       tl_assert(BOTTOM != seg1);
       tl_assert(BOTTOM != seg2 && UNKNOWN != seg2);
@@ -545,7 +545,7 @@ void pc_pp_Error ( Error* err )
       Seg*  seglo = xe->XE.SysParam.seglo;
       Seg*  seghi = xe->XE.SysParam.seghi;
       const HChar* s = VG_(get_error_string) (err);
-      HChar* what;
+      const HChar* what;
 
       tl_assert(BOTTOM != seglo && BOTTOM != seghi);
 
@@ -778,7 +778,7 @@ const HChar* pc_get_error_name ( Error* err )
 }
 
 Bool pc_get_extra_suppression_info ( Error* err,
-                                     /*OUT*/Char* buf, Int nBuf )
+                                     /*OUT*/HChar* buf, Int nBuf )
 {
    ErrorKind ekind = VG_(get_error_kind )(err);
    tl_assert(buf);
index 86335e152413f11078858f252965a4c31d9c1bbc..20d5bbeabf220f27f6bc6f1b1fff7a96a6d55f91 100644 (file)
@@ -57,7 +57,7 @@ Bool pc_read_extra_suppression_info ( Int fd, Char** bufpp,
 Bool pc_error_matches_suppression (Error* err, Supp* su);
 const HChar* pc_get_error_name ( Error* err );
 Bool pc_get_extra_suppression_info ( Error* err,
-                                     /*OUT*/Char* buf, Int nBuf );
+                                     /*OUT*/HChar* buf, Int nBuf );
 
 extern Bool h_clo_partial_loads_ok;
 /* extern Bool h_clo_lossage_check; */
index bcf89c3b49b09e6a62bc89b3c5159c65fe86f90b..9a51ad1fd297d8bf99e3a9466cecb6a555a60c67 100644 (file)
@@ -1390,7 +1390,7 @@ Bool HG_(error_matches_suppression) ( Error* err, Supp* su )
 }
 
 Bool HG_(get_extra_suppression_info) ( Error* err,
-                                       /*OUT*/Char* buf, Int nBuf )
+                                       /*OUT*/HChar* buf, Int nBuf )
 {
    /* Do nothing */
    return False;
index c391582423f28e6520f66bf1e1397c23b5d821bc..919ff528457b8d2ef853ce29ec1a77644c9db2bd 100644 (file)
@@ -45,7 +45,7 @@ Bool  HG_(read_extra_suppression_info) ( Int fd, Char** bufpp, SizeT* nBufp,
 Bool  HG_(error_matches_suppression) ( Error* err, Supp* su );
 const HChar* HG_(get_error_name) ( Error* err );
 Bool  HG_(get_extra_suppression_info) ( Error* err,
-                                        /*OUT*/Char* buf, Int nBuf );
+                                        /*OUT*/HChar* buf, Int nBuf );
 
 /* Functions for recording various kinds of errors. */
 void HG_(record_error_Race) ( Thread* thr, 
index f844c887a979040deccc7fc73437e08735418339..b8d80f4edd523e246570b55dc519839baf583893 100644 (file)
@@ -53,7 +53,7 @@ typedef struct _VgHashTable * VgHashTable;
    be freed with VG_(free)().  The table starts small but will
    periodically be expanded.  This is transparent to the users of this
    module. */
-extern VgHashTable VG_(HT_construct) ( HChar* name );
+extern VgHashTable VG_(HT_construct) ( const HChar* name );
 
 /* Count the number of nodes in a table. */
 extern Int VG_(HT_count_nodes) ( VgHashTable table );
index 91a51b4ce6813ffcd7e9aa00c84c94e28b38daa0..8536a815b4cd621d044ff461402b0090cae25f8c 100644 (file)
    Formatting functions
    ------------------------------------------------------------------ */
 
-extern UInt VG_(sprintf)  ( Char* buf, const HChar* format, ... )
+extern UInt VG_(sprintf)  ( HChar* buf, const HChar* format, ... )
                           PRINTF_CHECK(2, 3);
 
-extern UInt VG_(vsprintf) ( Char* buf, const HChar* format, va_list vargs )
+extern UInt VG_(vsprintf) ( HChar* buf, const HChar* format, va_list vargs )
                           PRINTF_CHECK(2, 0);
 
-extern UInt VG_(snprintf) ( Char* buf, Int size, 
+extern UInt VG_(snprintf) ( HChar* buf, Int size, 
                                        const HChar *format, ... )
                           PRINTF_CHECK(3, 4);
 
-extern UInt VG_(vsnprintf)( Char* buf, Int size, 
+extern UInt VG_(vsnprintf)( HChar* buf, Int size, 
                                        const HChar *format, va_list vargs )
                           PRINTF_CHECK(3, 0);
 
 // Percentify n/m with d decimal places.  Includes the '%' symbol at the end.
 // Right justifies in 'buf'.
-extern void VG_(percentify)(ULong n, ULong m, UInt d, Int n_buf, char buf[]);
+extern void VG_(percentify)(ULong n, ULong m, UInt d, Int n_buf, HChar buf[]);
 
 
 /* ---------------------------------------------------------------------
index aa23a0d5c04654edc3499f8d2d59ae7b1ba97b2a..cdd70a4bcf85bf072b355cfec12facec6f9185d1 100644 (file)
@@ -343,7 +343,7 @@ extern void VG_(needs_tool_errors) (
    // do nothing, and return False.  This function is the inverse of
    // VG_(tdict).tool_read_extra_suppression_info().
    Bool (*print_extra_suppression_info)(Error* err,
-                                        /*OUT*/Char* buf, Int nBuf)
+                                        /*OUT*/HChar* buf, Int nBuf)
 );
 
 /* Is information kept by the tool about specific instructions or
index 5eff7ae33bc930928da82a320c203af536c227e3..074037b34b62f520b3a9282f90eb39b86ca19d5d 100644 (file)
 // This converts a syscall number into a string, suitable for printing.  It is
 // needed because some platforms (Darwin) munge sysnums in various ways.
 // It is used in places where the sycall name will be printed alongside.
-extern Char* VG_(sysnum_string)      (Word sysnum, SizeT n_buf, Char* buf);
+extern HChar* VG_(sysnum_string)      (Word sysnum, SizeT n_buf, HChar* buf);
 
 // This is like VG_(sysnum_string), but prints extra info if needed.  It is
 // called in places where the syscall name will *not* be printed alongside.
-extern Char* VG_(sysnum_string_extra)(Word sysnum, SizeT n_buf, Char* buf);
+extern HChar* VG_(sysnum_string_extra)(Word sysnum, SizeT n_buf, HChar* buf);
 
 // Macros that make the above functions easier to use by declaring a local
 // buffer.
 #define VG_SYSNUM_STRING(sysnum) \
-   ({ Char qq_zz_buf[32]; VG_(sysnum_string)(sysnum, 32, qq_zz_buf); })
+   ({ HChar qq_zz_buf[32]; VG_(sysnum_string)(sysnum, 32, qq_zz_buf); })
 #define VG_SYSNUM_STRING_EXTRA(sysnum) \
-   ({ Char qq_zz_buf[64]; VG_(sysnum_string_extra)(sysnum, 64, qq_zz_buf); })
+   ({ HChar qq_zz_buf[64]; VG_(sysnum_string_extra)(sysnum, 64, qq_zz_buf); })
 
 
 #endif   // __PUB_TOOL_VKISCNUMS_H
index efc49b0e03949ba91a65181293d52ada0774cb2a..3b7d0247d9b0a874b26db221e197f96c1cdac8f9 100644 (file)
@@ -2139,7 +2139,7 @@ IRSB* ms_instrument ( VgCallbackClosure* closure,
 //--- Writing snapshots                                    ---//
 //------------------------------------------------------------//
 
-Char FP_buf[BUF_LEN];
+HChar FP_buf[BUF_LEN];
 
 // XXX: implement f{,n}printf in m_libcprint.c eventually, and use it here.
 // Then change Cachegrind to use it too.
@@ -2150,9 +2150,9 @@ Char FP_buf[BUF_LEN];
 })
 
 // Nb: uses a static buffer, each call trashes the last string returned.
-static Char* make_perc(double x)
+static HChar* make_perc(double x)
 {
-   static Char mbuf[32];
+   static HChar mbuf[32];
 
    VG_(percentify)((ULong)(x * 100), 10000, 2, 6, mbuf);
    // XXX: this is bogus if the denominator was zero -- resulting string is
index dd8e0e4036142c32d8f59a3bff02726758e9a514..bbbc56b99f5a417bd3a6c653a8c004e672b7f804 100644 (file)
@@ -270,7 +270,7 @@ void MC_(before_pp_Error) ( Error* err ) {
 /* Do a printf-style operation on either the XML or normal output
    channel, depending on the setting of VG_(clo_xml).
 */
-static void emit_WRK ( HChar* format, va_list vargs )
+static void emit_WRK ( const HChar* format, va_list vargs )
 {
    if (VG_(clo_xml)) {
       VG_(vprintf_xml)(format, vargs);
@@ -278,15 +278,15 @@ static void emit_WRK ( HChar* format, va_list vargs )
       VG_(vmessage)(Vg_UserMsg, format, vargs);
    }
 }
-static void emit ( HChar* format, ... ) PRINTF_CHECK(1, 2);
-static void emit ( HChar* format, ... )
+static void emit ( const HChar* format, ... ) PRINTF_CHECK(1, 2);
+static void emit ( const HChar* format, ... )
 {
    va_list vargs;
    va_start(vargs, format);
    emit_WRK(format, vargs);
    va_end(vargs);
 }
-static void emiN ( HChar* format, ... ) /* NO FORMAT CHECK */
+static void emiN ( const HChar* format, ... ) /* NO FORMAT CHECK */
 {
    va_list vargs;
    va_start(vargs, format);
@@ -433,9 +433,9 @@ static void mc_pp_origin ( ExeContext* ec, UInt okind )
    }
 }
 
-char * MC_(snprintf_delta) (char * buf, Int size, 
-                            SizeT current_val, SizeT old_val, 
-                            LeakCheckDeltaMode delta_mode)
+HChar * MC_(snprintf_delta) (HChar * buf, Int size, 
+                             SizeT current_val, SizeT old_val, 
+                             LeakCheckDeltaMode delta_mode)
 {
    if (delta_mode == LCD_Any)
       buf[0] = '\0';
@@ -452,10 +452,10 @@ static void pp_LossRecord(UInt n_this_record, UInt n_total_records,
 {
    // char arrays to produce the indication of increase/decrease in case
    // of delta_mode != LCD_Any
-   char        d_bytes[20];
-   char        d_direct_bytes[20];
-   char        d_indirect_bytes[20];
-   char        d_num_blocks[20];
+   HChar d_bytes[20];
+   HChar d_direct_bytes[20];
+   HChar d_indirect_bytes[20];
+   HChar d_num_blocks[20];
 
    MC_(snprintf_delta) (d_bytes, 20, 
                         lr->szB + lr->indirect_szB, 
@@ -1559,7 +1559,7 @@ const HChar* MC_(get_error_name) ( Error* err )
 }
 
 Bool MC_(get_extra_suppression_info) ( Error* err,
-                                       /*OUT*/Char* buf, Int nBuf )
+                                       /*OUT*/HChar* buf, Int nBuf )
 {
    ErrorKind ekind = VG_(get_error_kind )(err);
    tl_assert(buf);
index 1e1ebeea2ce11c7bafcd0687f983707ad68cd737..52ae577021c4abd42c9a5cf30d6b96cd6ad56b7b 100644 (file)
@@ -342,9 +342,9 @@ void MC_(who_points_at) ( Addr address, SizeT szB);
 
 // if delta_mode == LCD_Any, prints in buf an empty string
 // otherwise prints a delta in the layout  " (+%'lu)" or " (-%'lu)" 
-extern char * MC_(snprintf_delta) (char * buf, Int size, 
-                                   SizeT current_val, SizeT old_val, 
-                                   LeakCheckDeltaMode delta_mode);
+extern HChar * MC_(snprintf_delta) (HChar * buf, Int size, 
+                                    SizeT current_val, SizeT old_val, 
+                                    LeakCheckDeltaMode delta_mode);
 
 
 Bool MC_(is_valid_aligned_word)     ( Addr a );
@@ -380,7 +380,7 @@ Bool MC_(read_extra_suppression_info) ( Int fd, Char** buf,
 Bool MC_(error_matches_suppression) ( Error* err, Supp* su );
 
 Bool MC_(get_extra_suppression_info) ( Error* err,
-                                       /*OUT*/Char* buf, Int nBuf );
+                                       /*OUT*/HChar* buf, Int nBuf );
 
 const HChar* MC_(get_error_name) ( Error* err );
 
index 2d3eb95bbc31ec57a4d8b03e936e8c585f8bb3ef..1408a7d1989d284a003dfc90bb0b8fdce9311362 100644 (file)
@@ -966,7 +966,7 @@ static void gcSecVBitTable(void)
    secVBitTable = secVBitTable2;
 
    if (VG_(clo_verbosity) > 1) {
-      Char percbuf[7];
+      HChar percbuf[7];
       VG_(percentify)(n_survivors, n_nodes, 1, 6, percbuf);
       VG_(message)(Vg_DebugMsg, "memcheck GC: %d nodes, %d survivors (%s)\n",
                    n_nodes, n_survivors, percbuf);