[Lldb-commits] [lldb] r119786 - /lldb/trunk/source/Core/Debugger.cpp

Greg Clayton gclayton at apple.com
Thu Nov 18 20:16:11 PST 2010


Author: gclayton
Date: Thu Nov 18 22:16:11 2010
New Revision: 119786

URL: http://llvm.org/viewvc/llvm-project?rev=119786&view=rev
Log:
Print out addresses with the correct width for 32 bit programs.


Modified:
    lldb/trunk/source/Core/Debugger.cpp

Modified: lldb/trunk/source/Core/Debugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=119786&r1=119785&r2=119786&view=diff
==============================================================================
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Thu Nov 18 22:16:11 2010
@@ -1138,7 +1138,12 @@
 
                                     if (vaddr != LLDB_INVALID_ADDRESS)
                                     {
-                                        s.Printf("0x%16.16llx", vaddr);
+                                        int addr_width = 0;
+                                        if (exe_ctx && exe_ctx->process)
+                                            addr_width = exe_ctx->process->GetAddressByteSize() * 2;
+                                        if (addr_width == 0)
+                                            addr_width = 16;
+                                        s.Printf("0x%*.*llx", addr_width, addr_width, vaddr);
                                         var_success = true;
                                     }
                                 }





More information about the lldb-commits mailing list