title: What is Pc Materialization?
body: <p>I am working with a tool called for binary instrumentation called <a href="http://pintool.org/" rel="nofollow">Intel Pin</a>. However I encountered this strange terminology while I was examining part of the examples that Pin comes with. Here is the relevant part:</p>
  
  <pre><code>VOID CallTrace(TRACE trace, INS ins)
  {
      if (!KnobTraceCalls)
          return;
  
      if (INS_IsCall(ins) &amp;&amp; !INS_IsDirectBranchOrCall(ins))
      {
          // Indirect call
          string s = "Call " + FormatAddress(INS_Address(ins), TRACE_Rtn(trace));
          s += " -&gt; ";
  
          INS_InsertCall(ins, IPOINT_BEFORE, AFUNPTR(EmitIndirectCall), IARG_THREAD_ID,
                         IARG_PTR, new string(s), IARG_BRANCH_TARGET_ADDR,
                         IARG_G_ARG0_CALLER, IARG_G_ARG1_CALLER, IARG_END);
      }
      else if (INS_IsDirectBranchOrCall(ins))
      {
          // Is this a tail call?
          RTN sourceRtn = TRACE_Rtn(trace);
          RTN destRtn = RTN_FindByAddress(INS_DirectBranchOrCallTargetAddress(ins));
  
          if (INS_IsCall(ins)         // conventional call
              || sourceRtn != destRtn // tail call
          )
          {
              BOOL tailcall = !INS_IsCall(ins);
  
              string s = "";
              if (tailcall)
              {
                  s += "Tailcall ";
              }
              else
              {
                  if( INS_IsProcedureCall(ins) )
                      s += "Call ";
                  else
                  {
                      s += "PcMaterialization ";
                      tailcall=1;
                  }
  
              }
  
              //s += INS_Mnemonic(ins) + " ";
  
              s += FormatAddress(INS_Address(ins), TRACE_Rtn(trace));
              s += " -&gt; ";
  
              ADDRINT target = INS_DirectBranchOrCallTargetAddress(ins);
  
              s += FormatAddress(target, RTN_FindByAddress(target));
  
              INS_InsertCall(ins, IPOINT_BEFORE, AFUNPTR(EmitDirectCall),
                             IARG_THREAD_ID, IARG_PTR, new string(s), IARG_BOOL, tailcall,
                             IARG_G_ARG0_CALLER, IARG_G_ARG1_CALLER, IARG_END);
          }
      }
      else if (INS_IsRet(ins))
      {
          RTN rtn =  TRACE_Rtn(trace);
  
  #if defined(TARGET_LINUX) &amp;&amp; defined(TARGET_IA32)
  //        if( RTN_Name(rtn) ==  "_dl_debug_state") return;
          if( RTN_Valid(rtn) &amp;&amp; RTN_Name(rtn) ==  "_dl_runtime_resolve") return;
  #endif
          string tracestring = "Return " + FormatAddress(INS_Address(ins), rtn);
          INS_InsertCall(ins, IPOINT_BEFORE, AFUNPTR(EmitReturn),
                         IARG_THREAD_ID, IARG_PTR, new string(tracestring), IARG_G_RESULT0, IARG_END);
      }
  }
  </code></pre>
  
  <p>This method determines what actually is the instruction doing (direct call, indirect call, tail call, return and the unknown Pc Materialization).</p>
  
  <p>Here is the <a href="https://svn.mcs.anl.gov/repos/performance/Gwalp/gwalpsite/pin/source/tools/DebugTrace/debugtrace.cpp" rel="nofollow">full code</a>.</p>
  
  <p>So what does it mean at all? I tried googling - no relevant results.</p>