[Lldb-commits] [PATCH] Fix SBFrame::FindValue for when only global variables exist.

Chaoren Lin chaorenl at google.com
Thu Mar 19 15:02:52 PDT 2015


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D8464

Files:
  lldb/trunk/source/API/SBFrame.cpp

Index: lldb/trunk/source/API/SBFrame.cpp
===================================================================
--- lldb/trunk/source/API/SBFrame.cpp
+++ lldb/trunk/source/API/SBFrame.cpp
@@ -870,32 +870,30 @@
                 case eValueTypeVariableArgument:    // function argument variables
                 case eValueTypeVariableLocal:       // function local variables
                     {
-                        SymbolContext sc (frame->GetSymbolContext (eSymbolContextBlock));
+                        SymbolContext sc(frame->GetSymbolContext(eSymbolContextBlock));
 
                         const bool can_create = true;
                         const bool get_parent_variables = true;
                         const bool stop_if_block_is_inlined_function = true;
 
-                        if (sc.block && sc.block->AppendVariables (can_create, 
-                                                                   get_parent_variables,
-                                                                   stop_if_block_is_inlined_function,
-                                                                   &variable_list))
+                        if (sc.block)
+                            sc.block->AppendVariables(can_create,
+                                                      get_parent_variables,
+                                                      stop_if_block_is_inlined_function,
+                                                      &variable_list);
+                        if (value_type == eValueTypeVariableGlobal)
                         {
-                            if (value_type == eValueTypeVariableGlobal)
-                            {
-                                const bool get_file_globals = true;
-                                VariableList* frame_vars = frame->GetVariableList(get_file_globals);
-                                if (frame_vars)
-                                    frame_vars->AppendVariablesIfUnique(variable_list);
-                            }
-                            ConstString const_name(name);
-                            VariableSP variable_sp(variable_list.FindVariable(const_name,value_type));
-                            if (variable_sp)
-                            {
-                                value_sp = frame->GetValueObjectForFrameVariable (variable_sp, eNoDynamicValues);
-                                sb_value.SetSP (value_sp, use_dynamic);
-                                break;
-                            }
+                            const bool get_file_globals = true;
+                            VariableList *frame_vars = frame->GetVariableList(get_file_globals);
+                            if (frame_vars)
+                                frame_vars->AppendVariablesIfUnique(variable_list);
+                        }
+                        ConstString const_name(name);
+                        VariableSP variable_sp(variable_list.FindVariable(const_name, value_type));
+                        if (variable_sp)
+                        {
+                            value_sp = frame->GetValueObjectForFrameVariable(variable_sp, eNoDynamicValues);
+                            sb_value.SetSP(value_sp, use_dynamic);
                         }
                     }
                     break;

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8464.22311.patch
Type: text/x-patch
Size: 3321 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150319/66e632cb/attachment.bin>


More information about the lldb-commits mailing list