]> git.cworth.org Git - apitrace/blobdiff - retrace_stdc.cpp
apitrace diff-images: Print one line for each file being compared.
[apitrace] / retrace_stdc.cpp
index 0db72b20b3475850a3a18c03342c5afa9d4bd841..e6b108bbca679850704365ccb1732bc923006a92 100644 (file)
@@ -28,8 +28,6 @@
 
 #include <string.h>
 
-#include "glproc.hpp"
-
 
 
 #include "trace_parser.hpp"
@@ -92,6 +90,17 @@ upperBound(unsigned long long address) {
 void
 addRegion(unsigned long long address, void *buffer, unsigned long long size)
 {
+    if (retrace::verbosity >= 2) {
+        std::cout
+            << "region "
+            << std::hex
+            << "0x" << address << "-0x" << (address + size)
+            << " -> "
+            << "0x" << (uintptr_t)buffer << "-0x" << ((uintptr_t)buffer + size)
+            << std::dec
+            << "\n";
+    }
+
     if (!address) {
         // Ignore NULL pointer
         assert(!buffer);
@@ -168,7 +177,20 @@ lookupAddress(unsigned long long address) {
     if (it != regionMap.end()) {
         unsigned long long offset = address - it->first;
         assert(offset < it->second.size);
-        return (char *)it->second.buffer + offset;
+        void *addr = (char *)it->second.buffer + offset;
+
+        if (retrace::verbosity >= 2) {
+            std::cout
+                << "region "
+                << std::hex
+                << "0x" << address
+                << " <- "
+                << "0x" << (uintptr_t)addr
+                << std::dec
+                << "\n";
+        }
+
+        return addr;
     }
 
     if (address >= 0x00400000) {