[llvm-branch-commits] [lldb] r200055 - Fixed source display to show source/disassembly when the windows first appear and also fixed a crasher when running using the 'c' command in the source window.

Greg Clayton gclayton at apple.com
Fri Jan 24 16:46:57 PST 2014


Author: gclayton
Date: Fri Jan 24 18:46:57 2014
New Revision: 200055

URL: http://llvm.org/viewvc/llvm-project?rev=200055&view=rev
Log:
Fixed source display to show source/disassembly when the windows first appear and also fixed a crasher when running using the 'c' command in the source window.


Modified:
    lldb/branches/iohandler/source/Core/IOHandler.cpp

Modified: lldb/branches/iohandler/source/Core/IOHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/iohandler/source/Core/IOHandler.cpp?rev=200055&r1=200054&r2=200055&view=diff
==============================================================================
--- lldb/branches/iohandler/source/Core/IOHandler.cpp (original)
+++ lldb/branches/iohandler/source/Core/IOHandler.cpp Fri Jan 24 18:46:57 2014
@@ -4403,10 +4403,16 @@ public:
             }
         }
         
+        m_min_x = 1;
+        m_min_y = 1;
+        m_max_x = window.GetMaxX()-1;
+        m_max_y = window.GetMaxY()-1;
+        
         const uint32_t num_visible_lines = NumVisibleLines();
         StackFrameSP frame_sp;
         bool set_selected_line_to_pc = false;
 
+        
         if (update_location)
         {
             
@@ -4560,11 +4566,6 @@ public:
         }
         
             
-        m_min_x = 1;
-        m_min_y = 1;
-        m_max_x = window.GetMaxX()-1;
-        m_max_y = window.GetMaxY()-1;
-        
         window.Erase();
         window.DrawTitleBox ("Sources");
         
@@ -4713,8 +4714,11 @@ public:
                 StreamString strm;
 
                 InstructionList &insts = m_disassembly_sp->GetInstructionList();
-                Address pc_address = frame_sp->GetFrameCodeAddress();
-                const uint32_t pc_idx = insts.GetIndexOfInstructionAtAddress (pc_address);
+                Address pc_address;
+                
+                if (frame_sp)
+                    pc_address = frame_sp->GetFrameCodeAddress();
+                const uint32_t pc_idx = pc_address.IsValid() ? insts.GetIndexOfInstructionAtAddress (pc_address) : UINT32_MAX;
                 if (set_selected_line_to_pc)
                 {
                     m_selected_line = pc_idx;





More information about the llvm-branch-commits mailing list