88#include < cstdio>
99#include < cstring>
1010#include < sstream>
11+ #include < cinttypes> // Since C++11 for the macro of PRIx64
1112
1213#include " retdec/pdbparser/pdb_symbols.h"
1314
@@ -58,7 +59,8 @@ void dump_local_variable(PDBLocalVariable &var)
5859
5960void PDBFunction::dump (void )
6061{
61- printf (" ** Function [%s] at 0x%16lx\n " , name, address);
62+ printf (" ** Function [%s] at 0x%" PRIx64 " \n " , name, address);
63+
6264 if (overload_index > 0 )
6365 printf (" \t Function is overloaded. Index: %d\n " , overload_index);
6466 printf (" \t Offset : %08x\n " , offset);
@@ -100,12 +102,12 @@ void PDBFunction::dump(void)
100102 data[i].type_def ->dump (true );
101103 size = data[i].type_def ->size_bytes ;
102104 }
103- printf (" Size: %d bytes [%s] at 0x%16lx \n " , size, data[i].name , data[i].address );
105+ printf (" Size: %d bytes [%s] at 0x%" PRIx64 " \n " , size, data[i].name , data[i].address );
104106 }
105107 printf (" \t Line number information:\n " );
106108 for (unsigned int i = 0 ; i < lines.size (); i++)
107109 {
108- printf (" \t\t Line: %d Offset: %08x (%16lx )\n " , lines[i].line , lines[i].offset , lines[i].offset + address);
110+ printf (" \t\t Line: %d Offset: %08x (%" PRIx64 " )\n " , lines[i].line , lines[i].offset , lines[i].offset + address);
109111 }
110112 puts (" " );
111113}
@@ -297,7 +299,6 @@ void PDBSymbols::parse_symbols(void)
297299 continue ;
298300 PDBStream *stream = modules[m].stream ;
299301 position = 4 ;
300- int cnt = 0 ;
301302 PDBFunction * new_function = nullptr ;
302303 while (position < stream->size )
303304 { // Process all symbols in module stream
@@ -371,11 +372,9 @@ void PDBSymbols::parse_symbols(void)
371372 break ;
372373 }
373374 }
374- cnt++;
375375 position += symbol->size + 2 ;
376376 }
377377
378- cnt = 0 ;
379378 while (position < stream->size )
380379 { // Process all big symbols in module stream
381380 PDBBigSymbol *symbol = reinterpret_cast <PDBBigSymbol *>(stream->data + position);
@@ -397,7 +396,6 @@ void PDBSymbols::parse_symbols(void)
397396 break ;
398397 }
399398 position += symbol->size + 8 ;
400- cnt++;
401399 }
402400 }
403401 parsed = true ;
@@ -768,7 +766,7 @@ void PDBSymbols::print_global_variables(void)
768766 puts (" ******* SYM global variables list *******" );
769767 for (PDBGlobalVarAddressMap::iterator it = global_variables.begin (); it != global_variables.end (); ++it)
770768 {
771- printf (" Global variable [%s] at 0x%16lx \n " , it->second .name , it->second .address );
769+ printf (" Global variable [%s] at 0x%" PRIx64 " \n " , it->second .name , it->second .address );
772770 printf (" \t Offset : %08x\n " , it->second .offset );
773771 printf (" \t Section: %04x\n " , it->second .section );
774772 printf (" \t Module : %d\n " , it->second .module_index );
0 commit comments