[Lldb-commits] [PATCH] Add =shlibs-added/=shlibs-removed notifications (MI)

Greg Clayton clayborg at gmail.com
Tue Mar 10 12:58:01 PDT 2015


Overall looks good, just a few things to fix. See inlined comments.


================
Comment at: include/lldb/API/SBModule.h:332-333
@@ +331,4 @@
+    //------------------------------------------------------------------
+    lldb::SBFileSpec
+    GetSymbolVendorMainFileSpec() const;
+
----------------
Rename this to GetSymbolFileSpec(). The public API doesn't need to know anything about symbol vendors.

================
Comment at: include/lldb/Target/Target.h:498-547
@@ -497,1 +497,52 @@
+
+    // This event data class is for use by the TargetList to broadcast new target notifications.
+    class TargetEventData : public EventData
+    {
+    public:
+        TargetEventData (const lldb::TargetSP &target_sp);
+
+        TargetEventData (const lldb::TargetSP &target_sp, const ModuleList &module_list);
+
+        virtual
+        ~TargetEventData();
+
+        static const ConstString &
+        GetFlavorString ();
+
+        virtual const ConstString &
+        GetFlavor () const
+        {
+            return TargetEventData::GetFlavorString ();
+        }
+
+        virtual void
+        Dump (Stream *s) const;
+
+        static const TargetEventData *
+        GetEventDataFromEvent (const Event *event_ptr);
+
+        static lldb::TargetSP
+        GetTargetFromEvent (const Event *event_ptr);
+
+        static ModuleList
+        GetModuleListFromEvent (const Event *event_ptr);
+
+        const lldb::TargetSP &
+        GetTarget() const
+        {
+            return m_target_sp;
+        }
+
+        const ModuleList &
+        GetModuleList() const
+        {
+            return m_module_list;
+        }
+
+    private:
+        lldb::TargetSP m_target_sp;
+        ModuleList     m_module_list;
+
+        DISALLOW_COPY_AND_ASSIGN (TargetEventData);
+    };
     
----------------
Leave this in the Target.cpp and add static accessors to Target.h and Target.cpp much like the ones in SBTarget

================
Comment at: source/API/SBModule.cpp:689
@@ +688,3 @@
+lldb::SBFileSpec
+SBModule::GetSymbolVendorMainFileSpec() const
+{
----------------
Rename to GetSymbolFileSpec()

================
Comment at: source/API/SBTarget.cpp:136
@@ +135,3 @@
+{
+    return Target::TargetEventData::GetEventDataFromEvent(event.get()) != NULL;
+}
----------------
Make static functions in Target.h/cpp so we don't expose the TargetEventData class to anyone.

================
Comment at: source/API/SBTarget.cpp:142
@@ +141,3 @@
+{
+    return Target::TargetEventData::GetTargetFromEvent (event.get());
+}
----------------
Make static functions in Target.h/cpp so we don't expose the TargetEventData class to anyone.

================
Comment at: source/API/SBTarget.cpp:148
@@ +147,3 @@
+{
+    const ModuleList module_list = Target::TargetEventData::GetModuleListFromEvent (event.get());
+    return module_list.GetSize();
----------------
Make static functions in Target.h/cpp so we don't expose the TargetEventData class to anyone.

================
Comment at: source/API/SBTarget.cpp:155
@@ +154,3 @@
+{
+    const ModuleList module_list = Target::TargetEventData::GetModuleListFromEvent (event.get());
+    return SBModule(module_list.GetModuleAtIndex(idx));
----------------
Make static functions in Target.h/cpp so we don't expose the TargetEventData class to anyone.

http://reviews.llvm.org/D8201

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the lldb-commits mailing list