Replace 'ap' with 'up' suffix in variable names. (NFC)
The `ap` suffix is a remnant of lldb's former use of auto pointers, before they got deprecated. Although all their uses were replaced by unique pointers, some variables still carried the suffix. In r353795 I removed another auto_ptr remnant, namely redundant calls to ::get for unique_pointers. Jim justly noted that this is a good opportunity to clean up the variable names as well. I went over all the changes to ensure my find-and-replace didn't have any undesired side-effects. I hope I didn't miss any, but if you end up at this commit doing a git blame on a weirdly named variable, please know that the change was unintentional. llvm-svn: 353912
This commit is contained in:
		
							parent
							
								
									5cf777e413
								
							
						
					
					
						commit
						d5b440369d
					
				| 
						 | 
				
			
			@ -114,7 +114,7 @@ protected:
 | 
			
		|||
  void SetAddress(const lldb_private::Address *lldb_object_ptr);
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
  std::unique_ptr<lldb_private::Address> m_opaque_ap;
 | 
			
		||||
  std::unique_ptr<lldb_private::Address> m_opaque_up;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
bool LLDB_API operator==(const SBAddress &lhs, const SBAddress &rhs);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -99,7 +99,7 @@ protected:
 | 
			
		|||
  void SetLLDBObjectPtr(lldb_private::CommandReturnObject *ptr);
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
  std::unique_ptr<lldb_private::CommandReturnObject> m_opaque_ap;
 | 
			
		||||
  std::unique_ptr<lldb_private::CommandReturnObject> m_opaque_up;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace lldb
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -61,7 +61,7 @@ private:
 | 
			
		|||
 | 
			
		||||
  void SetDeclaration(const lldb_private::Declaration &lldb_object_ref);
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<lldb_private::Declaration> m_opaque_ap;
 | 
			
		||||
  std::unique_ptr<lldb_private::Declaration> m_opaque_up;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace lldb
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -79,7 +79,7 @@ protected:
 | 
			
		|||
  void SetError(const lldb_private::Status &lldb_error);
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
  std::unique_ptr<lldb_private::Status> m_opaque_ap;
 | 
			
		||||
  std::unique_ptr<lldb_private::Status> m_opaque_up;
 | 
			
		||||
 | 
			
		||||
  void CreateIfNeeded();
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -107,7 +107,7 @@ protected:
 | 
			
		|||
 | 
			
		||||
private:
 | 
			
		||||
  // This auto_pointer is made in the constructor and is always valid.
 | 
			
		||||
  mutable std::unique_ptr<lldb_private::EvaluateExpressionOptions> m_opaque_ap;
 | 
			
		||||
  mutable std::unique_ptr<lldb_private::EvaluateExpressionOptions> m_opaque_up;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace lldb
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -82,7 +82,7 @@ private:
 | 
			
		|||
 | 
			
		||||
  const lldb_private::FileSpec &ref() const;
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<lldb_private::FileSpec> m_opaque_ap;
 | 
			
		||||
  std::unique_ptr<lldb_private::FileSpec> m_opaque_up;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace lldb
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -49,7 +49,7 @@ private:
 | 
			
		|||
 | 
			
		||||
  const lldb_private::FileSpecList &ref() const;
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<lldb_private::FileSpecList> m_opaque_ap;
 | 
			
		||||
  std::unique_ptr<lldb_private::FileSpecList> m_opaque_up;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace lldb
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -68,7 +68,7 @@ private:
 | 
			
		|||
 | 
			
		||||
  void SetLineEntry(const lldb_private::LineEntry &lldb_object_ref);
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<lldb_private::LineEntry> m_opaque_ap;
 | 
			
		||||
  std::unique_ptr<lldb_private::LineEntry> m_opaque_up;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace lldb
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -104,7 +104,7 @@ private:
 | 
			
		|||
  // Unused.
 | 
			
		||||
  SBMemoryRegionInfo(const lldb_private::MemoryRegionInfo *lldb_object_ptr);
 | 
			
		||||
 | 
			
		||||
  lldb::MemoryRegionInfoUP m_opaque_ap;
 | 
			
		||||
  lldb::MemoryRegionInfoUP m_opaque_up;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace lldb
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -47,7 +47,7 @@ private:
 | 
			
		|||
 | 
			
		||||
  const lldb_private::MemoryRegionInfos &ref() const;
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<MemoryRegionInfoListImpl> m_opaque_ap;
 | 
			
		||||
  std::unique_ptr<MemoryRegionInfoListImpl> m_opaque_up;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace lldb
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -86,7 +86,7 @@ private:
 | 
			
		|||
  friend class SBModule;
 | 
			
		||||
  friend class SBTarget;
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<lldb_private::ModuleSpec> m_opaque_ap;
 | 
			
		||||
  std::unique_ptr<lldb_private::ModuleSpec> m_opaque_up;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
class SBModuleSpecList {
 | 
			
		||||
| 
						 | 
				
			
			@ -116,7 +116,7 @@ public:
 | 
			
		|||
  bool GetDescription(lldb::SBStream &description);
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
  std::unique_ptr<lldb_private::ModuleSpecList> m_opaque_ap;
 | 
			
		||||
  std::unique_ptr<lldb_private::ModuleSpecList> m_opaque_up;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace lldb
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -55,7 +55,7 @@ private:
 | 
			
		|||
 | 
			
		||||
  void SetProcessInfo(const lldb_private::ProcessInstanceInfo &proc_info_ref);
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<lldb_private::ProcessInstanceInfo> m_opaque_ap;
 | 
			
		||||
  std::unique_ptr<lldb_private::ProcessInstanceInfo> m_opaque_up;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace lldb
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -39,7 +39,7 @@ protected:
 | 
			
		|||
  friend class SBDebugger;
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
  std::unique_ptr<lldb_private::SourceManagerImpl> m_opaque_ap;
 | 
			
		||||
  std::unique_ptr<lldb_private::SourceManagerImpl> m_opaque_up;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace lldb
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -94,7 +94,7 @@ protected:
 | 
			
		|||
 | 
			
		||||
private:
 | 
			
		||||
  DISALLOW_COPY_AND_ASSIGN(SBStream);
 | 
			
		||||
  std::unique_ptr<lldb_private::Stream> m_opaque_ap;
 | 
			
		||||
  std::unique_ptr<lldb_private::Stream> m_opaque_up;
 | 
			
		||||
  bool m_is_file;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -55,7 +55,7 @@ protected:
 | 
			
		|||
  const lldb_private::StringList &operator*() const;
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
  std::unique_ptr<lldb_private::StringList> m_opaque_ap;
 | 
			
		||||
  std::unique_ptr<lldb_private::StringList> m_opaque_up;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace lldb
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -73,7 +73,7 @@ protected:
 | 
			
		|||
  void SetSymbolContext(const lldb_private::SymbolContext *sc_ptr);
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
  std::unique_ptr<lldb_private::SymbolContext> m_opaque_ap;
 | 
			
		||||
  std::unique_ptr<lldb_private::SymbolContext> m_opaque_up;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace lldb
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -48,7 +48,7 @@ protected:
 | 
			
		|||
  lldb_private::SymbolContextList &operator*() const;
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
  std::unique_ptr<lldb_private::SymbolContextList> m_opaque_ap;
 | 
			
		||||
  std::unique_ptr<lldb_private::SymbolContextList> m_opaque_up;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace lldb
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -51,7 +51,7 @@ protected:
 | 
			
		|||
 | 
			
		||||
  const lldb_private::TypeMemberImpl &ref() const;
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<lldb_private::TypeMemberImpl> m_opaque_ap;
 | 
			
		||||
  std::unique_ptr<lldb_private::TypeMemberImpl> m_opaque_up;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
class SBTypeMemberFunction {
 | 
			
		||||
| 
						 | 
				
			
			@ -244,7 +244,7 @@ public:
 | 
			
		|||
  uint32_t GetSize();
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
  std::unique_ptr<lldb_private::TypeListImpl> m_opaque_ap;
 | 
			
		||||
  std::unique_ptr<lldb_private::TypeListImpl> m_opaque_up;
 | 
			
		||||
  friend class SBModule;
 | 
			
		||||
  friend class SBCompileUnit;
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -71,7 +71,7 @@ public:
 | 
			
		|||
  uint32_t GetSize();
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
  std::unique_ptr<lldb_private::TypeEnumMemberListImpl> m_opaque_ap;
 | 
			
		||||
  std::unique_ptr<lldb_private::TypeEnumMemberListImpl> m_opaque_up;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace lldb
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -49,7 +49,7 @@ protected:
 | 
			
		|||
  void SetOptions(const lldb_private::TypeSummaryOptions *lldb_object_ptr);
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
  std::unique_ptr<lldb_private::TypeSummaryOptions> m_opaque_ap;
 | 
			
		||||
  std::unique_ptr<lldb_private::TypeSummaryOptions> m_opaque_up;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
class SBTypeSummary {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -65,7 +65,7 @@ private:
 | 
			
		|||
 | 
			
		||||
  ValueListImpl &ref();
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<ValueListImpl> m_opaque_ap;
 | 
			
		||||
  std::unique_ptr<ValueListImpl> m_opaque_up;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace lldb
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -72,7 +72,7 @@ protected:
 | 
			
		|||
  void SetOptions(VariablesOptionsImpl *lldb_object_ptr);
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
  std::unique_ptr<VariablesOptionsImpl> m_opaque_ap;
 | 
			
		||||
  std::unique_ptr<VariablesOptionsImpl> m_opaque_up;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace lldb
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -398,10 +398,10 @@ private:
 | 
			
		|||
  bool m_is_indirect;
 | 
			
		||||
  Address m_address;   ///< The address defining this location.
 | 
			
		||||
  Breakpoint &m_owner; ///< The breakpoint that produced this object.
 | 
			
		||||
  std::unique_ptr<BreakpointOptions> m_options_ap; ///< Breakpoint options
 | 
			
		||||
                                                   ///pointer, nullptr if we're
 | 
			
		||||
                                                   ///using our breakpoint's
 | 
			
		||||
                                                   ///options.
 | 
			
		||||
  std::unique_ptr<BreakpointOptions> m_options_up; ///< Breakpoint options
 | 
			
		||||
                                                   /// pointer, nullptr if we're
 | 
			
		||||
                                                   /// using our breakpoint's
 | 
			
		||||
                                                   /// options.
 | 
			
		||||
  lldb::BreakpointSiteSP m_bp_site_sp; ///< Our breakpoint site (it may be
 | 
			
		||||
                                       ///shared by more than one location.)
 | 
			
		||||
  lldb::UserExpressionSP m_user_expression_sp; ///< The compiled expression to
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -442,7 +442,7 @@ private:
 | 
			
		|||
  bool m_one_shot;
 | 
			
		||||
  uint32_t m_ignore_count; // Number of times to ignore this breakpoint
 | 
			
		||||
  std::unique_ptr<ThreadSpec>
 | 
			
		||||
      m_thread_spec_ap;         // Thread for which this breakpoint will take
 | 
			
		||||
      m_thread_spec_up;         // Thread for which this breakpoint will take
 | 
			
		||||
  std::string m_condition_text; // The condition to test.
 | 
			
		||||
  size_t m_condition_text_hash; // Its hash, so that locations know when the
 | 
			
		||||
                                // condition is updated.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -213,7 +213,7 @@ private:
 | 
			
		|||
                 // the callback machinery.
 | 
			
		||||
  bool m_being_created;
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<UserExpression> m_condition_ap; // The condition to test.
 | 
			
		||||
  std::unique_ptr<UserExpression> m_condition_up; // The condition to test.
 | 
			
		||||
 | 
			
		||||
  void SetID(lldb::watch_id_t id) { m_loc_id = id; }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -230,7 +230,7 @@ private:
 | 
			
		|||
  lldb::BatonSP m_callback_baton_sp; // This is the client data for the callback
 | 
			
		||||
  bool m_callback_is_synchronous;
 | 
			
		||||
  std::unique_ptr<ThreadSpec>
 | 
			
		||||
      m_thread_spec_ap; // Thread for which this watchpoint will take
 | 
			
		||||
      m_thread_spec_up; // Thread for which this watchpoint will take
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace lldb_private
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -144,8 +144,8 @@ public:
 | 
			
		|||
  lldb::StreamSP GetAsyncErrorStream();
 | 
			
		||||
 | 
			
		||||
  CommandInterpreter &GetCommandInterpreter() {
 | 
			
		||||
    assert(m_command_interpreter_ap.get());
 | 
			
		||||
    return *m_command_interpreter_ap;
 | 
			
		||||
    assert(m_command_interpreter_up.get());
 | 
			
		||||
    return *m_command_interpreter_up;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  lldb::ListenerSP GetListener() { return m_listener_sp; }
 | 
			
		||||
| 
						 | 
				
			
			@ -381,7 +381,7 @@ protected:
 | 
			
		|||
 | 
			
		||||
  PlatformList m_platform_list;
 | 
			
		||||
  lldb::ListenerSP m_listener_sp;
 | 
			
		||||
  std::unique_ptr<SourceManager> m_source_manager_ap; // This is a scratch
 | 
			
		||||
  std::unique_ptr<SourceManager> m_source_manager_up; // This is a scratch
 | 
			
		||||
                                                      // source manager that we
 | 
			
		||||
                                                      // return if we have no
 | 
			
		||||
                                                      // targets.
 | 
			
		||||
| 
						 | 
				
			
			@ -390,7 +390,7 @@ protected:
 | 
			
		|||
                                                      // this debugger used this
 | 
			
		||||
                                                      // shared
 | 
			
		||||
                                                      // source file cache.
 | 
			
		||||
  std::unique_ptr<CommandInterpreter> m_command_interpreter_ap;
 | 
			
		||||
  std::unique_ptr<CommandInterpreter> m_command_interpreter_up;
 | 
			
		||||
 | 
			
		||||
  IOHandlerStack m_input_reader_stack;
 | 
			
		||||
  llvm::StringMap<std::weak_ptr<llvm::raw_ostream>> m_log_streams;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -435,7 +435,7 @@ private:
 | 
			
		|||
 | 
			
		||||
protected:
 | 
			
		||||
#ifndef LLDB_DISABLE_LIBEDIT
 | 
			
		||||
  std::unique_ptr<Editline> m_editline_ap;
 | 
			
		||||
  std::unique_ptr<Editline> m_editline_up;
 | 
			
		||||
#endif
 | 
			
		||||
  IOHandlerDelegate &m_delegate;
 | 
			
		||||
  std::string m_prompt;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1091,7 +1091,7 @@ protected:
 | 
			
		|||
                                   ///parser for this module as it may or may
 | 
			
		||||
                                   ///not be shared with the SymbolFile
 | 
			
		||||
  lldb::SymbolVendorUP
 | 
			
		||||
      m_symfile_ap; ///< A pointer to the symbol vendor for this module.
 | 
			
		||||
      m_symfile_up; ///< A pointer to the symbol vendor for this module.
 | 
			
		||||
  std::vector<lldb::SymbolVendorUP>
 | 
			
		||||
      m_old_symfiles; ///< If anyone calls Module::SetSymbolFileFileSpec() and
 | 
			
		||||
                      ///changes the symbol file,
 | 
			
		||||
| 
						 | 
				
			
			@ -1103,9 +1103,9 @@ protected:
 | 
			
		|||
                                     ///when you have debug info for a module
 | 
			
		||||
                                     ///that doesn't match where the sources
 | 
			
		||||
                                     ///currently are
 | 
			
		||||
  lldb::SectionListUP m_sections_ap; ///< Unified section list for module that
 | 
			
		||||
                                     ///is used by the ObjectFile and and
 | 
			
		||||
                                     ///ObjectFile instances for the debug info
 | 
			
		||||
  lldb::SectionListUP m_sections_up; ///< Unified section list for module that
 | 
			
		||||
                                     /// is used by the ObjectFile and and
 | 
			
		||||
                                     /// ObjectFile instances for the debug info
 | 
			
		||||
 | 
			
		||||
  std::atomic<bool> m_did_load_objfile{false};
 | 
			
		||||
  std::atomic<bool> m_did_load_symbol_vendor{false};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -141,7 +141,7 @@ protected:
 | 
			
		|||
  // we need to hold on to the SyntheticChildren because someone might delete
 | 
			
		||||
  // the type binding while we are alive
 | 
			
		||||
  lldb::SyntheticChildrenSP m_synth_sp;
 | 
			
		||||
  std::unique_ptr<SyntheticChildrenFrontEnd> m_synth_filter_ap;
 | 
			
		||||
  std::unique_ptr<SyntheticChildrenFrontEnd> m_synth_filter_up;
 | 
			
		||||
 | 
			
		||||
  typedef ThreadSafeSTLMap<uint32_t, ValueObject *> ByIndexMap;
 | 
			
		||||
  typedef ThreadSafeSTLMap<const char *, uint32_t> NameToIndexMap;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -62,8 +62,8 @@ public:
 | 
			
		|||
  //------------------------------------------------------------------
 | 
			
		||||
  /// Constructor
 | 
			
		||||
  //------------------------------------------------------------------
 | 
			
		||||
  IRExecutionUnit(std::unique_ptr<llvm::LLVMContext> &context_ap,
 | 
			
		||||
                  std::unique_ptr<llvm::Module> &module_ap, ConstString &name,
 | 
			
		||||
  IRExecutionUnit(std::unique_ptr<llvm::LLVMContext> &context_up,
 | 
			
		||||
                  std::unique_ptr<llvm::Module> &module_up, ConstString &name,
 | 
			
		||||
                  const lldb::TargetSP &target_sp, const SymbolContext &sym_ctx,
 | 
			
		||||
                  std::vector<std::string> &cpu_features);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -336,13 +336,13 @@ private:
 | 
			
		|||
                                    bool AbortOnFailure = true) override;
 | 
			
		||||
 | 
			
		||||
  private:
 | 
			
		||||
    std::unique_ptr<SectionMemoryManager> m_default_mm_ap; ///< The memory
 | 
			
		||||
                                                           ///allocator to use
 | 
			
		||||
                                                           ///in actually
 | 
			
		||||
                                                           ///creating space.
 | 
			
		||||
                                                           ///All calls are
 | 
			
		||||
                                                           ///passed through to
 | 
			
		||||
                                                           ///it.
 | 
			
		||||
    std::unique_ptr<SectionMemoryManager> m_default_mm_up; ///< The memory
 | 
			
		||||
                                                           /// allocator to use
 | 
			
		||||
                                                           /// in actually
 | 
			
		||||
                                                           /// creating space.
 | 
			
		||||
                                                           /// All calls are
 | 
			
		||||
                                                           /// passed through to
 | 
			
		||||
                                                           /// it.
 | 
			
		||||
    IRExecutionUnit &m_parent; ///< The execution unit this is a proxy for.
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -392,11 +392,11 @@ private:
 | 
			
		|||
  typedef std::vector<AllocationRecord> RecordVector;
 | 
			
		||||
  RecordVector m_records;
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<llvm::LLVMContext> m_context_ap;
 | 
			
		||||
  std::unique_ptr<llvm::ExecutionEngine> m_execution_engine_ap;
 | 
			
		||||
  std::unique_ptr<llvm::ObjectCache> m_object_cache_ap;
 | 
			
		||||
  std::unique_ptr<llvm::LLVMContext> m_context_up;
 | 
			
		||||
  std::unique_ptr<llvm::ExecutionEngine> m_execution_engine_up;
 | 
			
		||||
  std::unique_ptr<llvm::ObjectCache> m_object_cache_up;
 | 
			
		||||
  std::unique_ptr<llvm::Module>
 | 
			
		||||
      m_module_ap;        ///< Holder for the module until it's been handed off
 | 
			
		||||
      m_module_up;        ///< Holder for the module until it's been handed off
 | 
			
		||||
  llvm::Module *m_module; ///< Owned by the execution engine
 | 
			
		||||
  std::vector<std::string> m_cpu_features;
 | 
			
		||||
  std::vector<JittedFunction> m_jitted_functions; ///< A vector of all functions
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -97,9 +97,9 @@ protected:
 | 
			
		|||
 | 
			
		||||
  std::shared_ptr<IRExecutionUnit>
 | 
			
		||||
      m_execution_unit_sp; ///< The execution unit the expression is stored in.
 | 
			
		||||
  std::unique_ptr<Materializer> m_materializer_ap; ///< The materializer to use
 | 
			
		||||
                                                   ///when running the
 | 
			
		||||
                                                   ///expression.
 | 
			
		||||
  std::unique_ptr<Materializer> m_materializer_up; ///< The materializer to use
 | 
			
		||||
                                                   /// when running the
 | 
			
		||||
                                                   /// expression.
 | 
			
		||||
  lldb::ModuleWP m_jit_module_wp;
 | 
			
		||||
  bool m_enforce_valid_object; ///< True if the expression parser should enforce
 | 
			
		||||
                               ///the presence of a valid class pointer
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -139,7 +139,7 @@ protected:
 | 
			
		|||
  int m_tflags;   ///< Cached tflags information.
 | 
			
		||||
#ifdef LLDB_CONFIG_TERMIOS_SUPPORTED
 | 
			
		||||
  std::unique_ptr<struct termios>
 | 
			
		||||
      m_termios_ap; ///< Cached terminal state information.
 | 
			
		||||
      m_termios_up; ///< Cached terminal state information.
 | 
			
		||||
#endif
 | 
			
		||||
  lldb::pid_t m_process_group; ///< Cached process group information.
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -121,7 +121,7 @@ public:
 | 
			
		|||
  bool HasExternalSource();
 | 
			
		||||
 | 
			
		||||
  void SetExternalSource(
 | 
			
		||||
      llvm::IntrusiveRefCntPtr<clang::ExternalASTSource> &ast_source_ap);
 | 
			
		||||
      llvm::IntrusiveRefCntPtr<clang::ExternalASTSource> &ast_source_up);
 | 
			
		||||
 | 
			
		||||
  void RemoveExternalSource();
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1018,22 +1018,22 @@ protected:
 | 
			
		|||
  //------------------------------------------------------------------
 | 
			
		||||
  // clang-format off
 | 
			
		||||
    std::string                                     m_target_triple;
 | 
			
		||||
    std::unique_ptr<clang::ASTContext>              m_ast_ap;
 | 
			
		||||
    std::unique_ptr<clang::LangOptions>             m_language_options_ap;
 | 
			
		||||
    std::unique_ptr<clang::FileManager>             m_file_manager_ap;
 | 
			
		||||
    std::unique_ptr<clang::FileSystemOptions>       m_file_system_options_ap;
 | 
			
		||||
    std::unique_ptr<clang::SourceManager>           m_source_manager_ap;
 | 
			
		||||
    std::unique_ptr<clang::DiagnosticsEngine>       m_diagnostics_engine_ap;
 | 
			
		||||
    std::unique_ptr<clang::DiagnosticConsumer>      m_diagnostic_consumer_ap;
 | 
			
		||||
    std::unique_ptr<clang::ASTContext>              m_ast_up;
 | 
			
		||||
    std::unique_ptr<clang::LangOptions>             m_language_options_up;
 | 
			
		||||
    std::unique_ptr<clang::FileManager>             m_file_manager_up;
 | 
			
		||||
    std::unique_ptr<clang::FileSystemOptions>       m_file_system_options_up;
 | 
			
		||||
    std::unique_ptr<clang::SourceManager>           m_source_manager_up;
 | 
			
		||||
    std::unique_ptr<clang::DiagnosticsEngine>       m_diagnostics_engine_up;
 | 
			
		||||
    std::unique_ptr<clang::DiagnosticConsumer>      m_diagnostic_consumer_up;
 | 
			
		||||
    std::shared_ptr<clang::TargetOptions>           m_target_options_rp;
 | 
			
		||||
    std::unique_ptr<clang::TargetInfo>              m_target_info_ap;
 | 
			
		||||
    std::unique_ptr<clang::IdentifierTable>         m_identifier_table_ap;
 | 
			
		||||
    std::unique_ptr<clang::SelectorTable>           m_selector_table_ap;
 | 
			
		||||
    std::unique_ptr<clang::Builtin::Context>        m_builtins_ap;
 | 
			
		||||
    std::unique_ptr<DWARFASTParserClang>            m_dwarf_ast_parser_ap;
 | 
			
		||||
    std::unique_ptr<PDBASTParser>                   m_pdb_ast_parser_ap;
 | 
			
		||||
    std::unique_ptr<ClangASTSource>                 m_scratch_ast_source_ap;
 | 
			
		||||
    std::unique_ptr<clang::MangleContext>           m_mangle_ctx_ap;
 | 
			
		||||
    std::unique_ptr<clang::TargetInfo>              m_target_info_up;
 | 
			
		||||
    std::unique_ptr<clang::IdentifierTable>         m_identifier_table_up;
 | 
			
		||||
    std::unique_ptr<clang::SelectorTable>           m_selector_table_up;
 | 
			
		||||
    std::unique_ptr<clang::Builtin::Context>        m_builtins_up;
 | 
			
		||||
    std::unique_ptr<DWARFASTParserClang>            m_dwarf_ast_parser_up;
 | 
			
		||||
    std::unique_ptr<PDBASTParser>                   m_pdb_ast_parser_up;
 | 
			
		||||
    std::unique_ptr<ClangASTSource>                 m_scratch_ast_source_up;
 | 
			
		||||
    std::unique_ptr<clang::MangleContext>           m_mangle_ctx_up;
 | 
			
		||||
    CompleteTagDeclCallback                         m_callback_tag_decl;
 | 
			
		||||
    CompleteObjCInterfaceDeclCallback               m_callback_objc_decl;
 | 
			
		||||
    void *                                          m_callback_baton;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -429,7 +429,7 @@ protected:
 | 
			
		|||
  FileSpecList m_support_files; ///< Files associated with this compile unit's
 | 
			
		||||
                                ///line table and declarations.
 | 
			
		||||
  std::unique_ptr<LineTable>
 | 
			
		||||
      m_line_table_ap; ///< Line table that will get parsed on demand.
 | 
			
		||||
      m_line_table_up; ///< Line table that will get parsed on demand.
 | 
			
		||||
  DebugMacrosSP
 | 
			
		||||
      m_debug_macros_sp; ///< Debug macros that will get parsed on demand.
 | 
			
		||||
  lldb::VariableListSP m_variables; ///< Global and static variable list that
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -779,8 +779,8 @@ protected:
 | 
			
		|||
                                            /// functions
 | 
			
		||||
  lldb::ProcessWP m_process_wp;
 | 
			
		||||
  const lldb::addr_t m_memory_addr;
 | 
			
		||||
  std::unique_ptr<lldb_private::SectionList> m_sections_ap;
 | 
			
		||||
  std::unique_ptr<lldb_private::Symtab> m_symtab_ap;
 | 
			
		||||
  std::unique_ptr<lldb_private::SectionList> m_sections_up;
 | 
			
		||||
  std::unique_ptr<lldb_private::Symtab> m_symtab_up;
 | 
			
		||||
  uint32_t m_synthetic_symbol_idx;
 | 
			
		||||
 | 
			
		||||
  //------------------------------------------------------------------
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -419,12 +419,12 @@ private:
 | 
			
		|||
  lldb::TargetSP m_target_sp;
 | 
			
		||||
  std::string m_module_spec;
 | 
			
		||||
  lldb::ModuleSP m_module_sp;
 | 
			
		||||
  std::unique_ptr<FileSpec> m_file_spec_ap;
 | 
			
		||||
  std::unique_ptr<FileSpec> m_file_spec_up;
 | 
			
		||||
  size_t m_start_line;
 | 
			
		||||
  size_t m_end_line;
 | 
			
		||||
  std::string m_function_spec;
 | 
			
		||||
  std::string m_class_name;
 | 
			
		||||
  std::unique_ptr<AddressRange> m_address_range_ap;
 | 
			
		||||
  std::unique_ptr<AddressRange> m_address_range_up;
 | 
			
		||||
  uint32_t m_type; // Or'ed bits from SpecificationType
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -124,7 +124,7 @@ public:
 | 
			
		|||
  virtual size_t GetTypes(SymbolContextScope *sc_scope,
 | 
			
		||||
                          lldb::TypeClass type_mask, TypeList &type_list);
 | 
			
		||||
 | 
			
		||||
  SymbolFile *GetSymbolFile() { return m_sym_file_ap.get(); }
 | 
			
		||||
  SymbolFile *GetSymbolFile() { return m_sym_file_up.get(); }
 | 
			
		||||
 | 
			
		||||
  FileSpec GetMainFileSpec() const;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -161,7 +161,7 @@ protected:
 | 
			
		|||
                                   // case it isn't the same as the module
 | 
			
		||||
                                   // object file (debug symbols in a separate
 | 
			
		||||
                                   // file)
 | 
			
		||||
  std::unique_ptr<SymbolFile> m_sym_file_ap; // A single symbol file. Subclasses
 | 
			
		||||
  std::unique_ptr<SymbolFile> m_sym_file_up; // A single symbol file. Subclasses
 | 
			
		||||
                                             // can add more of these if needed.
 | 
			
		||||
  Symtab *m_symtab; // Save a symtab once to not pass it through `AddSymbols` of
 | 
			
		||||
                    // the symbol file each time when it is needed
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -34,7 +34,7 @@ public:
 | 
			
		|||
    size_t size; /* size in bytes of this argument */
 | 
			
		||||
 | 
			
		||||
    lldb::addr_t value;                 /* literal value */
 | 
			
		||||
    std::unique_ptr<uint8_t[]> data_ap; /* host data pointer */
 | 
			
		||||
    std::unique_ptr<uint8_t[]> data_up; /* host data pointer */
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  ~ABI() override;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -151,7 +151,7 @@ public:
 | 
			
		|||
                                     const char *name, bool for_expression) = 0;
 | 
			
		||||
 | 
			
		||||
  protected:
 | 
			
		||||
    std::unique_ptr<ClangASTContext> m_scratch_ast_ctx_ap;
 | 
			
		||||
    std::unique_ptr<ClangASTContext> m_scratch_ast_ctx_up;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  class ObjCExceptionPrecondition : public Breakpoint::BreakpointPrecondition {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2522,7 +2522,7 @@ public:
 | 
			
		|||
 | 
			
		||||
  const lldb::ABISP &GetABI();
 | 
			
		||||
 | 
			
		||||
  OperatingSystem *GetOperatingSystem() { return m_os_ap.get(); }
 | 
			
		||||
  OperatingSystem *GetOperatingSystem() { return m_os_up.get(); }
 | 
			
		||||
 | 
			
		||||
  virtual LanguageRuntime *GetLanguageRuntime(lldb::LanguageType language,
 | 
			
		||||
                                              bool retry_if_null = true);
 | 
			
		||||
| 
						 | 
				
			
			@ -2537,7 +2537,7 @@ public:
 | 
			
		|||
  bool IsRunning() const;
 | 
			
		||||
 | 
			
		||||
  DynamicCheckerFunctions *GetDynamicCheckers() {
 | 
			
		||||
    return m_dynamic_checkers_ap.get();
 | 
			
		||||
    return m_dynamic_checkers_up.get();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  void SetDynamicCheckers(DynamicCheckerFunctions *dynamic_checkers);
 | 
			
		||||
| 
						 | 
				
			
			@ -2918,10 +2918,10 @@ protected:
 | 
			
		|||
  };
 | 
			
		||||
 | 
			
		||||
  void SetNextEventAction(Process::NextEventAction *next_event_action) {
 | 
			
		||||
    if (m_next_event_action_ap.get())
 | 
			
		||||
      m_next_event_action_ap->HandleBeingUnshipped();
 | 
			
		||||
    if (m_next_event_action_up.get())
 | 
			
		||||
      m_next_event_action_up->HandleBeingUnshipped();
 | 
			
		||||
 | 
			
		||||
    m_next_event_action_ap.reset(next_event_action);
 | 
			
		||||
    m_next_event_action_up.reset(next_event_action);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // This is the completer for Attaching:
 | 
			
		||||
| 
						 | 
				
			
			@ -3070,15 +3070,15 @@ protected:
 | 
			
		|||
  BreakpointSiteList m_breakpoint_site_list; ///< This is the list of breakpoint
 | 
			
		||||
                                             ///locations we intend to insert in
 | 
			
		||||
                                             ///the target.
 | 
			
		||||
  lldb::DynamicLoaderUP m_dyld_ap;
 | 
			
		||||
  lldb::JITLoaderListUP m_jit_loaders_ap;
 | 
			
		||||
  lldb::DynamicCheckerFunctionsUP m_dynamic_checkers_ap; ///< The functions used
 | 
			
		||||
                                                         ///by the expression
 | 
			
		||||
                                                         ///parser to validate
 | 
			
		||||
                                                         ///data that
 | 
			
		||||
                                                         ///expressions use.
 | 
			
		||||
  lldb::OperatingSystemUP m_os_ap;
 | 
			
		||||
  lldb::SystemRuntimeUP m_system_runtime_ap;
 | 
			
		||||
  lldb::DynamicLoaderUP m_dyld_up;
 | 
			
		||||
  lldb::JITLoaderListUP m_jit_loaders_up;
 | 
			
		||||
  lldb::DynamicCheckerFunctionsUP m_dynamic_checkers_up; ///< The functions used
 | 
			
		||||
                                                         /// by the expression
 | 
			
		||||
                                                         /// parser to validate
 | 
			
		||||
                                                         /// data that
 | 
			
		||||
                                                         /// expressions use.
 | 
			
		||||
  lldb::OperatingSystemUP m_os_up;
 | 
			
		||||
  lldb::SystemRuntimeUP m_system_runtime_up;
 | 
			
		||||
  lldb::UnixSignalsSP
 | 
			
		||||
      m_unix_signals_sp; /// This is the current signal set for this process.
 | 
			
		||||
  lldb::ABISP m_abi_sp;
 | 
			
		||||
| 
						 | 
				
			
			@ -3098,7 +3098,7 @@ protected:
 | 
			
		|||
                        /// with an explicit call to Kill or Detach?
 | 
			
		||||
  LanguageRuntimeCollection m_language_runtimes;
 | 
			
		||||
  InstrumentationRuntimeCollection m_instrumentation_runtimes;
 | 
			
		||||
  std::unique_ptr<NextEventAction> m_next_event_action_ap;
 | 
			
		||||
  std::unique_ptr<NextEventAction> m_next_event_action_up;
 | 
			
		||||
  std::vector<PreResumeCallbackAndBaton> m_pre_resume_actions;
 | 
			
		||||
  ProcessRunLock m_public_run_lock;
 | 
			
		||||
  ProcessRunLock m_private_run_lock;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -91,7 +91,7 @@ protected:
 | 
			
		|||
 | 
			
		||||
  bool SetFrameAtIndex(uint32_t idx, lldb::StackFrameSP &frame_sp);
 | 
			
		||||
 | 
			
		||||
  static void Merge(std::unique_ptr<StackFrameList> &curr_ap,
 | 
			
		||||
  static void Merge(std::unique_ptr<StackFrameList> &curr_up,
 | 
			
		||||
                    lldb::StackFrameListSP &prev_sp);
 | 
			
		||||
 | 
			
		||||
  void GetFramesUpTo(uint32_t end_idx);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1147,7 +1147,7 @@ public:
 | 
			
		|||
    // and is responsible for deleting it when we're done.
 | 
			
		||||
    void SetThreadSpecifier(ThreadSpec *specifier);
 | 
			
		||||
 | 
			
		||||
    ThreadSpec *GetThreadSpecifier() { return m_thread_spec_ap.get(); }
 | 
			
		||||
    ThreadSpec *GetThreadSpecifier() { return m_thread_spec_up.get(); }
 | 
			
		||||
 | 
			
		||||
    bool IsActive() { return m_active; }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1159,7 +1159,7 @@ public:
 | 
			
		|||
    lldb::TargetSP m_target_sp;
 | 
			
		||||
    StringList m_commands;
 | 
			
		||||
    lldb::SymbolContextSpecifierSP m_specifier_sp;
 | 
			
		||||
    std::unique_ptr<ThreadSpec> m_thread_spec_ap;
 | 
			
		||||
    std::unique_ptr<ThreadSpec> m_thread_spec_up;
 | 
			
		||||
    bool m_active;
 | 
			
		||||
 | 
			
		||||
    // Use CreateStopHook to make a new empty stop hook. The GetCommandPointer
 | 
			
		||||
| 
						 | 
				
			
			@ -1297,9 +1297,9 @@ protected:
 | 
			
		|||
  REPLMap m_repl_map;
 | 
			
		||||
 | 
			
		||||
  lldb::ClangASTImporterSP m_ast_importer_sp;
 | 
			
		||||
  lldb::ClangModulesDeclVendorUP m_clang_modules_decl_vendor_ap;
 | 
			
		||||
  lldb::ClangModulesDeclVendorUP m_clang_modules_decl_vendor_up;
 | 
			
		||||
 | 
			
		||||
  lldb::SourceManagerUP m_source_manager_ap;
 | 
			
		||||
  lldb::SourceManagerUP m_source_manager_up;
 | 
			
		||||
 | 
			
		||||
  typedef std::map<lldb::user_id_t, StopHookSP> StopHookCollection;
 | 
			
		||||
  StopHookCollection m_stop_hooks;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1347,7 +1347,7 @@ protected:
 | 
			
		|||
                                            ///thread plan logic for the current
 | 
			
		||||
                                            ///resume.
 | 
			
		||||
  /// It gets set in Thread::ShouldResume.
 | 
			
		||||
  std::unique_ptr<lldb_private::Unwind> m_unwinder_ap;
 | 
			
		||||
  std::unique_ptr<lldb_private::Unwind> m_unwinder_up;
 | 
			
		||||
  bool m_destroy_called; // This is used internally to make sure derived Thread
 | 
			
		||||
                         // classes call DestroyThread.
 | 
			
		||||
  LazyBool m_override_should_notify;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -92,7 +92,7 @@ private:
 | 
			
		|||
                                         // for the ThreadPlanStepThrough.
 | 
			
		||||
  lldb::ThreadPlanSP m_sub_plan_sp;      // Keep track of the last plan we were
 | 
			
		||||
                                    // running.  If it fails, we should stop.
 | 
			
		||||
  std::unique_ptr<RegularExpression> m_avoid_regexp_ap;
 | 
			
		||||
  std::unique_ptr<RegularExpression> m_avoid_regexp_up;
 | 
			
		||||
  bool m_step_past_prologue; // FIXME: For now hard-coded to true, we could put
 | 
			
		||||
                             // a switch in for this if there's
 | 
			
		||||
                             // demand for that.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -20,25 +20,25 @@
 | 
			
		|||
using namespace lldb;
 | 
			
		||||
using namespace lldb_private;
 | 
			
		||||
 | 
			
		||||
SBAddress::SBAddress() : m_opaque_ap(new Address()) {}
 | 
			
		||||
SBAddress::SBAddress() : m_opaque_up(new Address()) {}
 | 
			
		||||
 | 
			
		||||
SBAddress::SBAddress(const Address *lldb_object_ptr)
 | 
			
		||||
    : m_opaque_ap(new Address()) {
 | 
			
		||||
    : m_opaque_up(new Address()) {
 | 
			
		||||
  if (lldb_object_ptr)
 | 
			
		||||
    ref() = *lldb_object_ptr;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBAddress::SBAddress(const SBAddress &rhs) : m_opaque_ap(new Address()) {
 | 
			
		||||
SBAddress::SBAddress(const SBAddress &rhs) : m_opaque_up(new Address()) {
 | 
			
		||||
  if (rhs.IsValid())
 | 
			
		||||
    ref() = rhs.ref();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBAddress::SBAddress(lldb::SBSection section, lldb::addr_t offset)
 | 
			
		||||
    : m_opaque_ap(new Address(section.GetSP(), offset)) {}
 | 
			
		||||
    : m_opaque_up(new Address(section.GetSP(), offset)) {}
 | 
			
		||||
 | 
			
		||||
// Create an address by resolving a load address using the supplied target
 | 
			
		||||
SBAddress::SBAddress(lldb::addr_t load_addr, lldb::SBTarget &target)
 | 
			
		||||
    : m_opaque_ap(new Address()) {
 | 
			
		||||
    : m_opaque_up(new Address()) {
 | 
			
		||||
  SetLoadAddress(load_addr, target);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -49,7 +49,7 @@ const SBAddress &SBAddress::operator=(const SBAddress &rhs) {
 | 
			
		|||
    if (rhs.IsValid())
 | 
			
		||||
      ref() = rhs.ref();
 | 
			
		||||
    else
 | 
			
		||||
      m_opaque_ap.reset(new Address());
 | 
			
		||||
      m_opaque_up.reset(new Address());
 | 
			
		||||
  }
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -61,10 +61,10 @@ bool lldb::operator==(const SBAddress &lhs, const SBAddress &rhs) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
bool SBAddress::IsValid() const {
 | 
			
		||||
  return m_opaque_ap != NULL && m_opaque_ap->IsValid();
 | 
			
		||||
  return m_opaque_up != NULL && m_opaque_up->IsValid();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBAddress::Clear() { m_opaque_ap.reset(new Address()); }
 | 
			
		||||
void SBAddress::Clear() { m_opaque_up.reset(new Address()); }
 | 
			
		||||
 | 
			
		||||
void SBAddress::SetAddress(lldb::SBSection section, lldb::addr_t offset) {
 | 
			
		||||
  Address &addr = ref();
 | 
			
		||||
| 
						 | 
				
			
			@ -76,12 +76,12 @@ void SBAddress::SetAddress(const Address *lldb_object_ptr) {
 | 
			
		|||
  if (lldb_object_ptr)
 | 
			
		||||
    ref() = *lldb_object_ptr;
 | 
			
		||||
  else
 | 
			
		||||
    m_opaque_ap.reset(new Address());
 | 
			
		||||
    m_opaque_up.reset(new Address());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lldb::addr_t SBAddress::GetFileAddress() const {
 | 
			
		||||
  if (m_opaque_ap->IsValid())
 | 
			
		||||
    return m_opaque_ap->GetFileAddress();
 | 
			
		||||
  if (m_opaque_up->IsValid())
 | 
			
		||||
    return m_opaque_up->GetFileAddress();
 | 
			
		||||
  else
 | 
			
		||||
    return LLDB_INVALID_ADDRESS;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -92,9 +92,9 @@ lldb::addr_t SBAddress::GetLoadAddress(const SBTarget &target) const {
 | 
			
		|||
  lldb::addr_t addr = LLDB_INVALID_ADDRESS;
 | 
			
		||||
  TargetSP target_sp(target.GetSP());
 | 
			
		||||
  if (target_sp) {
 | 
			
		||||
    if (m_opaque_ap->IsValid()) {
 | 
			
		||||
    if (m_opaque_up->IsValid()) {
 | 
			
		||||
      std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
 | 
			
		||||
      addr = m_opaque_ap->GetLoadAddress(target_sp.get());
 | 
			
		||||
      addr = m_opaque_up->GetLoadAddress(target_sp.get());
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -117,20 +117,20 @@ void SBAddress::SetLoadAddress(lldb::addr_t load_addr, lldb::SBTarget &target) {
 | 
			
		|||
  if (target.IsValid())
 | 
			
		||||
    *this = target.ResolveLoadAddress(load_addr);
 | 
			
		||||
  else
 | 
			
		||||
    m_opaque_ap->Clear();
 | 
			
		||||
    m_opaque_up->Clear();
 | 
			
		||||
 | 
			
		||||
  // Check if we weren't were able to resolve a section offset address. If we
 | 
			
		||||
  // weren't it is ok, the load address might be a location on the stack or
 | 
			
		||||
  // heap, so we should just have an address with no section and a valid offset
 | 
			
		||||
  if (!m_opaque_ap->IsValid())
 | 
			
		||||
    m_opaque_ap->SetOffset(load_addr);
 | 
			
		||||
  if (!m_opaque_up->IsValid())
 | 
			
		||||
    m_opaque_up->SetOffset(load_addr);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBAddress::OffsetAddress(addr_t offset) {
 | 
			
		||||
  if (m_opaque_ap->IsValid()) {
 | 
			
		||||
    addr_t addr_offset = m_opaque_ap->GetOffset();
 | 
			
		||||
  if (m_opaque_up->IsValid()) {
 | 
			
		||||
    addr_t addr_offset = m_opaque_up->GetOffset();
 | 
			
		||||
    if (addr_offset != LLDB_INVALID_ADDRESS) {
 | 
			
		||||
      m_opaque_ap->SetOffset(addr_offset + offset);
 | 
			
		||||
      m_opaque_up->SetOffset(addr_offset + offset);
 | 
			
		||||
      return true;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -139,45 +139,45 @@ bool SBAddress::OffsetAddress(addr_t offset) {
 | 
			
		|||
 | 
			
		||||
lldb::SBSection SBAddress::GetSection() {
 | 
			
		||||
  lldb::SBSection sb_section;
 | 
			
		||||
  if (m_opaque_ap->IsValid())
 | 
			
		||||
    sb_section.SetSP(m_opaque_ap->GetSection());
 | 
			
		||||
  if (m_opaque_up->IsValid())
 | 
			
		||||
    sb_section.SetSP(m_opaque_up->GetSection());
 | 
			
		||||
  return sb_section;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lldb::addr_t SBAddress::GetOffset() {
 | 
			
		||||
  if (m_opaque_ap->IsValid())
 | 
			
		||||
    return m_opaque_ap->GetOffset();
 | 
			
		||||
  if (m_opaque_up->IsValid())
 | 
			
		||||
    return m_opaque_up->GetOffset();
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Address *SBAddress::operator->() { return m_opaque_ap.get(); }
 | 
			
		||||
Address *SBAddress::operator->() { return m_opaque_up.get(); }
 | 
			
		||||
 | 
			
		||||
const Address *SBAddress::operator->() const { return m_opaque_ap.get(); }
 | 
			
		||||
const Address *SBAddress::operator->() const { return m_opaque_up.get(); }
 | 
			
		||||
 | 
			
		||||
Address &SBAddress::ref() {
 | 
			
		||||
  if (m_opaque_ap == NULL)
 | 
			
		||||
    m_opaque_ap.reset(new Address());
 | 
			
		||||
  return *m_opaque_ap;
 | 
			
		||||
  if (m_opaque_up == NULL)
 | 
			
		||||
    m_opaque_up.reset(new Address());
 | 
			
		||||
  return *m_opaque_up;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const Address &SBAddress::ref() const {
 | 
			
		||||
  // This object should already have checked with "IsValid()" prior to calling
 | 
			
		||||
  // this function. In case you didn't we will assert and die to let you know.
 | 
			
		||||
  assert(m_opaque_ap.get());
 | 
			
		||||
  return *m_opaque_ap;
 | 
			
		||||
  assert(m_opaque_up.get());
 | 
			
		||||
  return *m_opaque_up;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Address *SBAddress::get() { return m_opaque_ap.get(); }
 | 
			
		||||
Address *SBAddress::get() { return m_opaque_up.get(); }
 | 
			
		||||
 | 
			
		||||
bool SBAddress::GetDescription(SBStream &description) {
 | 
			
		||||
  // Call "ref()" on the stream to make sure it creates a backing stream in
 | 
			
		||||
  // case there isn't one already...
 | 
			
		||||
  Stream &strm = description.ref();
 | 
			
		||||
  if (m_opaque_ap->IsValid()) {
 | 
			
		||||
    m_opaque_ap->Dump(&strm, NULL, Address::DumpStyleResolvedDescription,
 | 
			
		||||
  if (m_opaque_up->IsValid()) {
 | 
			
		||||
    m_opaque_up->Dump(&strm, NULL, Address::DumpStyleResolvedDescription,
 | 
			
		||||
                      Address::DumpStyleModuleWithFileAddress, 4);
 | 
			
		||||
    StreamString sstrm;
 | 
			
		||||
    //        m_opaque_ap->Dump (&sstrm, NULL,
 | 
			
		||||
    //        m_opaque_up->Dump (&sstrm, NULL,
 | 
			
		||||
    //        Address::DumpStyleResolvedDescription, Address::DumpStyleInvalid,
 | 
			
		||||
    //        4);
 | 
			
		||||
    //        if (sstrm.GetData())
 | 
			
		||||
| 
						 | 
				
			
			@ -190,52 +190,52 @@ bool SBAddress::GetDescription(SBStream &description) {
 | 
			
		|||
 | 
			
		||||
SBModule SBAddress::GetModule() {
 | 
			
		||||
  SBModule sb_module;
 | 
			
		||||
  if (m_opaque_ap->IsValid())
 | 
			
		||||
    sb_module.SetSP(m_opaque_ap->GetModule());
 | 
			
		||||
  if (m_opaque_up->IsValid())
 | 
			
		||||
    sb_module.SetSP(m_opaque_up->GetModule());
 | 
			
		||||
  return sb_module;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBSymbolContext SBAddress::GetSymbolContext(uint32_t resolve_scope) {
 | 
			
		||||
  SBSymbolContext sb_sc;
 | 
			
		||||
  SymbolContextItem scope = static_cast<SymbolContextItem>(resolve_scope);
 | 
			
		||||
  if (m_opaque_ap->IsValid())
 | 
			
		||||
    m_opaque_ap->CalculateSymbolContext(&sb_sc.ref(), scope);
 | 
			
		||||
  if (m_opaque_up->IsValid())
 | 
			
		||||
    m_opaque_up->CalculateSymbolContext(&sb_sc.ref(), scope);
 | 
			
		||||
  return sb_sc;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBCompileUnit SBAddress::GetCompileUnit() {
 | 
			
		||||
  SBCompileUnit sb_comp_unit;
 | 
			
		||||
  if (m_opaque_ap->IsValid())
 | 
			
		||||
    sb_comp_unit.reset(m_opaque_ap->CalculateSymbolContextCompileUnit());
 | 
			
		||||
  if (m_opaque_up->IsValid())
 | 
			
		||||
    sb_comp_unit.reset(m_opaque_up->CalculateSymbolContextCompileUnit());
 | 
			
		||||
  return sb_comp_unit;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBFunction SBAddress::GetFunction() {
 | 
			
		||||
  SBFunction sb_function;
 | 
			
		||||
  if (m_opaque_ap->IsValid())
 | 
			
		||||
    sb_function.reset(m_opaque_ap->CalculateSymbolContextFunction());
 | 
			
		||||
  if (m_opaque_up->IsValid())
 | 
			
		||||
    sb_function.reset(m_opaque_up->CalculateSymbolContextFunction());
 | 
			
		||||
  return sb_function;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBBlock SBAddress::GetBlock() {
 | 
			
		||||
  SBBlock sb_block;
 | 
			
		||||
  if (m_opaque_ap->IsValid())
 | 
			
		||||
    sb_block.SetPtr(m_opaque_ap->CalculateSymbolContextBlock());
 | 
			
		||||
  if (m_opaque_up->IsValid())
 | 
			
		||||
    sb_block.SetPtr(m_opaque_up->CalculateSymbolContextBlock());
 | 
			
		||||
  return sb_block;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBSymbol SBAddress::GetSymbol() {
 | 
			
		||||
  SBSymbol sb_symbol;
 | 
			
		||||
  if (m_opaque_ap->IsValid())
 | 
			
		||||
    sb_symbol.reset(m_opaque_ap->CalculateSymbolContextSymbol());
 | 
			
		||||
  if (m_opaque_up->IsValid())
 | 
			
		||||
    sb_symbol.reset(m_opaque_up->CalculateSymbolContextSymbol());
 | 
			
		||||
  return sb_symbol;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBLineEntry SBAddress::GetLineEntry() {
 | 
			
		||||
  SBLineEntry sb_line_entry;
 | 
			
		||||
  if (m_opaque_ap->IsValid()) {
 | 
			
		||||
  if (m_opaque_up->IsValid()) {
 | 
			
		||||
    LineEntry line_entry;
 | 
			
		||||
    if (m_opaque_ap->CalculateSymbolContextLineEntry(line_entry))
 | 
			
		||||
    if (m_opaque_up->CalculateSymbolContextLineEntry(line_entry))
 | 
			
		||||
      sb_line_entry.SetLineEntry(line_entry);
 | 
			
		||||
  }
 | 
			
		||||
  return sb_line_entry;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,53 +19,53 @@ using namespace lldb;
 | 
			
		|||
using namespace lldb_private;
 | 
			
		||||
 | 
			
		||||
SBCommandReturnObject::SBCommandReturnObject()
 | 
			
		||||
    : m_opaque_ap(new CommandReturnObject()) {}
 | 
			
		||||
    : m_opaque_up(new CommandReturnObject()) {}
 | 
			
		||||
 | 
			
		||||
SBCommandReturnObject::SBCommandReturnObject(const SBCommandReturnObject &rhs)
 | 
			
		||||
    : m_opaque_ap() {
 | 
			
		||||
  if (rhs.m_opaque_ap)
 | 
			
		||||
    m_opaque_ap.reset(new CommandReturnObject(*rhs.m_opaque_ap));
 | 
			
		||||
    : m_opaque_up() {
 | 
			
		||||
  if (rhs.m_opaque_up)
 | 
			
		||||
    m_opaque_up.reset(new CommandReturnObject(*rhs.m_opaque_up));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBCommandReturnObject::SBCommandReturnObject(CommandReturnObject *ptr)
 | 
			
		||||
    : m_opaque_ap(ptr) {}
 | 
			
		||||
    : m_opaque_up(ptr) {}
 | 
			
		||||
 | 
			
		||||
SBCommandReturnObject::~SBCommandReturnObject() = default;
 | 
			
		||||
 | 
			
		||||
CommandReturnObject *SBCommandReturnObject::Release() {
 | 
			
		||||
  return m_opaque_ap.release();
 | 
			
		||||
  return m_opaque_up.release();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const SBCommandReturnObject &SBCommandReturnObject::
 | 
			
		||||
operator=(const SBCommandReturnObject &rhs) {
 | 
			
		||||
  if (this != &rhs) {
 | 
			
		||||
    if (rhs.m_opaque_ap)
 | 
			
		||||
      m_opaque_ap.reset(new CommandReturnObject(*rhs.m_opaque_ap));
 | 
			
		||||
    if (rhs.m_opaque_up)
 | 
			
		||||
      m_opaque_up.reset(new CommandReturnObject(*rhs.m_opaque_up));
 | 
			
		||||
    else
 | 
			
		||||
      m_opaque_ap.reset();
 | 
			
		||||
      m_opaque_up.reset();
 | 
			
		||||
  }
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBCommandReturnObject::IsValid() const { return m_opaque_ap != nullptr; }
 | 
			
		||||
bool SBCommandReturnObject::IsValid() const { return m_opaque_up != nullptr; }
 | 
			
		||||
 | 
			
		||||
const char *SBCommandReturnObject::GetOutput() {
 | 
			
		||||
  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 | 
			
		||||
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
    llvm::StringRef output = m_opaque_ap->GetOutputData();
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    llvm::StringRef output = m_opaque_up->GetOutputData();
 | 
			
		||||
    ConstString result(output.empty() ? llvm::StringRef("") : output);
 | 
			
		||||
 | 
			
		||||
    if (log)
 | 
			
		||||
      log->Printf("SBCommandReturnObject(%p)::GetOutput () => \"%s\"",
 | 
			
		||||
                  static_cast<void *>(m_opaque_ap.get()), result.AsCString());
 | 
			
		||||
                  static_cast<void *>(m_opaque_up.get()), result.AsCString());
 | 
			
		||||
 | 
			
		||||
    return result.AsCString();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (log)
 | 
			
		||||
    log->Printf("SBCommandReturnObject(%p)::GetOutput () => nullptr",
 | 
			
		||||
                static_cast<void *>(m_opaque_ap.get()));
 | 
			
		||||
                static_cast<void *>(m_opaque_up.get()));
 | 
			
		||||
 | 
			
		||||
  return nullptr;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -73,29 +73,29 @@ const char *SBCommandReturnObject::GetOutput() {
 | 
			
		|||
const char *SBCommandReturnObject::GetError() {
 | 
			
		||||
  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 | 
			
		||||
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
    llvm::StringRef output = m_opaque_ap->GetErrorData();
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    llvm::StringRef output = m_opaque_up->GetErrorData();
 | 
			
		||||
    ConstString result(output.empty() ? llvm::StringRef("") : output);
 | 
			
		||||
    if (log)
 | 
			
		||||
      log->Printf("SBCommandReturnObject(%p)::GetError () => \"%s\"",
 | 
			
		||||
                  static_cast<void *>(m_opaque_ap.get()), result.AsCString());
 | 
			
		||||
                  static_cast<void *>(m_opaque_up.get()), result.AsCString());
 | 
			
		||||
 | 
			
		||||
    return result.AsCString();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (log)
 | 
			
		||||
    log->Printf("SBCommandReturnObject(%p)::GetError () => nullptr",
 | 
			
		||||
                static_cast<void *>(m_opaque_ap.get()));
 | 
			
		||||
                static_cast<void *>(m_opaque_up.get()));
 | 
			
		||||
 | 
			
		||||
  return nullptr;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
size_t SBCommandReturnObject::GetOutputSize() {
 | 
			
		||||
  return (m_opaque_ap ? m_opaque_ap->GetOutputData().size() : 0);
 | 
			
		||||
  return (m_opaque_up ? m_opaque_up->GetOutputData().size() : 0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
size_t SBCommandReturnObject::GetErrorSize() {
 | 
			
		||||
  return (m_opaque_ap ? m_opaque_ap->GetErrorData().size() : 0);
 | 
			
		||||
  return (m_opaque_up ? m_opaque_up->GetErrorData().size() : 0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
size_t SBCommandReturnObject::PutOutput(FILE *fh) {
 | 
			
		||||
| 
						 | 
				
			
			@ -117,71 +117,71 @@ size_t SBCommandReturnObject::PutError(FILE *fh) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
void SBCommandReturnObject::Clear() {
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    m_opaque_ap->Clear();
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    m_opaque_up->Clear();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lldb::ReturnStatus SBCommandReturnObject::GetStatus() {
 | 
			
		||||
  return (m_opaque_ap ? m_opaque_ap->GetStatus() : lldb::eReturnStatusInvalid);
 | 
			
		||||
  return (m_opaque_up ? m_opaque_up->GetStatus() : lldb::eReturnStatusInvalid);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBCommandReturnObject::SetStatus(lldb::ReturnStatus status) {
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    m_opaque_ap->SetStatus(status);
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    m_opaque_up->SetStatus(status);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBCommandReturnObject::Succeeded() {
 | 
			
		||||
  return (m_opaque_ap ? m_opaque_ap->Succeeded() : false);
 | 
			
		||||
  return (m_opaque_up ? m_opaque_up->Succeeded() : false);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBCommandReturnObject::HasResult() {
 | 
			
		||||
  return (m_opaque_ap ? m_opaque_ap->HasResult() : false);
 | 
			
		||||
  return (m_opaque_up ? m_opaque_up->HasResult() : false);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBCommandReturnObject::AppendMessage(const char *message) {
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    m_opaque_ap->AppendMessage(message);
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    m_opaque_up->AppendMessage(message);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBCommandReturnObject::AppendWarning(const char *message) {
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    m_opaque_ap->AppendWarning(message);
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    m_opaque_up->AppendWarning(message);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
CommandReturnObject *SBCommandReturnObject::operator->() const {
 | 
			
		||||
  return m_opaque_ap.get();
 | 
			
		||||
  return m_opaque_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
CommandReturnObject *SBCommandReturnObject::get() const {
 | 
			
		||||
  return m_opaque_ap.get();
 | 
			
		||||
  return m_opaque_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
CommandReturnObject &SBCommandReturnObject::operator*() const {
 | 
			
		||||
  assert(m_opaque_ap.get());
 | 
			
		||||
  return *(m_opaque_ap.get());
 | 
			
		||||
  assert(m_opaque_up.get());
 | 
			
		||||
  return *(m_opaque_up.get());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
CommandReturnObject &SBCommandReturnObject::ref() const {
 | 
			
		||||
  assert(m_opaque_ap.get());
 | 
			
		||||
  return *(m_opaque_ap.get());
 | 
			
		||||
  assert(m_opaque_up.get());
 | 
			
		||||
  return *(m_opaque_up.get());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBCommandReturnObject::SetLLDBObjectPtr(CommandReturnObject *ptr) {
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    m_opaque_ap.reset(ptr);
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    m_opaque_up.reset(ptr);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBCommandReturnObject::GetDescription(SBStream &description) {
 | 
			
		||||
  Stream &strm = description.ref();
 | 
			
		||||
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    description.Printf("Error:  ");
 | 
			
		||||
    lldb::ReturnStatus status = m_opaque_ap->GetStatus();
 | 
			
		||||
    lldb::ReturnStatus status = m_opaque_up->GetStatus();
 | 
			
		||||
    if (status == lldb::eReturnStatusStarted)
 | 
			
		||||
      strm.PutCString("Started");
 | 
			
		||||
    else if (status == lldb::eReturnStatusInvalid)
 | 
			
		||||
      strm.PutCString("Invalid");
 | 
			
		||||
    else if (m_opaque_ap->Succeeded())
 | 
			
		||||
    else if (m_opaque_up->Succeeded())
 | 
			
		||||
      strm.PutCString("Success");
 | 
			
		||||
    else
 | 
			
		||||
      strm.PutCString("Fail");
 | 
			
		||||
| 
						 | 
				
			
			@ -207,51 +207,51 @@ void SBCommandReturnObject::SetImmediateErrorFile(FILE *fh) {
 | 
			
		|||
 | 
			
		||||
void SBCommandReturnObject::SetImmediateOutputFile(FILE *fh,
 | 
			
		||||
                                                   bool transfer_ownership) {
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    m_opaque_ap->SetImmediateOutputFile(fh, transfer_ownership);
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    m_opaque_up->SetImmediateOutputFile(fh, transfer_ownership);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBCommandReturnObject::SetImmediateErrorFile(FILE *fh,
 | 
			
		||||
                                                  bool transfer_ownership) {
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    m_opaque_ap->SetImmediateErrorFile(fh, transfer_ownership);
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    m_opaque_up->SetImmediateErrorFile(fh, transfer_ownership);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBCommandReturnObject::PutCString(const char *string, int len) {
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    if (len == 0 || string == nullptr || *string == 0) {
 | 
			
		||||
      return;
 | 
			
		||||
    } else if (len > 0) {
 | 
			
		||||
      std::string buffer(string, len);
 | 
			
		||||
      m_opaque_ap->AppendMessage(buffer.c_str());
 | 
			
		||||
      m_opaque_up->AppendMessage(buffer.c_str());
 | 
			
		||||
    } else
 | 
			
		||||
      m_opaque_ap->AppendMessage(string);
 | 
			
		||||
      m_opaque_up->AppendMessage(string);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const char *SBCommandReturnObject::GetOutput(bool only_if_no_immediate) {
 | 
			
		||||
  if (!m_opaque_ap)
 | 
			
		||||
  if (!m_opaque_up)
 | 
			
		||||
    return nullptr;
 | 
			
		||||
  if (!only_if_no_immediate ||
 | 
			
		||||
      m_opaque_ap->GetImmediateOutputStream().get() == nullptr)
 | 
			
		||||
      m_opaque_up->GetImmediateOutputStream().get() == nullptr)
 | 
			
		||||
    return GetOutput();
 | 
			
		||||
  return nullptr;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const char *SBCommandReturnObject::GetError(bool only_if_no_immediate) {
 | 
			
		||||
  if (!m_opaque_ap)
 | 
			
		||||
  if (!m_opaque_up)
 | 
			
		||||
    return nullptr;
 | 
			
		||||
  if (!only_if_no_immediate ||
 | 
			
		||||
      m_opaque_ap->GetImmediateErrorStream().get() == nullptr)
 | 
			
		||||
      m_opaque_up->GetImmediateErrorStream().get() == nullptr)
 | 
			
		||||
    return GetError();
 | 
			
		||||
  return nullptr;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
size_t SBCommandReturnObject::Printf(const char *format, ...) {
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    va_list args;
 | 
			
		||||
    va_start(args, format);
 | 
			
		||||
    size_t result = m_opaque_ap->GetOutputStream().PrintfVarArg(format, args);
 | 
			
		||||
    size_t result = m_opaque_up->GetOutputStream().PrintfVarArg(format, args);
 | 
			
		||||
    va_end(args);
 | 
			
		||||
    return result;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -260,15 +260,15 @@ size_t SBCommandReturnObject::Printf(const char *format, ...) {
 | 
			
		|||
 | 
			
		||||
void SBCommandReturnObject::SetError(lldb::SBError &error,
 | 
			
		||||
                                     const char *fallback_error_cstr) {
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    if (error.IsValid())
 | 
			
		||||
      m_opaque_ap->SetError(error.ref(), fallback_error_cstr);
 | 
			
		||||
      m_opaque_up->SetError(error.ref(), fallback_error_cstr);
 | 
			
		||||
    else if (fallback_error_cstr)
 | 
			
		||||
      m_opaque_ap->SetError(Status(), fallback_error_cstr);
 | 
			
		||||
      m_opaque_up->SetError(Status(), fallback_error_cstr);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBCommandReturnObject::SetError(const char *error_cstr) {
 | 
			
		||||
  if (m_opaque_ap && error_cstr)
 | 
			
		||||
    m_opaque_ap->SetError(error_cstr);
 | 
			
		||||
  if (m_opaque_up && error_cstr)
 | 
			
		||||
    m_opaque_up->SetError(error_cstr);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -148,7 +148,7 @@ lldb::SBTypeList SBCompileUnit::GetTypes(uint32_t type_mask) {
 | 
			
		|||
  TypeClass type_class = static_cast<TypeClass>(type_mask);
 | 
			
		||||
  TypeList type_list;
 | 
			
		||||
  vendor->GetTypes(m_opaque_ptr, type_class, type_list);
 | 
			
		||||
  sb_type_list.m_opaque_ap->Append(type_list);
 | 
			
		||||
  sb_type_list.m_opaque_up->Append(type_list);
 | 
			
		||||
  return sb_type_list;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,15 +18,15 @@
 | 
			
		|||
using namespace lldb;
 | 
			
		||||
using namespace lldb_private;
 | 
			
		||||
 | 
			
		||||
SBDeclaration::SBDeclaration() : m_opaque_ap() {}
 | 
			
		||||
SBDeclaration::SBDeclaration() : m_opaque_up() {}
 | 
			
		||||
 | 
			
		||||
SBDeclaration::SBDeclaration(const SBDeclaration &rhs) : m_opaque_ap() {
 | 
			
		||||
SBDeclaration::SBDeclaration(const SBDeclaration &rhs) : m_opaque_up() {
 | 
			
		||||
  if (rhs.IsValid())
 | 
			
		||||
    ref() = rhs.ref();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBDeclaration::SBDeclaration(const lldb_private::Declaration *lldb_object_ptr)
 | 
			
		||||
    : m_opaque_ap() {
 | 
			
		||||
    : m_opaque_up() {
 | 
			
		||||
  if (lldb_object_ptr)
 | 
			
		||||
    ref() = *lldb_object_ptr;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -36,7 +36,7 @@ const SBDeclaration &SBDeclaration::operator=(const SBDeclaration &rhs) {
 | 
			
		|||
    if (rhs.IsValid())
 | 
			
		||||
      ref() = rhs.ref();
 | 
			
		||||
    else
 | 
			
		||||
      m_opaque_ap.reset();
 | 
			
		||||
      m_opaque_up.reset();
 | 
			
		||||
  }
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -49,21 +49,21 @@ void SBDeclaration::SetDeclaration(
 | 
			
		|||
SBDeclaration::~SBDeclaration() {}
 | 
			
		||||
 | 
			
		||||
bool SBDeclaration::IsValid() const {
 | 
			
		||||
  return m_opaque_ap.get() && m_opaque_ap->IsValid();
 | 
			
		||||
  return m_opaque_up.get() && m_opaque_up->IsValid();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBFileSpec SBDeclaration::GetFileSpec() const {
 | 
			
		||||
  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 | 
			
		||||
 | 
			
		||||
  SBFileSpec sb_file_spec;
 | 
			
		||||
  if (m_opaque_ap.get() && m_opaque_ap->GetFile())
 | 
			
		||||
    sb_file_spec.SetFileSpec(m_opaque_ap->GetFile());
 | 
			
		||||
  if (m_opaque_up.get() && m_opaque_up->GetFile())
 | 
			
		||||
    sb_file_spec.SetFileSpec(m_opaque_up->GetFile());
 | 
			
		||||
 | 
			
		||||
  if (log) {
 | 
			
		||||
    SBStream sstr;
 | 
			
		||||
    sb_file_spec.GetDescription(sstr);
 | 
			
		||||
    log->Printf("SBLineEntry(%p)::GetFileSpec () => SBFileSpec(%p): %s",
 | 
			
		||||
                static_cast<void *>(m_opaque_ap.get()),
 | 
			
		||||
                static_cast<void *>(m_opaque_up.get()),
 | 
			
		||||
                static_cast<const void *>(sb_file_spec.get()), sstr.GetData());
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -74,19 +74,19 @@ uint32_t SBDeclaration::GetLine() const {
 | 
			
		|||
  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 | 
			
		||||
 | 
			
		||||
  uint32_t line = 0;
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    line = m_opaque_ap->GetLine();
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    line = m_opaque_up->GetLine();
 | 
			
		||||
 | 
			
		||||
  if (log)
 | 
			
		||||
    log->Printf("SBLineEntry(%p)::GetLine () => %u",
 | 
			
		||||
                static_cast<void *>(m_opaque_ap.get()), line);
 | 
			
		||||
                static_cast<void *>(m_opaque_up.get()), line);
 | 
			
		||||
 | 
			
		||||
  return line;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint32_t SBDeclaration::GetColumn() const {
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    return m_opaque_ap->GetColumn();
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    return m_opaque_up->GetColumn();
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -101,8 +101,8 @@ void SBDeclaration::SetLine(uint32_t line) { ref().SetLine(line); }
 | 
			
		|||
void SBDeclaration::SetColumn(uint32_t column) { ref().SetColumn(column); }
 | 
			
		||||
 | 
			
		||||
bool SBDeclaration::operator==(const SBDeclaration &rhs) const {
 | 
			
		||||
  lldb_private::Declaration *lhs_ptr = m_opaque_ap.get();
 | 
			
		||||
  lldb_private::Declaration *rhs_ptr = rhs.m_opaque_ap.get();
 | 
			
		||||
  lldb_private::Declaration *lhs_ptr = m_opaque_up.get();
 | 
			
		||||
  lldb_private::Declaration *rhs_ptr = rhs.m_opaque_up.get();
 | 
			
		||||
 | 
			
		||||
  if (lhs_ptr && rhs_ptr)
 | 
			
		||||
    return lldb_private::Declaration::Compare(*lhs_ptr, *rhs_ptr) == 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -111,8 +111,8 @@ bool SBDeclaration::operator==(const SBDeclaration &rhs) const {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
bool SBDeclaration::operator!=(const SBDeclaration &rhs) const {
 | 
			
		||||
  lldb_private::Declaration *lhs_ptr = m_opaque_ap.get();
 | 
			
		||||
  lldb_private::Declaration *rhs_ptr = rhs.m_opaque_ap.get();
 | 
			
		||||
  lldb_private::Declaration *lhs_ptr = m_opaque_up.get();
 | 
			
		||||
  lldb_private::Declaration *rhs_ptr = rhs.m_opaque_up.get();
 | 
			
		||||
 | 
			
		||||
  if (lhs_ptr && rhs_ptr)
 | 
			
		||||
    return lldb_private::Declaration::Compare(*lhs_ptr, *rhs_ptr) != 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -121,25 +121,25 @@ bool SBDeclaration::operator!=(const SBDeclaration &rhs) const {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
const lldb_private::Declaration *SBDeclaration::operator->() const {
 | 
			
		||||
  return m_opaque_ap.get();
 | 
			
		||||
  return m_opaque_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lldb_private::Declaration &SBDeclaration::ref() {
 | 
			
		||||
  if (m_opaque_ap == NULL)
 | 
			
		||||
    m_opaque_ap.reset(new lldb_private::Declaration());
 | 
			
		||||
  return *m_opaque_ap;
 | 
			
		||||
  if (m_opaque_up == NULL)
 | 
			
		||||
    m_opaque_up.reset(new lldb_private::Declaration());
 | 
			
		||||
  return *m_opaque_up;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const lldb_private::Declaration &SBDeclaration::ref() const {
 | 
			
		||||
  return *m_opaque_ap;
 | 
			
		||||
  return *m_opaque_up;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBDeclaration::GetDescription(SBStream &description) {
 | 
			
		||||
  Stream &strm = description.ref();
 | 
			
		||||
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    char file_path[PATH_MAX * 2];
 | 
			
		||||
    m_opaque_ap->GetFile().GetPath(file_path, sizeof(file_path));
 | 
			
		||||
    m_opaque_up->GetFile().GetPath(file_path, sizeof(file_path));
 | 
			
		||||
    strm.Printf("%s:%u", file_path, GetLine());
 | 
			
		||||
    if (GetColumn() > 0)
 | 
			
		||||
      strm.Printf(":%u", GetColumn());
 | 
			
		||||
| 
						 | 
				
			
			@ -149,4 +149,4 @@ bool SBDeclaration::GetDescription(SBStream &description) {
 | 
			
		|||
  return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lldb_private::Declaration *SBDeclaration::get() { return m_opaque_ap.get(); }
 | 
			
		||||
lldb_private::Declaration *SBDeclaration::get() { return m_opaque_up.get(); }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,48 +16,48 @@
 | 
			
		|||
using namespace lldb;
 | 
			
		||||
using namespace lldb_private;
 | 
			
		||||
 | 
			
		||||
SBError::SBError() : m_opaque_ap() {}
 | 
			
		||||
SBError::SBError() : m_opaque_up() {}
 | 
			
		||||
 | 
			
		||||
SBError::SBError(const SBError &rhs) : m_opaque_ap() {
 | 
			
		||||
SBError::SBError(const SBError &rhs) : m_opaque_up() {
 | 
			
		||||
  if (rhs.IsValid())
 | 
			
		||||
    m_opaque_ap.reset(new Status(*rhs));
 | 
			
		||||
    m_opaque_up.reset(new Status(*rhs));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBError::~SBError() {}
 | 
			
		||||
 | 
			
		||||
const SBError &SBError::operator=(const SBError &rhs) {
 | 
			
		||||
  if (rhs.IsValid()) {
 | 
			
		||||
    if (m_opaque_ap)
 | 
			
		||||
      *m_opaque_ap = *rhs;
 | 
			
		||||
    if (m_opaque_up)
 | 
			
		||||
      *m_opaque_up = *rhs;
 | 
			
		||||
    else
 | 
			
		||||
      m_opaque_ap.reset(new Status(*rhs));
 | 
			
		||||
      m_opaque_up.reset(new Status(*rhs));
 | 
			
		||||
  } else
 | 
			
		||||
    m_opaque_ap.reset();
 | 
			
		||||
    m_opaque_up.reset();
 | 
			
		||||
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const char *SBError::GetCString() const {
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    return m_opaque_ap->AsCString();
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    return m_opaque_up->AsCString();
 | 
			
		||||
  return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBError::Clear() {
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    m_opaque_ap->Clear();
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    m_opaque_up->Clear();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBError::Fail() const {
 | 
			
		||||
  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 | 
			
		||||
 | 
			
		||||
  bool ret_value = false;
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    ret_value = m_opaque_ap->Fail();
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    ret_value = m_opaque_up->Fail();
 | 
			
		||||
 | 
			
		||||
  if (log)
 | 
			
		||||
    log->Printf("SBError(%p)::Fail () => %i",
 | 
			
		||||
                static_cast<void *>(m_opaque_ap.get()), ret_value);
 | 
			
		||||
                static_cast<void *>(m_opaque_up.get()), ret_value);
 | 
			
		||||
 | 
			
		||||
  return ret_value;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -65,12 +65,12 @@ bool SBError::Fail() const {
 | 
			
		|||
bool SBError::Success() const {
 | 
			
		||||
  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 | 
			
		||||
  bool ret_value = true;
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    ret_value = m_opaque_ap->Success();
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    ret_value = m_opaque_up->Success();
 | 
			
		||||
 | 
			
		||||
  if (log)
 | 
			
		||||
    log->Printf("SBError(%p)::Success () => %i",
 | 
			
		||||
                static_cast<void *>(m_opaque_ap.get()), ret_value);
 | 
			
		||||
                static_cast<void *>(m_opaque_up.get()), ret_value);
 | 
			
		||||
 | 
			
		||||
  return ret_value;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -79,12 +79,12 @@ uint32_t SBError::GetError() const {
 | 
			
		|||
  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 | 
			
		||||
 | 
			
		||||
  uint32_t err = 0;
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    err = m_opaque_ap->GetError();
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    err = m_opaque_up->GetError();
 | 
			
		||||
 | 
			
		||||
  if (log)
 | 
			
		||||
    log->Printf("SBError(%p)::GetError () => 0x%8.8x",
 | 
			
		||||
                static_cast<void *>(m_opaque_ap.get()), err);
 | 
			
		||||
                static_cast<void *>(m_opaque_up.get()), err);
 | 
			
		||||
 | 
			
		||||
  return err;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -92,74 +92,74 @@ uint32_t SBError::GetError() const {
 | 
			
		|||
ErrorType SBError::GetType() const {
 | 
			
		||||
  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 | 
			
		||||
  ErrorType err_type = eErrorTypeInvalid;
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    err_type = m_opaque_ap->GetType();
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    err_type = m_opaque_up->GetType();
 | 
			
		||||
 | 
			
		||||
  if (log)
 | 
			
		||||
    log->Printf("SBError(%p)::GetType () => %i",
 | 
			
		||||
                static_cast<void *>(m_opaque_ap.get()), err_type);
 | 
			
		||||
                static_cast<void *>(m_opaque_up.get()), err_type);
 | 
			
		||||
 | 
			
		||||
  return err_type;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBError::SetError(uint32_t err, ErrorType type) {
 | 
			
		||||
  CreateIfNeeded();
 | 
			
		||||
  m_opaque_ap->SetError(err, type);
 | 
			
		||||
  m_opaque_up->SetError(err, type);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBError::SetError(const Status &lldb_error) {
 | 
			
		||||
  CreateIfNeeded();
 | 
			
		||||
  *m_opaque_ap = lldb_error;
 | 
			
		||||
  *m_opaque_up = lldb_error;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBError::SetErrorToErrno() {
 | 
			
		||||
  CreateIfNeeded();
 | 
			
		||||
  m_opaque_ap->SetErrorToErrno();
 | 
			
		||||
  m_opaque_up->SetErrorToErrno();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBError::SetErrorToGenericError() {
 | 
			
		||||
  CreateIfNeeded();
 | 
			
		||||
  m_opaque_ap->SetErrorToErrno();
 | 
			
		||||
  m_opaque_up->SetErrorToErrno();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBError::SetErrorString(const char *err_str) {
 | 
			
		||||
  CreateIfNeeded();
 | 
			
		||||
  m_opaque_ap->SetErrorString(err_str);
 | 
			
		||||
  m_opaque_up->SetErrorString(err_str);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int SBError::SetErrorStringWithFormat(const char *format, ...) {
 | 
			
		||||
  CreateIfNeeded();
 | 
			
		||||
  va_list args;
 | 
			
		||||
  va_start(args, format);
 | 
			
		||||
  int num_chars = m_opaque_ap->SetErrorStringWithVarArg(format, args);
 | 
			
		||||
  int num_chars = m_opaque_up->SetErrorStringWithVarArg(format, args);
 | 
			
		||||
  va_end(args);
 | 
			
		||||
  return num_chars;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBError::IsValid() const { return m_opaque_ap != NULL; }
 | 
			
		||||
bool SBError::IsValid() const { return m_opaque_up != NULL; }
 | 
			
		||||
 | 
			
		||||
void SBError::CreateIfNeeded() {
 | 
			
		||||
  if (m_opaque_ap == NULL)
 | 
			
		||||
    m_opaque_ap.reset(new Status());
 | 
			
		||||
  if (m_opaque_up == NULL)
 | 
			
		||||
    m_opaque_up.reset(new Status());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lldb_private::Status *SBError::operator->() { return m_opaque_ap.get(); }
 | 
			
		||||
lldb_private::Status *SBError::operator->() { return m_opaque_up.get(); }
 | 
			
		||||
 | 
			
		||||
lldb_private::Status *SBError::get() { return m_opaque_ap.get(); }
 | 
			
		||||
lldb_private::Status *SBError::get() { return m_opaque_up.get(); }
 | 
			
		||||
 | 
			
		||||
lldb_private::Status &SBError::ref() {
 | 
			
		||||
  CreateIfNeeded();
 | 
			
		||||
  return *m_opaque_ap;
 | 
			
		||||
  return *m_opaque_up;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const lldb_private::Status &SBError::operator*() const {
 | 
			
		||||
  // Be sure to call "IsValid()" before calling this function or it will crash
 | 
			
		||||
  return *m_opaque_ap;
 | 
			
		||||
  return *m_opaque_up;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBError::GetDescription(SBStream &description) {
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
    if (m_opaque_ap->Success())
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    if (m_opaque_up->Success())
 | 
			
		||||
      description.Printf("success");
 | 
			
		||||
    else {
 | 
			
		||||
      const char *err_string = GetCString();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,11 +16,11 @@ using namespace lldb;
 | 
			
		|||
using namespace lldb_private;
 | 
			
		||||
 | 
			
		||||
SBExpressionOptions::SBExpressionOptions()
 | 
			
		||||
    : m_opaque_ap(new EvaluateExpressionOptions()) {}
 | 
			
		||||
    : m_opaque_up(new EvaluateExpressionOptions()) {}
 | 
			
		||||
 | 
			
		||||
SBExpressionOptions::SBExpressionOptions(const SBExpressionOptions &rhs) {
 | 
			
		||||
  m_opaque_ap.reset(new EvaluateExpressionOptions());
 | 
			
		||||
  *(m_opaque_ap.get()) = rhs.ref();
 | 
			
		||||
  m_opaque_up.reset(new EvaluateExpressionOptions());
 | 
			
		||||
  *(m_opaque_up.get()) = rhs.ref();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const SBExpressionOptions &SBExpressionOptions::
 | 
			
		||||
| 
						 | 
				
			
			@ -34,143 +34,145 @@ operator=(const SBExpressionOptions &rhs) {
 | 
			
		|||
SBExpressionOptions::~SBExpressionOptions() {}
 | 
			
		||||
 | 
			
		||||
bool SBExpressionOptions::GetCoerceResultToId() const {
 | 
			
		||||
  return m_opaque_ap->DoesCoerceToId();
 | 
			
		||||
  return m_opaque_up->DoesCoerceToId();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBExpressionOptions::SetCoerceResultToId(bool coerce) {
 | 
			
		||||
  m_opaque_ap->SetCoerceToId(coerce);
 | 
			
		||||
  m_opaque_up->SetCoerceToId(coerce);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBExpressionOptions::GetUnwindOnError() const {
 | 
			
		||||
  return m_opaque_ap->DoesUnwindOnError();
 | 
			
		||||
  return m_opaque_up->DoesUnwindOnError();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBExpressionOptions::SetUnwindOnError(bool unwind) {
 | 
			
		||||
  m_opaque_ap->SetUnwindOnError(unwind);
 | 
			
		||||
  m_opaque_up->SetUnwindOnError(unwind);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBExpressionOptions::GetIgnoreBreakpoints() const {
 | 
			
		||||
  return m_opaque_ap->DoesIgnoreBreakpoints();
 | 
			
		||||
  return m_opaque_up->DoesIgnoreBreakpoints();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBExpressionOptions::SetIgnoreBreakpoints(bool ignore) {
 | 
			
		||||
  m_opaque_ap->SetIgnoreBreakpoints(ignore);
 | 
			
		||||
  m_opaque_up->SetIgnoreBreakpoints(ignore);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lldb::DynamicValueType SBExpressionOptions::GetFetchDynamicValue() const {
 | 
			
		||||
  return m_opaque_ap->GetUseDynamic();
 | 
			
		||||
  return m_opaque_up->GetUseDynamic();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBExpressionOptions::SetFetchDynamicValue(lldb::DynamicValueType dynamic) {
 | 
			
		||||
  m_opaque_ap->SetUseDynamic(dynamic);
 | 
			
		||||
  m_opaque_up->SetUseDynamic(dynamic);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint32_t SBExpressionOptions::GetTimeoutInMicroSeconds() const {
 | 
			
		||||
  return m_opaque_ap->GetTimeout() ? m_opaque_ap->GetTimeout()->count() : 0;
 | 
			
		||||
  return m_opaque_up->GetTimeout() ? m_opaque_up->GetTimeout()->count() : 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBExpressionOptions::SetTimeoutInMicroSeconds(uint32_t timeout) {
 | 
			
		||||
  m_opaque_ap->SetTimeout(timeout == 0 ? Timeout<std::micro>(llvm::None)
 | 
			
		||||
  m_opaque_up->SetTimeout(timeout == 0 ? Timeout<std::micro>(llvm::None)
 | 
			
		||||
                                       : std::chrono::microseconds(timeout));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint32_t SBExpressionOptions::GetOneThreadTimeoutInMicroSeconds() const {
 | 
			
		||||
  return m_opaque_ap->GetOneThreadTimeout() ? m_opaque_ap->GetOneThreadTimeout()->count() : 0;
 | 
			
		||||
  return m_opaque_up->GetOneThreadTimeout()
 | 
			
		||||
             ? m_opaque_up->GetOneThreadTimeout()->count()
 | 
			
		||||
             : 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBExpressionOptions::SetOneThreadTimeoutInMicroSeconds(uint32_t timeout) {
 | 
			
		||||
  m_opaque_ap->SetOneThreadTimeout(timeout == 0
 | 
			
		||||
  m_opaque_up->SetOneThreadTimeout(timeout == 0
 | 
			
		||||
                                       ? Timeout<std::micro>(llvm::None)
 | 
			
		||||
                                       : std::chrono::microseconds(timeout));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBExpressionOptions::GetTryAllThreads() const {
 | 
			
		||||
  return m_opaque_ap->GetTryAllThreads();
 | 
			
		||||
  return m_opaque_up->GetTryAllThreads();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBExpressionOptions::SetTryAllThreads(bool run_others) {
 | 
			
		||||
  m_opaque_ap->SetTryAllThreads(run_others);
 | 
			
		||||
  m_opaque_up->SetTryAllThreads(run_others);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBExpressionOptions::GetStopOthers() const {
 | 
			
		||||
  return m_opaque_ap->GetStopOthers();
 | 
			
		||||
  return m_opaque_up->GetStopOthers();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBExpressionOptions::SetStopOthers(bool run_others) {
 | 
			
		||||
  m_opaque_ap->SetStopOthers(run_others);
 | 
			
		||||
  m_opaque_up->SetStopOthers(run_others);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBExpressionOptions::GetTrapExceptions() const {
 | 
			
		||||
  return m_opaque_ap->GetTrapExceptions();
 | 
			
		||||
  return m_opaque_up->GetTrapExceptions();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBExpressionOptions::SetTrapExceptions(bool trap_exceptions) {
 | 
			
		||||
  m_opaque_ap->SetTrapExceptions(trap_exceptions);
 | 
			
		||||
  m_opaque_up->SetTrapExceptions(trap_exceptions);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBExpressionOptions::SetLanguage(lldb::LanguageType language) {
 | 
			
		||||
  m_opaque_ap->SetLanguage(language);
 | 
			
		||||
  m_opaque_up->SetLanguage(language);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBExpressionOptions::SetCancelCallback(
 | 
			
		||||
    lldb::ExpressionCancelCallback callback, void *baton) {
 | 
			
		||||
  m_opaque_ap->SetCancelCallback(callback, baton);
 | 
			
		||||
  m_opaque_up->SetCancelCallback(callback, baton);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBExpressionOptions::GetGenerateDebugInfo() {
 | 
			
		||||
  return m_opaque_ap->GetGenerateDebugInfo();
 | 
			
		||||
  return m_opaque_up->GetGenerateDebugInfo();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBExpressionOptions::SetGenerateDebugInfo(bool b) {
 | 
			
		||||
  return m_opaque_ap->SetGenerateDebugInfo(b);
 | 
			
		||||
  return m_opaque_up->SetGenerateDebugInfo(b);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBExpressionOptions::GetSuppressPersistentResult() {
 | 
			
		||||
  return m_opaque_ap->GetResultIsInternal();
 | 
			
		||||
  return m_opaque_up->GetResultIsInternal();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBExpressionOptions::SetSuppressPersistentResult(bool b) {
 | 
			
		||||
  return m_opaque_ap->SetResultIsInternal(b);
 | 
			
		||||
  return m_opaque_up->SetResultIsInternal(b);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const char *SBExpressionOptions::GetPrefix() const {
 | 
			
		||||
  return m_opaque_ap->GetPrefix();
 | 
			
		||||
  return m_opaque_up->GetPrefix();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBExpressionOptions::SetPrefix(const char *prefix) {
 | 
			
		||||
  return m_opaque_ap->SetPrefix(prefix);
 | 
			
		||||
  return m_opaque_up->SetPrefix(prefix);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBExpressionOptions::GetAutoApplyFixIts() {
 | 
			
		||||
  return m_opaque_ap->GetAutoApplyFixIts();
 | 
			
		||||
  return m_opaque_up->GetAutoApplyFixIts();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBExpressionOptions::SetAutoApplyFixIts(bool b) {
 | 
			
		||||
  return m_opaque_ap->SetAutoApplyFixIts(b);
 | 
			
		||||
  return m_opaque_up->SetAutoApplyFixIts(b);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBExpressionOptions::GetTopLevel() {
 | 
			
		||||
  return m_opaque_ap->GetExecutionPolicy() == eExecutionPolicyTopLevel;
 | 
			
		||||
  return m_opaque_up->GetExecutionPolicy() == eExecutionPolicyTopLevel;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBExpressionOptions::SetTopLevel(bool b) {
 | 
			
		||||
  m_opaque_ap->SetExecutionPolicy(b ? eExecutionPolicyTopLevel
 | 
			
		||||
                                    : m_opaque_ap->default_execution_policy);
 | 
			
		||||
  m_opaque_up->SetExecutionPolicy(b ? eExecutionPolicyTopLevel
 | 
			
		||||
                                    : m_opaque_up->default_execution_policy);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBExpressionOptions::GetAllowJIT() {
 | 
			
		||||
  return m_opaque_ap->GetExecutionPolicy() != eExecutionPolicyNever;
 | 
			
		||||
  return m_opaque_up->GetExecutionPolicy() != eExecutionPolicyNever;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBExpressionOptions::SetAllowJIT(bool allow) {
 | 
			
		||||
  m_opaque_ap->SetExecutionPolicy(allow ? m_opaque_ap->default_execution_policy
 | 
			
		||||
                                    : eExecutionPolicyNever);
 | 
			
		||||
  m_opaque_up->SetExecutionPolicy(allow ? m_opaque_up->default_execution_policy
 | 
			
		||||
                                        : eExecutionPolicyNever);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
EvaluateExpressionOptions *SBExpressionOptions::get() const {
 | 
			
		||||
  return m_opaque_ap.get();
 | 
			
		||||
  return m_opaque_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
EvaluateExpressionOptions &SBExpressionOptions::ref() const {
 | 
			
		||||
  return *(m_opaque_ap.get());
 | 
			
		||||
  return *(m_opaque_up.get());
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,50 +22,50 @@
 | 
			
		|||
using namespace lldb;
 | 
			
		||||
using namespace lldb_private;
 | 
			
		||||
 | 
			
		||||
SBFileSpec::SBFileSpec() : m_opaque_ap(new lldb_private::FileSpec()) {}
 | 
			
		||||
SBFileSpec::SBFileSpec() : m_opaque_up(new lldb_private::FileSpec()) {}
 | 
			
		||||
 | 
			
		||||
SBFileSpec::SBFileSpec(const SBFileSpec &rhs)
 | 
			
		||||
    : m_opaque_ap(new lldb_private::FileSpec(*rhs.m_opaque_ap)) {}
 | 
			
		||||
    : m_opaque_up(new lldb_private::FileSpec(*rhs.m_opaque_up)) {}
 | 
			
		||||
 | 
			
		||||
SBFileSpec::SBFileSpec(const lldb_private::FileSpec &fspec)
 | 
			
		||||
    : m_opaque_ap(new lldb_private::FileSpec(fspec)) {}
 | 
			
		||||
    : m_opaque_up(new lldb_private::FileSpec(fspec)) {}
 | 
			
		||||
 | 
			
		||||
// Deprecated!!!
 | 
			
		||||
SBFileSpec::SBFileSpec(const char *path) : m_opaque_ap(new FileSpec(path)) {
 | 
			
		||||
  FileSystem::Instance().Resolve(*m_opaque_ap);
 | 
			
		||||
SBFileSpec::SBFileSpec(const char *path) : m_opaque_up(new FileSpec(path)) {
 | 
			
		||||
  FileSystem::Instance().Resolve(*m_opaque_up);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBFileSpec::SBFileSpec(const char *path, bool resolve)
 | 
			
		||||
    : m_opaque_ap(new FileSpec(path)) {
 | 
			
		||||
    : m_opaque_up(new FileSpec(path)) {
 | 
			
		||||
  if (resolve)
 | 
			
		||||
    FileSystem::Instance().Resolve(*m_opaque_ap);
 | 
			
		||||
    FileSystem::Instance().Resolve(*m_opaque_up);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBFileSpec::~SBFileSpec() {}
 | 
			
		||||
 | 
			
		||||
const SBFileSpec &SBFileSpec::operator=(const SBFileSpec &rhs) {
 | 
			
		||||
  if (this != &rhs)
 | 
			
		||||
    *m_opaque_ap = *rhs.m_opaque_ap;
 | 
			
		||||
    *m_opaque_up = *rhs.m_opaque_up;
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBFileSpec::IsValid() const { return m_opaque_ap->operator bool(); }
 | 
			
		||||
bool SBFileSpec::IsValid() const { return m_opaque_up->operator bool(); }
 | 
			
		||||
 | 
			
		||||
bool SBFileSpec::Exists() const {
 | 
			
		||||
  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 | 
			
		||||
 | 
			
		||||
  bool result = FileSystem::Instance().Exists(*m_opaque_ap);
 | 
			
		||||
  bool result = FileSystem::Instance().Exists(*m_opaque_up);
 | 
			
		||||
 | 
			
		||||
  if (log)
 | 
			
		||||
    log->Printf("SBFileSpec(%p)::Exists () => %s",
 | 
			
		||||
                static_cast<void *>(m_opaque_ap.get()),
 | 
			
		||||
                static_cast<void *>(m_opaque_up.get()),
 | 
			
		||||
                (result ? "true" : "false"));
 | 
			
		||||
 | 
			
		||||
  return result;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBFileSpec::ResolveExecutableLocation() {
 | 
			
		||||
  return FileSystem::Instance().ResolveExecutableLocation(*m_opaque_ap);
 | 
			
		||||
  return FileSystem::Instance().ResolveExecutableLocation(*m_opaque_up);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int SBFileSpec::ResolvePath(const char *src_path, char *dst_path,
 | 
			
		||||
| 
						 | 
				
			
			@ -77,60 +77,60 @@ int SBFileSpec::ResolvePath(const char *src_path, char *dst_path,
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
const char *SBFileSpec::GetFilename() const {
 | 
			
		||||
  const char *s = m_opaque_ap->GetFilename().AsCString();
 | 
			
		||||
  const char *s = m_opaque_up->GetFilename().AsCString();
 | 
			
		||||
 | 
			
		||||
  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 | 
			
		||||
  if (log) {
 | 
			
		||||
    if (s)
 | 
			
		||||
      log->Printf("SBFileSpec(%p)::GetFilename () => \"%s\"",
 | 
			
		||||
                  static_cast<void *>(m_opaque_ap.get()), s);
 | 
			
		||||
                  static_cast<void *>(m_opaque_up.get()), s);
 | 
			
		||||
    else
 | 
			
		||||
      log->Printf("SBFileSpec(%p)::GetFilename () => NULL",
 | 
			
		||||
                  static_cast<void *>(m_opaque_ap.get()));
 | 
			
		||||
                  static_cast<void *>(m_opaque_up.get()));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return s;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const char *SBFileSpec::GetDirectory() const {
 | 
			
		||||
  FileSpec directory{*m_opaque_ap};
 | 
			
		||||
  FileSpec directory{*m_opaque_up};
 | 
			
		||||
  directory.GetFilename().Clear();
 | 
			
		||||
  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 | 
			
		||||
  if (log) {
 | 
			
		||||
    if (directory)
 | 
			
		||||
      log->Printf("SBFileSpec(%p)::GetDirectory () => \"%s\"",
 | 
			
		||||
                  static_cast<void *>(m_opaque_ap.get()),
 | 
			
		||||
                  static_cast<void *>(m_opaque_up.get()),
 | 
			
		||||
                  directory.GetCString());
 | 
			
		||||
    else
 | 
			
		||||
      log->Printf("SBFileSpec(%p)::GetDirectory () => NULL",
 | 
			
		||||
                  static_cast<void *>(m_opaque_ap.get()));
 | 
			
		||||
                  static_cast<void *>(m_opaque_up.get()));
 | 
			
		||||
  }
 | 
			
		||||
  return directory.GetCString();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBFileSpec::SetFilename(const char *filename) {
 | 
			
		||||
  if (filename && filename[0])
 | 
			
		||||
    m_opaque_ap->GetFilename().SetCString(filename);
 | 
			
		||||
    m_opaque_up->GetFilename().SetCString(filename);
 | 
			
		||||
  else
 | 
			
		||||
    m_opaque_ap->GetFilename().Clear();
 | 
			
		||||
    m_opaque_up->GetFilename().Clear();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBFileSpec::SetDirectory(const char *directory) {
 | 
			
		||||
  if (directory && directory[0])
 | 
			
		||||
    m_opaque_ap->GetDirectory().SetCString(directory);
 | 
			
		||||
    m_opaque_up->GetDirectory().SetCString(directory);
 | 
			
		||||
  else
 | 
			
		||||
    m_opaque_ap->GetDirectory().Clear();
 | 
			
		||||
    m_opaque_up->GetDirectory().Clear();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint32_t SBFileSpec::GetPath(char *dst_path, size_t dst_len) const {
 | 
			
		||||
  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 | 
			
		||||
 | 
			
		||||
  uint32_t result = m_opaque_ap->GetPath(dst_path, dst_len);
 | 
			
		||||
  uint32_t result = m_opaque_up->GetPath(dst_path, dst_len);
 | 
			
		||||
 | 
			
		||||
  if (log)
 | 
			
		||||
    log->Printf("SBFileSpec(%p)::GetPath (dst_path=\"%.*s\", dst_len=%" PRIu64
 | 
			
		||||
                ") => %u",
 | 
			
		||||
                static_cast<void *>(m_opaque_ap.get()), result, dst_path,
 | 
			
		||||
                static_cast<void *>(m_opaque_up.get()), result, dst_path,
 | 
			
		||||
                static_cast<uint64_t>(dst_len), result);
 | 
			
		||||
 | 
			
		||||
  if (result == 0 && dst_path && dst_len > 0)
 | 
			
		||||
| 
						 | 
				
			
			@ -139,31 +139,31 @@ uint32_t SBFileSpec::GetPath(char *dst_path, size_t dst_len) const {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
const lldb_private::FileSpec *SBFileSpec::operator->() const {
 | 
			
		||||
  return m_opaque_ap.get();
 | 
			
		||||
  return m_opaque_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const lldb_private::FileSpec *SBFileSpec::get() const {
 | 
			
		||||
  return m_opaque_ap.get();
 | 
			
		||||
  return m_opaque_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const lldb_private::FileSpec &SBFileSpec::operator*() const {
 | 
			
		||||
  return *m_opaque_ap;
 | 
			
		||||
  return *m_opaque_up;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const lldb_private::FileSpec &SBFileSpec::ref() const { return *m_opaque_ap; }
 | 
			
		||||
const lldb_private::FileSpec &SBFileSpec::ref() const { return *m_opaque_up; }
 | 
			
		||||
 | 
			
		||||
void SBFileSpec::SetFileSpec(const lldb_private::FileSpec &fs) {
 | 
			
		||||
  *m_opaque_ap = fs;
 | 
			
		||||
  *m_opaque_up = fs;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBFileSpec::GetDescription(SBStream &description) const {
 | 
			
		||||
  Stream &strm = description.ref();
 | 
			
		||||
  char path[PATH_MAX];
 | 
			
		||||
  if (m_opaque_ap->GetPath(path, sizeof(path)))
 | 
			
		||||
  if (m_opaque_up->GetPath(path, sizeof(path)))
 | 
			
		||||
    strm.PutCString(path);
 | 
			
		||||
  return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBFileSpec::AppendPathComponent(const char *fn) {
 | 
			
		||||
  m_opaque_ap->AppendPathComponent(fn);
 | 
			
		||||
  m_opaque_up->AppendPathComponent(fn);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -20,19 +20,19 @@
 | 
			
		|||
using namespace lldb;
 | 
			
		||||
using namespace lldb_private;
 | 
			
		||||
 | 
			
		||||
SBFileSpecList::SBFileSpecList() : m_opaque_ap(new FileSpecList()) {}
 | 
			
		||||
SBFileSpecList::SBFileSpecList() : m_opaque_up(new FileSpecList()) {}
 | 
			
		||||
 | 
			
		||||
SBFileSpecList::SBFileSpecList(const SBFileSpecList &rhs) : m_opaque_ap() {
 | 
			
		||||
SBFileSpecList::SBFileSpecList(const SBFileSpecList &rhs) : m_opaque_up() {
 | 
			
		||||
  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 | 
			
		||||
 | 
			
		||||
  if (rhs.m_opaque_ap)
 | 
			
		||||
    m_opaque_ap.reset(new FileSpecList(*(rhs.get())));
 | 
			
		||||
  if (rhs.m_opaque_up)
 | 
			
		||||
    m_opaque_up.reset(new FileSpecList(*(rhs.get())));
 | 
			
		||||
 | 
			
		||||
  if (log) {
 | 
			
		||||
    log->Printf("SBFileSpecList::SBFileSpecList (const SBFileSpecList "
 | 
			
		||||
                "rhs.ap=%p) => SBFileSpecList(%p)",
 | 
			
		||||
                static_cast<void *>(rhs.m_opaque_ap.get()),
 | 
			
		||||
                static_cast<void *>(m_opaque_ap.get()));
 | 
			
		||||
                static_cast<void *>(rhs.m_opaque_up.get()),
 | 
			
		||||
                static_cast<void *>(m_opaque_up.get()));
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -40,59 +40,59 @@ SBFileSpecList::~SBFileSpecList() {}
 | 
			
		|||
 | 
			
		||||
const SBFileSpecList &SBFileSpecList::operator=(const SBFileSpecList &rhs) {
 | 
			
		||||
  if (this != &rhs) {
 | 
			
		||||
    m_opaque_ap.reset(new lldb_private::FileSpecList(*(rhs.get())));
 | 
			
		||||
    m_opaque_up.reset(new lldb_private::FileSpecList(*(rhs.get())));
 | 
			
		||||
  }
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint32_t SBFileSpecList::GetSize() const { return m_opaque_ap->GetSize(); }
 | 
			
		||||
uint32_t SBFileSpecList::GetSize() const { return m_opaque_up->GetSize(); }
 | 
			
		||||
 | 
			
		||||
void SBFileSpecList::Append(const SBFileSpec &sb_file) {
 | 
			
		||||
  m_opaque_ap->Append(sb_file.ref());
 | 
			
		||||
  m_opaque_up->Append(sb_file.ref());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBFileSpecList::AppendIfUnique(const SBFileSpec &sb_file) {
 | 
			
		||||
  return m_opaque_ap->AppendIfUnique(sb_file.ref());
 | 
			
		||||
  return m_opaque_up->AppendIfUnique(sb_file.ref());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBFileSpecList::Clear() { m_opaque_ap->Clear(); }
 | 
			
		||||
void SBFileSpecList::Clear() { m_opaque_up->Clear(); }
 | 
			
		||||
 | 
			
		||||
uint32_t SBFileSpecList::FindFileIndex(uint32_t idx, const SBFileSpec &sb_file,
 | 
			
		||||
                                       bool full) {
 | 
			
		||||
  return m_opaque_ap->FindFileIndex(idx, sb_file.ref(), full);
 | 
			
		||||
  return m_opaque_up->FindFileIndex(idx, sb_file.ref(), full);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const SBFileSpec SBFileSpecList::GetFileSpecAtIndex(uint32_t idx) const {
 | 
			
		||||
  SBFileSpec new_spec;
 | 
			
		||||
  new_spec.SetFileSpec(m_opaque_ap->GetFileSpecAtIndex(idx));
 | 
			
		||||
  new_spec.SetFileSpec(m_opaque_up->GetFileSpecAtIndex(idx));
 | 
			
		||||
  return new_spec;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const lldb_private::FileSpecList *SBFileSpecList::operator->() const {
 | 
			
		||||
  return m_opaque_ap.get();
 | 
			
		||||
  return m_opaque_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const lldb_private::FileSpecList *SBFileSpecList::get() const {
 | 
			
		||||
  return m_opaque_ap.get();
 | 
			
		||||
  return m_opaque_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const lldb_private::FileSpecList &SBFileSpecList::operator*() const {
 | 
			
		||||
  return *m_opaque_ap;
 | 
			
		||||
  return *m_opaque_up;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const lldb_private::FileSpecList &SBFileSpecList::ref() const {
 | 
			
		||||
  return *m_opaque_ap;
 | 
			
		||||
  return *m_opaque_up;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBFileSpecList::GetDescription(SBStream &description) const {
 | 
			
		||||
  Stream &strm = description.ref();
 | 
			
		||||
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
    uint32_t num_files = m_opaque_ap->GetSize();
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    uint32_t num_files = m_opaque_up->GetSize();
 | 
			
		||||
    strm.Printf("%d files: ", num_files);
 | 
			
		||||
    for (uint32_t i = 0; i < num_files; i++) {
 | 
			
		||||
      char path[PATH_MAX];
 | 
			
		||||
      if (m_opaque_ap->GetFileSpecAtIndex(i).GetPath(path, sizeof(path)))
 | 
			
		||||
      if (m_opaque_up->GetFileSpecAtIndex(i).GetPath(path, sizeof(path)))
 | 
			
		||||
        strm.Printf("\n    %s", path);
 | 
			
		||||
    }
 | 
			
		||||
  } else
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,15 +18,15 @@
 | 
			
		|||
using namespace lldb;
 | 
			
		||||
using namespace lldb_private;
 | 
			
		||||
 | 
			
		||||
SBLineEntry::SBLineEntry() : m_opaque_ap() {}
 | 
			
		||||
SBLineEntry::SBLineEntry() : m_opaque_up() {}
 | 
			
		||||
 | 
			
		||||
SBLineEntry::SBLineEntry(const SBLineEntry &rhs) : m_opaque_ap() {
 | 
			
		||||
SBLineEntry::SBLineEntry(const SBLineEntry &rhs) : m_opaque_up() {
 | 
			
		||||
  if (rhs.IsValid())
 | 
			
		||||
    ref() = rhs.ref();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBLineEntry::SBLineEntry(const lldb_private::LineEntry *lldb_object_ptr)
 | 
			
		||||
    : m_opaque_ap() {
 | 
			
		||||
    : m_opaque_up() {
 | 
			
		||||
  if (lldb_object_ptr)
 | 
			
		||||
    ref() = *lldb_object_ptr;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -36,7 +36,7 @@ const SBLineEntry &SBLineEntry::operator=(const SBLineEntry &rhs) {
 | 
			
		|||
    if (rhs.IsValid())
 | 
			
		||||
      ref() = rhs.ref();
 | 
			
		||||
    else
 | 
			
		||||
      m_opaque_ap.reset();
 | 
			
		||||
      m_opaque_up.reset();
 | 
			
		||||
  }
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -49,8 +49,8 @@ SBLineEntry::~SBLineEntry() {}
 | 
			
		|||
 | 
			
		||||
SBAddress SBLineEntry::GetStartAddress() const {
 | 
			
		||||
  SBAddress sb_address;
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    sb_address.SetAddress(&m_opaque_ap->range.GetBaseAddress());
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    sb_address.SetAddress(&m_opaque_up->range.GetBaseAddress());
 | 
			
		||||
 | 
			
		||||
  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 | 
			
		||||
  if (log) {
 | 
			
		||||
| 
						 | 
				
			
			@ -60,7 +60,7 @@ SBAddress SBLineEntry::GetStartAddress() const {
 | 
			
		|||
      addr->Dump(&sstr, NULL, Address::DumpStyleModuleWithFileAddress,
 | 
			
		||||
                 Address::DumpStyleInvalid, 4);
 | 
			
		||||
    log->Printf("SBLineEntry(%p)::GetStartAddress () => SBAddress (%p): %s",
 | 
			
		||||
                static_cast<void *>(m_opaque_ap.get()),
 | 
			
		||||
                static_cast<void *>(m_opaque_up.get()),
 | 
			
		||||
                static_cast<void *>(sb_address.get()), sstr.GetData());
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -69,9 +69,9 @@ SBAddress SBLineEntry::GetStartAddress() const {
 | 
			
		|||
 | 
			
		||||
SBAddress SBLineEntry::GetEndAddress() const {
 | 
			
		||||
  SBAddress sb_address;
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
    sb_address.SetAddress(&m_opaque_ap->range.GetBaseAddress());
 | 
			
		||||
    sb_address.OffsetAddress(m_opaque_ap->range.GetByteSize());
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    sb_address.SetAddress(&m_opaque_up->range.GetBaseAddress());
 | 
			
		||||
    sb_address.OffsetAddress(m_opaque_up->range.GetByteSize());
 | 
			
		||||
  }
 | 
			
		||||
  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 | 
			
		||||
  if (log) {
 | 
			
		||||
| 
						 | 
				
			
			@ -81,28 +81,28 @@ SBAddress SBLineEntry::GetEndAddress() const {
 | 
			
		|||
      addr->Dump(&sstr, NULL, Address::DumpStyleModuleWithFileAddress,
 | 
			
		||||
                 Address::DumpStyleInvalid, 4);
 | 
			
		||||
    log->Printf("SBLineEntry(%p)::GetEndAddress () => SBAddress (%p): %s",
 | 
			
		||||
                static_cast<void *>(m_opaque_ap.get()),
 | 
			
		||||
                static_cast<void *>(m_opaque_up.get()),
 | 
			
		||||
                static_cast<void *>(sb_address.get()), sstr.GetData());
 | 
			
		||||
  }
 | 
			
		||||
  return sb_address;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBLineEntry::IsValid() const {
 | 
			
		||||
  return m_opaque_ap.get() && m_opaque_ap->IsValid();
 | 
			
		||||
  return m_opaque_up.get() && m_opaque_up->IsValid();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBFileSpec SBLineEntry::GetFileSpec() const {
 | 
			
		||||
  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 | 
			
		||||
 | 
			
		||||
  SBFileSpec sb_file_spec;
 | 
			
		||||
  if (m_opaque_ap.get() && m_opaque_ap->file)
 | 
			
		||||
    sb_file_spec.SetFileSpec(m_opaque_ap->file);
 | 
			
		||||
  if (m_opaque_up.get() && m_opaque_up->file)
 | 
			
		||||
    sb_file_spec.SetFileSpec(m_opaque_up->file);
 | 
			
		||||
 | 
			
		||||
  if (log) {
 | 
			
		||||
    SBStream sstr;
 | 
			
		||||
    sb_file_spec.GetDescription(sstr);
 | 
			
		||||
    log->Printf("SBLineEntry(%p)::GetFileSpec () => SBFileSpec(%p): %s",
 | 
			
		||||
                static_cast<void *>(m_opaque_ap.get()),
 | 
			
		||||
                static_cast<void *>(m_opaque_up.get()),
 | 
			
		||||
                static_cast<const void *>(sb_file_spec.get()), sstr.GetData());
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -113,19 +113,19 @@ uint32_t SBLineEntry::GetLine() const {
 | 
			
		|||
  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 | 
			
		||||
 | 
			
		||||
  uint32_t line = 0;
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    line = m_opaque_ap->line;
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    line = m_opaque_up->line;
 | 
			
		||||
 | 
			
		||||
  if (log)
 | 
			
		||||
    log->Printf("SBLineEntry(%p)::GetLine () => %u",
 | 
			
		||||
                static_cast<void *>(m_opaque_ap.get()), line);
 | 
			
		||||
                static_cast<void *>(m_opaque_up.get()), line);
 | 
			
		||||
 | 
			
		||||
  return line;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint32_t SBLineEntry::GetColumn() const {
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    return m_opaque_ap->column;
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    return m_opaque_up->column;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -140,8 +140,8 @@ void SBLineEntry::SetLine(uint32_t line) { ref().line = line; }
 | 
			
		|||
void SBLineEntry::SetColumn(uint32_t column) { ref().line = column; }
 | 
			
		||||
 | 
			
		||||
bool SBLineEntry::operator==(const SBLineEntry &rhs) const {
 | 
			
		||||
  lldb_private::LineEntry *lhs_ptr = m_opaque_ap.get();
 | 
			
		||||
  lldb_private::LineEntry *rhs_ptr = rhs.m_opaque_ap.get();
 | 
			
		||||
  lldb_private::LineEntry *lhs_ptr = m_opaque_up.get();
 | 
			
		||||
  lldb_private::LineEntry *rhs_ptr = rhs.m_opaque_up.get();
 | 
			
		||||
 | 
			
		||||
  if (lhs_ptr && rhs_ptr)
 | 
			
		||||
    return lldb_private::LineEntry::Compare(*lhs_ptr, *rhs_ptr) == 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -150,8 +150,8 @@ bool SBLineEntry::operator==(const SBLineEntry &rhs) const {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
bool SBLineEntry::operator!=(const SBLineEntry &rhs) const {
 | 
			
		||||
  lldb_private::LineEntry *lhs_ptr = m_opaque_ap.get();
 | 
			
		||||
  lldb_private::LineEntry *rhs_ptr = rhs.m_opaque_ap.get();
 | 
			
		||||
  lldb_private::LineEntry *lhs_ptr = m_opaque_up.get();
 | 
			
		||||
  lldb_private::LineEntry *rhs_ptr = rhs.m_opaque_up.get();
 | 
			
		||||
 | 
			
		||||
  if (lhs_ptr && rhs_ptr)
 | 
			
		||||
    return lldb_private::LineEntry::Compare(*lhs_ptr, *rhs_ptr) != 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -160,23 +160,23 @@ bool SBLineEntry::operator!=(const SBLineEntry &rhs) const {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
const lldb_private::LineEntry *SBLineEntry::operator->() const {
 | 
			
		||||
  return m_opaque_ap.get();
 | 
			
		||||
  return m_opaque_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lldb_private::LineEntry &SBLineEntry::ref() {
 | 
			
		||||
  if (m_opaque_ap == NULL)
 | 
			
		||||
    m_opaque_ap.reset(new lldb_private::LineEntry());
 | 
			
		||||
  return *m_opaque_ap;
 | 
			
		||||
  if (m_opaque_up == NULL)
 | 
			
		||||
    m_opaque_up.reset(new lldb_private::LineEntry());
 | 
			
		||||
  return *m_opaque_up;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const lldb_private::LineEntry &SBLineEntry::ref() const { return *m_opaque_ap; }
 | 
			
		||||
const lldb_private::LineEntry &SBLineEntry::ref() const { return *m_opaque_up; }
 | 
			
		||||
 | 
			
		||||
bool SBLineEntry::GetDescription(SBStream &description) {
 | 
			
		||||
  Stream &strm = description.ref();
 | 
			
		||||
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    char file_path[PATH_MAX * 2];
 | 
			
		||||
    m_opaque_ap->file.GetPath(file_path, sizeof(file_path));
 | 
			
		||||
    m_opaque_up->file.GetPath(file_path, sizeof(file_path));
 | 
			
		||||
    strm.Printf("%s:%u", file_path, GetLine());
 | 
			
		||||
    if (GetColumn() > 0)
 | 
			
		||||
      strm.Printf(":%u", GetColumn());
 | 
			
		||||
| 
						 | 
				
			
			@ -186,4 +186,4 @@ bool SBLineEntry::GetDescription(SBStream &description) {
 | 
			
		|||
  return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lldb_private::LineEntry *SBLineEntry::get() { return m_opaque_ap.get(); }
 | 
			
		||||
lldb_private::LineEntry *SBLineEntry::get() { return m_opaque_up.get(); }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -17,16 +17,16 @@ using namespace lldb;
 | 
			
		|||
using namespace lldb_private;
 | 
			
		||||
 | 
			
		||||
SBMemoryRegionInfo::SBMemoryRegionInfo()
 | 
			
		||||
    : m_opaque_ap(new MemoryRegionInfo()) {}
 | 
			
		||||
    : m_opaque_up(new MemoryRegionInfo()) {}
 | 
			
		||||
 | 
			
		||||
SBMemoryRegionInfo::SBMemoryRegionInfo(const MemoryRegionInfo *lldb_object_ptr)
 | 
			
		||||
    : m_opaque_ap(new MemoryRegionInfo()) {
 | 
			
		||||
    : m_opaque_up(new MemoryRegionInfo()) {
 | 
			
		||||
  if (lldb_object_ptr)
 | 
			
		||||
    ref() = *lldb_object_ptr;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBMemoryRegionInfo::SBMemoryRegionInfo(const SBMemoryRegionInfo &rhs)
 | 
			
		||||
    : m_opaque_ap(new MemoryRegionInfo()) {
 | 
			
		||||
    : m_opaque_up(new MemoryRegionInfo()) {
 | 
			
		||||
  ref() = rhs.ref();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -40,7 +40,7 @@ operator=(const SBMemoryRegionInfo &rhs) {
 | 
			
		|||
 | 
			
		||||
SBMemoryRegionInfo::~SBMemoryRegionInfo() {}
 | 
			
		||||
 | 
			
		||||
void SBMemoryRegionInfo::Clear() { m_opaque_ap->Clear(); }
 | 
			
		||||
void SBMemoryRegionInfo::Clear() { m_opaque_up->Clear(); }
 | 
			
		||||
 | 
			
		||||
bool SBMemoryRegionInfo::operator==(const SBMemoryRegionInfo &rhs) const {
 | 
			
		||||
  return ref() == rhs.ref();
 | 
			
		||||
| 
						 | 
				
			
			@ -50,47 +50,47 @@ bool SBMemoryRegionInfo::operator!=(const SBMemoryRegionInfo &rhs) const {
 | 
			
		|||
  return ref() != rhs.ref();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
MemoryRegionInfo &SBMemoryRegionInfo::ref() { return *m_opaque_ap; }
 | 
			
		||||
MemoryRegionInfo &SBMemoryRegionInfo::ref() { return *m_opaque_up; }
 | 
			
		||||
 | 
			
		||||
const MemoryRegionInfo &SBMemoryRegionInfo::ref() const { return *m_opaque_ap; }
 | 
			
		||||
const MemoryRegionInfo &SBMemoryRegionInfo::ref() const { return *m_opaque_up; }
 | 
			
		||||
 | 
			
		||||
lldb::addr_t SBMemoryRegionInfo::GetRegionBase() {
 | 
			
		||||
  return m_opaque_ap->GetRange().GetRangeBase();
 | 
			
		||||
  return m_opaque_up->GetRange().GetRangeBase();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lldb::addr_t SBMemoryRegionInfo::GetRegionEnd() {
 | 
			
		||||
  return m_opaque_ap->GetRange().GetRangeEnd();
 | 
			
		||||
  return m_opaque_up->GetRange().GetRangeEnd();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBMemoryRegionInfo::IsReadable() {
 | 
			
		||||
  return m_opaque_ap->GetReadable() == MemoryRegionInfo::eYes;
 | 
			
		||||
  return m_opaque_up->GetReadable() == MemoryRegionInfo::eYes;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBMemoryRegionInfo::IsWritable() {
 | 
			
		||||
  return m_opaque_ap->GetWritable() == MemoryRegionInfo::eYes;
 | 
			
		||||
  return m_opaque_up->GetWritable() == MemoryRegionInfo::eYes;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBMemoryRegionInfo::IsExecutable() {
 | 
			
		||||
  return m_opaque_ap->GetExecutable() == MemoryRegionInfo::eYes;
 | 
			
		||||
  return m_opaque_up->GetExecutable() == MemoryRegionInfo::eYes;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBMemoryRegionInfo::IsMapped() {
 | 
			
		||||
  return m_opaque_ap->GetMapped() == MemoryRegionInfo::eYes;
 | 
			
		||||
  return m_opaque_up->GetMapped() == MemoryRegionInfo::eYes;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const char *SBMemoryRegionInfo::GetName() {
 | 
			
		||||
  return m_opaque_ap->GetName().AsCString();
 | 
			
		||||
  return m_opaque_up->GetName().AsCString();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBMemoryRegionInfo::GetDescription(SBStream &description) {
 | 
			
		||||
  Stream &strm = description.ref();
 | 
			
		||||
  const addr_t load_addr = m_opaque_ap->GetRange().base;
 | 
			
		||||
  const addr_t load_addr = m_opaque_up->GetRange().base;
 | 
			
		||||
 | 
			
		||||
  strm.Printf("[0x%16.16" PRIx64 "-0x%16.16" PRIx64 " ", load_addr,
 | 
			
		||||
              load_addr + m_opaque_ap->GetRange().size);
 | 
			
		||||
  strm.Printf(m_opaque_ap->GetReadable() ? "R" : "-");
 | 
			
		||||
  strm.Printf(m_opaque_ap->GetWritable() ? "W" : "-");
 | 
			
		||||
  strm.Printf(m_opaque_ap->GetExecutable() ? "X" : "-");
 | 
			
		||||
              load_addr + m_opaque_up->GetRange().size);
 | 
			
		||||
  strm.Printf(m_opaque_up->GetReadable() ? "R" : "-");
 | 
			
		||||
  strm.Printf(m_opaque_up->GetWritable() ? "W" : "-");
 | 
			
		||||
  strm.Printf(m_opaque_up->GetExecutable() ? "X" : "-");
 | 
			
		||||
  strm.Printf("]");
 | 
			
		||||
 | 
			
		||||
  return true;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -64,69 +64,67 @@ private:
 | 
			
		|||
  MemoryRegionInfos m_regions;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
MemoryRegionInfos &SBMemoryRegionInfoList::ref() {
 | 
			
		||||
  return m_opaque_ap->Ref();
 | 
			
		||||
}
 | 
			
		||||
MemoryRegionInfos &SBMemoryRegionInfoList::ref() { return m_opaque_up->Ref(); }
 | 
			
		||||
 | 
			
		||||
const MemoryRegionInfos &SBMemoryRegionInfoList::ref() const {
 | 
			
		||||
  return m_opaque_ap->Ref();
 | 
			
		||||
  return m_opaque_up->Ref();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBMemoryRegionInfoList::SBMemoryRegionInfoList()
 | 
			
		||||
    : m_opaque_ap(new MemoryRegionInfoListImpl()) {}
 | 
			
		||||
    : m_opaque_up(new MemoryRegionInfoListImpl()) {}
 | 
			
		||||
 | 
			
		||||
SBMemoryRegionInfoList::SBMemoryRegionInfoList(
 | 
			
		||||
    const SBMemoryRegionInfoList &rhs)
 | 
			
		||||
    : m_opaque_ap(new MemoryRegionInfoListImpl(*rhs.m_opaque_ap)) {}
 | 
			
		||||
    : m_opaque_up(new MemoryRegionInfoListImpl(*rhs.m_opaque_up)) {}
 | 
			
		||||
 | 
			
		||||
SBMemoryRegionInfoList::~SBMemoryRegionInfoList() {}
 | 
			
		||||
 | 
			
		||||
const SBMemoryRegionInfoList &SBMemoryRegionInfoList::
 | 
			
		||||
operator=(const SBMemoryRegionInfoList &rhs) {
 | 
			
		||||
  if (this != &rhs) {
 | 
			
		||||
    *m_opaque_ap = *rhs.m_opaque_ap;
 | 
			
		||||
    *m_opaque_up = *rhs.m_opaque_up;
 | 
			
		||||
  }
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint32_t SBMemoryRegionInfoList::GetSize() const {
 | 
			
		||||
  return m_opaque_ap->GetSize();
 | 
			
		||||
  return m_opaque_up->GetSize();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBMemoryRegionInfoList::GetMemoryRegionAtIndex(
 | 
			
		||||
    uint32_t idx, SBMemoryRegionInfo ®ion_info) {
 | 
			
		||||
  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 | 
			
		||||
 | 
			
		||||
  bool result = m_opaque_ap->GetMemoryRegionInfoAtIndex(idx, region_info.ref());
 | 
			
		||||
  bool result = m_opaque_up->GetMemoryRegionInfoAtIndex(idx, region_info.ref());
 | 
			
		||||
 | 
			
		||||
  if (log) {
 | 
			
		||||
    SBStream sstr;
 | 
			
		||||
    region_info.GetDescription(sstr);
 | 
			
		||||
    log->Printf("SBMemoryRegionInfoList::GetMemoryRegionAtIndex (this.ap=%p, "
 | 
			
		||||
                "idx=%d) => SBMemoryRegionInfo (this.ap=%p, '%s')",
 | 
			
		||||
                static_cast<void *>(m_opaque_ap.get()), idx,
 | 
			
		||||
                static_cast<void *>(region_info.m_opaque_ap.get()),
 | 
			
		||||
                static_cast<void *>(m_opaque_up.get()), idx,
 | 
			
		||||
                static_cast<void *>(region_info.m_opaque_up.get()),
 | 
			
		||||
                sstr.GetData());
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return result;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBMemoryRegionInfoList::Clear() { m_opaque_ap->Clear(); }
 | 
			
		||||
void SBMemoryRegionInfoList::Clear() { m_opaque_up->Clear(); }
 | 
			
		||||
 | 
			
		||||
void SBMemoryRegionInfoList::Append(SBMemoryRegionInfo &sb_region) {
 | 
			
		||||
  m_opaque_ap->Append(sb_region.ref());
 | 
			
		||||
  m_opaque_up->Append(sb_region.ref());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBMemoryRegionInfoList::Append(SBMemoryRegionInfoList &sb_region_list) {
 | 
			
		||||
  m_opaque_ap->Append(*sb_region_list);
 | 
			
		||||
  m_opaque_up->Append(*sb_region_list);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const MemoryRegionInfoListImpl *SBMemoryRegionInfoList::operator->() const {
 | 
			
		||||
  return m_opaque_ap.get();
 | 
			
		||||
  return m_opaque_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const MemoryRegionInfoListImpl &SBMemoryRegionInfoList::operator*() const {
 | 
			
		||||
  assert(m_opaque_ap.get());
 | 
			
		||||
  return *m_opaque_ap;
 | 
			
		||||
  assert(m_opaque_up.get());
 | 
			
		||||
  return *m_opaque_up;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -36,7 +36,7 @@ SBModule::SBModule(const lldb::ModuleSP &module_sp) : m_opaque_sp(module_sp) {}
 | 
			
		|||
 | 
			
		||||
SBModule::SBModule(const SBModuleSpec &module_spec) : m_opaque_sp() {
 | 
			
		||||
  ModuleSP module_sp;
 | 
			
		||||
  Status error = ModuleList::GetSharedModule(*module_spec.m_opaque_ap,
 | 
			
		||||
  Status error = ModuleList::GetSharedModule(*module_spec.m_opaque_up,
 | 
			
		||||
                                             module_sp, NULL, NULL, NULL);
 | 
			
		||||
  if (module_sp)
 | 
			
		||||
    SetSP(module_sp);
 | 
			
		||||
| 
						 | 
				
			
			@ -492,7 +492,7 @@ lldb::SBTypeList SBModule::GetTypes(uint32_t type_mask) {
 | 
			
		|||
  TypeClass type_class = static_cast<TypeClass>(type_mask);
 | 
			
		||||
  TypeList type_list;
 | 
			
		||||
  vendor->GetTypes(NULL, type_class, type_list);
 | 
			
		||||
  sb_type_list.m_opaque_ap->Append(type_list);
 | 
			
		||||
  sb_type_list.m_opaque_up->Append(type_list);
 | 
			
		||||
  return sb_type_list;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -17,58 +17,58 @@
 | 
			
		|||
using namespace lldb;
 | 
			
		||||
using namespace lldb_private;
 | 
			
		||||
 | 
			
		||||
SBModuleSpec::SBModuleSpec() : m_opaque_ap(new lldb_private::ModuleSpec()) {}
 | 
			
		||||
SBModuleSpec::SBModuleSpec() : m_opaque_up(new lldb_private::ModuleSpec()) {}
 | 
			
		||||
 | 
			
		||||
SBModuleSpec::SBModuleSpec(const SBModuleSpec &rhs)
 | 
			
		||||
    : m_opaque_ap(new lldb_private::ModuleSpec(*rhs.m_opaque_ap)) {}
 | 
			
		||||
    : m_opaque_up(new lldb_private::ModuleSpec(*rhs.m_opaque_up)) {}
 | 
			
		||||
 | 
			
		||||
const SBModuleSpec &SBModuleSpec::operator=(const SBModuleSpec &rhs) {
 | 
			
		||||
  if (this != &rhs)
 | 
			
		||||
    *m_opaque_ap = *(rhs.m_opaque_ap);
 | 
			
		||||
    *m_opaque_up = *(rhs.m_opaque_up);
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBModuleSpec::~SBModuleSpec() {}
 | 
			
		||||
 | 
			
		||||
bool SBModuleSpec::IsValid() const { return m_opaque_ap->operator bool(); }
 | 
			
		||||
bool SBModuleSpec::IsValid() const { return m_opaque_up->operator bool(); }
 | 
			
		||||
 | 
			
		||||
void SBModuleSpec::Clear() { m_opaque_ap->Clear(); }
 | 
			
		||||
void SBModuleSpec::Clear() { m_opaque_up->Clear(); }
 | 
			
		||||
 | 
			
		||||
SBFileSpec SBModuleSpec::GetFileSpec() {
 | 
			
		||||
  SBFileSpec sb_spec(m_opaque_ap->GetFileSpec());
 | 
			
		||||
  SBFileSpec sb_spec(m_opaque_up->GetFileSpec());
 | 
			
		||||
  return sb_spec;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBModuleSpec::SetFileSpec(const lldb::SBFileSpec &sb_spec) {
 | 
			
		||||
  m_opaque_ap->GetFileSpec() = *sb_spec;
 | 
			
		||||
  m_opaque_up->GetFileSpec() = *sb_spec;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lldb::SBFileSpec SBModuleSpec::GetPlatformFileSpec() {
 | 
			
		||||
  return SBFileSpec(m_opaque_ap->GetPlatformFileSpec());
 | 
			
		||||
  return SBFileSpec(m_opaque_up->GetPlatformFileSpec());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBModuleSpec::SetPlatformFileSpec(const lldb::SBFileSpec &sb_spec) {
 | 
			
		||||
  m_opaque_ap->GetPlatformFileSpec() = *sb_spec;
 | 
			
		||||
  m_opaque_up->GetPlatformFileSpec() = *sb_spec;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lldb::SBFileSpec SBModuleSpec::GetSymbolFileSpec() {
 | 
			
		||||
  return SBFileSpec(m_opaque_ap->GetSymbolFileSpec());
 | 
			
		||||
  return SBFileSpec(m_opaque_up->GetSymbolFileSpec());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBModuleSpec::SetSymbolFileSpec(const lldb::SBFileSpec &sb_spec) {
 | 
			
		||||
  m_opaque_ap->GetSymbolFileSpec() = *sb_spec;
 | 
			
		||||
  m_opaque_up->GetSymbolFileSpec() = *sb_spec;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const char *SBModuleSpec::GetObjectName() {
 | 
			
		||||
  return m_opaque_ap->GetObjectName().GetCString();
 | 
			
		||||
  return m_opaque_up->GetObjectName().GetCString();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBModuleSpec::SetObjectName(const char *name) {
 | 
			
		||||
  m_opaque_ap->GetObjectName().SetCString(name);
 | 
			
		||||
  m_opaque_up->GetObjectName().SetCString(name);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const char *SBModuleSpec::GetTriple() {
 | 
			
		||||
  std::string triple(m_opaque_ap->GetArchitecture().GetTriple().str());
 | 
			
		||||
  std::string triple(m_opaque_up->GetArchitecture().GetTriple().str());
 | 
			
		||||
  // Unique the string so we don't run into ownership issues since the const
 | 
			
		||||
  // strings put the string into the string pool once and the strings never
 | 
			
		||||
  // comes out
 | 
			
		||||
| 
						 | 
				
			
			@ -77,35 +77,35 @@ const char *SBModuleSpec::GetTriple() {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
void SBModuleSpec::SetTriple(const char *triple) {
 | 
			
		||||
  m_opaque_ap->GetArchitecture().SetTriple(triple);
 | 
			
		||||
  m_opaque_up->GetArchitecture().SetTriple(triple);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const uint8_t *SBModuleSpec::GetUUIDBytes() {
 | 
			
		||||
  return m_opaque_ap->GetUUID().GetBytes().data();
 | 
			
		||||
  return m_opaque_up->GetUUID().GetBytes().data();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
size_t SBModuleSpec::GetUUIDLength() {
 | 
			
		||||
  return m_opaque_ap->GetUUID().GetBytes().size();
 | 
			
		||||
  return m_opaque_up->GetUUID().GetBytes().size();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBModuleSpec::SetUUIDBytes(const uint8_t *uuid, size_t uuid_len) {
 | 
			
		||||
  m_opaque_ap->GetUUID() = UUID::fromOptionalData(uuid, uuid_len);
 | 
			
		||||
  return m_opaque_ap->GetUUID().IsValid();
 | 
			
		||||
  m_opaque_up->GetUUID() = UUID::fromOptionalData(uuid, uuid_len);
 | 
			
		||||
  return m_opaque_up->GetUUID().IsValid();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBModuleSpec::GetDescription(lldb::SBStream &description) {
 | 
			
		||||
  m_opaque_ap->Dump(description.ref());
 | 
			
		||||
  m_opaque_up->Dump(description.ref());
 | 
			
		||||
  return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBModuleSpecList::SBModuleSpecList() : m_opaque_ap(new ModuleSpecList()) {}
 | 
			
		||||
SBModuleSpecList::SBModuleSpecList() : m_opaque_up(new ModuleSpecList()) {}
 | 
			
		||||
 | 
			
		||||
SBModuleSpecList::SBModuleSpecList(const SBModuleSpecList &rhs)
 | 
			
		||||
    : m_opaque_ap(new ModuleSpecList(*rhs.m_opaque_ap)) {}
 | 
			
		||||
    : m_opaque_up(new ModuleSpecList(*rhs.m_opaque_up)) {}
 | 
			
		||||
 | 
			
		||||
SBModuleSpecList &SBModuleSpecList::operator=(const SBModuleSpecList &rhs) {
 | 
			
		||||
  if (this != &rhs)
 | 
			
		||||
    *m_opaque_ap = *rhs.m_opaque_ap;
 | 
			
		||||
    *m_opaque_up = *rhs.m_opaque_up;
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -116,43 +116,43 @@ SBModuleSpecList SBModuleSpecList::GetModuleSpecifications(const char *path) {
 | 
			
		|||
  FileSpec file_spec(path);
 | 
			
		||||
  FileSystem::Instance().Resolve(file_spec);
 | 
			
		||||
  Host::ResolveExecutableInBundle(file_spec);
 | 
			
		||||
  ObjectFile::GetModuleSpecifications(file_spec, 0, 0, *specs.m_opaque_ap);
 | 
			
		||||
  ObjectFile::GetModuleSpecifications(file_spec, 0, 0, *specs.m_opaque_up);
 | 
			
		||||
  return specs;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBModuleSpecList::Append(const SBModuleSpec &spec) {
 | 
			
		||||
  m_opaque_ap->Append(*spec.m_opaque_ap);
 | 
			
		||||
  m_opaque_up->Append(*spec.m_opaque_up);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBModuleSpecList::Append(const SBModuleSpecList &spec_list) {
 | 
			
		||||
  m_opaque_ap->Append(*spec_list.m_opaque_ap);
 | 
			
		||||
  m_opaque_up->Append(*spec_list.m_opaque_up);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
size_t SBModuleSpecList::GetSize() { return m_opaque_ap->GetSize(); }
 | 
			
		||||
size_t SBModuleSpecList::GetSize() { return m_opaque_up->GetSize(); }
 | 
			
		||||
 | 
			
		||||
SBModuleSpec SBModuleSpecList::GetSpecAtIndex(size_t i) {
 | 
			
		||||
  SBModuleSpec sb_module_spec;
 | 
			
		||||
  m_opaque_ap->GetModuleSpecAtIndex(i, *sb_module_spec.m_opaque_ap);
 | 
			
		||||
  m_opaque_up->GetModuleSpecAtIndex(i, *sb_module_spec.m_opaque_up);
 | 
			
		||||
  return sb_module_spec;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBModuleSpec
 | 
			
		||||
SBModuleSpecList::FindFirstMatchingSpec(const SBModuleSpec &match_spec) {
 | 
			
		||||
  SBModuleSpec sb_module_spec;
 | 
			
		||||
  m_opaque_ap->FindMatchingModuleSpec(*match_spec.m_opaque_ap,
 | 
			
		||||
                                      *sb_module_spec.m_opaque_ap);
 | 
			
		||||
  m_opaque_up->FindMatchingModuleSpec(*match_spec.m_opaque_up,
 | 
			
		||||
                                      *sb_module_spec.m_opaque_up);
 | 
			
		||||
  return sb_module_spec;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBModuleSpecList
 | 
			
		||||
SBModuleSpecList::FindMatchingSpecs(const SBModuleSpec &match_spec) {
 | 
			
		||||
  SBModuleSpecList specs;
 | 
			
		||||
  m_opaque_ap->FindMatchingModuleSpecs(*match_spec.m_opaque_ap,
 | 
			
		||||
                                       *specs.m_opaque_ap);
 | 
			
		||||
  m_opaque_up->FindMatchingModuleSpecs(*match_spec.m_opaque_up,
 | 
			
		||||
                                       *specs.m_opaque_up);
 | 
			
		||||
  return specs;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBModuleSpecList::GetDescription(lldb::SBStream &description) {
 | 
			
		||||
  m_opaque_ap->Dump(description.ref());
 | 
			
		||||
  m_opaque_up->Dump(description.ref());
 | 
			
		||||
  return true;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,11 +14,11 @@
 | 
			
		|||
using namespace lldb;
 | 
			
		||||
using namespace lldb_private;
 | 
			
		||||
 | 
			
		||||
SBProcessInfo::SBProcessInfo() : m_opaque_ap() {}
 | 
			
		||||
SBProcessInfo::SBProcessInfo() : m_opaque_up() {}
 | 
			
		||||
 | 
			
		||||
SBProcessInfo::SBProcessInfo(const SBProcessInfo &rhs) : m_opaque_ap() {
 | 
			
		||||
SBProcessInfo::SBProcessInfo(const SBProcessInfo &rhs) : m_opaque_up() {
 | 
			
		||||
  if (rhs.IsValid()) {
 | 
			
		||||
    ref() = *rhs.m_opaque_ap;
 | 
			
		||||
    ref() = *rhs.m_opaque_up;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -27,118 +27,118 @@ SBProcessInfo::~SBProcessInfo() {}
 | 
			
		|||
SBProcessInfo &SBProcessInfo::operator=(const SBProcessInfo &rhs) {
 | 
			
		||||
  if (this != &rhs) {
 | 
			
		||||
    if (rhs.IsValid())
 | 
			
		||||
      ref() = *rhs.m_opaque_ap;
 | 
			
		||||
      ref() = *rhs.m_opaque_up;
 | 
			
		||||
    else
 | 
			
		||||
      m_opaque_ap.reset();
 | 
			
		||||
      m_opaque_up.reset();
 | 
			
		||||
  }
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ProcessInstanceInfo &SBProcessInfo::ref() {
 | 
			
		||||
  if (m_opaque_ap == nullptr) {
 | 
			
		||||
    m_opaque_ap.reset(new ProcessInstanceInfo());
 | 
			
		||||
  if (m_opaque_up == nullptr) {
 | 
			
		||||
    m_opaque_up.reset(new ProcessInstanceInfo());
 | 
			
		||||
  }
 | 
			
		||||
  return *m_opaque_ap;
 | 
			
		||||
  return *m_opaque_up;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBProcessInfo::SetProcessInfo(const ProcessInstanceInfo &proc_info_ref) {
 | 
			
		||||
  ref() = proc_info_ref;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBProcessInfo::IsValid() const { return m_opaque_ap != nullptr; }
 | 
			
		||||
bool SBProcessInfo::IsValid() const { return m_opaque_up != nullptr; }
 | 
			
		||||
 | 
			
		||||
const char *SBProcessInfo::GetName() {
 | 
			
		||||
  const char *name = nullptr;
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
    name = m_opaque_ap->GetName();
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    name = m_opaque_up->GetName();
 | 
			
		||||
  }
 | 
			
		||||
  return name;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBFileSpec SBProcessInfo::GetExecutableFile() {
 | 
			
		||||
  SBFileSpec file_spec;
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
    file_spec.SetFileSpec(m_opaque_ap->GetExecutableFile());
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    file_spec.SetFileSpec(m_opaque_up->GetExecutableFile());
 | 
			
		||||
  }
 | 
			
		||||
  return file_spec;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lldb::pid_t SBProcessInfo::GetProcessID() {
 | 
			
		||||
  lldb::pid_t proc_id = LLDB_INVALID_PROCESS_ID;
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
    proc_id = m_opaque_ap->GetProcessID();
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    proc_id = m_opaque_up->GetProcessID();
 | 
			
		||||
  }
 | 
			
		||||
  return proc_id;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint32_t SBProcessInfo::GetUserID() {
 | 
			
		||||
  uint32_t user_id = UINT32_MAX;
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
    user_id = m_opaque_ap->GetUserID();
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    user_id = m_opaque_up->GetUserID();
 | 
			
		||||
  }
 | 
			
		||||
  return user_id;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint32_t SBProcessInfo::GetGroupID() {
 | 
			
		||||
  uint32_t group_id = UINT32_MAX;
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
    group_id = m_opaque_ap->GetGroupID();
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    group_id = m_opaque_up->GetGroupID();
 | 
			
		||||
  }
 | 
			
		||||
  return group_id;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBProcessInfo::UserIDIsValid() {
 | 
			
		||||
  bool is_valid = false;
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
    is_valid = m_opaque_ap->UserIDIsValid();
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    is_valid = m_opaque_up->UserIDIsValid();
 | 
			
		||||
  }
 | 
			
		||||
  return is_valid;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBProcessInfo::GroupIDIsValid() {
 | 
			
		||||
  bool is_valid = false;
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
    is_valid = m_opaque_ap->GroupIDIsValid();
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    is_valid = m_opaque_up->GroupIDIsValid();
 | 
			
		||||
  }
 | 
			
		||||
  return is_valid;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint32_t SBProcessInfo::GetEffectiveUserID() {
 | 
			
		||||
  uint32_t user_id = UINT32_MAX;
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
    user_id = m_opaque_ap->GetEffectiveUserID();
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    user_id = m_opaque_up->GetEffectiveUserID();
 | 
			
		||||
  }
 | 
			
		||||
  return user_id;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint32_t SBProcessInfo::GetEffectiveGroupID() {
 | 
			
		||||
  uint32_t group_id = UINT32_MAX;
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
    group_id = m_opaque_ap->GetEffectiveGroupID();
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    group_id = m_opaque_up->GetEffectiveGroupID();
 | 
			
		||||
  }
 | 
			
		||||
  return group_id;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBProcessInfo::EffectiveUserIDIsValid() {
 | 
			
		||||
  bool is_valid = false;
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
    is_valid = m_opaque_ap->EffectiveUserIDIsValid();
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    is_valid = m_opaque_up->EffectiveUserIDIsValid();
 | 
			
		||||
  }
 | 
			
		||||
  return is_valid;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBProcessInfo::EffectiveGroupIDIsValid() {
 | 
			
		||||
  bool is_valid = false;
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
    is_valid = m_opaque_ap->EffectiveGroupIDIsValid();
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    is_valid = m_opaque_up->EffectiveGroupIDIsValid();
 | 
			
		||||
  }
 | 
			
		||||
  return is_valid;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lldb::pid_t SBProcessInfo::GetParentProcessID() {
 | 
			
		||||
  lldb::pid_t proc_id = LLDB_INVALID_PROCESS_ID;
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
    proc_id = m_opaque_ap->GetParentProcessID();
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    proc_id = m_opaque_up->GetParentProcessID();
 | 
			
		||||
  }
 | 
			
		||||
  return proc_id;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -71,23 +71,23 @@ using namespace lldb;
 | 
			
		|||
using namespace lldb_private;
 | 
			
		||||
 | 
			
		||||
SBSourceManager::SBSourceManager(const SBDebugger &debugger) {
 | 
			
		||||
  m_opaque_ap.reset(new SourceManagerImpl(debugger.get_sp()));
 | 
			
		||||
  m_opaque_up.reset(new SourceManagerImpl(debugger.get_sp()));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBSourceManager::SBSourceManager(const SBTarget &target) {
 | 
			
		||||
  m_opaque_ap.reset(new SourceManagerImpl(target.GetSP()));
 | 
			
		||||
  m_opaque_up.reset(new SourceManagerImpl(target.GetSP()));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBSourceManager::SBSourceManager(const SBSourceManager &rhs) {
 | 
			
		||||
  if (&rhs == this)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  m_opaque_ap.reset(new SourceManagerImpl(*(rhs.m_opaque_ap.get())));
 | 
			
		||||
  m_opaque_up.reset(new SourceManagerImpl(*(rhs.m_opaque_up.get())));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const lldb::SBSourceManager &SBSourceManager::
 | 
			
		||||
operator=(const lldb::SBSourceManager &rhs) {
 | 
			
		||||
  m_opaque_ap.reset(new SourceManagerImpl(*(rhs.m_opaque_ap.get())));
 | 
			
		||||
  m_opaque_up.reset(new SourceManagerImpl(*(rhs.m_opaque_up.get())));
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -106,10 +106,10 @@ size_t SBSourceManager::DisplaySourceLinesWithLineNumbersAndColumn(
 | 
			
		|||
    const SBFileSpec &file, uint32_t line, uint32_t column,
 | 
			
		||||
    uint32_t context_before, uint32_t context_after,
 | 
			
		||||
    const char *current_line_cstr, SBStream &s) {
 | 
			
		||||
  if (m_opaque_ap == NULL)
 | 
			
		||||
  if (m_opaque_up == NULL)
 | 
			
		||||
    return 0;
 | 
			
		||||
 | 
			
		||||
  return m_opaque_ap->DisplaySourceLinesWithLineNumbers(
 | 
			
		||||
  return m_opaque_up->DisplaySourceLinesWithLineNumbers(
 | 
			
		||||
      file.ref(), line, column, context_before, context_after,
 | 
			
		||||
      current_line_cstr, s.get());
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -17,31 +17,31 @@
 | 
			
		|||
using namespace lldb;
 | 
			
		||||
using namespace lldb_private;
 | 
			
		||||
 | 
			
		||||
SBStream::SBStream() : m_opaque_ap(new StreamString()), m_is_file(false) {}
 | 
			
		||||
SBStream::SBStream() : m_opaque_up(new StreamString()), m_is_file(false) {}
 | 
			
		||||
 | 
			
		||||
SBStream::SBStream(SBStream &&rhs)
 | 
			
		||||
    : m_opaque_ap(std::move(rhs.m_opaque_ap)), m_is_file(rhs.m_is_file) {}
 | 
			
		||||
    : m_opaque_up(std::move(rhs.m_opaque_up)), m_is_file(rhs.m_is_file) {}
 | 
			
		||||
 | 
			
		||||
SBStream::~SBStream() {}
 | 
			
		||||
 | 
			
		||||
bool SBStream::IsValid() const { return (m_opaque_ap != NULL); }
 | 
			
		||||
bool SBStream::IsValid() const { return (m_opaque_up != NULL); }
 | 
			
		||||
 | 
			
		||||
// If this stream is not redirected to a file, it will maintain a local cache
 | 
			
		||||
// for the stream data which can be accessed using this accessor.
 | 
			
		||||
const char *SBStream::GetData() {
 | 
			
		||||
  if (m_is_file || m_opaque_ap == NULL)
 | 
			
		||||
  if (m_is_file || m_opaque_up == NULL)
 | 
			
		||||
    return NULL;
 | 
			
		||||
 | 
			
		||||
  return static_cast<StreamString *>(m_opaque_ap.get())->GetData();
 | 
			
		||||
  return static_cast<StreamString *>(m_opaque_up.get())->GetData();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// If this stream is not redirected to a file, it will maintain a local cache
 | 
			
		||||
// for the stream output whose length can be accessed using this accessor.
 | 
			
		||||
size_t SBStream::GetSize() {
 | 
			
		||||
  if (m_is_file || m_opaque_ap == NULL)
 | 
			
		||||
  if (m_is_file || m_opaque_up == NULL)
 | 
			
		||||
    return 0;
 | 
			
		||||
 | 
			
		||||
  return static_cast<StreamString *>(m_opaque_ap.get())->GetSize();
 | 
			
		||||
  return static_cast<StreamString *>(m_opaque_up.get())->GetSize();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBStream::Printf(const char *format, ...) {
 | 
			
		||||
| 
						 | 
				
			
			@ -58,11 +58,11 @@ void SBStream::RedirectToFile(const char *path, bool append) {
 | 
			
		|||
    return;
 | 
			
		||||
 | 
			
		||||
  std::string local_data;
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    // See if we have any locally backed data. If so, copy it so we can then
 | 
			
		||||
    // redirect it to the file so we don't lose the data
 | 
			
		||||
    if (!m_is_file)
 | 
			
		||||
      local_data = static_cast<StreamString *>(m_opaque_ap.get())->GetString();
 | 
			
		||||
      local_data = static_cast<StreamString *>(m_opaque_up.get())->GetString();
 | 
			
		||||
  }
 | 
			
		||||
  StreamFile *stream_file = new StreamFile;
 | 
			
		||||
  uint32_t open_options = File::eOpenOptionWrite | File::eOpenOptionCanCreate;
 | 
			
		||||
| 
						 | 
				
			
			@ -73,15 +73,15 @@ void SBStream::RedirectToFile(const char *path, bool append) {
 | 
			
		|||
 | 
			
		||||
  FileSystem::Instance().Open(stream_file->GetFile(), FileSpec(path),
 | 
			
		||||
                              open_options);
 | 
			
		||||
  m_opaque_ap.reset(stream_file);
 | 
			
		||||
  m_opaque_up.reset(stream_file);
 | 
			
		||||
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    m_is_file = true;
 | 
			
		||||
 | 
			
		||||
    // If we had any data locally in our StreamString, then pass that along to
 | 
			
		||||
    // the to new file we are redirecting to.
 | 
			
		||||
    if (!local_data.empty())
 | 
			
		||||
      m_opaque_ap->Write(&local_data[0], local_data.size());
 | 
			
		||||
      m_opaque_up->Write(&local_data[0], local_data.size());
 | 
			
		||||
  } else
 | 
			
		||||
    m_is_file = false;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -91,63 +91,63 @@ void SBStream::RedirectToFileHandle(FILE *fh, bool transfer_fh_ownership) {
 | 
			
		|||
    return;
 | 
			
		||||
 | 
			
		||||
  std::string local_data;
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    // See if we have any locally backed data. If so, copy it so we can then
 | 
			
		||||
    // redirect it to the file so we don't lose the data
 | 
			
		||||
    if (!m_is_file)
 | 
			
		||||
      local_data = static_cast<StreamString *>(m_opaque_ap.get())->GetString();
 | 
			
		||||
      local_data = static_cast<StreamString *>(m_opaque_up.get())->GetString();
 | 
			
		||||
  }
 | 
			
		||||
  m_opaque_ap.reset(new StreamFile(fh, transfer_fh_ownership));
 | 
			
		||||
  m_opaque_up.reset(new StreamFile(fh, transfer_fh_ownership));
 | 
			
		||||
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    m_is_file = true;
 | 
			
		||||
 | 
			
		||||
    // If we had any data locally in our StreamString, then pass that along to
 | 
			
		||||
    // the to new file we are redirecting to.
 | 
			
		||||
    if (!local_data.empty())
 | 
			
		||||
      m_opaque_ap->Write(&local_data[0], local_data.size());
 | 
			
		||||
      m_opaque_up->Write(&local_data[0], local_data.size());
 | 
			
		||||
  } else
 | 
			
		||||
    m_is_file = false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBStream::RedirectToFileDescriptor(int fd, bool transfer_fh_ownership) {
 | 
			
		||||
  std::string local_data;
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    // See if we have any locally backed data. If so, copy it so we can then
 | 
			
		||||
    // redirect it to the file so we don't lose the data
 | 
			
		||||
    if (!m_is_file)
 | 
			
		||||
      local_data = static_cast<StreamString *>(m_opaque_ap.get())->GetString();
 | 
			
		||||
      local_data = static_cast<StreamString *>(m_opaque_up.get())->GetString();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  m_opaque_ap.reset(new StreamFile(::fdopen(fd, "w"), transfer_fh_ownership));
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
  m_opaque_up.reset(new StreamFile(::fdopen(fd, "w"), transfer_fh_ownership));
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    m_is_file = true;
 | 
			
		||||
 | 
			
		||||
    // If we had any data locally in our StreamString, then pass that along to
 | 
			
		||||
    // the to new file we are redirecting to.
 | 
			
		||||
    if (!local_data.empty())
 | 
			
		||||
      m_opaque_ap->Write(&local_data[0], local_data.size());
 | 
			
		||||
      m_opaque_up->Write(&local_data[0], local_data.size());
 | 
			
		||||
  } else
 | 
			
		||||
    m_is_file = false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lldb_private::Stream *SBStream::operator->() { return m_opaque_ap.get(); }
 | 
			
		||||
lldb_private::Stream *SBStream::operator->() { return m_opaque_up.get(); }
 | 
			
		||||
 | 
			
		||||
lldb_private::Stream *SBStream::get() { return m_opaque_ap.get(); }
 | 
			
		||||
lldb_private::Stream *SBStream::get() { return m_opaque_up.get(); }
 | 
			
		||||
 | 
			
		||||
lldb_private::Stream &SBStream::ref() {
 | 
			
		||||
  if (m_opaque_ap == NULL)
 | 
			
		||||
    m_opaque_ap.reset(new StreamString());
 | 
			
		||||
  return *m_opaque_ap;
 | 
			
		||||
  if (m_opaque_up == NULL)
 | 
			
		||||
    m_opaque_up.reset(new StreamString());
 | 
			
		||||
  return *m_opaque_up;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBStream::Clear() {
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    // See if we have any locally backed data. If so, copy it so we can then
 | 
			
		||||
    // redirect it to the file so we don't lose the data
 | 
			
		||||
    if (m_is_file)
 | 
			
		||||
      m_opaque_ap.reset();
 | 
			
		||||
      m_opaque_up.reset();
 | 
			
		||||
    else
 | 
			
		||||
      static_cast<StreamString *>(m_opaque_ap.get())->Clear();
 | 
			
		||||
      static_cast<StreamString *>(m_opaque_up.get())->Clear();
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -13,25 +13,25 @@
 | 
			
		|||
using namespace lldb;
 | 
			
		||||
using namespace lldb_private;
 | 
			
		||||
 | 
			
		||||
SBStringList::SBStringList() : m_opaque_ap() {}
 | 
			
		||||
SBStringList::SBStringList() : m_opaque_up() {}
 | 
			
		||||
 | 
			
		||||
SBStringList::SBStringList(const lldb_private::StringList *lldb_strings_ptr)
 | 
			
		||||
    : m_opaque_ap() {
 | 
			
		||||
    : m_opaque_up() {
 | 
			
		||||
  if (lldb_strings_ptr)
 | 
			
		||||
    m_opaque_ap.reset(new lldb_private::StringList(*lldb_strings_ptr));
 | 
			
		||||
    m_opaque_up.reset(new lldb_private::StringList(*lldb_strings_ptr));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBStringList::SBStringList(const SBStringList &rhs) : m_opaque_ap() {
 | 
			
		||||
SBStringList::SBStringList(const SBStringList &rhs) : m_opaque_up() {
 | 
			
		||||
  if (rhs.IsValid())
 | 
			
		||||
    m_opaque_ap.reset(new lldb_private::StringList(*rhs));
 | 
			
		||||
    m_opaque_up.reset(new lldb_private::StringList(*rhs));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const SBStringList &SBStringList::operator=(const SBStringList &rhs) {
 | 
			
		||||
  if (this != &rhs) {
 | 
			
		||||
    if (rhs.IsValid())
 | 
			
		||||
      m_opaque_ap.reset(new lldb_private::StringList(*rhs));
 | 
			
		||||
      m_opaque_up.reset(new lldb_private::StringList(*rhs));
 | 
			
		||||
    else
 | 
			
		||||
      m_opaque_ap.reset();
 | 
			
		||||
      m_opaque_up.reset();
 | 
			
		||||
  }
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -39,70 +39,70 @@ const SBStringList &SBStringList::operator=(const SBStringList &rhs) {
 | 
			
		|||
SBStringList::~SBStringList() {}
 | 
			
		||||
 | 
			
		||||
const lldb_private::StringList *SBStringList::operator->() const {
 | 
			
		||||
  return m_opaque_ap.get();
 | 
			
		||||
  return m_opaque_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const lldb_private::StringList &SBStringList::operator*() const {
 | 
			
		||||
  return *m_opaque_ap;
 | 
			
		||||
  return *m_opaque_up;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBStringList::IsValid() const { return (m_opaque_ap != NULL); }
 | 
			
		||||
bool SBStringList::IsValid() const { return (m_opaque_up != NULL); }
 | 
			
		||||
 | 
			
		||||
void SBStringList::AppendString(const char *str) {
 | 
			
		||||
  if (str != NULL) {
 | 
			
		||||
    if (IsValid())
 | 
			
		||||
      m_opaque_ap->AppendString(str);
 | 
			
		||||
      m_opaque_up->AppendString(str);
 | 
			
		||||
    else
 | 
			
		||||
      m_opaque_ap.reset(new lldb_private::StringList(str));
 | 
			
		||||
      m_opaque_up.reset(new lldb_private::StringList(str));
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBStringList::AppendList(const char **strv, int strc) {
 | 
			
		||||
  if ((strv != NULL) && (strc > 0)) {
 | 
			
		||||
    if (IsValid())
 | 
			
		||||
      m_opaque_ap->AppendList(strv, strc);
 | 
			
		||||
      m_opaque_up->AppendList(strv, strc);
 | 
			
		||||
    else
 | 
			
		||||
      m_opaque_ap.reset(new lldb_private::StringList(strv, strc));
 | 
			
		||||
      m_opaque_up.reset(new lldb_private::StringList(strv, strc));
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBStringList::AppendList(const SBStringList &strings) {
 | 
			
		||||
  if (strings.IsValid()) {
 | 
			
		||||
    if (!IsValid())
 | 
			
		||||
      m_opaque_ap.reset(new lldb_private::StringList());
 | 
			
		||||
    m_opaque_ap->AppendList(*(strings.m_opaque_ap));
 | 
			
		||||
      m_opaque_up.reset(new lldb_private::StringList());
 | 
			
		||||
    m_opaque_up->AppendList(*(strings.m_opaque_up));
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBStringList::AppendList(const StringList &strings) {
 | 
			
		||||
  if (!IsValid())
 | 
			
		||||
    m_opaque_ap.reset(new lldb_private::StringList());
 | 
			
		||||
  m_opaque_ap->AppendList(strings);
 | 
			
		||||
    m_opaque_up.reset(new lldb_private::StringList());
 | 
			
		||||
  m_opaque_up->AppendList(strings);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint32_t SBStringList::GetSize() const {
 | 
			
		||||
  if (IsValid()) {
 | 
			
		||||
    return m_opaque_ap->GetSize();
 | 
			
		||||
    return m_opaque_up->GetSize();
 | 
			
		||||
  }
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const char *SBStringList::GetStringAtIndex(size_t idx) {
 | 
			
		||||
  if (IsValid()) {
 | 
			
		||||
    return m_opaque_ap->GetStringAtIndex(idx);
 | 
			
		||||
    return m_opaque_up->GetStringAtIndex(idx);
 | 
			
		||||
  }
 | 
			
		||||
  return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const char *SBStringList::GetStringAtIndex(size_t idx) const {
 | 
			
		||||
  if (IsValid()) {
 | 
			
		||||
    return m_opaque_ap->GetStringAtIndex(idx);
 | 
			
		||||
    return m_opaque_up->GetStringAtIndex(idx);
 | 
			
		||||
  }
 | 
			
		||||
  return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBStringList::Clear() {
 | 
			
		||||
  if (IsValid()) {
 | 
			
		||||
    m_opaque_ap->Clear();
 | 
			
		||||
    m_opaque_up->Clear();
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -17,19 +17,19 @@
 | 
			
		|||
using namespace lldb;
 | 
			
		||||
using namespace lldb_private;
 | 
			
		||||
 | 
			
		||||
SBSymbolContext::SBSymbolContext() : m_opaque_ap() {}
 | 
			
		||||
SBSymbolContext::SBSymbolContext() : m_opaque_up() {}
 | 
			
		||||
 | 
			
		||||
SBSymbolContext::SBSymbolContext(const SymbolContext *sc_ptr) : m_opaque_ap() {
 | 
			
		||||
SBSymbolContext::SBSymbolContext(const SymbolContext *sc_ptr) : m_opaque_up() {
 | 
			
		||||
  if (sc_ptr)
 | 
			
		||||
    m_opaque_ap.reset(new SymbolContext(*sc_ptr));
 | 
			
		||||
    m_opaque_up.reset(new SymbolContext(*sc_ptr));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBSymbolContext::SBSymbolContext(const SBSymbolContext &rhs) : m_opaque_ap() {
 | 
			
		||||
SBSymbolContext::SBSymbolContext(const SBSymbolContext &rhs) : m_opaque_up() {
 | 
			
		||||
  if (rhs.IsValid()) {
 | 
			
		||||
    if (m_opaque_ap)
 | 
			
		||||
      *m_opaque_ap = *rhs.m_opaque_ap;
 | 
			
		||||
    if (m_opaque_up)
 | 
			
		||||
      *m_opaque_up = *rhs.m_opaque_up;
 | 
			
		||||
    else
 | 
			
		||||
      ref() = *rhs.m_opaque_ap;
 | 
			
		||||
      ref() = *rhs.m_opaque_up;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -38,32 +38,32 @@ SBSymbolContext::~SBSymbolContext() {}
 | 
			
		|||
const SBSymbolContext &SBSymbolContext::operator=(const SBSymbolContext &rhs) {
 | 
			
		||||
  if (this != &rhs) {
 | 
			
		||||
    if (rhs.IsValid())
 | 
			
		||||
      m_opaque_ap.reset(new lldb_private::SymbolContext(*rhs.m_opaque_ap));
 | 
			
		||||
      m_opaque_up.reset(new lldb_private::SymbolContext(*rhs.m_opaque_up));
 | 
			
		||||
  }
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBSymbolContext::SetSymbolContext(const SymbolContext *sc_ptr) {
 | 
			
		||||
  if (sc_ptr) {
 | 
			
		||||
    if (m_opaque_ap)
 | 
			
		||||
      *m_opaque_ap = *sc_ptr;
 | 
			
		||||
    if (m_opaque_up)
 | 
			
		||||
      *m_opaque_up = *sc_ptr;
 | 
			
		||||
    else
 | 
			
		||||
      m_opaque_ap.reset(new SymbolContext(*sc_ptr));
 | 
			
		||||
      m_opaque_up.reset(new SymbolContext(*sc_ptr));
 | 
			
		||||
  } else {
 | 
			
		||||
    if (m_opaque_ap)
 | 
			
		||||
      m_opaque_ap->Clear(true);
 | 
			
		||||
    if (m_opaque_up)
 | 
			
		||||
      m_opaque_up->Clear(true);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBSymbolContext::IsValid() const { return m_opaque_ap != NULL; }
 | 
			
		||||
bool SBSymbolContext::IsValid() const { return m_opaque_up != NULL; }
 | 
			
		||||
 | 
			
		||||
SBModule SBSymbolContext::GetModule() {
 | 
			
		||||
  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 | 
			
		||||
 | 
			
		||||
  SBModule sb_module;
 | 
			
		||||
  ModuleSP module_sp;
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
    module_sp = m_opaque_ap->module_sp;
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    module_sp = m_opaque_up->module_sp;
 | 
			
		||||
    sb_module.SetSP(module_sp);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -71,7 +71,7 @@ SBModule SBSymbolContext::GetModule() {
 | 
			
		|||
    SBStream sstr;
 | 
			
		||||
    sb_module.GetDescription(sstr);
 | 
			
		||||
    log->Printf("SBSymbolContext(%p)::GetModule () => SBModule(%p): %s",
 | 
			
		||||
                static_cast<void *>(m_opaque_ap.get()),
 | 
			
		||||
                static_cast<void *>(m_opaque_up.get()),
 | 
			
		||||
                static_cast<void *>(module_sp.get()), sstr.GetData());
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -79,7 +79,7 @@ SBModule SBSymbolContext::GetModule() {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
SBCompileUnit SBSymbolContext::GetCompileUnit() {
 | 
			
		||||
  return SBCompileUnit(m_opaque_ap ? m_opaque_ap->comp_unit : NULL);
 | 
			
		||||
  return SBCompileUnit(m_opaque_up ? m_opaque_up->comp_unit : NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBFunction SBSymbolContext::GetFunction() {
 | 
			
		||||
| 
						 | 
				
			
			@ -87,33 +87,33 @@ SBFunction SBSymbolContext::GetFunction() {
 | 
			
		|||
 | 
			
		||||
  Function *function = NULL;
 | 
			
		||||
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    function = m_opaque_ap->function;
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    function = m_opaque_up->function;
 | 
			
		||||
 | 
			
		||||
  SBFunction sb_function(function);
 | 
			
		||||
 | 
			
		||||
  if (log)
 | 
			
		||||
    log->Printf("SBSymbolContext(%p)::GetFunction () => SBFunction(%p)",
 | 
			
		||||
                static_cast<void *>(m_opaque_ap.get()),
 | 
			
		||||
                static_cast<void *>(m_opaque_up.get()),
 | 
			
		||||
                static_cast<void *>(function));
 | 
			
		||||
 | 
			
		||||
  return sb_function;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBBlock SBSymbolContext::GetBlock() {
 | 
			
		||||
  return SBBlock(m_opaque_ap ? m_opaque_ap->block : NULL);
 | 
			
		||||
  return SBBlock(m_opaque_up ? m_opaque_up->block : NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBLineEntry SBSymbolContext::GetLineEntry() {
 | 
			
		||||
  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 | 
			
		||||
 | 
			
		||||
  SBLineEntry sb_line_entry;
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    sb_line_entry.SetLineEntry(m_opaque_ap->line_entry);
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    sb_line_entry.SetLineEntry(m_opaque_up->line_entry);
 | 
			
		||||
 | 
			
		||||
  if (log) {
 | 
			
		||||
    log->Printf("SBSymbolContext(%p)::GetLineEntry () => SBLineEntry(%p)",
 | 
			
		||||
                static_cast<void *>(m_opaque_ap.get()),
 | 
			
		||||
                static_cast<void *>(m_opaque_up.get()),
 | 
			
		||||
                static_cast<void *>(sb_line_entry.get()));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -125,14 +125,14 @@ SBSymbol SBSymbolContext::GetSymbol() {
 | 
			
		|||
 | 
			
		||||
  Symbol *symbol = NULL;
 | 
			
		||||
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    symbol = m_opaque_ap->symbol;
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    symbol = m_opaque_up->symbol;
 | 
			
		||||
 | 
			
		||||
  SBSymbol sb_symbol(symbol);
 | 
			
		||||
 | 
			
		||||
  if (log)
 | 
			
		||||
    log->Printf("SBSymbolContext(%p)::GetSymbol () => SBSymbol(%p)",
 | 
			
		||||
                static_cast<void *>(m_opaque_ap.get()),
 | 
			
		||||
                static_cast<void *>(m_opaque_up.get()),
 | 
			
		||||
                static_cast<void *>(symbol));
 | 
			
		||||
 | 
			
		||||
  return sb_symbol;
 | 
			
		||||
| 
						 | 
				
			
			@ -166,35 +166,35 @@ void SBSymbolContext::SetSymbol(lldb::SBSymbol symbol) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
lldb_private::SymbolContext *SBSymbolContext::operator->() const {
 | 
			
		||||
  return m_opaque_ap.get();
 | 
			
		||||
  return m_opaque_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const lldb_private::SymbolContext &SBSymbolContext::operator*() const {
 | 
			
		||||
  assert(m_opaque_ap.get());
 | 
			
		||||
  return *m_opaque_ap;
 | 
			
		||||
  assert(m_opaque_up.get());
 | 
			
		||||
  return *m_opaque_up;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lldb_private::SymbolContext &SBSymbolContext::operator*() {
 | 
			
		||||
  if (m_opaque_ap == NULL)
 | 
			
		||||
    m_opaque_ap.reset(new SymbolContext);
 | 
			
		||||
  return *m_opaque_ap;
 | 
			
		||||
  if (m_opaque_up == NULL)
 | 
			
		||||
    m_opaque_up.reset(new SymbolContext);
 | 
			
		||||
  return *m_opaque_up;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lldb_private::SymbolContext &SBSymbolContext::ref() {
 | 
			
		||||
  if (m_opaque_ap == NULL)
 | 
			
		||||
    m_opaque_ap.reset(new SymbolContext);
 | 
			
		||||
  return *m_opaque_ap;
 | 
			
		||||
  if (m_opaque_up == NULL)
 | 
			
		||||
    m_opaque_up.reset(new SymbolContext);
 | 
			
		||||
  return *m_opaque_up;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lldb_private::SymbolContext *SBSymbolContext::get() const {
 | 
			
		||||
  return m_opaque_ap.get();
 | 
			
		||||
  return m_opaque_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBSymbolContext::GetDescription(SBStream &description) {
 | 
			
		||||
  Stream &strm = description.ref();
 | 
			
		||||
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
    m_opaque_ap->GetDescription(&strm, lldb::eDescriptionLevelFull, NULL);
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    m_opaque_up->GetDescription(&strm, lldb::eDescriptionLevelFull, NULL);
 | 
			
		||||
  } else
 | 
			
		||||
    strm.PutCString("No value");
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -205,8 +205,8 @@ SBSymbolContext
 | 
			
		|||
SBSymbolContext::GetParentOfInlinedScope(const SBAddress &curr_frame_pc,
 | 
			
		||||
                                         SBAddress &parent_frame_addr) const {
 | 
			
		||||
  SBSymbolContext sb_sc;
 | 
			
		||||
  if (m_opaque_ap.get() && curr_frame_pc.IsValid()) {
 | 
			
		||||
    if (m_opaque_ap->GetParentOfInlinedScope(curr_frame_pc.ref(), sb_sc.ref(),
 | 
			
		||||
  if (m_opaque_up.get() && curr_frame_pc.IsValid()) {
 | 
			
		||||
    if (m_opaque_up->GetParentOfInlinedScope(curr_frame_pc.ref(), sb_sc.ref(),
 | 
			
		||||
                                             parent_frame_addr.ref()))
 | 
			
		||||
      return sb_sc;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,32 +14,32 @@ using namespace lldb;
 | 
			
		|||
using namespace lldb_private;
 | 
			
		||||
 | 
			
		||||
SBSymbolContextList::SBSymbolContextList()
 | 
			
		||||
    : m_opaque_ap(new SymbolContextList()) {}
 | 
			
		||||
    : m_opaque_up(new SymbolContextList()) {}
 | 
			
		||||
 | 
			
		||||
SBSymbolContextList::SBSymbolContextList(const SBSymbolContextList &rhs)
 | 
			
		||||
    : m_opaque_ap(new SymbolContextList(*rhs.m_opaque_ap)) {}
 | 
			
		||||
    : m_opaque_up(new SymbolContextList(*rhs.m_opaque_up)) {}
 | 
			
		||||
 | 
			
		||||
SBSymbolContextList::~SBSymbolContextList() {}
 | 
			
		||||
 | 
			
		||||
const SBSymbolContextList &SBSymbolContextList::
 | 
			
		||||
operator=(const SBSymbolContextList &rhs) {
 | 
			
		||||
  if (this != &rhs) {
 | 
			
		||||
    *m_opaque_ap = *rhs.m_opaque_ap;
 | 
			
		||||
    *m_opaque_up = *rhs.m_opaque_up;
 | 
			
		||||
  }
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint32_t SBSymbolContextList::GetSize() const {
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    return m_opaque_ap->GetSize();
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    return m_opaque_up->GetSize();
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBSymbolContext SBSymbolContextList::GetContextAtIndex(uint32_t idx) {
 | 
			
		||||
  SBSymbolContext sb_sc;
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    SymbolContext sc;
 | 
			
		||||
    if (m_opaque_ap->GetContextAtIndex(idx, sc)) {
 | 
			
		||||
    if (m_opaque_up->GetContextAtIndex(idx, sc)) {
 | 
			
		||||
      sb_sc.SetSymbolContext(&sc);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -47,34 +47,34 @@ SBSymbolContext SBSymbolContextList::GetContextAtIndex(uint32_t idx) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
void SBSymbolContextList::Clear() {
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    m_opaque_ap->Clear();
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    m_opaque_up->Clear();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBSymbolContextList::Append(SBSymbolContext &sc) {
 | 
			
		||||
  if (sc.IsValid() && m_opaque_ap.get())
 | 
			
		||||
    m_opaque_ap->Append(*sc);
 | 
			
		||||
  if (sc.IsValid() && m_opaque_up.get())
 | 
			
		||||
    m_opaque_up->Append(*sc);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBSymbolContextList::Append(SBSymbolContextList &sc_list) {
 | 
			
		||||
  if (sc_list.IsValid() && m_opaque_ap.get())
 | 
			
		||||
    m_opaque_ap->Append(*sc_list);
 | 
			
		||||
  if (sc_list.IsValid() && m_opaque_up.get())
 | 
			
		||||
    m_opaque_up->Append(*sc_list);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBSymbolContextList::IsValid() const { return m_opaque_ap != NULL; }
 | 
			
		||||
bool SBSymbolContextList::IsValid() const { return m_opaque_up != NULL; }
 | 
			
		||||
 | 
			
		||||
lldb_private::SymbolContextList *SBSymbolContextList::operator->() const {
 | 
			
		||||
  return m_opaque_ap.get();
 | 
			
		||||
  return m_opaque_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lldb_private::SymbolContextList &SBSymbolContextList::operator*() const {
 | 
			
		||||
  assert(m_opaque_ap.get());
 | 
			
		||||
  return *m_opaque_ap;
 | 
			
		||||
  assert(m_opaque_up.get());
 | 
			
		||||
  return *m_opaque_up;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBSymbolContextList::GetDescription(lldb::SBStream &description) {
 | 
			
		||||
  Stream &strm = description.ref();
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    m_opaque_ap->GetDescription(&strm, lldb::eDescriptionLevelFull, NULL);
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    m_opaque_up->GetDescription(&strm, lldb::eDescriptionLevelFull, NULL);
 | 
			
		||||
  return true;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1570,7 +1570,7 @@ lldb::SBModule SBTarget::AddModule(const SBModuleSpec &module_spec) {
 | 
			
		|||
  lldb::SBModule sb_module;
 | 
			
		||||
  TargetSP target_sp(GetSP());
 | 
			
		||||
  if (target_sp)
 | 
			
		||||
    sb_module.SetSP(target_sp->GetSharedModule(*module_spec.m_opaque_ap));
 | 
			
		||||
    sb_module.SetSP(target_sp->GetSharedModule(*module_spec.m_opaque_up));
 | 
			
		||||
  return sb_module;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -44,7 +44,7 @@ SBType::SBType(const SBType &rhs) : m_opaque_sp() {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
// SBType::SBType (TypeImpl* impl) :
 | 
			
		||||
//    m_opaque_ap(impl)
 | 
			
		||||
//    m_opaque_up(impl)
 | 
			
		||||
//{}
 | 
			
		||||
//
 | 
			
		||||
bool SBType::operator==(SBType &rhs) {
 | 
			
		||||
| 
						 | 
				
			
			@ -444,20 +444,20 @@ lldb::TemplateArgumentKind SBType::GetTemplateArgumentKind(uint32_t idx) {
 | 
			
		|||
  return eTemplateArgumentKindNull;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBTypeList::SBTypeList() : m_opaque_ap(new TypeListImpl()) {}
 | 
			
		||||
SBTypeList::SBTypeList() : m_opaque_up(new TypeListImpl()) {}
 | 
			
		||||
 | 
			
		||||
SBTypeList::SBTypeList(const SBTypeList &rhs)
 | 
			
		||||
    : m_opaque_ap(new TypeListImpl()) {
 | 
			
		||||
    : m_opaque_up(new TypeListImpl()) {
 | 
			
		||||
  for (uint32_t i = 0, rhs_size = const_cast<SBTypeList &>(rhs).GetSize();
 | 
			
		||||
       i < rhs_size; i++)
 | 
			
		||||
    Append(const_cast<SBTypeList &>(rhs).GetTypeAtIndex(i));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBTypeList::IsValid() { return (m_opaque_ap != NULL); }
 | 
			
		||||
bool SBTypeList::IsValid() { return (m_opaque_up != NULL); }
 | 
			
		||||
 | 
			
		||||
SBTypeList &SBTypeList::operator=(const SBTypeList &rhs) {
 | 
			
		||||
  if (this != &rhs) {
 | 
			
		||||
    m_opaque_ap.reset(new TypeListImpl());
 | 
			
		||||
    m_opaque_up.reset(new TypeListImpl());
 | 
			
		||||
    for (uint32_t i = 0, rhs_size = const_cast<SBTypeList &>(rhs).GetSize();
 | 
			
		||||
         i < rhs_size; i++)
 | 
			
		||||
      Append(const_cast<SBTypeList &>(rhs).GetTypeAtIndex(i));
 | 
			
		||||
| 
						 | 
				
			
			@ -467,75 +467,75 @@ SBTypeList &SBTypeList::operator=(const SBTypeList &rhs) {
 | 
			
		|||
 | 
			
		||||
void SBTypeList::Append(SBType type) {
 | 
			
		||||
  if (type.IsValid())
 | 
			
		||||
    m_opaque_ap->Append(type.m_opaque_sp);
 | 
			
		||||
    m_opaque_up->Append(type.m_opaque_sp);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBType SBTypeList::GetTypeAtIndex(uint32_t index) {
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    return SBType(m_opaque_ap->GetTypeAtIndex(index));
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    return SBType(m_opaque_up->GetTypeAtIndex(index));
 | 
			
		||||
  return SBType();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint32_t SBTypeList::GetSize() { return m_opaque_ap->GetSize(); }
 | 
			
		||||
uint32_t SBTypeList::GetSize() { return m_opaque_up->GetSize(); }
 | 
			
		||||
 | 
			
		||||
SBTypeList::~SBTypeList() {}
 | 
			
		||||
 | 
			
		||||
SBTypeMember::SBTypeMember() : m_opaque_ap() {}
 | 
			
		||||
SBTypeMember::SBTypeMember() : m_opaque_up() {}
 | 
			
		||||
 | 
			
		||||
SBTypeMember::~SBTypeMember() {}
 | 
			
		||||
 | 
			
		||||
SBTypeMember::SBTypeMember(const SBTypeMember &rhs) : m_opaque_ap() {
 | 
			
		||||
SBTypeMember::SBTypeMember(const SBTypeMember &rhs) : m_opaque_up() {
 | 
			
		||||
  if (this != &rhs) {
 | 
			
		||||
    if (rhs.IsValid())
 | 
			
		||||
      m_opaque_ap.reset(new TypeMemberImpl(rhs.ref()));
 | 
			
		||||
      m_opaque_up.reset(new TypeMemberImpl(rhs.ref()));
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lldb::SBTypeMember &SBTypeMember::operator=(const lldb::SBTypeMember &rhs) {
 | 
			
		||||
  if (this != &rhs) {
 | 
			
		||||
    if (rhs.IsValid())
 | 
			
		||||
      m_opaque_ap.reset(new TypeMemberImpl(rhs.ref()));
 | 
			
		||||
      m_opaque_up.reset(new TypeMemberImpl(rhs.ref()));
 | 
			
		||||
  }
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBTypeMember::IsValid() const { return m_opaque_ap.get(); }
 | 
			
		||||
bool SBTypeMember::IsValid() const { return m_opaque_up.get(); }
 | 
			
		||||
 | 
			
		||||
const char *SBTypeMember::GetName() {
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    return m_opaque_ap->GetName().GetCString();
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    return m_opaque_up->GetName().GetCString();
 | 
			
		||||
  return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBType SBTypeMember::GetType() {
 | 
			
		||||
  SBType sb_type;
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
    sb_type.SetSP(m_opaque_ap->GetTypeImpl());
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    sb_type.SetSP(m_opaque_up->GetTypeImpl());
 | 
			
		||||
  }
 | 
			
		||||
  return sb_type;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint64_t SBTypeMember::GetOffsetInBytes() {
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    return m_opaque_ap->GetBitOffset() / 8u;
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    return m_opaque_up->GetBitOffset() / 8u;
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint64_t SBTypeMember::GetOffsetInBits() {
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    return m_opaque_ap->GetBitOffset();
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    return m_opaque_up->GetBitOffset();
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBTypeMember::IsBitfield() {
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    return m_opaque_ap->GetIsBitfield();
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    return m_opaque_up->GetIsBitfield();
 | 
			
		||||
  return false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint32_t SBTypeMember::GetBitfieldSizeInBits() {
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    return m_opaque_ap->GetBitfieldBitSize();
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    return m_opaque_up->GetBitfieldBitSize();
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -543,23 +543,23 @@ bool SBTypeMember::GetDescription(lldb::SBStream &description,
 | 
			
		|||
                                  lldb::DescriptionLevel description_level) {
 | 
			
		||||
  Stream &strm = description.ref();
 | 
			
		||||
 | 
			
		||||
  if (m_opaque_ap) {
 | 
			
		||||
    const uint32_t bit_offset = m_opaque_ap->GetBitOffset();
 | 
			
		||||
  if (m_opaque_up) {
 | 
			
		||||
    const uint32_t bit_offset = m_opaque_up->GetBitOffset();
 | 
			
		||||
    const uint32_t byte_offset = bit_offset / 8u;
 | 
			
		||||
    const uint32_t byte_bit_offset = bit_offset % 8u;
 | 
			
		||||
    const char *name = m_opaque_ap->GetName().GetCString();
 | 
			
		||||
    const char *name = m_opaque_up->GetName().GetCString();
 | 
			
		||||
    if (byte_bit_offset)
 | 
			
		||||
      strm.Printf("+%u + %u bits: (", byte_offset, byte_bit_offset);
 | 
			
		||||
    else
 | 
			
		||||
      strm.Printf("+%u: (", byte_offset);
 | 
			
		||||
 | 
			
		||||
    TypeImplSP type_impl_sp(m_opaque_ap->GetTypeImpl());
 | 
			
		||||
    TypeImplSP type_impl_sp(m_opaque_up->GetTypeImpl());
 | 
			
		||||
    if (type_impl_sp)
 | 
			
		||||
      type_impl_sp->GetDescription(strm, description_level);
 | 
			
		||||
 | 
			
		||||
    strm.Printf(") %s", name);
 | 
			
		||||
    if (m_opaque_ap->GetIsBitfield()) {
 | 
			
		||||
      const uint32_t bitfield_bit_size = m_opaque_ap->GetBitfieldBitSize();
 | 
			
		||||
    if (m_opaque_up->GetIsBitfield()) {
 | 
			
		||||
      const uint32_t bitfield_bit_size = m_opaque_up->GetBitfieldBitSize();
 | 
			
		||||
      strm.Printf(" : %u", bitfield_bit_size);
 | 
			
		||||
    }
 | 
			
		||||
  } else {
 | 
			
		||||
| 
						 | 
				
			
			@ -569,16 +569,16 @@ bool SBTypeMember::GetDescription(lldb::SBStream &description,
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
void SBTypeMember::reset(TypeMemberImpl *type_member_impl) {
 | 
			
		||||
  m_opaque_ap.reset(type_member_impl);
 | 
			
		||||
  m_opaque_up.reset(type_member_impl);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
TypeMemberImpl &SBTypeMember::ref() {
 | 
			
		||||
  if (m_opaque_ap == NULL)
 | 
			
		||||
    m_opaque_ap.reset(new TypeMemberImpl());
 | 
			
		||||
  return *m_opaque_ap;
 | 
			
		||||
  if (m_opaque_up == NULL)
 | 
			
		||||
    m_opaque_up.reset(new TypeMemberImpl());
 | 
			
		||||
  return *m_opaque_up;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const TypeMemberImpl &SBTypeMember::ref() const { return *m_opaque_ap; }
 | 
			
		||||
const TypeMemberImpl &SBTypeMember::ref() const { return *m_opaque_up; }
 | 
			
		||||
 | 
			
		||||
SBTypeMemberFunction::SBTypeMemberFunction() : m_opaque_sp() {}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -85,22 +85,22 @@ const TypeEnumMemberImpl &SBTypeEnumMember::ref() const {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
SBTypeEnumMemberList::SBTypeEnumMemberList()
 | 
			
		||||
    : m_opaque_ap(new TypeEnumMemberListImpl()) {}
 | 
			
		||||
    : m_opaque_up(new TypeEnumMemberListImpl()) {}
 | 
			
		||||
 | 
			
		||||
SBTypeEnumMemberList::SBTypeEnumMemberList(const SBTypeEnumMemberList &rhs)
 | 
			
		||||
    : m_opaque_ap(new TypeEnumMemberListImpl()) {
 | 
			
		||||
    : m_opaque_up(new TypeEnumMemberListImpl()) {
 | 
			
		||||
  for (uint32_t i = 0,
 | 
			
		||||
                rhs_size = const_cast<SBTypeEnumMemberList &>(rhs).GetSize();
 | 
			
		||||
       i < rhs_size; i++)
 | 
			
		||||
    Append(const_cast<SBTypeEnumMemberList &>(rhs).GetTypeEnumMemberAtIndex(i));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBTypeEnumMemberList::IsValid() { return (m_opaque_ap != NULL); }
 | 
			
		||||
bool SBTypeEnumMemberList::IsValid() { return (m_opaque_up != NULL); }
 | 
			
		||||
 | 
			
		||||
SBTypeEnumMemberList &SBTypeEnumMemberList::
 | 
			
		||||
operator=(const SBTypeEnumMemberList &rhs) {
 | 
			
		||||
  if (this != &rhs) {
 | 
			
		||||
    m_opaque_ap.reset(new TypeEnumMemberListImpl());
 | 
			
		||||
    m_opaque_up.reset(new TypeEnumMemberListImpl());
 | 
			
		||||
    for (uint32_t i = 0,
 | 
			
		||||
                  rhs_size = const_cast<SBTypeEnumMemberList &>(rhs).GetSize();
 | 
			
		||||
         i < rhs_size; i++)
 | 
			
		||||
| 
						 | 
				
			
			@ -112,17 +112,17 @@ operator=(const SBTypeEnumMemberList &rhs) {
 | 
			
		|||
 | 
			
		||||
void SBTypeEnumMemberList::Append(SBTypeEnumMember enum_member) {
 | 
			
		||||
  if (enum_member.IsValid())
 | 
			
		||||
    m_opaque_ap->Append(enum_member.m_opaque_sp);
 | 
			
		||||
    m_opaque_up->Append(enum_member.m_opaque_sp);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBTypeEnumMember
 | 
			
		||||
SBTypeEnumMemberList::GetTypeEnumMemberAtIndex(uint32_t index) {
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    return SBTypeEnumMember(m_opaque_ap->GetTypeEnumMemberAtIndex(index));
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    return SBTypeEnumMember(m_opaque_up->GetTypeEnumMemberAtIndex(index));
 | 
			
		||||
  return SBTypeEnumMember();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint32_t SBTypeEnumMemberList::GetSize() { return m_opaque_ap->GetSize(); }
 | 
			
		||||
uint32_t SBTypeEnumMemberList::GetSize() { return m_opaque_up->GetSize(); }
 | 
			
		||||
 | 
			
		||||
SBTypeEnumMemberList::~SBTypeEnumMemberList() {}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,62 +18,62 @@ using namespace lldb;
 | 
			
		|||
using namespace lldb_private;
 | 
			
		||||
 | 
			
		||||
SBTypeSummaryOptions::SBTypeSummaryOptions() {
 | 
			
		||||
  m_opaque_ap.reset(new TypeSummaryOptions());
 | 
			
		||||
  m_opaque_up.reset(new TypeSummaryOptions());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBTypeSummaryOptions::SBTypeSummaryOptions(
 | 
			
		||||
    const lldb::SBTypeSummaryOptions &rhs) {
 | 
			
		||||
  if (rhs.m_opaque_ap)
 | 
			
		||||
    m_opaque_ap.reset(new TypeSummaryOptions(*rhs.m_opaque_ap));
 | 
			
		||||
  if (rhs.m_opaque_up)
 | 
			
		||||
    m_opaque_up.reset(new TypeSummaryOptions(*rhs.m_opaque_up));
 | 
			
		||||
  else
 | 
			
		||||
    m_opaque_ap.reset(new TypeSummaryOptions());
 | 
			
		||||
    m_opaque_up.reset(new TypeSummaryOptions());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBTypeSummaryOptions::~SBTypeSummaryOptions() {}
 | 
			
		||||
 | 
			
		||||
bool SBTypeSummaryOptions::IsValid() { return m_opaque_ap.get(); }
 | 
			
		||||
bool SBTypeSummaryOptions::IsValid() { return m_opaque_up.get(); }
 | 
			
		||||
 | 
			
		||||
lldb::LanguageType SBTypeSummaryOptions::GetLanguage() {
 | 
			
		||||
  if (IsValid())
 | 
			
		||||
    return m_opaque_ap->GetLanguage();
 | 
			
		||||
    return m_opaque_up->GetLanguage();
 | 
			
		||||
  return lldb::eLanguageTypeUnknown;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lldb::TypeSummaryCapping SBTypeSummaryOptions::GetCapping() {
 | 
			
		||||
  if (IsValid())
 | 
			
		||||
    return m_opaque_ap->GetCapping();
 | 
			
		||||
    return m_opaque_up->GetCapping();
 | 
			
		||||
  return eTypeSummaryCapped;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBTypeSummaryOptions::SetLanguage(lldb::LanguageType l) {
 | 
			
		||||
  if (IsValid())
 | 
			
		||||
    m_opaque_ap->SetLanguage(l);
 | 
			
		||||
    m_opaque_up->SetLanguage(l);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBTypeSummaryOptions::SetCapping(lldb::TypeSummaryCapping c) {
 | 
			
		||||
  if (IsValid())
 | 
			
		||||
    m_opaque_ap->SetCapping(c);
 | 
			
		||||
    m_opaque_up->SetCapping(c);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lldb_private::TypeSummaryOptions *SBTypeSummaryOptions::operator->() {
 | 
			
		||||
  return m_opaque_ap.get();
 | 
			
		||||
  return m_opaque_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const lldb_private::TypeSummaryOptions *SBTypeSummaryOptions::
 | 
			
		||||
operator->() const {
 | 
			
		||||
  return m_opaque_ap.get();
 | 
			
		||||
  return m_opaque_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lldb_private::TypeSummaryOptions *SBTypeSummaryOptions::get() {
 | 
			
		||||
  return m_opaque_ap.get();
 | 
			
		||||
  return m_opaque_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lldb_private::TypeSummaryOptions &SBTypeSummaryOptions::ref() {
 | 
			
		||||
  return *m_opaque_ap;
 | 
			
		||||
  return *m_opaque_up;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const lldb_private::TypeSummaryOptions &SBTypeSummaryOptions::ref() const {
 | 
			
		||||
  return *m_opaque_ap;
 | 
			
		||||
  return *m_opaque_up;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBTypeSummaryOptions::SBTypeSummaryOptions(
 | 
			
		||||
| 
						 | 
				
			
			@ -84,9 +84,9 @@ SBTypeSummaryOptions::SBTypeSummaryOptions(
 | 
			
		|||
void SBTypeSummaryOptions::SetOptions(
 | 
			
		||||
    const lldb_private::TypeSummaryOptions *lldb_object_ptr) {
 | 
			
		||||
  if (lldb_object_ptr)
 | 
			
		||||
    m_opaque_ap.reset(new TypeSummaryOptions(*lldb_object_ptr));
 | 
			
		||||
    m_opaque_up.reset(new TypeSummaryOptions(*lldb_object_ptr));
 | 
			
		||||
  else
 | 
			
		||||
    m_opaque_ap.reset(new TypeSummaryOptions());
 | 
			
		||||
    m_opaque_up.reset(new TypeSummaryOptions());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBTypeSummary::SBTypeSummary() : m_opaque_sp() {}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -67,77 +67,77 @@ private:
 | 
			
		|||
  std::vector<lldb::SBValue> m_values;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
SBValueList::SBValueList() : m_opaque_ap() {}
 | 
			
		||||
SBValueList::SBValueList() : m_opaque_up() {}
 | 
			
		||||
 | 
			
		||||
SBValueList::SBValueList(const SBValueList &rhs) : m_opaque_ap() {
 | 
			
		||||
SBValueList::SBValueList(const SBValueList &rhs) : m_opaque_up() {
 | 
			
		||||
  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 | 
			
		||||
 | 
			
		||||
  if (rhs.IsValid())
 | 
			
		||||
    m_opaque_ap.reset(new ValueListImpl(*rhs));
 | 
			
		||||
    m_opaque_up.reset(new ValueListImpl(*rhs));
 | 
			
		||||
 | 
			
		||||
  if (log) {
 | 
			
		||||
    log->Printf(
 | 
			
		||||
        "SBValueList::SBValueList (rhs.ap=%p) => this.ap = %p",
 | 
			
		||||
        static_cast<void *>(rhs.IsValid() ? rhs.m_opaque_ap.get() : NULL),
 | 
			
		||||
        static_cast<void *>(m_opaque_ap.get()));
 | 
			
		||||
        static_cast<void *>(rhs.IsValid() ? rhs.m_opaque_up.get() : NULL),
 | 
			
		||||
        static_cast<void *>(m_opaque_up.get()));
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBValueList::SBValueList(const ValueListImpl *lldb_object_ptr) : m_opaque_ap() {
 | 
			
		||||
SBValueList::SBValueList(const ValueListImpl *lldb_object_ptr) : m_opaque_up() {
 | 
			
		||||
  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 | 
			
		||||
 | 
			
		||||
  if (lldb_object_ptr)
 | 
			
		||||
    m_opaque_ap.reset(new ValueListImpl(*lldb_object_ptr));
 | 
			
		||||
    m_opaque_up.reset(new ValueListImpl(*lldb_object_ptr));
 | 
			
		||||
 | 
			
		||||
  if (log) {
 | 
			
		||||
    log->Printf("SBValueList::SBValueList (lldb_object_ptr=%p) => this.ap = %p",
 | 
			
		||||
                static_cast<const void *>(lldb_object_ptr),
 | 
			
		||||
                static_cast<void *>(m_opaque_ap.get()));
 | 
			
		||||
                static_cast<void *>(m_opaque_up.get()));
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBValueList::~SBValueList() {}
 | 
			
		||||
 | 
			
		||||
bool SBValueList::IsValid() const { return (m_opaque_ap != NULL); }
 | 
			
		||||
bool SBValueList::IsValid() const { return (m_opaque_up != NULL); }
 | 
			
		||||
 | 
			
		||||
void SBValueList::Clear() { m_opaque_ap.reset(); }
 | 
			
		||||
void SBValueList::Clear() { m_opaque_up.reset(); }
 | 
			
		||||
 | 
			
		||||
const SBValueList &SBValueList::operator=(const SBValueList &rhs) {
 | 
			
		||||
  if (this != &rhs) {
 | 
			
		||||
    if (rhs.IsValid())
 | 
			
		||||
      m_opaque_ap.reset(new ValueListImpl(*rhs));
 | 
			
		||||
      m_opaque_up.reset(new ValueListImpl(*rhs));
 | 
			
		||||
    else
 | 
			
		||||
      m_opaque_ap.reset();
 | 
			
		||||
      m_opaque_up.reset();
 | 
			
		||||
  }
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ValueListImpl *SBValueList::operator->() { return m_opaque_ap.get(); }
 | 
			
		||||
ValueListImpl *SBValueList::operator->() { return m_opaque_up.get(); }
 | 
			
		||||
 | 
			
		||||
ValueListImpl &SBValueList::operator*() { return *m_opaque_ap; }
 | 
			
		||||
ValueListImpl &SBValueList::operator*() { return *m_opaque_up; }
 | 
			
		||||
 | 
			
		||||
const ValueListImpl *SBValueList::operator->() const {
 | 
			
		||||
  return m_opaque_ap.get();
 | 
			
		||||
  return m_opaque_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const ValueListImpl &SBValueList::operator*() const { return *m_opaque_ap; }
 | 
			
		||||
const ValueListImpl &SBValueList::operator*() const { return *m_opaque_up; }
 | 
			
		||||
 | 
			
		||||
void SBValueList::Append(const SBValue &val_obj) {
 | 
			
		||||
  CreateIfNeeded();
 | 
			
		||||
  m_opaque_ap->Append(val_obj);
 | 
			
		||||
  m_opaque_up->Append(val_obj);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBValueList::Append(lldb::ValueObjectSP &val_obj_sp) {
 | 
			
		||||
  if (val_obj_sp) {
 | 
			
		||||
    CreateIfNeeded();
 | 
			
		||||
    m_opaque_ap->Append(SBValue(val_obj_sp));
 | 
			
		||||
    m_opaque_up->Append(SBValue(val_obj_sp));
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBValueList::Append(const lldb::SBValueList &value_list) {
 | 
			
		||||
  if (value_list.IsValid()) {
 | 
			
		||||
    CreateIfNeeded();
 | 
			
		||||
    m_opaque_ap->Append(*value_list);
 | 
			
		||||
    m_opaque_up->Append(*value_list);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -149,15 +149,15 @@ SBValue SBValueList::GetValueAtIndex(uint32_t idx) const {
 | 
			
		|||
  //    idx);
 | 
			
		||||
 | 
			
		||||
  SBValue sb_value;
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    sb_value = m_opaque_ap->GetValueAtIndex(idx);
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    sb_value = m_opaque_up->GetValueAtIndex(idx);
 | 
			
		||||
 | 
			
		||||
  if (log) {
 | 
			
		||||
    SBStream sstr;
 | 
			
		||||
    sb_value.GetDescription(sstr);
 | 
			
		||||
    log->Printf("SBValueList::GetValueAtIndex (this.ap=%p, idx=%d) => SBValue "
 | 
			
		||||
                "(this.sp = %p, '%s')",
 | 
			
		||||
                static_cast<void *>(m_opaque_ap.get()), idx,
 | 
			
		||||
                static_cast<void *>(m_opaque_up.get()), idx,
 | 
			
		||||
                static_cast<void *>(sb_value.GetSP().get()), sstr.GetData());
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -171,38 +171,38 @@ uint32_t SBValueList::GetSize() const {
 | 
			
		|||
  //    log->Printf ("SBValueList::GetSize ()");
 | 
			
		||||
 | 
			
		||||
  uint32_t size = 0;
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    size = m_opaque_ap->GetSize();
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    size = m_opaque_up->GetSize();
 | 
			
		||||
 | 
			
		||||
  if (log)
 | 
			
		||||
    log->Printf("SBValueList::GetSize (this.ap=%p) => %d",
 | 
			
		||||
                static_cast<void *>(m_opaque_ap.get()), size);
 | 
			
		||||
                static_cast<void *>(m_opaque_up.get()), size);
 | 
			
		||||
 | 
			
		||||
  return size;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBValueList::CreateIfNeeded() {
 | 
			
		||||
  if (m_opaque_ap == NULL)
 | 
			
		||||
    m_opaque_ap.reset(new ValueListImpl());
 | 
			
		||||
  if (m_opaque_up == NULL)
 | 
			
		||||
    m_opaque_up.reset(new ValueListImpl());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBValue SBValueList::FindValueObjectByUID(lldb::user_id_t uid) {
 | 
			
		||||
  SBValue sb_value;
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    sb_value = m_opaque_ap->FindValueByUID(uid);
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    sb_value = m_opaque_up->FindValueByUID(uid);
 | 
			
		||||
  return sb_value;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBValue SBValueList::GetFirstValueByName(const char *name) const {
 | 
			
		||||
  SBValue sb_value;
 | 
			
		||||
  if (m_opaque_ap)
 | 
			
		||||
    sb_value = m_opaque_ap->GetFirstValueByName(name);
 | 
			
		||||
  if (m_opaque_up)
 | 
			
		||||
    sb_value = m_opaque_up->GetFirstValueByName(name);
 | 
			
		||||
  return sb_value;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void *SBValueList::opaque_ptr() { return m_opaque_ap.get(); }
 | 
			
		||||
void *SBValueList::opaque_ptr() { return m_opaque_up.get(); }
 | 
			
		||||
 | 
			
		||||
ValueListImpl &SBValueList::ref() {
 | 
			
		||||
  CreateIfNeeded();
 | 
			
		||||
  return *m_opaque_ap;
 | 
			
		||||
  return *m_opaque_up;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -80,98 +80,98 @@ private:
 | 
			
		|||
};
 | 
			
		||||
 | 
			
		||||
SBVariablesOptions::SBVariablesOptions()
 | 
			
		||||
    : m_opaque_ap(new VariablesOptionsImpl()) {}
 | 
			
		||||
    : m_opaque_up(new VariablesOptionsImpl()) {}
 | 
			
		||||
 | 
			
		||||
SBVariablesOptions::SBVariablesOptions(const SBVariablesOptions &options)
 | 
			
		||||
    : m_opaque_ap(new VariablesOptionsImpl(options.ref())) {}
 | 
			
		||||
    : m_opaque_up(new VariablesOptionsImpl(options.ref())) {}
 | 
			
		||||
 | 
			
		||||
SBVariablesOptions &SBVariablesOptions::
 | 
			
		||||
operator=(const SBVariablesOptions &options) {
 | 
			
		||||
  m_opaque_ap.reset(new VariablesOptionsImpl(options.ref()));
 | 
			
		||||
  m_opaque_up.reset(new VariablesOptionsImpl(options.ref()));
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBVariablesOptions::~SBVariablesOptions() = default;
 | 
			
		||||
 | 
			
		||||
bool SBVariablesOptions::IsValid() const { return m_opaque_ap != nullptr; }
 | 
			
		||||
bool SBVariablesOptions::IsValid() const { return m_opaque_up != nullptr; }
 | 
			
		||||
 | 
			
		||||
bool SBVariablesOptions::GetIncludeArguments() const {
 | 
			
		||||
  return m_opaque_ap->GetIncludeArguments();
 | 
			
		||||
  return m_opaque_up->GetIncludeArguments();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBVariablesOptions::SetIncludeArguments(bool arguments) {
 | 
			
		||||
  m_opaque_ap->SetIncludeArguments(arguments);
 | 
			
		||||
  m_opaque_up->SetIncludeArguments(arguments);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBVariablesOptions::GetIncludeRecognizedArguments(
 | 
			
		||||
    const lldb::SBTarget &target) const {
 | 
			
		||||
  return m_opaque_ap->GetIncludeRecognizedArguments(target.GetSP());
 | 
			
		||||
  return m_opaque_up->GetIncludeRecognizedArguments(target.GetSP());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBVariablesOptions::SetIncludeRecognizedArguments(bool arguments) {
 | 
			
		||||
  m_opaque_ap->SetIncludeRecognizedArguments(arguments);
 | 
			
		||||
  m_opaque_up->SetIncludeRecognizedArguments(arguments);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBVariablesOptions::GetIncludeLocals() const {
 | 
			
		||||
  return m_opaque_ap->GetIncludeLocals();
 | 
			
		||||
  return m_opaque_up->GetIncludeLocals();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBVariablesOptions::SetIncludeLocals(bool locals) {
 | 
			
		||||
  m_opaque_ap->SetIncludeLocals(locals);
 | 
			
		||||
  m_opaque_up->SetIncludeLocals(locals);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBVariablesOptions::GetIncludeStatics() const {
 | 
			
		||||
  return m_opaque_ap->GetIncludeStatics();
 | 
			
		||||
  return m_opaque_up->GetIncludeStatics();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBVariablesOptions::SetIncludeStatics(bool statics) {
 | 
			
		||||
  m_opaque_ap->SetIncludeStatics(statics);
 | 
			
		||||
  m_opaque_up->SetIncludeStatics(statics);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBVariablesOptions::GetInScopeOnly() const {
 | 
			
		||||
  return m_opaque_ap->GetInScopeOnly();
 | 
			
		||||
  return m_opaque_up->GetInScopeOnly();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBVariablesOptions::SetInScopeOnly(bool in_scope_only) {
 | 
			
		||||
  m_opaque_ap->SetInScopeOnly(in_scope_only);
 | 
			
		||||
  m_opaque_up->SetInScopeOnly(in_scope_only);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool SBVariablesOptions::GetIncludeRuntimeSupportValues() const {
 | 
			
		||||
  return m_opaque_ap->GetIncludeRuntimeSupportValues();
 | 
			
		||||
  return m_opaque_up->GetIncludeRuntimeSupportValues();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBVariablesOptions::SetIncludeRuntimeSupportValues(
 | 
			
		||||
    bool runtime_support_values) {
 | 
			
		||||
  m_opaque_ap->SetIncludeRuntimeSupportValues(runtime_support_values);
 | 
			
		||||
  m_opaque_up->SetIncludeRuntimeSupportValues(runtime_support_values);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
lldb::DynamicValueType SBVariablesOptions::GetUseDynamic() const {
 | 
			
		||||
  return m_opaque_ap->GetUseDynamic();
 | 
			
		||||
  return m_opaque_up->GetUseDynamic();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SBVariablesOptions::SetUseDynamic(lldb::DynamicValueType dynamic) {
 | 
			
		||||
  m_opaque_ap->SetUseDynamic(dynamic);
 | 
			
		||||
  m_opaque_up->SetUseDynamic(dynamic);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
VariablesOptionsImpl *SBVariablesOptions::operator->() {
 | 
			
		||||
  return m_opaque_ap.operator->();
 | 
			
		||||
  return m_opaque_up.operator->();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const VariablesOptionsImpl *SBVariablesOptions::operator->() const {
 | 
			
		||||
  return m_opaque_ap.operator->();
 | 
			
		||||
  return m_opaque_up.operator->();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
VariablesOptionsImpl *SBVariablesOptions::get() { return m_opaque_ap.get(); }
 | 
			
		||||
VariablesOptionsImpl *SBVariablesOptions::get() { return m_opaque_up.get(); }
 | 
			
		||||
 | 
			
		||||
VariablesOptionsImpl &SBVariablesOptions::ref() { return *m_opaque_ap; }
 | 
			
		||||
VariablesOptionsImpl &SBVariablesOptions::ref() { return *m_opaque_up; }
 | 
			
		||||
 | 
			
		||||
const VariablesOptionsImpl &SBVariablesOptions::ref() const {
 | 
			
		||||
  return *m_opaque_ap;
 | 
			
		||||
  return *m_opaque_up;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SBVariablesOptions::SBVariablesOptions(VariablesOptionsImpl *lldb_object_ptr)
 | 
			
		||||
    : m_opaque_ap(std::move(lldb_object_ptr)) {}
 | 
			
		||||
    : m_opaque_up(std::move(lldb_object_ptr)) {}
 | 
			
		||||
 | 
			
		||||
void SBVariablesOptions::SetOptions(VariablesOptionsImpl *lldb_object_ptr) {
 | 
			
		||||
  m_opaque_ap.reset(std::move(lldb_object_ptr));
 | 
			
		||||
  m_opaque_up.reset(std::move(lldb_object_ptr));
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -35,7 +35,7 @@ BreakpointLocation::BreakpointLocation(break_id_t loc_id, Breakpoint &owner,
 | 
			
		|||
                        hardware),
 | 
			
		||||
      m_being_created(true), m_should_resolve_indirect_functions(false),
 | 
			
		||||
      m_is_reexported(false), m_is_indirect(false), m_address(addr),
 | 
			
		||||
      m_owner(owner), m_options_ap(), m_bp_site_sp(), m_condition_mutex() {
 | 
			
		||||
      m_owner(owner), m_options_up(), m_bp_site_sp(), m_condition_mutex() {
 | 
			
		||||
  if (check_for_resolver) {
 | 
			
		||||
    Symbol *symbol = m_address.CalculateSymbolContextSymbol();
 | 
			
		||||
    if (symbol && symbol->IsIndirect()) {
 | 
			
		||||
| 
						 | 
				
			
			@ -56,10 +56,10 @@ lldb::addr_t BreakpointLocation::GetLoadAddress() const {
 | 
			
		|||
const BreakpointOptions *
 | 
			
		||||
BreakpointLocation::GetOptionsSpecifyingKind(BreakpointOptions::OptionKind kind)
 | 
			
		||||
const {
 | 
			
		||||
    if (m_options_ap && m_options_ap->IsOptionSet(kind))
 | 
			
		||||
      return m_options_ap.get();
 | 
			
		||||
    else
 | 
			
		||||
      return m_owner.GetOptions();
 | 
			
		||||
  if (m_options_up && m_options_up->IsOptionSet(kind))
 | 
			
		||||
    return m_options_up.get();
 | 
			
		||||
  else
 | 
			
		||||
    return m_owner.GetOptions();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Address &BreakpointLocation::GetAddress() { return m_address; }
 | 
			
		||||
| 
						 | 
				
			
			@ -71,8 +71,8 @@ Target &BreakpointLocation::GetTarget() { return m_owner.GetTarget(); }
 | 
			
		|||
bool BreakpointLocation::IsEnabled() const {
 | 
			
		||||
  if (!m_owner.IsEnabled())
 | 
			
		||||
    return false;
 | 
			
		||||
  else if (m_options_ap != nullptr)
 | 
			
		||||
    return m_options_ap->IsEnabled();
 | 
			
		||||
  else if (m_options_up != nullptr)
 | 
			
		||||
    return m_options_up->IsEnabled();
 | 
			
		||||
  else
 | 
			
		||||
    return true;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -89,9 +89,9 @@ void BreakpointLocation::SetEnabled(bool enabled) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
bool BreakpointLocation::IsAutoContinue() const {
 | 
			
		||||
  if (m_options_ap 
 | 
			
		||||
      && m_options_ap->IsOptionSet(BreakpointOptions::eAutoContinue))
 | 
			
		||||
    return m_options_ap->IsAutoContinue();
 | 
			
		||||
  if (m_options_up &&
 | 
			
		||||
      m_options_up->IsOptionSet(BreakpointOptions::eAutoContinue))
 | 
			
		||||
    return m_options_up->IsAutoContinue();
 | 
			
		||||
  else
 | 
			
		||||
    return m_owner.IsAutoContinue();
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -107,8 +107,8 @@ void BreakpointLocation::SetThreadID(lldb::tid_t thread_id) {
 | 
			
		|||
  else {
 | 
			
		||||
    // If we're resetting this to an invalid thread id, then don't make an
 | 
			
		||||
    // options pointer just to do that.
 | 
			
		||||
    if (m_options_ap != nullptr)
 | 
			
		||||
      m_options_ap->SetThreadID(thread_id);
 | 
			
		||||
    if (m_options_up != nullptr)
 | 
			
		||||
      m_options_up->SetThreadID(thread_id);
 | 
			
		||||
  }
 | 
			
		||||
  SendBreakpointLocationChangedEvent(eBreakpointEventTypeThreadChanged);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -129,8 +129,8 @@ void BreakpointLocation::SetThreadIndex(uint32_t index) {
 | 
			
		|||
  else {
 | 
			
		||||
    // If we're resetting this to an invalid thread id, then don't make an
 | 
			
		||||
    // options pointer just to do that.
 | 
			
		||||
    if (m_options_ap != nullptr)
 | 
			
		||||
      m_options_ap->GetThreadSpec()->SetIndex(index);
 | 
			
		||||
    if (m_options_up != nullptr)
 | 
			
		||||
      m_options_up->GetThreadSpec()->SetIndex(index);
 | 
			
		||||
  }
 | 
			
		||||
  SendBreakpointLocationChangedEvent(eBreakpointEventTypeThreadChanged);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -151,8 +151,8 @@ void BreakpointLocation::SetThreadName(const char *thread_name) {
 | 
			
		|||
  else {
 | 
			
		||||
    // If we're resetting this to an invalid thread id, then don't make an
 | 
			
		||||
    // options pointer just to do that.
 | 
			
		||||
    if (m_options_ap != nullptr)
 | 
			
		||||
      m_options_ap->GetThreadSpec()->SetName(thread_name);
 | 
			
		||||
    if (m_options_up != nullptr)
 | 
			
		||||
      m_options_up->GetThreadSpec()->SetName(thread_name);
 | 
			
		||||
  }
 | 
			
		||||
  SendBreakpointLocationChangedEvent(eBreakpointEventTypeThreadChanged);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -173,8 +173,8 @@ void BreakpointLocation::SetQueueName(const char *queue_name) {
 | 
			
		|||
  else {
 | 
			
		||||
    // If we're resetting this to an invalid thread id, then don't make an
 | 
			
		||||
    // options pointer just to do that.
 | 
			
		||||
    if (m_options_ap != nullptr)
 | 
			
		||||
      m_options_ap->GetThreadSpec()->SetQueueName(queue_name);
 | 
			
		||||
    if (m_options_up != nullptr)
 | 
			
		||||
      m_options_up->GetThreadSpec()->SetQueueName(queue_name);
 | 
			
		||||
  }
 | 
			
		||||
  SendBreakpointLocationChangedEvent(eBreakpointEventTypeThreadChanged);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -190,8 +190,8 @@ const char *BreakpointLocation::GetQueueName() const {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
bool BreakpointLocation::InvokeCallback(StoppointCallbackContext *context) {
 | 
			
		||||
  if (m_options_ap != nullptr && m_options_ap->HasCallback())
 | 
			
		||||
    return m_options_ap->InvokeCallback(context, m_owner.GetID(), GetID());
 | 
			
		||||
  if (m_options_up != nullptr && m_options_up->HasCallback())
 | 
			
		||||
    return m_options_up->InvokeCallback(context, m_owner.GetID(), GetID());
 | 
			
		||||
  else
 | 
			
		||||
    return m_owner.InvokeCallback(context, GetID());
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -344,16 +344,16 @@ void BreakpointLocation::SetIgnoreCount(uint32_t n) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
void BreakpointLocation::DecrementIgnoreCount() {
 | 
			
		||||
  if (m_options_ap != nullptr) {
 | 
			
		||||
    uint32_t loc_ignore = m_options_ap->GetIgnoreCount();
 | 
			
		||||
  if (m_options_up != nullptr) {
 | 
			
		||||
    uint32_t loc_ignore = m_options_up->GetIgnoreCount();
 | 
			
		||||
    if (loc_ignore != 0)
 | 
			
		||||
      m_options_ap->SetIgnoreCount(loc_ignore - 1);
 | 
			
		||||
      m_options_up->SetIgnoreCount(loc_ignore - 1);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool BreakpointLocation::IgnoreCountShouldStop() {
 | 
			
		||||
  if (m_options_ap != nullptr) {
 | 
			
		||||
    uint32_t loc_ignore = m_options_ap->GetIgnoreCount();
 | 
			
		||||
  if (m_options_up != nullptr) {
 | 
			
		||||
    uint32_t loc_ignore = m_options_up->GetIgnoreCount();
 | 
			
		||||
    if (loc_ignore != 0) {
 | 
			
		||||
      m_owner.DecrementIgnoreCount();
 | 
			
		||||
      DecrementIgnoreCount(); // Have to decrement our owners' ignore count,
 | 
			
		||||
| 
						 | 
				
			
			@ -369,11 +369,10 @@ BreakpointOptions *BreakpointLocation::GetLocationOptions() {
 | 
			
		|||
  // If we make the copy we don't copy the callbacks because that is
 | 
			
		||||
  // potentially expensive and we don't want to do that for the simple case
 | 
			
		||||
  // where someone is just disabling the location.
 | 
			
		||||
  if (m_options_ap == nullptr)
 | 
			
		||||
    m_options_ap.reset(
 | 
			
		||||
        new BreakpointOptions(false));
 | 
			
		||||
  if (m_options_up == nullptr)
 | 
			
		||||
    m_options_up.reset(new BreakpointOptions(false));
 | 
			
		||||
 | 
			
		||||
  return m_options_ap.get();
 | 
			
		||||
  return m_options_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool BreakpointLocation::ValidForThisThread(Thread *thread) {
 | 
			
		||||
| 
						 | 
				
			
			@ -603,17 +602,17 @@ void BreakpointLocation::GetDescription(Stream *s,
 | 
			
		|||
    s->Indent();
 | 
			
		||||
    s->Printf("hit count = %-4u\n", GetHitCount());
 | 
			
		||||
 | 
			
		||||
    if (m_options_ap) {
 | 
			
		||||
    if (m_options_up) {
 | 
			
		||||
      s->Indent();
 | 
			
		||||
      m_options_ap->GetDescription(s, level);
 | 
			
		||||
      m_options_up->GetDescription(s, level);
 | 
			
		||||
      s->EOL();
 | 
			
		||||
    }
 | 
			
		||||
    s->IndentLess();
 | 
			
		||||
  } else if (level != eDescriptionLevelInitial) {
 | 
			
		||||
    s->Printf(", %sresolved, hit count = %u ", (IsResolved() ? "" : "un"),
 | 
			
		||||
              GetHitCount());
 | 
			
		||||
    if (m_options_ap) {
 | 
			
		||||
      m_options_ap->GetDescription(s, level);
 | 
			
		||||
    if (m_options_up) {
 | 
			
		||||
      m_options_up->GetDescription(s, level);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -629,7 +628,7 @@ void BreakpointLocation::Dump(Stream *s) const {
 | 
			
		|||
            "hw_index = %i  hit_count = %-4u  ignore_count = %-4u",
 | 
			
		||||
            GetID(), tid,
 | 
			
		||||
            (uint64_t)m_address.GetOpcodeLoadAddress(&m_owner.GetTarget()),
 | 
			
		||||
            (m_options_ap ? m_options_ap->IsEnabled() : m_owner.IsEnabled())
 | 
			
		||||
            (m_options_up ? m_options_up->IsEnabled() : m_owner.IsEnabled())
 | 
			
		||||
                ? "enabled "
 | 
			
		||||
                : "disabled",
 | 
			
		||||
            IsHardware() ? "hardware" : "software", GetHardwareIndex(),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -125,12 +125,12 @@ bool BreakpointOptions::NullCallback(void *baton,
 | 
			
		|||
BreakpointOptions::BreakpointOptions(bool all_flags_set)
 | 
			
		||||
    : m_callback(BreakpointOptions::NullCallback), m_callback_baton_sp(),
 | 
			
		||||
      m_baton_is_command_baton(false), m_callback_is_synchronous(false),
 | 
			
		||||
      m_enabled(true), m_one_shot(false), m_ignore_count(0), m_thread_spec_ap(),
 | 
			
		||||
      m_enabled(true), m_one_shot(false), m_ignore_count(0), m_thread_spec_up(),
 | 
			
		||||
      m_condition_text(), m_condition_text_hash(0), m_auto_continue(false),
 | 
			
		||||
      m_set_flags(0) {
 | 
			
		||||
        if (all_flags_set)
 | 
			
		||||
          m_set_flags.Set(~((Flags::ValueType) 0));
 | 
			
		||||
      }
 | 
			
		||||
  if (all_flags_set)
 | 
			
		||||
    m_set_flags.Set(~((Flags::ValueType)0));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
BreakpointOptions::BreakpointOptions(const char *condition, bool enabled,
 | 
			
		||||
                                     int32_t ignore, bool one_shot, 
 | 
			
		||||
| 
						 | 
				
			
			@ -155,11 +155,10 @@ BreakpointOptions::BreakpointOptions(const BreakpointOptions &rhs)
 | 
			
		|||
      m_baton_is_command_baton(rhs.m_baton_is_command_baton),
 | 
			
		||||
      m_callback_is_synchronous(rhs.m_callback_is_synchronous),
 | 
			
		||||
      m_enabled(rhs.m_enabled), m_one_shot(rhs.m_one_shot),
 | 
			
		||||
      m_ignore_count(rhs.m_ignore_count), m_thread_spec_ap(),
 | 
			
		||||
      m_auto_continue(rhs.m_auto_continue),
 | 
			
		||||
      m_set_flags(rhs.m_set_flags) {
 | 
			
		||||
  if (rhs.m_thread_spec_ap != nullptr)
 | 
			
		||||
    m_thread_spec_ap.reset(new ThreadSpec(*rhs.m_thread_spec_ap));
 | 
			
		||||
      m_ignore_count(rhs.m_ignore_count), m_thread_spec_up(),
 | 
			
		||||
      m_auto_continue(rhs.m_auto_continue), m_set_flags(rhs.m_set_flags) {
 | 
			
		||||
  if (rhs.m_thread_spec_up != nullptr)
 | 
			
		||||
    m_thread_spec_up.reset(new ThreadSpec(*rhs.m_thread_spec_up));
 | 
			
		||||
  m_condition_text = rhs.m_condition_text;
 | 
			
		||||
  m_condition_text_hash = rhs.m_condition_text_hash;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -176,8 +175,8 @@ operator=(const BreakpointOptions &rhs) {
 | 
			
		|||
  m_enabled = rhs.m_enabled;
 | 
			
		||||
  m_one_shot = rhs.m_one_shot;
 | 
			
		||||
  m_ignore_count = rhs.m_ignore_count;
 | 
			
		||||
  if (rhs.m_thread_spec_ap != nullptr)
 | 
			
		||||
    m_thread_spec_ap.reset(new ThreadSpec(*rhs.m_thread_spec_ap));
 | 
			
		||||
  if (rhs.m_thread_spec_up != nullptr)
 | 
			
		||||
    m_thread_spec_up.reset(new ThreadSpec(*rhs.m_thread_spec_up));
 | 
			
		||||
  m_condition_text = rhs.m_condition_text;
 | 
			
		||||
  m_condition_text_hash = rhs.m_condition_text_hash;
 | 
			
		||||
  m_auto_continue = rhs.m_auto_continue;
 | 
			
		||||
| 
						 | 
				
			
			@ -228,12 +227,11 @@ void BreakpointOptions::CopyOverSetOptions(const BreakpointOptions &incoming)
 | 
			
		|||
    m_auto_continue = incoming.m_auto_continue;
 | 
			
		||||
    m_set_flags.Set(eAutoContinue);
 | 
			
		||||
  }
 | 
			
		||||
  if (incoming.m_set_flags.Test(eThreadSpec) && incoming.m_thread_spec_ap)
 | 
			
		||||
  {
 | 
			
		||||
    if (!m_thread_spec_ap)
 | 
			
		||||
      m_thread_spec_ap.reset(new ThreadSpec(*incoming.m_thread_spec_ap));
 | 
			
		||||
  if (incoming.m_set_flags.Test(eThreadSpec) && incoming.m_thread_spec_up) {
 | 
			
		||||
    if (!m_thread_spec_up)
 | 
			
		||||
      m_thread_spec_up.reset(new ThreadSpec(*incoming.m_thread_spec_up));
 | 
			
		||||
    else
 | 
			
		||||
      *m_thread_spec_ap = *incoming.m_thread_spec_ap;
 | 
			
		||||
      *m_thread_spec_up = *incoming.m_thread_spec_up;
 | 
			
		||||
    m_set_flags.Set(eThreadSpec);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -404,9 +402,9 @@ StructuredData::ObjectSP BreakpointOptions::SerializeToStructuredData() {
 | 
			
		|||
          BreakpointOptions::CommandData::GetSerializationKey(), commands_sp);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  if (m_set_flags.Test(eThreadSpec) && m_thread_spec_ap) {
 | 
			
		||||
  if (m_set_flags.Test(eThreadSpec) && m_thread_spec_up) {
 | 
			
		||||
    StructuredData::ObjectSP thread_spec_sp =
 | 
			
		||||
        m_thread_spec_ap->SerializeToStructuredData();
 | 
			
		||||
        m_thread_spec_up->SerializeToStructuredData();
 | 
			
		||||
    options_dict_sp->AddItem(ThreadSpec::GetSerializationKey(), thread_spec_sp);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -521,16 +519,16 @@ const char *BreakpointOptions::GetConditionText(size_t *hash) const {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
const ThreadSpec *BreakpointOptions::GetThreadSpecNoCreate() const {
 | 
			
		||||
  return m_thread_spec_ap.get();
 | 
			
		||||
  return m_thread_spec_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ThreadSpec *BreakpointOptions::GetThreadSpec() {
 | 
			
		||||
  if (m_thread_spec_ap == nullptr) {
 | 
			
		||||
  if (m_thread_spec_up == nullptr) {
 | 
			
		||||
    m_set_flags.Set(eThreadSpec);
 | 
			
		||||
    m_thread_spec_ap.reset(new ThreadSpec());
 | 
			
		||||
    m_thread_spec_up.reset(new ThreadSpec());
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return m_thread_spec_ap.get();
 | 
			
		||||
  return m_thread_spec_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void BreakpointOptions::SetThreadID(lldb::tid_t thread_id) {
 | 
			
		||||
| 
						 | 
				
			
			@ -540,7 +538,7 @@ void BreakpointOptions::SetThreadID(lldb::tid_t thread_id) {
 | 
			
		|||
 | 
			
		||||
void BreakpointOptions::SetThreadSpec(
 | 
			
		||||
    std::unique_ptr<ThreadSpec> &thread_spec_up) {
 | 
			
		||||
  m_thread_spec_ap = std::move(thread_spec_up);
 | 
			
		||||
  m_thread_spec_up = std::move(thread_spec_up);
 | 
			
		||||
  m_set_flags.Set(eThreadSpec);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -572,8 +570,8 @@ void BreakpointOptions::GetDescription(Stream *s,
 | 
			
		|||
    if (m_auto_continue)
 | 
			
		||||
      s->Printf("auto-continue ");
 | 
			
		||||
 | 
			
		||||
    if (m_thread_spec_ap)
 | 
			
		||||
      m_thread_spec_ap->GetDescription(s, level);
 | 
			
		||||
    if (m_thread_spec_up)
 | 
			
		||||
      m_thread_spec_up->GetDescription(s, level);
 | 
			
		||||
 | 
			
		||||
    if (level == lldb::eDescriptionLevelFull) {
 | 
			
		||||
      s->IndentLess();
 | 
			
		||||
| 
						 | 
				
			
			@ -678,7 +676,7 @@ bool BreakpointOptions::BreakpointOptionsCallbackFunction(
 | 
			
		|||
void BreakpointOptions::Clear()
 | 
			
		||||
{
 | 
			
		||||
  m_set_flags.Clear();
 | 
			
		||||
  m_thread_spec_ap.release();
 | 
			
		||||
  m_thread_spec_up.release();
 | 
			
		||||
  m_one_shot = false;
 | 
			
		||||
  m_ignore_count = 0;
 | 
			
		||||
  m_auto_continue = false;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -272,26 +272,26 @@ bool Watchpoint::InvokeCallback(StoppointCallbackContext *context) {
 | 
			
		|||
 | 
			
		||||
void Watchpoint::SetCondition(const char *condition) {
 | 
			
		||||
  if (condition == nullptr || condition[0] == '\0') {
 | 
			
		||||
    if (m_condition_ap)
 | 
			
		||||
      m_condition_ap.reset();
 | 
			
		||||
    if (m_condition_up)
 | 
			
		||||
      m_condition_up.reset();
 | 
			
		||||
  } else {
 | 
			
		||||
    // Pass nullptr for expr_prefix (no translation-unit level definitions).
 | 
			
		||||
    Status error;
 | 
			
		||||
    m_condition_ap.reset(m_target.GetUserExpressionForLanguage(
 | 
			
		||||
    m_condition_up.reset(m_target.GetUserExpressionForLanguage(
 | 
			
		||||
        condition, llvm::StringRef(), lldb::eLanguageTypeUnknown,
 | 
			
		||||
        UserExpression::eResultTypeAny, EvaluateExpressionOptions(),
 | 
			
		||||
        nullptr, error));
 | 
			
		||||
        UserExpression::eResultTypeAny, EvaluateExpressionOptions(), nullptr,
 | 
			
		||||
        error));
 | 
			
		||||
    if (error.Fail()) {
 | 
			
		||||
      // FIXME: Log something...
 | 
			
		||||
      m_condition_ap.reset();
 | 
			
		||||
      m_condition_up.reset();
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  SendWatchpointChangedEvent(eWatchpointEventTypeConditionChanged);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const char *Watchpoint::GetConditionText() const {
 | 
			
		||||
  if (m_condition_ap)
 | 
			
		||||
    return m_condition_ap->GetUserText();
 | 
			
		||||
  if (m_condition_up)
 | 
			
		||||
    return m_condition_up->GetUserText();
 | 
			
		||||
  else
 | 
			
		||||
    return nullptr;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -30,7 +30,7 @@ bool WatchpointOptions::NullCallback(void *baton,
 | 
			
		|||
//----------------------------------------------------------------------
 | 
			
		||||
WatchpointOptions::WatchpointOptions()
 | 
			
		||||
    : m_callback(WatchpointOptions::NullCallback), m_callback_baton_sp(),
 | 
			
		||||
      m_callback_is_synchronous(false), m_thread_spec_ap() {}
 | 
			
		||||
      m_callback_is_synchronous(false), m_thread_spec_up() {}
 | 
			
		||||
 | 
			
		||||
//----------------------------------------------------------------------
 | 
			
		||||
// WatchpointOptions copy constructor
 | 
			
		||||
| 
						 | 
				
			
			@ -38,9 +38,9 @@ WatchpointOptions::WatchpointOptions()
 | 
			
		|||
WatchpointOptions::WatchpointOptions(const WatchpointOptions &rhs)
 | 
			
		||||
    : m_callback(rhs.m_callback), m_callback_baton_sp(rhs.m_callback_baton_sp),
 | 
			
		||||
      m_callback_is_synchronous(rhs.m_callback_is_synchronous),
 | 
			
		||||
      m_thread_spec_ap() {
 | 
			
		||||
  if (rhs.m_thread_spec_ap != nullptr)
 | 
			
		||||
    m_thread_spec_ap.reset(new ThreadSpec(*rhs.m_thread_spec_ap));
 | 
			
		||||
      m_thread_spec_up() {
 | 
			
		||||
  if (rhs.m_thread_spec_up != nullptr)
 | 
			
		||||
    m_thread_spec_up.reset(new ThreadSpec(*rhs.m_thread_spec_up));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//----------------------------------------------------------------------
 | 
			
		||||
| 
						 | 
				
			
			@ -51,8 +51,8 @@ operator=(const WatchpointOptions &rhs) {
 | 
			
		|||
  m_callback = rhs.m_callback;
 | 
			
		||||
  m_callback_baton_sp = rhs.m_callback_baton_sp;
 | 
			
		||||
  m_callback_is_synchronous = rhs.m_callback_is_synchronous;
 | 
			
		||||
  if (rhs.m_thread_spec_ap != nullptr)
 | 
			
		||||
    m_thread_spec_ap.reset(new ThreadSpec(*rhs.m_thread_spec_ap));
 | 
			
		||||
  if (rhs.m_thread_spec_up != nullptr)
 | 
			
		||||
    m_thread_spec_up.reset(new ThreadSpec(*rhs.m_thread_spec_up));
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -113,14 +113,14 @@ bool WatchpointOptions::HasCallback() {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
const ThreadSpec *WatchpointOptions::GetThreadSpecNoCreate() const {
 | 
			
		||||
  return m_thread_spec_ap.get();
 | 
			
		||||
  return m_thread_spec_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ThreadSpec *WatchpointOptions::GetThreadSpec() {
 | 
			
		||||
  if (m_thread_spec_ap == nullptr)
 | 
			
		||||
    m_thread_spec_ap.reset(new ThreadSpec());
 | 
			
		||||
  if (m_thread_spec_up == nullptr)
 | 
			
		||||
    m_thread_spec_up.reset(new ThreadSpec());
 | 
			
		||||
 | 
			
		||||
  return m_thread_spec_ap.get();
 | 
			
		||||
  return m_thread_spec_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void WatchpointOptions::SetThreadID(lldb::tid_t thread_id) {
 | 
			
		||||
| 
						 | 
				
			
			@ -152,8 +152,8 @@ void WatchpointOptions::GetDescription(Stream *s,
 | 
			
		|||
    } else
 | 
			
		||||
      s->PutCString(" Options: ");
 | 
			
		||||
 | 
			
		||||
    if (m_thread_spec_ap)
 | 
			
		||||
      m_thread_spec_ap->GetDescription(s, level);
 | 
			
		||||
    if (m_thread_spec_up)
 | 
			
		||||
      m_thread_spec_up->GetDescription(s, level);
 | 
			
		||||
    else if (level == eDescriptionLevelBrief)
 | 
			
		||||
      s->PutCString("thread spec: no ");
 | 
			
		||||
    if (level == lldb::eDescriptionLevelFull) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -890,11 +890,11 @@ protected:
 | 
			
		|||
    auto command_name = args[0].ref;
 | 
			
		||||
    if (!m_interpreter.CommandExists(command_name)) {
 | 
			
		||||
      StreamString error_msg_stream;
 | 
			
		||||
      const bool generate_apropos = true;
 | 
			
		||||
      const bool generate_upropos = true;
 | 
			
		||||
      const bool generate_type_lookup = false;
 | 
			
		||||
      CommandObjectHelp::GenerateAdditionalHelpAvenuesMessage(
 | 
			
		||||
          &error_msg_stream, command_name, llvm::StringRef(), llvm::StringRef(),
 | 
			
		||||
          generate_apropos, generate_type_lookup);
 | 
			
		||||
          generate_upropos, generate_type_lookup);
 | 
			
		||||
      result.AppendError(error_msg_stream.GetString());
 | 
			
		||||
      result.SetStatus(eReturnStatusFailed);
 | 
			
		||||
      return false;
 | 
			
		||||
| 
						 | 
				
			
			@ -988,7 +988,7 @@ protected:
 | 
			
		|||
  void IOHandlerInputComplete(IOHandler &io_handler,
 | 
			
		||||
                              std::string &data) override {
 | 
			
		||||
    io_handler.SetIsDone(true);
 | 
			
		||||
    if (m_regex_cmd_ap) {
 | 
			
		||||
    if (m_regex_cmd_up) {
 | 
			
		||||
      StringList lines;
 | 
			
		||||
      if (lines.SplitIntoLines(data)) {
 | 
			
		||||
        const size_t num_lines = lines.GetSize();
 | 
			
		||||
| 
						 | 
				
			
			@ -1007,8 +1007,8 @@ protected:
 | 
			
		|||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (m_regex_cmd_ap->HasRegexEntries()) {
 | 
			
		||||
        CommandObjectSP cmd_sp(m_regex_cmd_ap.release());
 | 
			
		||||
      if (m_regex_cmd_up->HasRegexEntries()) {
 | 
			
		||||
        CommandObjectSP cmd_sp(m_regex_cmd_up.release());
 | 
			
		||||
        m_interpreter.AddCommand(cmd_sp->GetCommandName(), cmd_sp, true);
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -1025,7 +1025,7 @@ protected:
 | 
			
		|||
 | 
			
		||||
    Status error;
 | 
			
		||||
    auto name = command[0].ref;
 | 
			
		||||
    m_regex_cmd_ap = llvm::make_unique<CommandObjectRegexCommand>(
 | 
			
		||||
    m_regex_cmd_up = llvm::make_unique<CommandObjectRegexCommand>(
 | 
			
		||||
        m_interpreter, name, m_options.GetHelp(), m_options.GetSyntax(), 10, 0,
 | 
			
		||||
        true);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1070,7 +1070,7 @@ protected:
 | 
			
		|||
                                 bool check_only) {
 | 
			
		||||
    Status error;
 | 
			
		||||
 | 
			
		||||
    if (!m_regex_cmd_ap) {
 | 
			
		||||
    if (!m_regex_cmd_up) {
 | 
			
		||||
      error.SetErrorStringWithFormat(
 | 
			
		||||
          "invalid regular expression command object for: '%.*s'",
 | 
			
		||||
          (int)regex_sed.size(), regex_sed.data());
 | 
			
		||||
| 
						 | 
				
			
			@ -1156,22 +1156,22 @@ protected:
 | 
			
		|||
      std::string subst(regex_sed.substr(second_separator_char_pos + 1,
 | 
			
		||||
                                         third_separator_char_pos -
 | 
			
		||||
                                             second_separator_char_pos - 1));
 | 
			
		||||
      m_regex_cmd_ap->AddRegexCommand(regex.c_str(), subst.c_str());
 | 
			
		||||
      m_regex_cmd_up->AddRegexCommand(regex.c_str(), subst.c_str());
 | 
			
		||||
    }
 | 
			
		||||
    return error;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  void AddRegexCommandToInterpreter() {
 | 
			
		||||
    if (m_regex_cmd_ap) {
 | 
			
		||||
      if (m_regex_cmd_ap->HasRegexEntries()) {
 | 
			
		||||
        CommandObjectSP cmd_sp(m_regex_cmd_ap.release());
 | 
			
		||||
    if (m_regex_cmd_up) {
 | 
			
		||||
      if (m_regex_cmd_up->HasRegexEntries()) {
 | 
			
		||||
        CommandObjectSP cmd_sp(m_regex_cmd_up.release());
 | 
			
		||||
        m_interpreter.AddCommand(cmd_sp->GetCommandName(), cmd_sp, true);
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> m_regex_cmd_ap;
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> m_regex_cmd_up;
 | 
			
		||||
 | 
			
		||||
  class CommandOptions : public Options {
 | 
			
		||||
  public:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -20,8 +20,9 @@ using namespace lldb_private;
 | 
			
		|||
//-------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
void CommandObjectHelp::GenerateAdditionalHelpAvenuesMessage(
 | 
			
		||||
    Stream *s, llvm::StringRef command, llvm::StringRef prefix, llvm::StringRef subcommand,
 | 
			
		||||
    bool include_apropos, bool include_type_lookup) {
 | 
			
		||||
    Stream *s, llvm::StringRef command, llvm::StringRef prefix,
 | 
			
		||||
    llvm::StringRef subcommand, bool include_upropos,
 | 
			
		||||
    bool include_type_lookup) {
 | 
			
		||||
  if (!s || command.empty())
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -32,7 +33,7 @@ void CommandObjectHelp::GenerateAdditionalHelpAvenuesMessage(
 | 
			
		|||
  s->Printf("'%s' is not a known command.\n", command_str.c_str());
 | 
			
		||||
  s->Printf("Try '%shelp' to see a current list of commands.\n",
 | 
			
		||||
            prefix.str().c_str());
 | 
			
		||||
  if (include_apropos) {
 | 
			
		||||
  if (include_upropos) {
 | 
			
		||||
    s->Printf("Try '%sapropos %s' for a list of related commands.\n",
 | 
			
		||||
      prefix_str.c_str(), lookup_str.c_str());
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -29,7 +29,7 @@ public:
 | 
			
		|||
 | 
			
		||||
  static void GenerateAdditionalHelpAvenuesMessage(
 | 
			
		||||
      Stream *s, llvm::StringRef command, llvm::StringRef prefix,
 | 
			
		||||
      llvm::StringRef subcommand, bool include_apropos = true,
 | 
			
		||||
      llvm::StringRef subcommand, bool include_upropos = true,
 | 
			
		||||
      bool include_type_lookup = true);
 | 
			
		||||
 | 
			
		||||
  class CommandOptions : public Options {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4770,49 +4770,49 @@ protected:
 | 
			
		|||
      Target::StopHookSP new_hook_sp = target->CreateStopHook();
 | 
			
		||||
 | 
			
		||||
      //  First step, make the specifier.
 | 
			
		||||
      std::unique_ptr<SymbolContextSpecifier> specifier_ap;
 | 
			
		||||
      std::unique_ptr<SymbolContextSpecifier> specifier_up;
 | 
			
		||||
      if (m_options.m_sym_ctx_specified) {
 | 
			
		||||
        specifier_ap.reset(new SymbolContextSpecifier(
 | 
			
		||||
        specifier_up.reset(new SymbolContextSpecifier(
 | 
			
		||||
            m_interpreter.GetDebugger().GetSelectedTarget()));
 | 
			
		||||
 | 
			
		||||
        if (!m_options.m_module_name.empty()) {
 | 
			
		||||
          specifier_ap->AddSpecification(
 | 
			
		||||
          specifier_up->AddSpecification(
 | 
			
		||||
              m_options.m_module_name.c_str(),
 | 
			
		||||
              SymbolContextSpecifier::eModuleSpecified);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (!m_options.m_class_name.empty()) {
 | 
			
		||||
          specifier_ap->AddSpecification(
 | 
			
		||||
          specifier_up->AddSpecification(
 | 
			
		||||
              m_options.m_class_name.c_str(),
 | 
			
		||||
              SymbolContextSpecifier::eClassOrNamespaceSpecified);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (!m_options.m_file_name.empty()) {
 | 
			
		||||
          specifier_ap->AddSpecification(
 | 
			
		||||
          specifier_up->AddSpecification(
 | 
			
		||||
              m_options.m_file_name.c_str(),
 | 
			
		||||
              SymbolContextSpecifier::eFileSpecified);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (m_options.m_line_start != 0) {
 | 
			
		||||
          specifier_ap->AddLineSpecification(
 | 
			
		||||
          specifier_up->AddLineSpecification(
 | 
			
		||||
              m_options.m_line_start,
 | 
			
		||||
              SymbolContextSpecifier::eLineStartSpecified);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (m_options.m_line_end != UINT_MAX) {
 | 
			
		||||
          specifier_ap->AddLineSpecification(
 | 
			
		||||
          specifier_up->AddLineSpecification(
 | 
			
		||||
              m_options.m_line_end, SymbolContextSpecifier::eLineEndSpecified);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (!m_options.m_function_name.empty()) {
 | 
			
		||||
          specifier_ap->AddSpecification(
 | 
			
		||||
          specifier_up->AddSpecification(
 | 
			
		||||
              m_options.m_function_name.c_str(),
 | 
			
		||||
              SymbolContextSpecifier::eFunctionSpecified);
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if (specifier_ap)
 | 
			
		||||
        new_hook_sp->SetSpecifier(specifier_ap.release());
 | 
			
		||||
      if (specifier_up)
 | 
			
		||||
        new_hook_sp->SetSpecifier(specifier_up.release());
 | 
			
		||||
 | 
			
		||||
      // Next see if any of the thread options have been entered:
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -225,12 +225,12 @@ are no syntax errors may indicate that a function was declared but never called.
 | 
			
		|||
    WatchpointOptions *wp_options =
 | 
			
		||||
        (WatchpointOptions *)io_handler.GetUserData();
 | 
			
		||||
    if (wp_options) {
 | 
			
		||||
      std::unique_ptr<WatchpointOptions::CommandData> data_ap(
 | 
			
		||||
      std::unique_ptr<WatchpointOptions::CommandData> data_up(
 | 
			
		||||
          new WatchpointOptions::CommandData());
 | 
			
		||||
      if (data_ap) {
 | 
			
		||||
        data_ap->user_source.SplitIntoLines(line);
 | 
			
		||||
      if (data_up) {
 | 
			
		||||
        data_up->user_source.SplitIntoLines(line);
 | 
			
		||||
        auto baton_sp = std::make_shared<WatchpointOptions::CommandBaton>(
 | 
			
		||||
            std::move(data_ap));
 | 
			
		||||
            std::move(data_up));
 | 
			
		||||
        wp_options->SetCallback(WatchpointOptionsCallbackFunction, baton_sp);
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -249,19 +249,19 @@ are no syntax errors may indicate that a function was declared but never called.
 | 
			
		|||
  /// Set a one-liner as the callback for the watchpoint.
 | 
			
		||||
  void SetWatchpointCommandCallback(WatchpointOptions *wp_options,
 | 
			
		||||
                                    const char *oneliner) {
 | 
			
		||||
    std::unique_ptr<WatchpointOptions::CommandData> data_ap(
 | 
			
		||||
    std::unique_ptr<WatchpointOptions::CommandData> data_up(
 | 
			
		||||
        new WatchpointOptions::CommandData());
 | 
			
		||||
 | 
			
		||||
    // It's necessary to set both user_source and script_source to the
 | 
			
		||||
    // oneliner. The former is used to generate callback description (as in
 | 
			
		||||
    // watchpoint command list) while the latter is used for Python to
 | 
			
		||||
    // interpret during the actual callback.
 | 
			
		||||
    data_ap->user_source.AppendString(oneliner);
 | 
			
		||||
    data_ap->script_source.assign(oneliner);
 | 
			
		||||
    data_ap->stop_on_error = m_options.m_stop_on_error;
 | 
			
		||||
    data_up->user_source.AppendString(oneliner);
 | 
			
		||||
    data_up->script_source.assign(oneliner);
 | 
			
		||||
    data_up->stop_on_error = m_options.m_stop_on_error;
 | 
			
		||||
 | 
			
		||||
    auto baton_sp =
 | 
			
		||||
        std::make_shared<WatchpointOptions::CommandBaton>(std::move(data_ap));
 | 
			
		||||
        std::make_shared<WatchpointOptions::CommandBaton>(std::move(data_up));
 | 
			
		||||
    wp_options->SetCallback(WatchpointOptionsCallbackFunction, baton_sp);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -763,8 +763,8 @@ Debugger::Debugger(lldb::LogOutputCallback log_callback, void *baton)
 | 
			
		|||
      m_broadcaster_manager_sp(BroadcasterManager::MakeBroadcasterManager()),
 | 
			
		||||
      m_terminal_state(), m_target_list(*this), m_platform_list(),
 | 
			
		||||
      m_listener_sp(Listener::MakeListener("lldb.Debugger")),
 | 
			
		||||
      m_source_manager_ap(), m_source_file_cache(),
 | 
			
		||||
      m_command_interpreter_ap(llvm::make_unique<CommandInterpreter>(
 | 
			
		||||
      m_source_manager_up(), m_source_file_cache(),
 | 
			
		||||
      m_command_interpreter_up(llvm::make_unique<CommandInterpreter>(
 | 
			
		||||
          *this, eScriptLanguageDefault, false)),
 | 
			
		||||
      m_input_reader_stack(), m_instance_name(), m_loaded_plugins(),
 | 
			
		||||
      m_event_handler_thread(), m_io_handler_thread(),
 | 
			
		||||
| 
						 | 
				
			
			@ -776,7 +776,7 @@ Debugger::Debugger(lldb::LogOutputCallback log_callback, void *baton)
 | 
			
		|||
  if (log_callback)
 | 
			
		||||
    m_log_callback_stream_sp =
 | 
			
		||||
        std::make_shared<StreamCallback>(log_callback, baton);
 | 
			
		||||
  m_command_interpreter_ap->Initialize();
 | 
			
		||||
  m_command_interpreter_up->Initialize();
 | 
			
		||||
  // Always add our default platform to the platform list
 | 
			
		||||
  PlatformSP default_platform_sp(Platform::GetHostPlatform());
 | 
			
		||||
  assert(default_platform_sp);
 | 
			
		||||
| 
						 | 
				
			
			@ -793,11 +793,11 @@ Debugger::Debugger(lldb::LogOutputCallback log_callback, void *baton)
 | 
			
		|||
  m_collection_sp->AppendProperty(
 | 
			
		||||
      ConstString("symbols"), ConstString("Symbol lookup and cache settings."),
 | 
			
		||||
      true, ModuleList::GetGlobalModuleListProperties().GetValueProperties());
 | 
			
		||||
  if (m_command_interpreter_ap) {
 | 
			
		||||
  if (m_command_interpreter_up) {
 | 
			
		||||
    m_collection_sp->AppendProperty(
 | 
			
		||||
        ConstString("interpreter"),
 | 
			
		||||
        ConstString("Settings specify to the debugger's command interpreter."),
 | 
			
		||||
        true, m_command_interpreter_ap->GetValueProperties());
 | 
			
		||||
        true, m_command_interpreter_up->GetValueProperties());
 | 
			
		||||
  }
 | 
			
		||||
  OptionValueSInt64 *term_width =
 | 
			
		||||
      m_collection_sp->GetPropertyAtIndexAsOptionValueSInt64(
 | 
			
		||||
| 
						 | 
				
			
			@ -856,7 +856,7 @@ void Debugger::Clear() {
 | 
			
		|||
    if (m_input_file_sp)
 | 
			
		||||
      m_input_file_sp->GetFile().Close();
 | 
			
		||||
 | 
			
		||||
    m_command_interpreter_ap->Clear();
 | 
			
		||||
    m_command_interpreter_up->Clear();
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -870,11 +870,11 @@ void Debugger::SetCloseInputOnEOF(bool b) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
bool Debugger::GetAsyncExecution() {
 | 
			
		||||
  return !m_command_interpreter_ap->GetSynchronous();
 | 
			
		||||
  return !m_command_interpreter_up->GetSynchronous();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Debugger::SetAsyncExecution(bool async_execution) {
 | 
			
		||||
  m_command_interpreter_ap->SetSynchronous(!async_execution);
 | 
			
		||||
  m_command_interpreter_up->SetSynchronous(!async_execution);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Debugger::SetInputFileHandle(FILE *fh, bool tranfer_ownership) {
 | 
			
		||||
| 
						 | 
				
			
			@ -1286,9 +1286,9 @@ bool Debugger::EnableLog(llvm::StringRef channel,
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
SourceManager &Debugger::GetSourceManager() {
 | 
			
		||||
  if (!m_source_manager_ap)
 | 
			
		||||
    m_source_manager_ap = llvm::make_unique<SourceManager>(shared_from_this());
 | 
			
		||||
  return *m_source_manager_ap;
 | 
			
		||||
  if (!m_source_manager_up)
 | 
			
		||||
    m_source_manager_up = llvm::make_unique<SourceManager>(shared_from_this());
 | 
			
		||||
  return *m_source_manager_up;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// This function handles events that were broadcast by the process.
 | 
			
		||||
| 
						 | 
				
			
			@ -1536,7 +1536,7 @@ void Debugger::DefaultEventHandler() {
 | 
			
		|||
  listener_sp->StartListeningForEventSpec(m_broadcaster_manager_sp,
 | 
			
		||||
                                          thread_event_spec);
 | 
			
		||||
  listener_sp->StartListeningForEvents(
 | 
			
		||||
      m_command_interpreter_ap.get(),
 | 
			
		||||
      m_command_interpreter_up.get(),
 | 
			
		||||
      CommandInterpreter::eBroadcastBitQuitCommandReceived |
 | 
			
		||||
          CommandInterpreter::eBroadcastBitAsynchronousOutputData |
 | 
			
		||||
          CommandInterpreter::eBroadcastBitAsynchronousErrorData);
 | 
			
		||||
| 
						 | 
				
			
			@ -1563,7 +1563,7 @@ void Debugger::DefaultEventHandler() {
 | 
			
		|||
            }
 | 
			
		||||
          } else if (broadcaster_class == broadcaster_class_thread) {
 | 
			
		||||
            HandleThreadEvent(event_sp);
 | 
			
		||||
          } else if (broadcaster == m_command_interpreter_ap.get()) {
 | 
			
		||||
          } else if (broadcaster == m_command_interpreter_up.get()) {
 | 
			
		||||
            if (event_type &
 | 
			
		||||
                CommandInterpreter::eBroadcastBitQuitCommandReceived) {
 | 
			
		||||
              done = true;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -741,11 +741,11 @@ void Instruction::Dump(lldb_private::Stream *s, uint32_t max_opcode_byte_size,
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
bool Instruction::DumpEmulation(const ArchSpec &arch) {
 | 
			
		||||
  std::unique_ptr<EmulateInstruction> insn_emulator_ap(
 | 
			
		||||
  std::unique_ptr<EmulateInstruction> insn_emulator_up(
 | 
			
		||||
      EmulateInstruction::FindPlugin(arch, eInstructionTypeAny, nullptr));
 | 
			
		||||
  if (insn_emulator_ap) {
 | 
			
		||||
    insn_emulator_ap->SetInstruction(GetOpcode(), GetAddress(), nullptr);
 | 
			
		||||
    return insn_emulator_ap->EvaluateInstruction(0);
 | 
			
		||||
  if (insn_emulator_up) {
 | 
			
		||||
    insn_emulator_up->SetInstruction(GetOpcode(), GetAddress(), nullptr);
 | 
			
		||||
    return insn_emulator_up->EvaluateInstruction(0);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return false;
 | 
			
		||||
| 
						 | 
				
			
			@ -992,11 +992,11 @@ bool Instruction::TestEmulation(Stream *out_stream, const char *file_name) {
 | 
			
		|||
  arch.SetTriple(llvm::Triple(value_sp->GetStringValue()));
 | 
			
		||||
 | 
			
		||||
  bool success = false;
 | 
			
		||||
  std::unique_ptr<EmulateInstruction> insn_emulator_ap(
 | 
			
		||||
  std::unique_ptr<EmulateInstruction> insn_emulator_up(
 | 
			
		||||
      EmulateInstruction::FindPlugin(arch, eInstructionTypeAny, nullptr));
 | 
			
		||||
  if (insn_emulator_ap)
 | 
			
		||||
  if (insn_emulator_up)
 | 
			
		||||
    success =
 | 
			
		||||
        insn_emulator_ap->TestEmulation(out_stream, arch, data_dictionary);
 | 
			
		||||
        insn_emulator_up->TestEmulation(out_stream, arch, data_dictionary);
 | 
			
		||||
 | 
			
		||||
  if (success)
 | 
			
		||||
    out_stream->Printf("Emulation test succeeded.");
 | 
			
		||||
| 
						 | 
				
			
			@ -1012,14 +1012,14 @@ bool Instruction::Emulate(
 | 
			
		|||
    EmulateInstruction::WriteMemoryCallback write_mem_callback,
 | 
			
		||||
    EmulateInstruction::ReadRegisterCallback read_reg_callback,
 | 
			
		||||
    EmulateInstruction::WriteRegisterCallback write_reg_callback) {
 | 
			
		||||
  std::unique_ptr<EmulateInstruction> insn_emulator_ap(
 | 
			
		||||
  std::unique_ptr<EmulateInstruction> insn_emulator_up(
 | 
			
		||||
      EmulateInstruction::FindPlugin(arch, eInstructionTypeAny, nullptr));
 | 
			
		||||
  if (insn_emulator_ap) {
 | 
			
		||||
    insn_emulator_ap->SetBaton(baton);
 | 
			
		||||
    insn_emulator_ap->SetCallbacks(read_mem_callback, write_mem_callback,
 | 
			
		||||
  if (insn_emulator_up) {
 | 
			
		||||
    insn_emulator_up->SetBaton(baton);
 | 
			
		||||
    insn_emulator_up->SetCallbacks(read_mem_callback, write_mem_callback,
 | 
			
		||||
                                   read_reg_callback, write_reg_callback);
 | 
			
		||||
    insn_emulator_ap->SetInstruction(GetOpcode(), GetAddress(), nullptr);
 | 
			
		||||
    return insn_emulator_ap->EvaluateInstruction(evaluate_options);
 | 
			
		||||
    insn_emulator_up->SetInstruction(GetOpcode(), GetAddress(), nullptr);
 | 
			
		||||
    return insn_emulator_up->EvaluateInstruction(evaluate_options);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return false;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -551,7 +551,7 @@ lldb::offset_t lldb_private::DumpDataExtractor(
 | 
			
		|||
 | 
			
		||||
    case eFormatFloat: {
 | 
			
		||||
      TargetSP target_sp;
 | 
			
		||||
      bool used_apfloat = false;
 | 
			
		||||
      bool used_upfloat = false;
 | 
			
		||||
      if (exe_scope)
 | 
			
		||||
        target_sp = exe_scope->CalculateTarget();
 | 
			
		||||
      if (target_sp) {
 | 
			
		||||
| 
						 | 
				
			
			@ -600,13 +600,13 @@ lldb::offset_t lldb_private::DumpDataExtractor(
 | 
			
		|||
 | 
			
		||||
            if (!sv.empty()) {
 | 
			
		||||
              s->Printf("%*.*s", (int)sv.size(), (int)sv.size(), sv.data());
 | 
			
		||||
              used_apfloat = true;
 | 
			
		||||
              used_upfloat = true;
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if (!used_apfloat) {
 | 
			
		||||
      if (!used_upfloat) {
 | 
			
		||||
        std::ostringstream ss;
 | 
			
		||||
        if (item_byte_size == sizeof(float) || item_byte_size == 2) {
 | 
			
		||||
          float f;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -38,10 +38,10 @@ DynamicLoader *DynamicLoader::FindPlugin(Process *process,
 | 
			
		|||
        PluginManager::GetDynamicLoaderCreateCallbackForPluginName(
 | 
			
		||||
            const_plugin_name);
 | 
			
		||||
    if (create_callback) {
 | 
			
		||||
      std::unique_ptr<DynamicLoader> instance_ap(
 | 
			
		||||
      std::unique_ptr<DynamicLoader> instance_up(
 | 
			
		||||
          create_callback(process, true));
 | 
			
		||||
      if (instance_ap)
 | 
			
		||||
        return instance_ap.release();
 | 
			
		||||
      if (instance_up)
 | 
			
		||||
        return instance_up.release();
 | 
			
		||||
    }
 | 
			
		||||
  } else {
 | 
			
		||||
    for (uint32_t idx = 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -49,10 +49,10 @@ DynamicLoader *DynamicLoader::FindPlugin(Process *process,
 | 
			
		|||
              PluginManager::GetDynamicLoaderCreateCallbackAtIndex(idx)) !=
 | 
			
		||||
         nullptr;
 | 
			
		||||
         ++idx) {
 | 
			
		||||
      std::unique_ptr<DynamicLoader> instance_ap(
 | 
			
		||||
      std::unique_ptr<DynamicLoader> instance_up(
 | 
			
		||||
          create_callback(process, false));
 | 
			
		||||
      if (instance_ap)
 | 
			
		||||
        return instance_ap.release();
 | 
			
		||||
      if (instance_up)
 | 
			
		||||
        return instance_up.release();
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  return nullptr;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -284,7 +284,7 @@ IOHandlerEditline::IOHandlerEditline(
 | 
			
		|||
    IOHandlerDelegate &delegate)
 | 
			
		||||
    : IOHandler(debugger, type, input_sp, output_sp, error_sp, flags),
 | 
			
		||||
#ifndef LLDB_DISABLE_LIBEDIT
 | 
			
		||||
      m_editline_ap(),
 | 
			
		||||
      m_editline_up(),
 | 
			
		||||
#endif
 | 
			
		||||
      m_delegate(delegate), m_prompt(), m_continuation_prompt(),
 | 
			
		||||
      m_current_lines_ptr(nullptr), m_base_line_number(line_number_start),
 | 
			
		||||
| 
						 | 
				
			
			@ -299,17 +299,17 @@ IOHandlerEditline::IOHandlerEditline(
 | 
			
		|||
  use_editline = m_input_sp->GetFile().GetIsRealTerminal();
 | 
			
		||||
 | 
			
		||||
  if (use_editline) {
 | 
			
		||||
    m_editline_ap.reset(new Editline(editline_name, GetInputFILE(),
 | 
			
		||||
    m_editline_up.reset(new Editline(editline_name, GetInputFILE(),
 | 
			
		||||
                                     GetOutputFILE(), GetErrorFILE(),
 | 
			
		||||
                                     m_color_prompts));
 | 
			
		||||
    m_editline_ap->SetIsInputCompleteCallback(IsInputCompleteCallback, this);
 | 
			
		||||
    m_editline_ap->SetAutoCompleteCallback(AutoCompleteCallback, this);
 | 
			
		||||
    m_editline_up->SetIsInputCompleteCallback(IsInputCompleteCallback, this);
 | 
			
		||||
    m_editline_up->SetAutoCompleteCallback(AutoCompleteCallback, this);
 | 
			
		||||
    // See if the delegate supports fixing indentation
 | 
			
		||||
    const char *indent_chars = delegate.IOHandlerGetFixIndentationCharacters();
 | 
			
		||||
    if (indent_chars) {
 | 
			
		||||
      // The delegate does support indentation, hook it up so when any
 | 
			
		||||
      // indentation character is typed, the delegate gets a chance to fix it
 | 
			
		||||
      m_editline_ap->SetFixIndentationCallback(FixIndentationCallback, this,
 | 
			
		||||
      m_editline_up->SetFixIndentationCallback(FixIndentationCallback, this,
 | 
			
		||||
                                               indent_chars);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -321,7 +321,7 @@ IOHandlerEditline::IOHandlerEditline(
 | 
			
		|||
 | 
			
		||||
IOHandlerEditline::~IOHandlerEditline() {
 | 
			
		||||
#ifndef LLDB_DISABLE_LIBEDIT
 | 
			
		||||
  m_editline_ap.reset();
 | 
			
		||||
  m_editline_up.reset();
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -337,8 +337,8 @@ void IOHandlerEditline::Deactivate() {
 | 
			
		|||
 | 
			
		||||
bool IOHandlerEditline::GetLine(std::string &line, bool &interrupted) {
 | 
			
		||||
#ifndef LLDB_DISABLE_LIBEDIT
 | 
			
		||||
  if (m_editline_ap) {
 | 
			
		||||
    return m_editline_ap->GetLine(line, interrupted);
 | 
			
		||||
  if (m_editline_up) {
 | 
			
		||||
    return m_editline_up->GetLine(line, interrupted);
 | 
			
		||||
  } else {
 | 
			
		||||
#endif
 | 
			
		||||
    line.clear();
 | 
			
		||||
| 
						 | 
				
			
			@ -440,8 +440,8 @@ int IOHandlerEditline::AutoCompleteCallback(
 | 
			
		|||
 | 
			
		||||
const char *IOHandlerEditline::GetPrompt() {
 | 
			
		||||
#ifndef LLDB_DISABLE_LIBEDIT
 | 
			
		||||
  if (m_editline_ap) {
 | 
			
		||||
    return m_editline_ap->GetPrompt();
 | 
			
		||||
  if (m_editline_up) {
 | 
			
		||||
    return m_editline_up->GetPrompt();
 | 
			
		||||
  } else {
 | 
			
		||||
#endif
 | 
			
		||||
    if (m_prompt.empty())
 | 
			
		||||
| 
						 | 
				
			
			@ -456,8 +456,8 @@ bool IOHandlerEditline::SetPrompt(llvm::StringRef prompt) {
 | 
			
		|||
  m_prompt = prompt;
 | 
			
		||||
 | 
			
		||||
#ifndef LLDB_DISABLE_LIBEDIT
 | 
			
		||||
  if (m_editline_ap)
 | 
			
		||||
    m_editline_ap->SetPrompt(m_prompt.empty() ? nullptr : m_prompt.c_str());
 | 
			
		||||
  if (m_editline_up)
 | 
			
		||||
    m_editline_up->SetPrompt(m_prompt.empty() ? nullptr : m_prompt.c_str());
 | 
			
		||||
#endif
 | 
			
		||||
  return true;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -471,8 +471,8 @@ void IOHandlerEditline::SetContinuationPrompt(llvm::StringRef prompt) {
 | 
			
		|||
  m_continuation_prompt = prompt;
 | 
			
		||||
 | 
			
		||||
#ifndef LLDB_DISABLE_LIBEDIT
 | 
			
		||||
  if (m_editline_ap)
 | 
			
		||||
    m_editline_ap->SetContinuationPrompt(m_continuation_prompt.empty()
 | 
			
		||||
  if (m_editline_up)
 | 
			
		||||
    m_editline_up->SetContinuationPrompt(m_continuation_prompt.empty()
 | 
			
		||||
                                             ? nullptr
 | 
			
		||||
                                             : m_continuation_prompt.c_str());
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			@ -484,8 +484,8 @@ void IOHandlerEditline::SetBaseLineNumber(uint32_t line) {
 | 
			
		|||
 | 
			
		||||
uint32_t IOHandlerEditline::GetCurrentLineIndex() const {
 | 
			
		||||
#ifndef LLDB_DISABLE_LIBEDIT
 | 
			
		||||
  if (m_editline_ap)
 | 
			
		||||
    return m_editline_ap->GetCurrentLine();
 | 
			
		||||
  if (m_editline_up)
 | 
			
		||||
    return m_editline_up->GetCurrentLine();
 | 
			
		||||
#endif
 | 
			
		||||
  return m_curr_line_idx;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -495,8 +495,8 @@ bool IOHandlerEditline::GetLines(StringList &lines, bool &interrupted) {
 | 
			
		|||
 | 
			
		||||
  bool success = false;
 | 
			
		||||
#ifndef LLDB_DISABLE_LIBEDIT
 | 
			
		||||
  if (m_editline_ap) {
 | 
			
		||||
    return m_editline_ap->GetLines(m_base_line_number, lines, interrupted);
 | 
			
		||||
  if (m_editline_up) {
 | 
			
		||||
    return m_editline_up->GetLines(m_base_line_number, lines, interrupted);
 | 
			
		||||
  } else {
 | 
			
		||||
#endif
 | 
			
		||||
    bool done = false;
 | 
			
		||||
| 
						 | 
				
			
			@ -564,8 +564,8 @@ void IOHandlerEditline::Run() {
 | 
			
		|||
 | 
			
		||||
void IOHandlerEditline::Cancel() {
 | 
			
		||||
#ifndef LLDB_DISABLE_LIBEDIT
 | 
			
		||||
  if (m_editline_ap)
 | 
			
		||||
    m_editline_ap->Cancel();
 | 
			
		||||
  if (m_editline_up)
 | 
			
		||||
    m_editline_up->Cancel();
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -575,23 +575,23 @@ bool IOHandlerEditline::Interrupt() {
 | 
			
		|||
    return true;
 | 
			
		||||
 | 
			
		||||
#ifndef LLDB_DISABLE_LIBEDIT
 | 
			
		||||
  if (m_editline_ap)
 | 
			
		||||
    return m_editline_ap->Interrupt();
 | 
			
		||||
  if (m_editline_up)
 | 
			
		||||
    return m_editline_up->Interrupt();
 | 
			
		||||
#endif
 | 
			
		||||
  return false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void IOHandlerEditline::GotEOF() {
 | 
			
		||||
#ifndef LLDB_DISABLE_LIBEDIT
 | 
			
		||||
  if (m_editline_ap)
 | 
			
		||||
    m_editline_ap->Interrupt();
 | 
			
		||||
  if (m_editline_up)
 | 
			
		||||
    m_editline_up->Interrupt();
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void IOHandlerEditline::PrintAsync(Stream *stream, const char *s, size_t len) {
 | 
			
		||||
#ifndef LLDB_DISABLE_LIBEDIT
 | 
			
		||||
  if (m_editline_ap)
 | 
			
		||||
    m_editline_ap->PrintAsync(stream, s, len);
 | 
			
		||||
  if (m_editline_up)
 | 
			
		||||
    m_editline_up->PrintAsync(stream, s, len);
 | 
			
		||||
  else
 | 
			
		||||
#endif
 | 
			
		||||
  {
 | 
			
		||||
| 
						 | 
				
			
			@ -1122,10 +1122,10 @@ public:
 | 
			
		|||
      const char *text = m_delegate_sp->WindowDelegateGetHelpText();
 | 
			
		||||
      KeyHelp *key_help = m_delegate_sp->WindowDelegateGetKeyHelp();
 | 
			
		||||
      if ((text && text[0]) || key_help) {
 | 
			
		||||
        std::unique_ptr<HelpDialogDelegate> help_delegate_ap(
 | 
			
		||||
        std::unique_ptr<HelpDialogDelegate> help_delegate_up(
 | 
			
		||||
            new HelpDialogDelegate(text, key_help));
 | 
			
		||||
        const size_t num_lines = help_delegate_ap->GetNumLines();
 | 
			
		||||
        const size_t max_length = help_delegate_ap->GetMaxLineLength();
 | 
			
		||||
        const size_t num_lines = help_delegate_up->GetNumLines();
 | 
			
		||||
        const size_t max_length = help_delegate_up->GetMaxLineLength();
 | 
			
		||||
        Rect bounds = GetBounds();
 | 
			
		||||
        bounds.Inset(1, 1);
 | 
			
		||||
        if (max_length + 4 < static_cast<size_t>(bounds.size.width)) {
 | 
			
		||||
| 
						 | 
				
			
			@ -1156,7 +1156,7 @@ public:
 | 
			
		|||
        else
 | 
			
		||||
          help_window_sp = CreateSubWindow("Help", bounds, true);
 | 
			
		||||
        help_window_sp->SetDelegate(
 | 
			
		||||
            WindowDelegateSP(help_delegate_ap.release()));
 | 
			
		||||
            WindowDelegateSP(help_delegate_up.release()));
 | 
			
		||||
        return true;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -277,8 +277,8 @@ Module::~Module() {
 | 
			
		|||
  // function calls back into this module object. The ordering is important
 | 
			
		||||
  // here because symbol files can require the module object file. So we tear
 | 
			
		||||
  // down the symbol file first, then the object file.
 | 
			
		||||
  m_sections_ap.reset();
 | 
			
		||||
  m_symfile_ap.reset();
 | 
			
		||||
  m_sections_up.reset();
 | 
			
		||||
  m_symfile_up.reset();
 | 
			
		||||
  m_objfile_sp.reset();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -291,13 +291,13 @@ ObjectFile *Module::GetMemoryObjectFile(const lldb::ProcessSP &process_sp,
 | 
			
		|||
    std::lock_guard<std::recursive_mutex> guard(m_mutex);
 | 
			
		||||
    if (process_sp) {
 | 
			
		||||
      m_did_load_objfile = true;
 | 
			
		||||
      auto data_ap = llvm::make_unique<DataBufferHeap>(size_to_read, 0);
 | 
			
		||||
      auto data_up = llvm::make_unique<DataBufferHeap>(size_to_read, 0);
 | 
			
		||||
      Status readmem_error;
 | 
			
		||||
      const size_t bytes_read =
 | 
			
		||||
          process_sp->ReadMemory(header_addr, data_ap->GetBytes(),
 | 
			
		||||
                                 data_ap->GetByteSize(), readmem_error);
 | 
			
		||||
          process_sp->ReadMemory(header_addr, data_up->GetBytes(),
 | 
			
		||||
                                 data_up->GetByteSize(), readmem_error);
 | 
			
		||||
      if (bytes_read == size_to_read) {
 | 
			
		||||
        DataBufferSP data_sp(data_ap.release());
 | 
			
		||||
        DataBufferSP data_sp(data_up.release());
 | 
			
		||||
        m_objfile_sp = ObjectFile::FindPlugin(shared_from_this(), process_sp,
 | 
			
		||||
                                              header_addr, data_sp);
 | 
			
		||||
        if (m_objfile_sp) {
 | 
			
		||||
| 
						 | 
				
			
			@ -1049,13 +1049,13 @@ SymbolVendor *Module::GetSymbolVendor(bool can_create,
 | 
			
		|||
      if (obj_file != nullptr) {
 | 
			
		||||
        static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
 | 
			
		||||
        Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
 | 
			
		||||
        m_symfile_ap.reset(
 | 
			
		||||
        m_symfile_up.reset(
 | 
			
		||||
            SymbolVendor::FindPlugin(shared_from_this(), feedback_strm));
 | 
			
		||||
        m_did_load_symbol_vendor = true;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  return m_symfile_ap.get();
 | 
			
		||||
  return m_symfile_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Module::SetFileSpecAndObjectName(const FileSpec &file,
 | 
			
		||||
| 
						 | 
				
			
			@ -1278,13 +1278,13 @@ ObjectFile *Module::GetObjectFile() {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
SectionList *Module::GetSectionList() {
 | 
			
		||||
  // Populate m_sections_ap with sections from objfile.
 | 
			
		||||
  if (!m_sections_ap) {
 | 
			
		||||
  // Populate m_sections_up with sections from objfile.
 | 
			
		||||
  if (!m_sections_up) {
 | 
			
		||||
    ObjectFile *obj_file = GetObjectFile();
 | 
			
		||||
    if (obj_file != nullptr)
 | 
			
		||||
      obj_file->CreateSections(*GetUnifiedSectionList());
 | 
			
		||||
  }
 | 
			
		||||
  return m_sections_ap.get();
 | 
			
		||||
  return m_sections_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Module::SectionFileAddressesChanged() {
 | 
			
		||||
| 
						 | 
				
			
			@ -1297,9 +1297,9 @@ void Module::SectionFileAddressesChanged() {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
SectionList *Module::GetUnifiedSectionList() {
 | 
			
		||||
  if (!m_sections_ap)
 | 
			
		||||
    m_sections_ap = llvm::make_unique<SectionList>();
 | 
			
		||||
  return m_sections_ap.get();
 | 
			
		||||
  if (!m_sections_up)
 | 
			
		||||
    m_sections_up = llvm::make_unique<SectionList>();
 | 
			
		||||
  return m_sections_up.get();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const Symbol *Module::FindFirstSymbolWithNameAndType(const ConstString &name,
 | 
			
		||||
| 
						 | 
				
			
			@ -1419,11 +1419,11 @@ void Module::PreloadSymbols() {
 | 
			
		|||
void Module::SetSymbolFileFileSpec(const FileSpec &file) {
 | 
			
		||||
  if (!FileSystem::Instance().Exists(file))
 | 
			
		||||
    return;
 | 
			
		||||
  if (m_symfile_ap) {
 | 
			
		||||
  if (m_symfile_up) {
 | 
			
		||||
    // Remove any sections in the unified section list that come from the
 | 
			
		||||
    // current symbol vendor.
 | 
			
		||||
    SectionList *section_list = GetSectionList();
 | 
			
		||||
    SymbolFile *symbol_file = m_symfile_ap->GetSymbolFile();
 | 
			
		||||
    SymbolFile *symbol_file = m_symfile_up->GetSymbolFile();
 | 
			
		||||
    if (section_list && symbol_file) {
 | 
			
		||||
      ObjectFile *obj_file = symbol_file->GetObjectFile();
 | 
			
		||||
      // Make sure we have an object file and that the symbol vendor's objfile
 | 
			
		||||
| 
						 | 
				
			
			@ -1471,10 +1471,10 @@ void Module::SetSymbolFileFileSpec(const FileSpec &file) {
 | 
			
		|||
    }
 | 
			
		||||
    // Keep all old symbol files around in case there are any lingering type
 | 
			
		||||
    // references in any SBValue objects that might have been handed out.
 | 
			
		||||
    m_old_symfiles.push_back(std::move(m_symfile_ap));
 | 
			
		||||
    m_old_symfiles.push_back(std::move(m_symfile_up));
 | 
			
		||||
  }
 | 
			
		||||
  m_symfile_spec = file;
 | 
			
		||||
  m_symfile_ap.reset();
 | 
			
		||||
  m_symfile_up.reset();
 | 
			
		||||
  m_did_load_symbol_vendor = false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -72,7 +72,7 @@ ConstString ValueObjectSynthetic::GetQualifiedTypeName() {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
ConstString ValueObjectSynthetic::GetDisplayTypeName() {
 | 
			
		||||
  if (ConstString synth_name = m_synth_filter_ap->GetSyntheticTypeName())
 | 
			
		||||
  if (ConstString synth_name = m_synth_filter_up->GetSyntheticTypeName())
 | 
			
		||||
    return synth_name;
 | 
			
		||||
 | 
			
		||||
  return m_parent->GetDisplayTypeName();
 | 
			
		||||
| 
						 | 
				
			
			@ -86,7 +86,7 @@ size_t ValueObjectSynthetic::CalculateNumChildren(uint32_t max) {
 | 
			
		|||
    return m_synthetic_children_count <= max ? m_synthetic_children_count : max;
 | 
			
		||||
 | 
			
		||||
  if (max < UINT32_MAX) {
 | 
			
		||||
    size_t num_children = m_synth_filter_ap->CalculateNumChildren(max);
 | 
			
		||||
    size_t num_children = m_synth_filter_up->CalculateNumChildren(max);
 | 
			
		||||
    if (log)
 | 
			
		||||
      log->Printf("[ValueObjectSynthetic::CalculateNumChildren] for VO of name "
 | 
			
		||||
                  "%s and type %s, the filter returned %zu child values",
 | 
			
		||||
| 
						 | 
				
			
			@ -95,7 +95,7 @@ size_t ValueObjectSynthetic::CalculateNumChildren(uint32_t max) {
 | 
			
		|||
    return num_children;
 | 
			
		||||
  } else {
 | 
			
		||||
    size_t num_children = (m_synthetic_children_count =
 | 
			
		||||
                               m_synth_filter_ap->CalculateNumChildren(max));
 | 
			
		||||
                               m_synth_filter_up->CalculateNumChildren(max));
 | 
			
		||||
    if (log)
 | 
			
		||||
      log->Printf("[ValueObjectSynthetic::CalculateNumChildren] for VO of name "
 | 
			
		||||
                  "%s and type %s, the filter returned %zu child values",
 | 
			
		||||
| 
						 | 
				
			
			@ -117,7 +117,7 @@ ValueObjectSynthetic::GetDynamicValue(lldb::DynamicValueType valueType) {
 | 
			
		|||
bool ValueObjectSynthetic::MightHaveChildren() {
 | 
			
		||||
  if (m_might_have_children == eLazyBoolCalculate)
 | 
			
		||||
    m_might_have_children =
 | 
			
		||||
        (m_synth_filter_ap->MightHaveChildren() ? eLazyBoolYes : eLazyBoolNo);
 | 
			
		||||
        (m_synth_filter_up->MightHaveChildren() ? eLazyBoolYes : eLazyBoolNo);
 | 
			
		||||
  return (m_might_have_children != eLazyBoolNo);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -140,9 +140,9 @@ void ValueObjectSynthetic::CreateSynthFilter() {
 | 
			
		|||
        valobj_for_frontend = deref_sp.get();
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  m_synth_filter_ap = (m_synth_sp->GetFrontEnd(*valobj_for_frontend));
 | 
			
		||||
  if (!m_synth_filter_ap)
 | 
			
		||||
    m_synth_filter_ap = llvm::make_unique<DummySyntheticFrontEnd>(*m_parent);
 | 
			
		||||
  m_synth_filter_up = (m_synth_sp->GetFrontEnd(*valobj_for_frontend));
 | 
			
		||||
  if (!m_synth_filter_up)
 | 
			
		||||
    m_synth_filter_up = llvm::make_unique<DummySyntheticFrontEnd>(*m_parent);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool ValueObjectSynthetic::UpdateValue() {
 | 
			
		||||
| 
						 | 
				
			
			@ -173,7 +173,7 @@ bool ValueObjectSynthetic::UpdateValue() {
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
  // let our backend do its update
 | 
			
		||||
  if (!m_synth_filter_ap->Update()) {
 | 
			
		||||
  if (!m_synth_filter_up->Update()) {
 | 
			
		||||
    if (log)
 | 
			
		||||
      log->Printf("[ValueObjectSynthetic::UpdateValue] name=%s, synthetic "
 | 
			
		||||
                  "filter said caches are stale - clearing",
 | 
			
		||||
| 
						 | 
				
			
			@ -198,7 +198,7 @@ bool ValueObjectSynthetic::UpdateValue() {
 | 
			
		|||
 | 
			
		||||
  m_provides_value = eLazyBoolCalculate;
 | 
			
		||||
 | 
			
		||||
  lldb::ValueObjectSP synth_val(m_synth_filter_ap->GetSyntheticValue());
 | 
			
		||||
  lldb::ValueObjectSP synth_val(m_synth_filter_up->GetSyntheticValue());
 | 
			
		||||
 | 
			
		||||
  if (synth_val && synth_val->CanProvideValue()) {
 | 
			
		||||
    if (log)
 | 
			
		||||
| 
						 | 
				
			
			@ -235,13 +235,13 @@ lldb::ValueObjectSP ValueObjectSynthetic::GetChildAtIndex(size_t idx,
 | 
			
		|||
 | 
			
		||||
  ValueObject *valobj;
 | 
			
		||||
  if (!m_children_byindex.GetValueForKey(idx, valobj)) {
 | 
			
		||||
    if (can_create && m_synth_filter_ap != nullptr) {
 | 
			
		||||
    if (can_create && m_synth_filter_up != nullptr) {
 | 
			
		||||
      if (log)
 | 
			
		||||
        log->Printf("[ValueObjectSynthetic::GetChildAtIndex] name=%s, child at "
 | 
			
		||||
                    "index %zu not cached and will be created",
 | 
			
		||||
                    GetName().AsCString(), idx);
 | 
			
		||||
 | 
			
		||||
      lldb::ValueObjectSP synth_guy = m_synth_filter_ap->GetChildAtIndex(idx);
 | 
			
		||||
      lldb::ValueObjectSP synth_guy = m_synth_filter_up->GetChildAtIndex(idx);
 | 
			
		||||
 | 
			
		||||
      if (log)
 | 
			
		||||
        log->Printf(
 | 
			
		||||
| 
						 | 
				
			
			@ -268,7 +268,7 @@ lldb::ValueObjectSP ValueObjectSynthetic::GetChildAtIndex(size_t idx,
 | 
			
		|||
                    "index %zu not cached and cannot "
 | 
			
		||||
                    "be created (can_create = %s, synth_filter = %p)",
 | 
			
		||||
                    GetName().AsCString(), idx, can_create ? "yes" : "no",
 | 
			
		||||
                    static_cast<void *>(m_synth_filter_ap.get()));
 | 
			
		||||
                    static_cast<void *>(m_synth_filter_up.get()));
 | 
			
		||||
 | 
			
		||||
      return lldb::ValueObjectSP();
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -301,13 +301,13 @@ size_t ValueObjectSynthetic::GetIndexOfChildWithName(const ConstString &name) {
 | 
			
		|||
  uint32_t found_index = UINT32_MAX;
 | 
			
		||||
  bool did_find = m_name_toindex.GetValueForKey(name.GetCString(), found_index);
 | 
			
		||||
 | 
			
		||||
  if (!did_find && m_synth_filter_ap != nullptr) {
 | 
			
		||||
    uint32_t index = m_synth_filter_ap->GetIndexOfChildWithName(name);
 | 
			
		||||
  if (!did_find && m_synth_filter_up != nullptr) {
 | 
			
		||||
    uint32_t index = m_synth_filter_up->GetIndexOfChildWithName(name);
 | 
			
		||||
    if (index == UINT32_MAX)
 | 
			
		||||
      return index;
 | 
			
		||||
    m_name_toindex.SetValueForKey(name.GetCString(), index);
 | 
			
		||||
    return index;
 | 
			
		||||
  } else if (!did_find && m_synth_filter_ap == nullptr)
 | 
			
		||||
  } else if (!did_find && m_synth_filter_up == nullptr)
 | 
			
		||||
    return UINT32_MAX;
 | 
			
		||||
  else /*if (iter != m_name_toindex.end())*/
 | 
			
		||||
    return found_index;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -995,12 +995,12 @@ bool DWARFExpression::Update_DW_OP_addr(lldb::addr_t file_addr) {
 | 
			
		|||
      // for this expression
 | 
			
		||||
 | 
			
		||||
      // So first we copy the data into a heap buffer
 | 
			
		||||
      std::unique_ptr<DataBufferHeap> head_data_ap(
 | 
			
		||||
      std::unique_ptr<DataBufferHeap> head_data_up(
 | 
			
		||||
          new DataBufferHeap(m_data.GetDataStart(), m_data.GetByteSize()));
 | 
			
		||||
 | 
			
		||||
      // Make en encoder so we can write the address into the buffer using the
 | 
			
		||||
      // correct byte order (endianness)
 | 
			
		||||
      DataEncoder encoder(head_data_ap->GetBytes(), head_data_ap->GetByteSize(),
 | 
			
		||||
      DataEncoder encoder(head_data_up->GetBytes(), head_data_up->GetByteSize(),
 | 
			
		||||
                          m_data.GetByteOrder(), addr_byte_size);
 | 
			
		||||
 | 
			
		||||
      // Replace the address in the new buffer
 | 
			
		||||
| 
						 | 
				
			
			@ -1009,7 +1009,7 @@ bool DWARFExpression::Update_DW_OP_addr(lldb::addr_t file_addr) {
 | 
			
		|||
 | 
			
		||||
      // All went well, so now we can reset the data using a shared pointer to
 | 
			
		||||
      // the heap data so "m_data" will now correctly manage the heap data.
 | 
			
		||||
      m_data.SetData(DataBufferSP(head_data_ap.release()));
 | 
			
		||||
      m_data.SetData(DataBufferSP(head_data_up.release()));
 | 
			
		||||
      return true;
 | 
			
		||||
    } else {
 | 
			
		||||
      const offset_t op_arg_size = GetOpcodeDataSize(m_data, offset, op);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -36,14 +36,14 @@
 | 
			
		|||
 | 
			
		||||
using namespace lldb_private;
 | 
			
		||||
 | 
			
		||||
IRExecutionUnit::IRExecutionUnit(std::unique_ptr<llvm::LLVMContext> &context_ap,
 | 
			
		||||
                                 std::unique_ptr<llvm::Module> &module_ap,
 | 
			
		||||
IRExecutionUnit::IRExecutionUnit(std::unique_ptr<llvm::LLVMContext> &context_up,
 | 
			
		||||
                                 std::unique_ptr<llvm::Module> &module_up,
 | 
			
		||||
                                 ConstString &name,
 | 
			
		||||
                                 const lldb::TargetSP &target_sp,
 | 
			
		||||
                                 const SymbolContext &sym_ctx,
 | 
			
		||||
                                 std::vector<std::string> &cpu_features)
 | 
			
		||||
    : IRMemoryMap(target_sp), m_context_ap(context_ap.release()),
 | 
			
		||||
      m_module_ap(module_ap.release()), m_module(m_module_ap.get()),
 | 
			
		||||
    : IRMemoryMap(target_sp), m_context_up(context_up.release()),
 | 
			
		||||
      m_module_up(module_up.release()), m_module(m_module_up.get()),
 | 
			
		||||
      m_cpu_features(cpu_features), m_name(name), m_sym_ctx(sym_ctx),
 | 
			
		||||
      m_did_jit(false), m_function_load_addr(LLDB_INVALID_ADDRESS),
 | 
			
		||||
      m_function_end_load_addr(LLDB_INVALID_ADDRESS),
 | 
			
		||||
| 
						 | 
				
			
			@ -267,10 +267,10 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, lldb::addr_t &func_addr,
 | 
			
		|||
    relocModel = llvm::Reloc::PIC_;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  m_module_ap->getContext().setInlineAsmDiagnosticHandler(ReportInlineAsmError,
 | 
			
		||||
  m_module_up->getContext().setInlineAsmDiagnosticHandler(ReportInlineAsmError,
 | 
			
		||||
                                                          &error);
 | 
			
		||||
 | 
			
		||||
  llvm::EngineBuilder builder(std::move(m_module_ap));
 | 
			
		||||
  llvm::EngineBuilder builder(std::move(m_module_up));
 | 
			
		||||
 | 
			
		||||
  builder.setEngineKind(llvm::EngineKind::JIT)
 | 
			
		||||
      .setErrorStr(&error_string)
 | 
			
		||||
| 
						 | 
				
			
			@ -289,12 +289,12 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, lldb::addr_t &func_addr,
 | 
			
		|||
  llvm::TargetMachine *target_machine =
 | 
			
		||||
      builder.selectTarget(triple, mArch, mCPU, mAttrs);
 | 
			
		||||
 | 
			
		||||
  m_execution_engine_ap.reset(builder.create(target_machine));
 | 
			
		||||
  m_execution_engine_up.reset(builder.create(target_machine));
 | 
			
		||||
 | 
			
		||||
  m_strip_underscore =
 | 
			
		||||
      (m_execution_engine_ap->getDataLayout().getGlobalPrefix() == '_');
 | 
			
		||||
      (m_execution_engine_up->getDataLayout().getGlobalPrefix() == '_');
 | 
			
		||||
 | 
			
		||||
  if (!m_execution_engine_ap) {
 | 
			
		||||
  if (!m_execution_engine_up) {
 | 
			
		||||
    error.SetErrorToGenericError();
 | 
			
		||||
    error.SetErrorStringWithFormat("Couldn't JIT the function: %s",
 | 
			
		||||
                                   error_string.c_str());
 | 
			
		||||
| 
						 | 
				
			
			@ -323,15 +323,15 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, lldb::addr_t &func_addr,
 | 
			
		|||
  };
 | 
			
		||||
 | 
			
		||||
  if (process_sp->GetTarget().GetEnableSaveObjects()) {
 | 
			
		||||
    m_object_cache_ap = llvm::make_unique<ObjectDumper>();
 | 
			
		||||
    m_execution_engine_ap->setObjectCache(m_object_cache_ap.get());
 | 
			
		||||
    m_object_cache_up = llvm::make_unique<ObjectDumper>();
 | 
			
		||||
    m_execution_engine_up->setObjectCache(m_object_cache_up.get());
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // Make sure we see all sections, including ones that don't have
 | 
			
		||||
  // relocations...
 | 
			
		||||
  m_execution_engine_ap->setProcessAllSections(true);
 | 
			
		||||
  m_execution_engine_up->setProcessAllSections(true);
 | 
			
		||||
 | 
			
		||||
  m_execution_engine_ap->DisableLazyCompilation();
 | 
			
		||||
  m_execution_engine_up->DisableLazyCompilation();
 | 
			
		||||
 | 
			
		||||
  for (llvm::Function &function : *m_module) {
 | 
			
		||||
    if (function.isDeclaration() || function.hasPrivateLinkage())
 | 
			
		||||
| 
						 | 
				
			
			@ -340,7 +340,7 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, lldb::addr_t &func_addr,
 | 
			
		|||
    const bool external =
 | 
			
		||||
        function.hasExternalLinkage() || function.hasLinkOnceODRLinkage();
 | 
			
		||||
 | 
			
		||||
    void *fun_ptr = m_execution_engine_ap->getPointerToFunction(&function);
 | 
			
		||||
    void *fun_ptr = m_execution_engine_up->getPointerToFunction(&function);
 | 
			
		||||
 | 
			
		||||
    if (!error.Success()) {
 | 
			
		||||
      // We got an error through our callback!
 | 
			
		||||
| 
						 | 
				
			
			@ -359,7 +359,7 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, lldb::addr_t &func_addr,
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
  CommitAllocations(process_sp);
 | 
			
		||||
  ReportAllocations(*m_execution_engine_ap);
 | 
			
		||||
  ReportAllocations(*m_execution_engine_up);
 | 
			
		||||
 | 
			
		||||
  // We have to do this after calling ReportAllocations because for the MCJIT,
 | 
			
		||||
  // getGlobalValueAddress will cause the JIT to perform all relocations.  That
 | 
			
		||||
| 
						 | 
				
			
			@ -371,7 +371,7 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, lldb::addr_t &func_addr,
 | 
			
		|||
      llvm::GlobalValue &val) {
 | 
			
		||||
    if (val.hasExternalLinkage() && !val.isDeclaration()) {
 | 
			
		||||
      uint64_t var_ptr_addr =
 | 
			
		||||
          m_execution_engine_ap->getGlobalValueAddress(val.getName().str());
 | 
			
		||||
          m_execution_engine_up->getGlobalValueAddress(val.getName().str());
 | 
			
		||||
 | 
			
		||||
      lldb::addr_t remote_addr = GetRemoteAddressForLocal(var_ptr_addr);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -488,13 +488,13 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, lldb::addr_t &func_addr,
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
IRExecutionUnit::~IRExecutionUnit() {
 | 
			
		||||
  m_module_ap.reset();
 | 
			
		||||
  m_execution_engine_ap.reset();
 | 
			
		||||
  m_context_ap.reset();
 | 
			
		||||
  m_module_up.reset();
 | 
			
		||||
  m_execution_engine_up.reset();
 | 
			
		||||
  m_context_up.reset();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
IRExecutionUnit::MemoryManager::MemoryManager(IRExecutionUnit &parent)
 | 
			
		||||
    : m_default_mm_ap(new llvm::SectionMemoryManager()), m_parent(parent) {}
 | 
			
		||||
    : m_default_mm_up(new llvm::SectionMemoryManager()), m_parent(parent) {}
 | 
			
		||||
 | 
			
		||||
IRExecutionUnit::MemoryManager::~MemoryManager() {}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -596,7 +596,7 @@ uint8_t *IRExecutionUnit::MemoryManager::allocateCodeSection(
 | 
			
		|||
    llvm::StringRef SectionName) {
 | 
			
		||||
  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
 | 
			
		||||
 | 
			
		||||
  uint8_t *return_value = m_default_mm_ap->allocateCodeSection(
 | 
			
		||||
  uint8_t *return_value = m_default_mm_up->allocateCodeSection(
 | 
			
		||||
      Size, Alignment, SectionID, SectionName);
 | 
			
		||||
 | 
			
		||||
  m_parent.m_records.push_back(AllocationRecord(
 | 
			
		||||
| 
						 | 
				
			
			@ -627,7 +627,7 @@ uint8_t *IRExecutionUnit::MemoryManager::allocateDataSection(
 | 
			
		|||
    llvm::StringRef SectionName, bool IsReadOnly) {
 | 
			
		||||
  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
 | 
			
		||||
 | 
			
		||||
  uint8_t *return_value = m_default_mm_ap->allocateDataSection(
 | 
			
		||||
  uint8_t *return_value = m_default_mm_up->allocateDataSection(
 | 
			
		||||
      Size, Alignment, SectionID, SectionName, IsReadOnly);
 | 
			
		||||
 | 
			
		||||
  uint32_t permissions = lldb::ePermissionsReadable;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1600,16 +1600,16 @@ bool IRInterpreter::Interpret(llvm::Module &module, llvm::Function &function,
 | 
			
		|||
                 "unable to locate host data for transfer to device");
 | 
			
		||||
          // Create the required buffer
 | 
			
		||||
          rawArgs[i].size = dataSize;
 | 
			
		||||
          rawArgs[i].data_ap.reset(new uint8_t[dataSize + 1]);
 | 
			
		||||
          rawArgs[i].data_up.reset(new uint8_t[dataSize + 1]);
 | 
			
		||||
 | 
			
		||||
          // Read string from host memory
 | 
			
		||||
          execution_unit.ReadMemory(rawArgs[i].data_ap.get(), addr, dataSize,
 | 
			
		||||
          execution_unit.ReadMemory(rawArgs[i].data_up.get(), addr, dataSize,
 | 
			
		||||
                                    error);
 | 
			
		||||
          assert(!error.Fail() &&
 | 
			
		||||
                 "we have failed to read the string from memory");
 | 
			
		||||
 | 
			
		||||
          // Add null terminator
 | 
			
		||||
          rawArgs[i].data_ap[dataSize] = '\0';
 | 
			
		||||
          rawArgs[i].data_up[dataSize] = '\0';
 | 
			
		||||
          rawArgs[i].type = lldb_private::ABI::CallArgument::HostPointer;
 | 
			
		||||
        } else /* if ( arg_ty->isPointerTy() ) */
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -45,15 +45,12 @@ LLVMUserExpression::LLVMUserExpression(ExecutionContextScope &exe_scope,
 | 
			
		|||
                                       const EvaluateExpressionOptions &options)
 | 
			
		||||
    : UserExpression(exe_scope, expr, prefix, language, desired_type, options),
 | 
			
		||||
      m_stack_frame_bottom(LLDB_INVALID_ADDRESS),
 | 
			
		||||
      m_stack_frame_top(LLDB_INVALID_ADDRESS),
 | 
			
		||||
      m_allow_cxx(false),
 | 
			
		||||
      m_allow_objc(false),
 | 
			
		||||
      m_transformed_text(),
 | 
			
		||||
      m_execution_unit_sp(), m_materializer_ap(), m_jit_module_wp(),
 | 
			
		||||
      m_enforce_valid_object(true), m_in_cplusplus_method(false),
 | 
			
		||||
      m_in_objectivec_method(false), m_in_static_method(false),
 | 
			
		||||
      m_needs_object_ptr(false), m_target(NULL), m_can_interpret(false),
 | 
			
		||||
      m_materialized_address(LLDB_INVALID_ADDRESS) {}
 | 
			
		||||
      m_stack_frame_top(LLDB_INVALID_ADDRESS), m_allow_cxx(false),
 | 
			
		||||
      m_allow_objc(false), m_transformed_text(), m_execution_unit_sp(),
 | 
			
		||||
      m_materializer_up(), m_jit_module_wp(), m_enforce_valid_object(true),
 | 
			
		||||
      m_in_cplusplus_method(false), m_in_objectivec_method(false),
 | 
			
		||||
      m_in_static_method(false), m_needs_object_ptr(false), m_target(NULL),
 | 
			
		||||
      m_can_interpret(false), m_materialized_address(LLDB_INVALID_ADDRESS) {}
 | 
			
		||||
 | 
			
		||||
LLVMUserExpression::~LLVMUserExpression() {
 | 
			
		||||
  if (m_target) {
 | 
			
		||||
| 
						 | 
				
			
			@ -312,8 +309,8 @@ bool LLVMUserExpression::PrepareToExecuteJITExpression(
 | 
			
		|||
      const bool zero_memory = false;
 | 
			
		||||
 | 
			
		||||
      m_materialized_address = m_execution_unit_sp->Malloc(
 | 
			
		||||
          m_materializer_ap->GetStructByteSize(),
 | 
			
		||||
          m_materializer_ap->GetStructAlignment(),
 | 
			
		||||
          m_materializer_up->GetStructByteSize(),
 | 
			
		||||
          m_materializer_up->GetStructAlignment(),
 | 
			
		||||
          lldb::ePermissionsReadable | lldb::ePermissionsWritable, policy,
 | 
			
		||||
          zero_memory, alloc_error);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -353,7 +350,7 @@ bool LLVMUserExpression::PrepareToExecuteJITExpression(
 | 
			
		|||
 | 
			
		||||
    Status materialize_error;
 | 
			
		||||
 | 
			
		||||
    m_dematerializer_sp = m_materializer_ap->Materialize(
 | 
			
		||||
    m_dematerializer_sp = m_materializer_up->Materialize(
 | 
			
		||||
        frame, *m_execution_unit_sp, struct_address, materialize_error);
 | 
			
		||||
 | 
			
		||||
    if (!materialize_error.Success()) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -528,18 +528,18 @@ Status File::Read(size_t &num_bytes, off_t &offset, bool null_terminate,
 | 
			
		|||
            num_bytes = bytes_left;
 | 
			
		||||
 | 
			
		||||
          size_t num_bytes_plus_nul_char = num_bytes + (null_terminate ? 1 : 0);
 | 
			
		||||
          std::unique_ptr<DataBufferHeap> data_heap_ap;
 | 
			
		||||
          data_heap_ap.reset(new DataBufferHeap());
 | 
			
		||||
          data_heap_ap->SetByteSize(num_bytes_plus_nul_char);
 | 
			
		||||
          std::unique_ptr<DataBufferHeap> data_heap_up;
 | 
			
		||||
          data_heap_up.reset(new DataBufferHeap());
 | 
			
		||||
          data_heap_up->SetByteSize(num_bytes_plus_nul_char);
 | 
			
		||||
 | 
			
		||||
          if (data_heap_ap) {
 | 
			
		||||
            error = Read(data_heap_ap->GetBytes(), num_bytes, offset);
 | 
			
		||||
          if (data_heap_up) {
 | 
			
		||||
            error = Read(data_heap_up->GetBytes(), num_bytes, offset);
 | 
			
		||||
            if (error.Success()) {
 | 
			
		||||
              // Make sure we read exactly what we asked for and if we got
 | 
			
		||||
              // less, adjust the array
 | 
			
		||||
              if (num_bytes_plus_nul_char < data_heap_ap->GetByteSize())
 | 
			
		||||
                data_heap_ap->SetByteSize(num_bytes_plus_nul_char);
 | 
			
		||||
              data_buffer_sp.reset(data_heap_ap.release());
 | 
			
		||||
              if (num_bytes_plus_nul_char < data_heap_up->GetByteSize())
 | 
			
		||||
                data_heap_up->SetByteSize(num_bytes_plus_nul_char);
 | 
			
		||||
              data_buffer_sp.reset(data_heap_up.release());
 | 
			
		||||
              return error;
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -87,7 +87,7 @@ bool Terminal::SetCanonical(bool enabled) {
 | 
			
		|||
TerminalState::TerminalState()
 | 
			
		||||
    : m_tty(), m_tflags(-1),
 | 
			
		||||
#ifdef LLDB_CONFIG_TERMIOS_SUPPORTED
 | 
			
		||||
      m_termios_ap(),
 | 
			
		||||
      m_termios_up(),
 | 
			
		||||
#endif
 | 
			
		||||
      m_process_group(-1) {
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -101,7 +101,7 @@ void TerminalState::Clear() {
 | 
			
		|||
  m_tty.Clear();
 | 
			
		||||
  m_tflags = -1;
 | 
			
		||||
#ifdef LLDB_CONFIG_TERMIOS_SUPPORTED
 | 
			
		||||
  m_termios_ap.reset();
 | 
			
		||||
  m_termios_up.reset();
 | 
			
		||||
#endif
 | 
			
		||||
  m_process_group = -1;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -118,11 +118,11 @@ bool TerminalState::Save(int fd, bool save_process_group) {
 | 
			
		|||
    m_tflags = ::fcntl(fd, F_GETFL, 0);
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef LLDB_CONFIG_TERMIOS_SUPPORTED
 | 
			
		||||
    if (m_termios_ap == NULL)
 | 
			
		||||
      m_termios_ap.reset(new struct termios);
 | 
			
		||||
    int err = ::tcgetattr(fd, m_termios_ap.get());
 | 
			
		||||
    if (m_termios_up == NULL)
 | 
			
		||||
      m_termios_up.reset(new struct termios);
 | 
			
		||||
    int err = ::tcgetattr(fd, m_termios_up.get());
 | 
			
		||||
    if (err != 0)
 | 
			
		||||
      m_termios_ap.reset();
 | 
			
		||||
      m_termios_up.reset();
 | 
			
		||||
#endif // #ifdef LLDB_CONFIG_TERMIOS_SUPPORTED
 | 
			
		||||
#ifndef LLDB_DISABLE_POSIX
 | 
			
		||||
    if (save_process_group)
 | 
			
		||||
| 
						 | 
				
			
			@ -134,7 +134,7 @@ bool TerminalState::Save(int fd, bool save_process_group) {
 | 
			
		|||
    m_tty.Clear();
 | 
			
		||||
    m_tflags = -1;
 | 
			
		||||
#ifdef LLDB_CONFIG_TERMIOS_SUPPORTED
 | 
			
		||||
    m_termios_ap.reset();
 | 
			
		||||
    m_termios_up.reset();
 | 
			
		||||
#endif
 | 
			
		||||
    m_process_group = -1;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -154,7 +154,7 @@ bool TerminalState::Restore() const {
 | 
			
		|||
 | 
			
		||||
#ifdef LLDB_CONFIG_TERMIOS_SUPPORTED
 | 
			
		||||
    if (TTYStateIsValid())
 | 
			
		||||
      tcsetattr(fd, TCSANOW, m_termios_ap.get());
 | 
			
		||||
      tcsetattr(fd, TCSANOW, m_termios_up.get());
 | 
			
		||||
#endif // #ifdef LLDB_CONFIG_TERMIOS_SUPPORTED
 | 
			
		||||
 | 
			
		||||
    if (ProcessGroupIsValid()) {
 | 
			
		||||
| 
						 | 
				
			
			@ -191,7 +191,7 @@ bool TerminalState::TFlagsIsValid() const { return m_tflags != -1; }
 | 
			
		|||
//----------------------------------------------------------------------
 | 
			
		||||
bool TerminalState::TTYStateIsValid() const {
 | 
			
		||||
#ifdef LLDB_CONFIG_TERMIOS_SUPPORTED
 | 
			
		||||
  return m_termios_ap != 0;
 | 
			
		||||
  return m_termios_up != 0;
 | 
			
		||||
#else
 | 
			
		||||
  return false;
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -522,7 +522,7 @@ void CommandInterpreter::LoadCommandDictionary() {
 | 
			
		|||
 | 
			
		||||
  size_t num_regexes = llvm::array_lengthof(break_regexes);
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> break_regex_cmd_ap(
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> break_regex_cmd_up(
 | 
			
		||||
      new CommandObjectRegexCommand(
 | 
			
		||||
          *this, "_regexp-break",
 | 
			
		||||
          "Set a breakpoint using one of several shorthand formats.",
 | 
			
		||||
| 
						 | 
				
			
			@ -550,28 +550,29 @@ void CommandInterpreter::LoadCommandDictionary() {
 | 
			
		|||
          "current file\n"
 | 
			
		||||
          "                                    // containing text 'break "
 | 
			
		||||
          "here'.\n",
 | 
			
		||||
          2, CommandCompletions::eSymbolCompletion |
 | 
			
		||||
                 CommandCompletions::eSourceFileCompletion,
 | 
			
		||||
          2,
 | 
			
		||||
          CommandCompletions::eSymbolCompletion |
 | 
			
		||||
              CommandCompletions::eSourceFileCompletion,
 | 
			
		||||
          false));
 | 
			
		||||
 | 
			
		||||
  if (break_regex_cmd_ap) {
 | 
			
		||||
  if (break_regex_cmd_up) {
 | 
			
		||||
    bool success = true;
 | 
			
		||||
    for (size_t i = 0; i < num_regexes; i++) {
 | 
			
		||||
      success = break_regex_cmd_ap->AddRegexCommand(break_regexes[i][0],
 | 
			
		||||
      success = break_regex_cmd_up->AddRegexCommand(break_regexes[i][0],
 | 
			
		||||
                                                    break_regexes[i][1]);
 | 
			
		||||
      if (!success)
 | 
			
		||||
        break;
 | 
			
		||||
    }
 | 
			
		||||
    success =
 | 
			
		||||
        break_regex_cmd_ap->AddRegexCommand("^$", "breakpoint list --full");
 | 
			
		||||
        break_regex_cmd_up->AddRegexCommand("^$", "breakpoint list --full");
 | 
			
		||||
 | 
			
		||||
    if (success) {
 | 
			
		||||
      CommandObjectSP break_regex_cmd_sp(break_regex_cmd_ap.release());
 | 
			
		||||
      CommandObjectSP break_regex_cmd_sp(break_regex_cmd_up.release());
 | 
			
		||||
      m_command_dict[break_regex_cmd_sp->GetCommandName()] = break_regex_cmd_sp;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> tbreak_regex_cmd_ap(
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> tbreak_regex_cmd_up(
 | 
			
		||||
      new CommandObjectRegexCommand(
 | 
			
		||||
          *this, "_regexp-tbreak",
 | 
			
		||||
          "Set a one-shot breakpoint using one of several shorthand formats.",
 | 
			
		||||
| 
						 | 
				
			
			@ -599,11 +600,12 @@ void CommandInterpreter::LoadCommandDictionary() {
 | 
			
		|||
          "current file\n"
 | 
			
		||||
          "                                    // containing text 'break "
 | 
			
		||||
          "here'.\n",
 | 
			
		||||
          2, CommandCompletions::eSymbolCompletion |
 | 
			
		||||
                 CommandCompletions::eSourceFileCompletion,
 | 
			
		||||
          2,
 | 
			
		||||
          CommandCompletions::eSymbolCompletion |
 | 
			
		||||
              CommandCompletions::eSourceFileCompletion,
 | 
			
		||||
          false));
 | 
			
		||||
 | 
			
		||||
  if (tbreak_regex_cmd_ap) {
 | 
			
		||||
  if (tbreak_regex_cmd_up) {
 | 
			
		||||
    bool success = true;
 | 
			
		||||
    for (size_t i = 0; i < num_regexes; i++) {
 | 
			
		||||
      // If you add a resultant command string longer than 1024 characters be
 | 
			
		||||
| 
						 | 
				
			
			@ -614,155 +616,158 @@ void CommandInterpreter::LoadCommandDictionary() {
 | 
			
		|||
      lldbassert(num_printed < 1024);
 | 
			
		||||
      UNUSED_IF_ASSERT_DISABLED(num_printed);
 | 
			
		||||
      success =
 | 
			
		||||
          tbreak_regex_cmd_ap->AddRegexCommand(break_regexes[i][0], buffer);
 | 
			
		||||
          tbreak_regex_cmd_up->AddRegexCommand(break_regexes[i][0], buffer);
 | 
			
		||||
      if (!success)
 | 
			
		||||
        break;
 | 
			
		||||
    }
 | 
			
		||||
    success =
 | 
			
		||||
        tbreak_regex_cmd_ap->AddRegexCommand("^$", "breakpoint list --full");
 | 
			
		||||
        tbreak_regex_cmd_up->AddRegexCommand("^$", "breakpoint list --full");
 | 
			
		||||
 | 
			
		||||
    if (success) {
 | 
			
		||||
      CommandObjectSP tbreak_regex_cmd_sp(tbreak_regex_cmd_ap.release());
 | 
			
		||||
      CommandObjectSP tbreak_regex_cmd_sp(tbreak_regex_cmd_up.release());
 | 
			
		||||
      m_command_dict[tbreak_regex_cmd_sp->GetCommandName()] =
 | 
			
		||||
          tbreak_regex_cmd_sp;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> attach_regex_cmd_ap(
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> attach_regex_cmd_up(
 | 
			
		||||
      new CommandObjectRegexCommand(
 | 
			
		||||
          *this, "_regexp-attach", "Attach to process by ID or name.",
 | 
			
		||||
          "_regexp-attach <pid> | <process-name>", 2, 0, false));
 | 
			
		||||
  if (attach_regex_cmd_ap) {
 | 
			
		||||
    if (attach_regex_cmd_ap->AddRegexCommand("^([0-9]+)[[:space:]]*$",
 | 
			
		||||
  if (attach_regex_cmd_up) {
 | 
			
		||||
    if (attach_regex_cmd_up->AddRegexCommand("^([0-9]+)[[:space:]]*$",
 | 
			
		||||
                                             "process attach --pid %1") &&
 | 
			
		||||
        attach_regex_cmd_ap->AddRegexCommand(
 | 
			
		||||
        attach_regex_cmd_up->AddRegexCommand(
 | 
			
		||||
            "^(-.*|.* -.*)$", "process attach %1") && // Any options that are
 | 
			
		||||
                                                      // specified get passed to
 | 
			
		||||
                                                      // 'process attach'
 | 
			
		||||
        attach_regex_cmd_ap->AddRegexCommand("^(.+)$",
 | 
			
		||||
        attach_regex_cmd_up->AddRegexCommand("^(.+)$",
 | 
			
		||||
                                             "process attach --name '%1'") &&
 | 
			
		||||
        attach_regex_cmd_ap->AddRegexCommand("^$", "process attach")) {
 | 
			
		||||
      CommandObjectSP attach_regex_cmd_sp(attach_regex_cmd_ap.release());
 | 
			
		||||
        attach_regex_cmd_up->AddRegexCommand("^$", "process attach")) {
 | 
			
		||||
      CommandObjectSP attach_regex_cmd_sp(attach_regex_cmd_up.release());
 | 
			
		||||
      m_command_dict[attach_regex_cmd_sp->GetCommandName()] =
 | 
			
		||||
          attach_regex_cmd_sp;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> down_regex_cmd_ap(
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> down_regex_cmd_up(
 | 
			
		||||
      new CommandObjectRegexCommand(*this, "_regexp-down",
 | 
			
		||||
                                    "Select a newer stack frame.  Defaults to "
 | 
			
		||||
                                    "moving one frame, a numeric argument can "
 | 
			
		||||
                                    "specify an arbitrary number.",
 | 
			
		||||
                                    "_regexp-down [<count>]", 2, 0, false));
 | 
			
		||||
  if (down_regex_cmd_ap) {
 | 
			
		||||
    if (down_regex_cmd_ap->AddRegexCommand("^$", "frame select -r -1") &&
 | 
			
		||||
        down_regex_cmd_ap->AddRegexCommand("^([0-9]+)$",
 | 
			
		||||
  if (down_regex_cmd_up) {
 | 
			
		||||
    if (down_regex_cmd_up->AddRegexCommand("^$", "frame select -r -1") &&
 | 
			
		||||
        down_regex_cmd_up->AddRegexCommand("^([0-9]+)$",
 | 
			
		||||
                                           "frame select -r -%1")) {
 | 
			
		||||
      CommandObjectSP down_regex_cmd_sp(down_regex_cmd_ap.release());
 | 
			
		||||
      CommandObjectSP down_regex_cmd_sp(down_regex_cmd_up.release());
 | 
			
		||||
      m_command_dict[down_regex_cmd_sp->GetCommandName()] = down_regex_cmd_sp;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> up_regex_cmd_ap(
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> up_regex_cmd_up(
 | 
			
		||||
      new CommandObjectRegexCommand(
 | 
			
		||||
          *this, "_regexp-up",
 | 
			
		||||
          "Select an older stack frame.  Defaults to moving one "
 | 
			
		||||
          "frame, a numeric argument can specify an arbitrary number.",
 | 
			
		||||
          "_regexp-up [<count>]", 2, 0, false));
 | 
			
		||||
  if (up_regex_cmd_ap) {
 | 
			
		||||
    if (up_regex_cmd_ap->AddRegexCommand("^$", "frame select -r 1") &&
 | 
			
		||||
        up_regex_cmd_ap->AddRegexCommand("^([0-9]+)$", "frame select -r %1")) {
 | 
			
		||||
      CommandObjectSP up_regex_cmd_sp(up_regex_cmd_ap.release());
 | 
			
		||||
  if (up_regex_cmd_up) {
 | 
			
		||||
    if (up_regex_cmd_up->AddRegexCommand("^$", "frame select -r 1") &&
 | 
			
		||||
        up_regex_cmd_up->AddRegexCommand("^([0-9]+)$", "frame select -r %1")) {
 | 
			
		||||
      CommandObjectSP up_regex_cmd_sp(up_regex_cmd_up.release());
 | 
			
		||||
      m_command_dict[up_regex_cmd_sp->GetCommandName()] = up_regex_cmd_sp;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> display_regex_cmd_ap(
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> display_regex_cmd_up(
 | 
			
		||||
      new CommandObjectRegexCommand(
 | 
			
		||||
          *this, "_regexp-display",
 | 
			
		||||
          "Evaluate an expression at every stop (see 'help target stop-hook'.)",
 | 
			
		||||
          "_regexp-display expression", 2, 0, false));
 | 
			
		||||
  if (display_regex_cmd_ap) {
 | 
			
		||||
    if (display_regex_cmd_ap->AddRegexCommand(
 | 
			
		||||
  if (display_regex_cmd_up) {
 | 
			
		||||
    if (display_regex_cmd_up->AddRegexCommand(
 | 
			
		||||
            "^(.+)$", "target stop-hook add -o \"expr -- %1\"")) {
 | 
			
		||||
      CommandObjectSP display_regex_cmd_sp(display_regex_cmd_ap.release());
 | 
			
		||||
      CommandObjectSP display_regex_cmd_sp(display_regex_cmd_up.release());
 | 
			
		||||
      m_command_dict[display_regex_cmd_sp->GetCommandName()] =
 | 
			
		||||
          display_regex_cmd_sp;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> undisplay_regex_cmd_ap(
 | 
			
		||||
      new CommandObjectRegexCommand(
 | 
			
		||||
          *this, "_regexp-undisplay", "Stop displaying expression at every "
 | 
			
		||||
                                      "stop (specified by stop-hook index.)",
 | 
			
		||||
          "_regexp-undisplay stop-hook-number", 2, 0, false));
 | 
			
		||||
  if (undisplay_regex_cmd_ap) {
 | 
			
		||||
    if (undisplay_regex_cmd_ap->AddRegexCommand("^([0-9]+)$",
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> undisplay_regex_cmd_up(
 | 
			
		||||
      new CommandObjectRegexCommand(*this, "_regexp-undisplay",
 | 
			
		||||
                                    "Stop displaying expression at every "
 | 
			
		||||
                                    "stop (specified by stop-hook index.)",
 | 
			
		||||
                                    "_regexp-undisplay stop-hook-number", 2, 0,
 | 
			
		||||
                                    false));
 | 
			
		||||
  if (undisplay_regex_cmd_up) {
 | 
			
		||||
    if (undisplay_regex_cmd_up->AddRegexCommand("^([0-9]+)$",
 | 
			
		||||
                                                "target stop-hook delete %1")) {
 | 
			
		||||
      CommandObjectSP undisplay_regex_cmd_sp(undisplay_regex_cmd_ap.release());
 | 
			
		||||
      CommandObjectSP undisplay_regex_cmd_sp(undisplay_regex_cmd_up.release());
 | 
			
		||||
      m_command_dict[undisplay_regex_cmd_sp->GetCommandName()] =
 | 
			
		||||
          undisplay_regex_cmd_sp;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> connect_gdb_remote_cmd_ap(
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> connect_gdb_remote_cmd_up(
 | 
			
		||||
      new CommandObjectRegexCommand(
 | 
			
		||||
          *this, "gdb-remote", "Connect to a process via remote GDB server.  "
 | 
			
		||||
                               "If no host is specifed, localhost is assumed.",
 | 
			
		||||
          *this, "gdb-remote",
 | 
			
		||||
          "Connect to a process via remote GDB server.  "
 | 
			
		||||
          "If no host is specifed, localhost is assumed.",
 | 
			
		||||
          "gdb-remote [<hostname>:]<portnum>", 2, 0, false));
 | 
			
		||||
  if (connect_gdb_remote_cmd_ap) {
 | 
			
		||||
    if (connect_gdb_remote_cmd_ap->AddRegexCommand(
 | 
			
		||||
  if (connect_gdb_remote_cmd_up) {
 | 
			
		||||
    if (connect_gdb_remote_cmd_up->AddRegexCommand(
 | 
			
		||||
            "^([^:]+|\\[[0-9a-fA-F:]+.*\\]):([0-9]+)$",
 | 
			
		||||
            "process connect --plugin gdb-remote connect://%1:%2") &&
 | 
			
		||||
        connect_gdb_remote_cmd_ap->AddRegexCommand(
 | 
			
		||||
        connect_gdb_remote_cmd_up->AddRegexCommand(
 | 
			
		||||
            "^([[:digit:]]+)$",
 | 
			
		||||
            "process connect --plugin gdb-remote connect://localhost:%1")) {
 | 
			
		||||
      CommandObjectSP command_sp(connect_gdb_remote_cmd_ap.release());
 | 
			
		||||
      CommandObjectSP command_sp(connect_gdb_remote_cmd_up.release());
 | 
			
		||||
      m_command_dict[command_sp->GetCommandName()] = command_sp;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> connect_kdp_remote_cmd_ap(
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> connect_kdp_remote_cmd_up(
 | 
			
		||||
      new CommandObjectRegexCommand(
 | 
			
		||||
          *this, "kdp-remote", "Connect to a process via remote KDP server.  "
 | 
			
		||||
                               "If no UDP port is specified, port 41139 is "
 | 
			
		||||
                               "assumed.",
 | 
			
		||||
          *this, "kdp-remote",
 | 
			
		||||
          "Connect to a process via remote KDP server.  "
 | 
			
		||||
          "If no UDP port is specified, port 41139 is "
 | 
			
		||||
          "assumed.",
 | 
			
		||||
          "kdp-remote <hostname>[:<portnum>]", 2, 0, false));
 | 
			
		||||
  if (connect_kdp_remote_cmd_ap) {
 | 
			
		||||
    if (connect_kdp_remote_cmd_ap->AddRegexCommand(
 | 
			
		||||
  if (connect_kdp_remote_cmd_up) {
 | 
			
		||||
    if (connect_kdp_remote_cmd_up->AddRegexCommand(
 | 
			
		||||
            "^([^:]+:[[:digit:]]+)$",
 | 
			
		||||
            "process connect --plugin kdp-remote udp://%1") &&
 | 
			
		||||
        connect_kdp_remote_cmd_ap->AddRegexCommand(
 | 
			
		||||
        connect_kdp_remote_cmd_up->AddRegexCommand(
 | 
			
		||||
            "^(.+)$", "process connect --plugin kdp-remote udp://%1:41139")) {
 | 
			
		||||
      CommandObjectSP command_sp(connect_kdp_remote_cmd_ap.release());
 | 
			
		||||
      CommandObjectSP command_sp(connect_kdp_remote_cmd_up.release());
 | 
			
		||||
      m_command_dict[command_sp->GetCommandName()] = command_sp;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> bt_regex_cmd_ap(
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> bt_regex_cmd_up(
 | 
			
		||||
      new CommandObjectRegexCommand(
 | 
			
		||||
          *this, "_regexp-bt",
 | 
			
		||||
          "Show the current thread's call stack.  Any numeric argument "
 | 
			
		||||
          "displays at most that many "
 | 
			
		||||
          "frames.  The argument 'all' displays all threads.",
 | 
			
		||||
          "bt [<digit> | all]", 2, 0, false));
 | 
			
		||||
  if (bt_regex_cmd_ap) {
 | 
			
		||||
  if (bt_regex_cmd_up) {
 | 
			
		||||
    // accept but don't document "bt -c <number>" -- before bt was a regex
 | 
			
		||||
    // command if you wanted to backtrace three frames you would do "bt -c 3"
 | 
			
		||||
    // but the intention is to have this emulate the gdb "bt" command and so
 | 
			
		||||
    // now "bt 3" is the preferred form, in line with gdb.
 | 
			
		||||
    if (bt_regex_cmd_ap->AddRegexCommand("^([[:digit:]]+)$",
 | 
			
		||||
    if (bt_regex_cmd_up->AddRegexCommand("^([[:digit:]]+)$",
 | 
			
		||||
                                         "thread backtrace -c %1") &&
 | 
			
		||||
        bt_regex_cmd_ap->AddRegexCommand("^-c ([[:digit:]]+)$",
 | 
			
		||||
        bt_regex_cmd_up->AddRegexCommand("^-c ([[:digit:]]+)$",
 | 
			
		||||
                                         "thread backtrace -c %1") &&
 | 
			
		||||
        bt_regex_cmd_ap->AddRegexCommand("^all$", "thread backtrace all") &&
 | 
			
		||||
        bt_regex_cmd_ap->AddRegexCommand("^$", "thread backtrace")) {
 | 
			
		||||
      CommandObjectSP command_sp(bt_regex_cmd_ap.release());
 | 
			
		||||
        bt_regex_cmd_up->AddRegexCommand("^all$", "thread backtrace all") &&
 | 
			
		||||
        bt_regex_cmd_up->AddRegexCommand("^$", "thread backtrace")) {
 | 
			
		||||
      CommandObjectSP command_sp(bt_regex_cmd_up.release());
 | 
			
		||||
      m_command_dict[command_sp->GetCommandName()] = command_sp;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> list_regex_cmd_ap(
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> list_regex_cmd_up(
 | 
			
		||||
      new CommandObjectRegexCommand(
 | 
			
		||||
          *this, "_regexp-list",
 | 
			
		||||
          "List relevant source code using one of several shorthand formats.",
 | 
			
		||||
| 
						 | 
				
			
			@ -775,30 +780,30 @@ void CommandInterpreter::LoadCommandDictionary() {
 | 
			
		|||
          "_regexp-list -[<count>]      // List previous <count> lines\n"
 | 
			
		||||
          "_regexp-list                 // List subsequent lines",
 | 
			
		||||
          2, CommandCompletions::eSourceFileCompletion, false));
 | 
			
		||||
  if (list_regex_cmd_ap) {
 | 
			
		||||
    if (list_regex_cmd_ap->AddRegexCommand("^([0-9]+)[[:space:]]*$",
 | 
			
		||||
  if (list_regex_cmd_up) {
 | 
			
		||||
    if (list_regex_cmd_up->AddRegexCommand("^([0-9]+)[[:space:]]*$",
 | 
			
		||||
                                           "source list --line %1") &&
 | 
			
		||||
        list_regex_cmd_ap->AddRegexCommand(
 | 
			
		||||
        list_regex_cmd_up->AddRegexCommand(
 | 
			
		||||
            "^(.*[^[:space:]])[[:space:]]*:[[:space:]]*([[:digit:]]+)[[:space:]"
 | 
			
		||||
            "]*$",
 | 
			
		||||
            "source list --file '%1' --line %2") &&
 | 
			
		||||
        list_regex_cmd_ap->AddRegexCommand(
 | 
			
		||||
        list_regex_cmd_up->AddRegexCommand(
 | 
			
		||||
            "^\\*?(0x[[:xdigit:]]+)[[:space:]]*$",
 | 
			
		||||
            "source list --address %1") &&
 | 
			
		||||
        list_regex_cmd_ap->AddRegexCommand("^-[[:space:]]*$",
 | 
			
		||||
        list_regex_cmd_up->AddRegexCommand("^-[[:space:]]*$",
 | 
			
		||||
                                           "source list --reverse") &&
 | 
			
		||||
        list_regex_cmd_ap->AddRegexCommand(
 | 
			
		||||
        list_regex_cmd_up->AddRegexCommand(
 | 
			
		||||
            "^-([[:digit:]]+)[[:space:]]*$",
 | 
			
		||||
            "source list --reverse --count %1") &&
 | 
			
		||||
        list_regex_cmd_ap->AddRegexCommand("^(.+)$",
 | 
			
		||||
        list_regex_cmd_up->AddRegexCommand("^(.+)$",
 | 
			
		||||
                                           "source list --name \"%1\"") &&
 | 
			
		||||
        list_regex_cmd_ap->AddRegexCommand("^$", "source list")) {
 | 
			
		||||
      CommandObjectSP list_regex_cmd_sp(list_regex_cmd_ap.release());
 | 
			
		||||
        list_regex_cmd_up->AddRegexCommand("^$", "source list")) {
 | 
			
		||||
      CommandObjectSP list_regex_cmd_sp(list_regex_cmd_up.release());
 | 
			
		||||
      m_command_dict[list_regex_cmd_sp->GetCommandName()] = list_regex_cmd_sp;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> env_regex_cmd_ap(
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> env_regex_cmd_up(
 | 
			
		||||
      new CommandObjectRegexCommand(
 | 
			
		||||
          *this, "_regexp-env",
 | 
			
		||||
          "Shorthand for viewing and setting environment variables.",
 | 
			
		||||
| 
						 | 
				
			
			@ -806,17 +811,17 @@ void CommandInterpreter::LoadCommandDictionary() {
 | 
			
		|||
          "_regexp-env                  // Show enrivonment\n"
 | 
			
		||||
          "_regexp-env <name>=<value>   // Set an environment variable",
 | 
			
		||||
          2, 0, false));
 | 
			
		||||
  if (env_regex_cmd_ap) {
 | 
			
		||||
    if (env_regex_cmd_ap->AddRegexCommand("^$",
 | 
			
		||||
  if (env_regex_cmd_up) {
 | 
			
		||||
    if (env_regex_cmd_up->AddRegexCommand("^$",
 | 
			
		||||
                                          "settings show target.env-vars") &&
 | 
			
		||||
        env_regex_cmd_ap->AddRegexCommand("^([A-Za-z_][A-Za-z_0-9]*=.*)$",
 | 
			
		||||
        env_regex_cmd_up->AddRegexCommand("^([A-Za-z_][A-Za-z_0-9]*=.*)$",
 | 
			
		||||
                                          "settings set target.env-vars %1")) {
 | 
			
		||||
      CommandObjectSP env_regex_cmd_sp(env_regex_cmd_ap.release());
 | 
			
		||||
      CommandObjectSP env_regex_cmd_sp(env_regex_cmd_up.release());
 | 
			
		||||
      m_command_dict[env_regex_cmd_sp->GetCommandName()] = env_regex_cmd_sp;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> jump_regex_cmd_ap(
 | 
			
		||||
  std::unique_ptr<CommandObjectRegexCommand> jump_regex_cmd_up(
 | 
			
		||||
      new CommandObjectRegexCommand(
 | 
			
		||||
          *this, "_regexp-jump", "Set the program counter to a new address.",
 | 
			
		||||
          "\n"
 | 
			
		||||
| 
						 | 
				
			
			@ -825,16 +830,16 @@ void CommandInterpreter::LoadCommandDictionary() {
 | 
			
		|||
          "_regexp-jump <file>:<line>\n"
 | 
			
		||||
          "_regexp-jump *<addr>\n",
 | 
			
		||||
          2, 0, false));
 | 
			
		||||
  if (jump_regex_cmd_ap) {
 | 
			
		||||
    if (jump_regex_cmd_ap->AddRegexCommand("^\\*(.*)$",
 | 
			
		||||
  if (jump_regex_cmd_up) {
 | 
			
		||||
    if (jump_regex_cmd_up->AddRegexCommand("^\\*(.*)$",
 | 
			
		||||
                                           "thread jump --addr %1") &&
 | 
			
		||||
        jump_regex_cmd_ap->AddRegexCommand("^([0-9]+)$",
 | 
			
		||||
        jump_regex_cmd_up->AddRegexCommand("^([0-9]+)$",
 | 
			
		||||
                                           "thread jump --line %1") &&
 | 
			
		||||
        jump_regex_cmd_ap->AddRegexCommand("^([^:]+):([0-9]+)$",
 | 
			
		||||
        jump_regex_cmd_up->AddRegexCommand("^([^:]+):([0-9]+)$",
 | 
			
		||||
                                           "thread jump --file %1 --line %2") &&
 | 
			
		||||
        jump_regex_cmd_ap->AddRegexCommand("^([+\\-][0-9]+)$",
 | 
			
		||||
        jump_regex_cmd_up->AddRegexCommand("^([+\\-][0-9]+)$",
 | 
			
		||||
                                           "thread jump --by %1")) {
 | 
			
		||||
      CommandObjectSP jump_regex_cmd_sp(jump_regex_cmd_ap.release());
 | 
			
		||||
      CommandObjectSP jump_regex_cmd_sp(jump_regex_cmd_up.release());
 | 
			
		||||
      m_command_dict[jump_regex_cmd_sp->GetCommandName()] = jump_regex_cmd_sp;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -760,7 +760,7 @@ bool Options::HandleOptionArgumentCompletion(
 | 
			
		|||
    CompletionRequest &request, OptionElementVector &opt_element_vector,
 | 
			
		||||
    int opt_element_index, CommandInterpreter &interpreter) {
 | 
			
		||||
  auto opt_defs = GetDefinitions();
 | 
			
		||||
  std::unique_ptr<SearchFilter> filter_ap;
 | 
			
		||||
  std::unique_ptr<SearchFilter> filter_up;
 | 
			
		||||
 | 
			
		||||
  int opt_arg_pos = opt_element_vector[opt_element_index].opt_arg_pos;
 | 
			
		||||
  int opt_defs_index = opt_element_vector[opt_element_index].opt_defs_index;
 | 
			
		||||
| 
						 | 
				
			
			@ -831,7 +831,7 @@ bool Options::HandleOptionArgumentCompletion(
 | 
			
		|||
              interpreter.GetDebugger().GetSelectedTarget();
 | 
			
		||||
          // Search filters require a target...
 | 
			
		||||
          if (target_sp)
 | 
			
		||||
            filter_ap.reset(new SearchFilterByModule(target_sp, module_spec));
 | 
			
		||||
            filter_up.reset(new SearchFilterByModule(target_sp, module_spec));
 | 
			
		||||
        }
 | 
			
		||||
        break;
 | 
			
		||||
      }
 | 
			
		||||
| 
						 | 
				
			
			@ -839,7 +839,7 @@ bool Options::HandleOptionArgumentCompletion(
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
  return CommandCompletions::InvokeCommonCompletionCallbacks(
 | 
			
		||||
      interpreter, completion_mask, request, filter_ap.get());
 | 
			
		||||
      interpreter, completion_mask, request, filter_up.get());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void OptionGroupOptions::Append(OptionGroup *group) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1604,7 +1604,7 @@ ValueObjectSP ABIMacOSX_arm::GetReturnValueObjectImpl(
 | 
			
		|||
                                  r2_reg_info->byte_size +
 | 
			
		||||
                                  r3_reg_info->byte_size &&
 | 
			
		||||
                process_sp) {
 | 
			
		||||
              std::unique_ptr<DataBufferHeap> heap_data_ap(
 | 
			
		||||
              std::unique_ptr<DataBufferHeap> heap_data_up(
 | 
			
		||||
                  new DataBufferHeap(*byte_size, 0));
 | 
			
		||||
              const ByteOrder byte_order = process_sp->GetByteOrder();
 | 
			
		||||
              RegisterValue r0_reg_value;
 | 
			
		||||
| 
						 | 
				
			
			@ -1617,18 +1617,18 @@ ValueObjectSP ABIMacOSX_arm::GetReturnValueObjectImpl(
 | 
			
		|||
                  reg_ctx->ReadRegister(r3_reg_info, r3_reg_value)) {
 | 
			
		||||
                Status error;
 | 
			
		||||
                if (r0_reg_value.GetAsMemoryData(r0_reg_info,
 | 
			
		||||
                                                 heap_data_ap->GetBytes() + 0,
 | 
			
		||||
                                                 heap_data_up->GetBytes() + 0,
 | 
			
		||||
                                                 4, byte_order, error) &&
 | 
			
		||||
                    r1_reg_value.GetAsMemoryData(r1_reg_info,
 | 
			
		||||
                                                 heap_data_ap->GetBytes() + 4,
 | 
			
		||||
                                                 heap_data_up->GetBytes() + 4,
 | 
			
		||||
                                                 4, byte_order, error) &&
 | 
			
		||||
                    r2_reg_value.GetAsMemoryData(r2_reg_info,
 | 
			
		||||
                                                 heap_data_ap->GetBytes() + 8,
 | 
			
		||||
                                                 heap_data_up->GetBytes() + 8,
 | 
			
		||||
                                                 4, byte_order, error) &&
 | 
			
		||||
                    r3_reg_value.GetAsMemoryData(r3_reg_info,
 | 
			
		||||
                                                 heap_data_ap->GetBytes() + 12,
 | 
			
		||||
                                                 heap_data_up->GetBytes() + 12,
 | 
			
		||||
                                                 4, byte_order, error)) {
 | 
			
		||||
                  DataExtractor data(DataBufferSP(heap_data_ap.release()),
 | 
			
		||||
                  DataExtractor data(DataBufferSP(heap_data_up.release()),
 | 
			
		||||
                                     byte_order,
 | 
			
		||||
                                     process_sp->GetAddressByteSize());
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2114,7 +2114,7 @@ static bool LoadValueFromConsecutiveGPRRegisters(
 | 
			
		|||
  if (!byte_size || *byte_size == 0)
 | 
			
		||||
    return false;
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<DataBufferHeap> heap_data_ap(
 | 
			
		||||
  std::unique_ptr<DataBufferHeap> heap_data_up(
 | 
			
		||||
      new DataBufferHeap(*byte_size, 0));
 | 
			
		||||
  const ByteOrder byte_order = exe_ctx.GetProcessRef().GetByteOrder();
 | 
			
		||||
  Status error;
 | 
			
		||||
| 
						 | 
				
			
			@ -2148,10 +2148,10 @@ static bool LoadValueFromConsecutiveGPRRegisters(
 | 
			
		|||
        if (!reg_ctx->ReadRegister(reg_info, reg_value))
 | 
			
		||||
          return false;
 | 
			
		||||
 | 
			
		||||
        // Make sure we have enough room in "heap_data_ap"
 | 
			
		||||
        if ((data_offset + *base_byte_size) <= heap_data_ap->GetByteSize()) {
 | 
			
		||||
        // Make sure we have enough room in "heap_data_up"
 | 
			
		||||
        if ((data_offset + *base_byte_size) <= heap_data_up->GetByteSize()) {
 | 
			
		||||
          const size_t bytes_copied = reg_value.GetAsMemoryData(
 | 
			
		||||
              reg_info, heap_data_ap->GetBytes() + data_offset, *base_byte_size,
 | 
			
		||||
              reg_info, heap_data_up->GetBytes() + data_offset, *base_byte_size,
 | 
			
		||||
              byte_order, error);
 | 
			
		||||
          if (bytes_copied != *base_byte_size)
 | 
			
		||||
            return false;
 | 
			
		||||
| 
						 | 
				
			
			@ -2162,7 +2162,7 @@ static bool LoadValueFromConsecutiveGPRRegisters(
 | 
			
		|||
      }
 | 
			
		||||
      data.SetByteOrder(byte_order);
 | 
			
		||||
      data.SetAddressByteSize(exe_ctx.GetProcessRef().GetAddressByteSize());
 | 
			
		||||
      data.SetData(DataBufferSP(heap_data_ap.release()));
 | 
			
		||||
      data.SetData(DataBufferSP(heap_data_up.release()));
 | 
			
		||||
      return true;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -2191,7 +2191,7 @@ static bool LoadValueFromConsecutiveGPRRegisters(
 | 
			
		|||
 | 
			
		||||
      const size_t curr_byte_size = std::min<size_t>(8, bytes_left);
 | 
			
		||||
      const size_t bytes_copied = reg_value.GetAsMemoryData(
 | 
			
		||||
          reg_info, heap_data_ap->GetBytes() + data_offset, curr_byte_size,
 | 
			
		||||
          reg_info, heap_data_up->GetBytes() + data_offset, curr_byte_size,
 | 
			
		||||
          byte_order, error);
 | 
			
		||||
      if (bytes_copied == 0)
 | 
			
		||||
        return false;
 | 
			
		||||
| 
						 | 
				
			
			@ -2235,15 +2235,15 @@ static bool LoadValueFromConsecutiveGPRRegisters(
 | 
			
		|||
      return false;
 | 
			
		||||
 | 
			
		||||
    if (exe_ctx.GetProcessRef().ReadMemory(
 | 
			
		||||
            value_addr, heap_data_ap->GetBytes(), heap_data_ap->GetByteSize(),
 | 
			
		||||
            error) != heap_data_ap->GetByteSize()) {
 | 
			
		||||
            value_addr, heap_data_up->GetBytes(), heap_data_up->GetByteSize(),
 | 
			
		||||
            error) != heap_data_up->GetByteSize()) {
 | 
			
		||||
      return false;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  data.SetByteOrder(byte_order);
 | 
			
		||||
  data.SetAddressByteSize(exe_ctx.GetProcessRef().GetAddressByteSize());
 | 
			
		||||
  data.SetData(DataBufferSP(heap_data_ap.release()));
 | 
			
		||||
  data.SetData(DataBufferSP(heap_data_up.release()));
 | 
			
		||||
  return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -2295,7 +2295,7 @@ ValueObjectSP ABIMacOSX_arm64::GetReturnValueObjectImpl(
 | 
			
		|||
              if (x1_reg_info) {
 | 
			
		||||
                if (*byte_size <=
 | 
			
		||||
                    x0_reg_info->byte_size + x1_reg_info->byte_size) {
 | 
			
		||||
                  std::unique_ptr<DataBufferHeap> heap_data_ap(
 | 
			
		||||
                  std::unique_ptr<DataBufferHeap> heap_data_up(
 | 
			
		||||
                      new DataBufferHeap(*byte_size, 0));
 | 
			
		||||
                  const ByteOrder byte_order =
 | 
			
		||||
                      exe_ctx.GetProcessRef().GetByteOrder();
 | 
			
		||||
| 
						 | 
				
			
			@ -2305,13 +2305,13 @@ ValueObjectSP ABIMacOSX_arm64::GetReturnValueObjectImpl(
 | 
			
		|||
                      reg_ctx->ReadRegister(x1_reg_info, x1_reg_value)) {
 | 
			
		||||
                    Status error;
 | 
			
		||||
                    if (x0_reg_value.GetAsMemoryData(
 | 
			
		||||
                            x0_reg_info, heap_data_ap->GetBytes() + 0, 8,
 | 
			
		||||
                            x0_reg_info, heap_data_up->GetBytes() + 0, 8,
 | 
			
		||||
                            byte_order, error) &&
 | 
			
		||||
                        x1_reg_value.GetAsMemoryData(
 | 
			
		||||
                            x1_reg_info, heap_data_ap->GetBytes() + 8, 8,
 | 
			
		||||
                            x1_reg_info, heap_data_up->GetBytes() + 8, 8,
 | 
			
		||||
                            byte_order, error)) {
 | 
			
		||||
                      DataExtractor data(
 | 
			
		||||
                          DataBufferSP(heap_data_ap.release()), byte_order,
 | 
			
		||||
                          DataBufferSP(heap_data_up.release()), byte_order,
 | 
			
		||||
                          exe_ctx.GetProcessRef().GetAddressByteSize());
 | 
			
		||||
 | 
			
		||||
                      return_valobj_sp = ValueObjectConstResult::Create(
 | 
			
		||||
| 
						 | 
				
			
			@ -2395,16 +2395,16 @@ ValueObjectSP ABIMacOSX_arm64::GetReturnValueObjectImpl(
 | 
			
		|||
 | 
			
		||||
      if (v0_info) {
 | 
			
		||||
        if (*byte_size <= v0_info->byte_size) {
 | 
			
		||||
          std::unique_ptr<DataBufferHeap> heap_data_ap(
 | 
			
		||||
          std::unique_ptr<DataBufferHeap> heap_data_up(
 | 
			
		||||
              new DataBufferHeap(*byte_size, 0));
 | 
			
		||||
          const ByteOrder byte_order = exe_ctx.GetProcessRef().GetByteOrder();
 | 
			
		||||
          RegisterValue reg_value;
 | 
			
		||||
          if (reg_ctx->ReadRegister(v0_info, reg_value)) {
 | 
			
		||||
            Status error;
 | 
			
		||||
            if (reg_value.GetAsMemoryData(v0_info, heap_data_ap->GetBytes(),
 | 
			
		||||
                                          heap_data_ap->GetByteSize(),
 | 
			
		||||
            if (reg_value.GetAsMemoryData(v0_info, heap_data_up->GetBytes(),
 | 
			
		||||
                                          heap_data_up->GetByteSize(),
 | 
			
		||||
                                          byte_order, error)) {
 | 
			
		||||
              DataExtractor data(DataBufferSP(heap_data_ap.release()),
 | 
			
		||||
              DataExtractor data(DataBufferSP(heap_data_up.release()),
 | 
			
		||||
                                 byte_order,
 | 
			
		||||
                                 exe_ctx.GetProcessRef().GetAddressByteSize());
 | 
			
		||||
              return_valobj_sp = ValueObjectConstResult::Create(
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2090,7 +2090,7 @@ static bool LoadValueFromConsecutiveGPRRegisters(
 | 
			
		|||
  if (byte_size || *byte_size == 0)
 | 
			
		||||
    return false;
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<DataBufferHeap> heap_data_ap(
 | 
			
		||||
  std::unique_ptr<DataBufferHeap> heap_data_up(
 | 
			
		||||
      new DataBufferHeap(*byte_size, 0));
 | 
			
		||||
  const ByteOrder byte_order = exe_ctx.GetProcessRef().GetByteOrder();
 | 
			
		||||
  Status error;
 | 
			
		||||
| 
						 | 
				
			
			@ -2124,10 +2124,10 @@ static bool LoadValueFromConsecutiveGPRRegisters(
 | 
			
		|||
        if (!reg_ctx->ReadRegister(reg_info, reg_value))
 | 
			
		||||
          return false;
 | 
			
		||||
 | 
			
		||||
        // Make sure we have enough room in "heap_data_ap"
 | 
			
		||||
        if ((data_offset + *base_byte_size) <= heap_data_ap->GetByteSize()) {
 | 
			
		||||
        // Make sure we have enough room in "heap_data_up"
 | 
			
		||||
        if ((data_offset + *base_byte_size) <= heap_data_up->GetByteSize()) {
 | 
			
		||||
          const size_t bytes_copied = reg_value.GetAsMemoryData(
 | 
			
		||||
              reg_info, heap_data_ap->GetBytes() + data_offset, *base_byte_size,
 | 
			
		||||
              reg_info, heap_data_up->GetBytes() + data_offset, *base_byte_size,
 | 
			
		||||
              byte_order, error);
 | 
			
		||||
          if (bytes_copied != *base_byte_size)
 | 
			
		||||
            return false;
 | 
			
		||||
| 
						 | 
				
			
			@ -2138,7 +2138,7 @@ static bool LoadValueFromConsecutiveGPRRegisters(
 | 
			
		|||
      }
 | 
			
		||||
      data.SetByteOrder(byte_order);
 | 
			
		||||
      data.SetAddressByteSize(exe_ctx.GetProcessRef().GetAddressByteSize());
 | 
			
		||||
      data.SetData(DataBufferSP(heap_data_ap.release()));
 | 
			
		||||
      data.SetData(DataBufferSP(heap_data_up.release()));
 | 
			
		||||
      return true;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -2163,7 +2163,7 @@ static bool LoadValueFromConsecutiveGPRRegisters(
 | 
			
		|||
 | 
			
		||||
      const size_t curr_byte_size = std::min<size_t>(8, bytes_left);
 | 
			
		||||
      const size_t bytes_copied = reg_value.GetAsMemoryData(
 | 
			
		||||
          reg_info, heap_data_ap->GetBytes() + data_offset, curr_byte_size,
 | 
			
		||||
          reg_info, heap_data_up->GetBytes() + data_offset, curr_byte_size,
 | 
			
		||||
          byte_order, error);
 | 
			
		||||
      if (bytes_copied == 0)
 | 
			
		||||
        return false;
 | 
			
		||||
| 
						 | 
				
			
			@ -2204,15 +2204,15 @@ static bool LoadValueFromConsecutiveGPRRegisters(
 | 
			
		|||
      return false;
 | 
			
		||||
 | 
			
		||||
    if (exe_ctx.GetProcessRef().ReadMemory(
 | 
			
		||||
            value_addr, heap_data_ap->GetBytes(), heap_data_ap->GetByteSize(),
 | 
			
		||||
            error) != heap_data_ap->GetByteSize()) {
 | 
			
		||||
            value_addr, heap_data_up->GetBytes(), heap_data_up->GetByteSize(),
 | 
			
		||||
            error) != heap_data_up->GetByteSize()) {
 | 
			
		||||
      return false;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  data.SetByteOrder(byte_order);
 | 
			
		||||
  data.SetAddressByteSize(exe_ctx.GetProcessRef().GetAddressByteSize());
 | 
			
		||||
  data.SetData(DataBufferSP(heap_data_ap.release()));
 | 
			
		||||
  data.SetData(DataBufferSP(heap_data_up.release()));
 | 
			
		||||
  return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -2266,7 +2266,7 @@ ValueObjectSP ABISysV_arm64::GetReturnValueObjectImpl(
 | 
			
		|||
              if (x1_reg_info) {
 | 
			
		||||
                if (*byte_size <=
 | 
			
		||||
                    x0_reg_info->byte_size + x1_reg_info->byte_size) {
 | 
			
		||||
                  std::unique_ptr<DataBufferHeap> heap_data_ap(
 | 
			
		||||
                  std::unique_ptr<DataBufferHeap> heap_data_up(
 | 
			
		||||
                      new DataBufferHeap(*byte_size, 0));
 | 
			
		||||
                  const ByteOrder byte_order =
 | 
			
		||||
                      exe_ctx.GetProcessRef().GetByteOrder();
 | 
			
		||||
| 
						 | 
				
			
			@ -2276,13 +2276,13 @@ ValueObjectSP ABISysV_arm64::GetReturnValueObjectImpl(
 | 
			
		|||
                      reg_ctx->ReadRegister(x1_reg_info, x1_reg_value)) {
 | 
			
		||||
                    Status error;
 | 
			
		||||
                    if (x0_reg_value.GetAsMemoryData(
 | 
			
		||||
                            x0_reg_info, heap_data_ap->GetBytes() + 0, 8,
 | 
			
		||||
                            x0_reg_info, heap_data_up->GetBytes() + 0, 8,
 | 
			
		||||
                            byte_order, error) &&
 | 
			
		||||
                        x1_reg_value.GetAsMemoryData(
 | 
			
		||||
                            x1_reg_info, heap_data_ap->GetBytes() + 8, 8,
 | 
			
		||||
                            x1_reg_info, heap_data_up->GetBytes() + 8, 8,
 | 
			
		||||
                            byte_order, error)) {
 | 
			
		||||
                      DataExtractor data(
 | 
			
		||||
                          DataBufferSP(heap_data_ap.release()), byte_order,
 | 
			
		||||
                          DataBufferSP(heap_data_up.release()), byte_order,
 | 
			
		||||
                          exe_ctx.GetProcessRef().GetAddressByteSize());
 | 
			
		||||
 | 
			
		||||
                      return_valobj_sp = ValueObjectConstResult::Create(
 | 
			
		||||
| 
						 | 
				
			
			@ -2364,16 +2364,16 @@ ValueObjectSP ABISysV_arm64::GetReturnValueObjectImpl(
 | 
			
		|||
      const RegisterInfo *v0_info = reg_ctx->GetRegisterInfoByName("v0", 0);
 | 
			
		||||
 | 
			
		||||
      if (v0_info) {
 | 
			
		||||
        std::unique_ptr<DataBufferHeap> heap_data_ap(
 | 
			
		||||
        std::unique_ptr<DataBufferHeap> heap_data_up(
 | 
			
		||||
            new DataBufferHeap(*byte_size, 0));
 | 
			
		||||
        const ByteOrder byte_order = exe_ctx.GetProcessRef().GetByteOrder();
 | 
			
		||||
        RegisterValue reg_value;
 | 
			
		||||
        if (reg_ctx->ReadRegister(v0_info, reg_value)) {
 | 
			
		||||
          Status error;
 | 
			
		||||
          if (reg_value.GetAsMemoryData(v0_info, heap_data_ap->GetBytes(),
 | 
			
		||||
                                        heap_data_ap->GetByteSize(), byte_order,
 | 
			
		||||
          if (reg_value.GetAsMemoryData(v0_info, heap_data_up->GetBytes(),
 | 
			
		||||
                                        heap_data_up->GetByteSize(), byte_order,
 | 
			
		||||
                                        error)) {
 | 
			
		||||
            DataExtractor data(DataBufferSP(heap_data_ap.release()), byte_order,
 | 
			
		||||
            DataExtractor data(DataBufferSP(heap_data_up.release()), byte_order,
 | 
			
		||||
                               exe_ctx.GetProcessRef().GetAddressByteSize());
 | 
			
		||||
            return_valobj_sp = ValueObjectConstResult::Create(
 | 
			
		||||
                &thread, return_compiler_type, ConstString(""), data);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1103,7 +1103,7 @@ bool ABISysV_hexagon::PrepareTrivialCall(
 | 
			
		|||
    sp -= argSize;
 | 
			
		||||
 | 
			
		||||
    // write this argument onto the stack of the host process
 | 
			
		||||
    proc->WriteMemory(sp, arg.data_ap.get(), arg.size, error);
 | 
			
		||||
    proc->WriteMemory(sp, arg.data_up.get(), arg.size, error);
 | 
			
		||||
    if (error.Fail())
 | 
			
		||||
      return false;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -648,19 +648,20 @@ ValueObjectSP ABISysV_i386::GetReturnValueObjectSimple(
 | 
			
		|||
        if (*byte_size <= vec_reg->byte_size) {
 | 
			
		||||
          ProcessSP process_sp(thread.GetProcess());
 | 
			
		||||
          if (process_sp) {
 | 
			
		||||
            std::unique_ptr<DataBufferHeap> heap_data_ap(
 | 
			
		||||
            std::unique_ptr<DataBufferHeap> heap_data_up(
 | 
			
		||||
                new DataBufferHeap(*byte_size, 0));
 | 
			
		||||
            const ByteOrder byte_order = process_sp->GetByteOrder();
 | 
			
		||||
            RegisterValue reg_value;
 | 
			
		||||
            if (reg_ctx->ReadRegister(vec_reg, reg_value)) {
 | 
			
		||||
              Status error;
 | 
			
		||||
              if (reg_value.GetAsMemoryData(vec_reg, heap_data_ap->GetBytes(),
 | 
			
		||||
                                            heap_data_ap->GetByteSize(),
 | 
			
		||||
              if (reg_value.GetAsMemoryData(vec_reg, heap_data_up->GetBytes(),
 | 
			
		||||
                                            heap_data_up->GetByteSize(),
 | 
			
		||||
                                            byte_order, error)) {
 | 
			
		||||
                DataExtractor data(DataBufferSP(heap_data_ap.release()),
 | 
			
		||||
                                   byte_order, process_sp->GetTarget()
 | 
			
		||||
                                                   .GetArchitecture()
 | 
			
		||||
                                                   .GetAddressByteSize());
 | 
			
		||||
                DataExtractor data(DataBufferSP(heap_data_up.release()),
 | 
			
		||||
                                   byte_order,
 | 
			
		||||
                                   process_sp->GetTarget()
 | 
			
		||||
                                       .GetArchitecture()
 | 
			
		||||
                                       .GetAddressByteSize());
 | 
			
		||||
                return_valobj_sp = ValueObjectConstResult::Create(
 | 
			
		||||
                    &thread, return_compiler_type, ConstString(""), data);
 | 
			
		||||
              }
 | 
			
		||||
| 
						 | 
				
			
			@ -672,7 +673,7 @@ ValueObjectSP ABISysV_i386::GetReturnValueObjectSimple(
 | 
			
		|||
          if (vec_reg2) {
 | 
			
		||||
            ProcessSP process_sp(thread.GetProcess());
 | 
			
		||||
            if (process_sp) {
 | 
			
		||||
              std::unique_ptr<DataBufferHeap> heap_data_ap(
 | 
			
		||||
              std::unique_ptr<DataBufferHeap> heap_data_up(
 | 
			
		||||
                  new DataBufferHeap(*byte_size, 0));
 | 
			
		||||
              const ByteOrder byte_order = process_sp->GetByteOrder();
 | 
			
		||||
              RegisterValue reg_value;
 | 
			
		||||
| 
						 | 
				
			
			@ -681,17 +682,18 @@ ValueObjectSP ABISysV_i386::GetReturnValueObjectSimple(
 | 
			
		|||
                  reg_ctx->ReadRegister(vec_reg2, reg_value2)) {
 | 
			
		||||
 | 
			
		||||
                Status error;
 | 
			
		||||
                if (reg_value.GetAsMemoryData(vec_reg, heap_data_ap->GetBytes(),
 | 
			
		||||
                if (reg_value.GetAsMemoryData(vec_reg, heap_data_up->GetBytes(),
 | 
			
		||||
                                              vec_reg->byte_size, byte_order,
 | 
			
		||||
                                              error) &&
 | 
			
		||||
                    reg_value2.GetAsMemoryData(
 | 
			
		||||
                        vec_reg2, heap_data_ap->GetBytes() + vec_reg->byte_size,
 | 
			
		||||
                        heap_data_ap->GetByteSize() - vec_reg->byte_size,
 | 
			
		||||
                        vec_reg2, heap_data_up->GetBytes() + vec_reg->byte_size,
 | 
			
		||||
                        heap_data_up->GetByteSize() - vec_reg->byte_size,
 | 
			
		||||
                        byte_order, error)) {
 | 
			
		||||
                  DataExtractor data(DataBufferSP(heap_data_ap.release()),
 | 
			
		||||
                                     byte_order, process_sp->GetTarget()
 | 
			
		||||
                                                     .GetArchitecture()
 | 
			
		||||
                                                     .GetAddressByteSize());
 | 
			
		||||
                  DataExtractor data(DataBufferSP(heap_data_up.release()),
 | 
			
		||||
                                     byte_order,
 | 
			
		||||
                                     process_sp->GetTarget()
 | 
			
		||||
                                         .GetArchitecture()
 | 
			
		||||
                                         .GetAddressByteSize());
 | 
			
		||||
                  return_valobj_sp = ValueObjectConstResult::Create(
 | 
			
		||||
                      &thread, return_compiler_type, ConstString(""), data);
 | 
			
		||||
                }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -618,16 +618,16 @@ ValueObjectSP ABISysV_ppc::GetReturnValueObjectSimple(
 | 
			
		|||
        if (*byte_size <= altivec_reg->byte_size) {
 | 
			
		||||
          ProcessSP process_sp(thread.GetProcess());
 | 
			
		||||
          if (process_sp) {
 | 
			
		||||
            std::unique_ptr<DataBufferHeap> heap_data_ap(
 | 
			
		||||
            std::unique_ptr<DataBufferHeap> heap_data_up(
 | 
			
		||||
                new DataBufferHeap(*byte_size, 0));
 | 
			
		||||
            const ByteOrder byte_order = process_sp->GetByteOrder();
 | 
			
		||||
            RegisterValue reg_value;
 | 
			
		||||
            if (reg_ctx->ReadRegister(altivec_reg, reg_value)) {
 | 
			
		||||
              Status error;
 | 
			
		||||
              if (reg_value.GetAsMemoryData(
 | 
			
		||||
                      altivec_reg, heap_data_ap->GetBytes(),
 | 
			
		||||
                      heap_data_ap->GetByteSize(), byte_order, error)) {
 | 
			
		||||
                DataExtractor data(DataBufferSP(heap_data_ap.release()),
 | 
			
		||||
                      altivec_reg, heap_data_up->GetBytes(),
 | 
			
		||||
                      heap_data_up->GetByteSize(), byte_order, error)) {
 | 
			
		||||
                DataExtractor data(DataBufferSP(heap_data_up.release()),
 | 
			
		||||
                                   byte_order,
 | 
			
		||||
                                   process_sp->GetTarget()
 | 
			
		||||
                                       .GetArchitecture()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
Some files were not shown because too many files have changed in this diff Show More
		Loading…
	
		Reference in New Issue