]> sourceware.org Git - systemtap.git/commitdiff
Dyninst compile fixes for 32-bit systems.
authorDavid Smith <dsmith@redhat.com>
Fri, 27 Jul 2012 17:54:54 +0000 (12:54 -0500)
committerDavid Smith <dsmith@redhat.com>
Fri, 27 Jul 2012 17:54:54 +0000 (12:54 -0500)
* stapdyn/dynsdt.cxx (find_sdt): Fix printf types for 64-bit longs.
  (instrument_sdt): Ditto.
* stapdyn/stapdyn.cxx (instrument_uprobes): Change type from 'uint64' to
  'int64', since there are only signed 64-bit long BPatch_constExpr
  constructors.

stapdyn/dynsdt.cxx
stapdyn/stapdyn.cxx

index 4c066e880734d596534aa7f2b00c2726dc2437d8..3b413bbcda9624385231a3802267bc1aef8b1ec7 100644 (file)
@@ -136,13 +136,13 @@ find_sdt(const string& file)
         {
           sdt_base_addr = shdr.sh_addr;
           sdt_base_offset = shdr.sh_offset;
-          warnx("SDT base addr:%#lx offset:%#lx", sdt_base_addr, sdt_base_offset);
+          warnx("SDT base addr:%#llx offset:%#llx", sdt_base_addr, sdt_base_offset);
         }
       if (sh_name && !strcmp(".probes", sh_name))
         {
           sdt_probes_addr = shdr.sh_addr;
           sdt_probes_offset = shdr.sh_offset;
-          warnx("SDT probes addr:%#lx offset:%#lx", sdt_probes_addr, sdt_probes_offset);
+          warnx("SDT probes addr:%#llx offset:%#llx", sdt_probes_addr, sdt_probes_offset);
         }
     }
 
@@ -239,7 +239,7 @@ find_sdt(const string& file)
                 joined_args << ", ";
               joined_args << p.args[i].first << "@\"" << p.args[i].second << "\"";
             }
-         warnx("SDT offset:%#lx semaphore:%#lx %s:%s(%s)",
+         warnx("SDT offset:%#llx semaphore:%#llx %s:%s(%s)",
                p.pc_offset, p.sem_offset,
                 p.provider.c_str(), p.name.c_str(),
                joined_args.str().c_str());
@@ -266,7 +266,7 @@ instrument_sdt(BPatch_process* process,
   Dyninst::Address address = object->fileOffsetToAddr(p.pc_offset);
   if (address == BPatch_object::E_OUT_OF_BOUNDS)
     {
-      warnx("couldn't convert %s:%s at %#lx to an address",
+      warnx("couldn't convert %s:%s at %#llx to an address",
             p.provider.c_str(), p.name.c_str(), p.pc_offset);
       return;
     }
@@ -275,7 +275,7 @@ instrument_sdt(BPatch_process* process,
   object->findPoints(address, points);
   if (points.empty())
     {
-      warnx("couldn't find %s:%s at %#lx -> %#lx",
+      warnx("couldn't find %s:%s at %#llx -> %#lx",
             p.provider.c_str(), p.name.c_str(), p.pc_offset, address);
       return;
     }
@@ -301,7 +301,7 @@ instrument_sdt(BPatch_process* process,
   image->findFunction("printf", printfFuncs);
   BPatch_funcCallExpr printfCall(*(printfFuncs[0]), printfArgs);
 
-  warnx("inserting %s:%s at %#lx -> %#lx [%zu]",
+  warnx("inserting %s:%s at %#llx -> %#lx [%zu]",
         p.provider.c_str(), p.name.c_str(), p.pc_offset, address, points.size());
   process->insertSnippet(printfCall, points);
 
@@ -309,11 +309,11 @@ instrument_sdt(BPatch_process* process,
     {
       Dyninst::Address sem_address = object->fileOffsetToAddr(p.sem_offset);
       if (sem_address == BPatch_object::E_OUT_OF_BOUNDS)
-        warnx("couldn't convert %s:%s semaphore %#lx to an address",
+        warnx("couldn't convert %s:%s semaphore %#llx to an address",
               p.provider.c_str(), p.name.c_str(), p.sem_offset);
       else
         {
-          warnx("incrementing semaphore for %s:%s at %#lx -> %#lx",
+          warnx("incrementing semaphore for %s:%s at %#llx -> %#lx",
                 p.provider.c_str(), p.name.c_str(), p.sem_offset, sem_address);
 
           BPatch_type *sem_type = image->findType("unsigned short");
index c3017c86a244ec1d1e682fef8ef198e6b303d122..08e9fa210bd6afc329038fe6a4dc639ed3879eda 100644 (file)
@@ -118,7 +118,7 @@ instrument_uprobes(BPatch_process *app, Elf_Data* data)
         }
 
       BPatch_Vector<BPatch_snippet *> args;
-      args.push_back(new BPatch_constExpr((uint64_t)i)); // probe index
+      args.push_back(new BPatch_constExpr((int64_t)i)); // probe index
       args.push_back(new BPatch_constExpr((void*)NULL)); // pt_regs
       BPatch_funcCallExpr call(enter_function, args);
       app->insertSnippet(call, points);
This page took 0.028143 seconds and 5 git commands to generate.