[Lldb-commits] [lldb] e6b6132 - Rename FunctionOptimizationWarning to the more generic FrameSelectedCallback (NFC)

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Thu May 21 16:37:54 PDT 2020


Author: Adrian Prantl
Date: 2020-05-21T16:22:01-07:00
New Revision: e6b613254d8b62cdd64ee9d8376f2bdda1bcc359

URL: https://github.com/llvm/llvm-project/commit/e6b613254d8b62cdd64ee9d8376f2bdda1bcc359
DIFF: https://github.com/llvm/llvm-project/commit/e6b613254d8b62cdd64ee9d8376f2bdda1bcc359.diff

LOG: Rename FunctionOptimizationWarning to the more generic FrameSelectedCallback (NFC)

Added: 
    

Modified: 
    lldb/include/lldb/Target/Thread.h
    lldb/source/Target/Thread.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Target/Thread.h b/lldb/include/lldb/Target/Thread.h
index 7422ef0d1bd5..97c35d7f870d 100644
--- a/lldb/include/lldb/Target/Thread.h
+++ b/lldb/include/lldb/Target/Thread.h
@@ -1211,7 +1211,7 @@ class Thread : public std::enable_shared_from_this<Thread>,
     m_temporary_resume_state = new_state;
   }
 
-  void FunctionOptimizationWarning(lldb_private::StackFrame *frame);
+  void FrameSelectedCallback(lldb_private::StackFrame *frame);
 
   // Classes that inherit from Process can see and modify these
   lldb::ProcessWP m_process_wp;    ///< The process that owns this thread.

diff  --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp
index f852e5546728..e24024c37a47 100644
--- a/lldb/source/Target/Thread.cpp
+++ b/lldb/source/Target/Thread.cpp
@@ -271,7 +271,7 @@ lldb::StackFrameSP Thread::GetSelectedFrame() {
   StackFrameListSP stack_frame_list_sp(GetStackFrameList());
   StackFrameSP frame_sp = stack_frame_list_sp->GetFrameAtIndex(
       stack_frame_list_sp->GetSelectedFrameIndex());
-  FunctionOptimizationWarning(frame_sp.get());
+  FrameSelectedCallback(frame_sp.get());
   return frame_sp;
 }
 
@@ -280,7 +280,7 @@ uint32_t Thread::SetSelectedFrame(lldb_private::StackFrame *frame,
   uint32_t ret_value = GetStackFrameList()->SetSelectedFrame(frame);
   if (broadcast)
     BroadcastSelectedFrameChange(frame->GetStackID());
-  FunctionOptimizationWarning(frame);
+  FrameSelectedCallback(frame);
   return ret_value;
 }
 
@@ -290,7 +290,7 @@ bool Thread::SetSelectedFrameByIndex(uint32_t frame_idx, bool broadcast) {
     GetStackFrameList()->SetSelectedFrame(frame_sp.get());
     if (broadcast)
       BroadcastSelectedFrameChange(frame_sp->GetStackID());
-    FunctionOptimizationWarning(frame_sp.get());
+    FrameSelectedCallback(frame_sp.get());
     return true;
   } else
     return false;
@@ -314,7 +314,7 @@ bool Thread::SetSelectedFrameByIndexNoisily(uint32_t frame_idx,
 
       bool show_frame_info = true;
       bool show_source = !already_shown;
-      FunctionOptimizationWarning(frame_sp.get());
+      FrameSelectedCallback(frame_sp.get());
       return frame_sp->GetStatus(output_stream, show_frame_info, show_source);
     }
     return false;
@@ -322,9 +322,11 @@ bool Thread::SetSelectedFrameByIndexNoisily(uint32_t frame_idx,
     return false;
 }
 
-void Thread::FunctionOptimizationWarning(StackFrame *frame) {
-  if (frame && frame->HasDebugInformation() &&
-      GetProcess()->GetWarningsOptimization()) {
+void Thread::FrameSelectedCallback(StackFrame *frame) {
+  if (!frame)
+    return;
+
+  if (frame->HasDebugInformation() && GetProcess()->GetWarningsOptimization()) {
     SymbolContext sc =
         frame->GetSymbolContext(eSymbolContextFunction | eSymbolContextModule);
     GetProcess()->PrintWarningOptimization(sc);


        


More information about the lldb-commits mailing list