diff options
author | Ed Maste <emaste@FreeBSD.org> | 2015-02-06 21:38:51 +0000 |
---|---|---|
committer | Ed Maste <emaste@FreeBSD.org> | 2015-02-06 21:38:51 +0000 |
commit | 205afe679855a4ce8149cdaa94d3f0868ce796dc (patch) | |
tree | 09bc83f73246ee3c7a779605cd0122093d2a8a19 /include/lldb/Breakpoint | |
parent | 0cac4ca3916ac24ab6139d03cbfd18db9e715bfe (diff) | |
download | src-205afe679855a4ce8149cdaa94d3f0868ce796dc.tar.gz src-205afe679855a4ce8149cdaa94d3f0868ce796dc.zip |
Import LLDB as of upstream SVN r225923 (git 2b588ecd)vendor/lldb/lldb-r225923
This corresponds with the branchpoint for the 3.6 release.
A number of files not required for the FreeBSD build have been removed.
Sponsored by: DARPA, AFRL
Notes
Notes:
svn path=/vendor/lldb/dist/; revision=278332
svn path=/vendor/lldb/lldb-r225923/; revision=278333; tag=vendor/lldb/lldb-r225923
Diffstat (limited to 'include/lldb/Breakpoint')
-rw-r--r-- | include/lldb/Breakpoint/Breakpoint.h | 81 | ||||
-rw-r--r-- | include/lldb/Breakpoint/BreakpointID.h | 15 | ||||
-rw-r--r-- | include/lldb/Breakpoint/BreakpointIDList.h | 2 | ||||
-rw-r--r-- | include/lldb/Breakpoint/BreakpointList.h | 14 | ||||
-rw-r--r-- | include/lldb/Breakpoint/BreakpointLocation.h | 23 | ||||
-rw-r--r-- | include/lldb/Breakpoint/BreakpointLocationCollection.h | 9 | ||||
-rw-r--r-- | include/lldb/Breakpoint/BreakpointLocationList.h | 15 | ||||
-rw-r--r-- | include/lldb/Breakpoint/BreakpointResolver.h | 8 | ||||
-rw-r--r-- | include/lldb/Breakpoint/BreakpointResolverAddress.h | 27 | ||||
-rw-r--r-- | include/lldb/Breakpoint/BreakpointResolverFileLine.h | 19 | ||||
-rw-r--r-- | include/lldb/Breakpoint/BreakpointResolverFileRegex.h | 19 | ||||
-rw-r--r-- | include/lldb/Breakpoint/BreakpointResolverName.h | 23 | ||||
-rw-r--r-- | include/lldb/Breakpoint/BreakpointSite.h | 6 |
13 files changed, 214 insertions, 47 deletions
diff --git a/include/lldb/Breakpoint/Breakpoint.h b/include/lldb/Breakpoint/Breakpoint.h index 15693f86e382..61acc061aebc 100644 --- a/include/lldb/Breakpoint/Breakpoint.h +++ b/include/lldb/Breakpoint/Breakpoint.h @@ -12,8 +12,11 @@ // C Includes // C++ Includes +#include <unordered_set> + // Other libraries and framework includes // Project includes +#include "lldb/Breakpoint/BreakpointID.h" #include "lldb/Breakpoint/BreakpointLocationList.h" #include "lldb/Breakpoint/BreakpointOptions.h" #include "lldb/Breakpoint/BreakpointLocationCollection.h" @@ -203,14 +206,29 @@ public: /// Tell this breakpoint to scan a given module list and resolve any /// new locations that match the breakpoint's specifications. /// - /// @param[in] changed_modules + /// @param[in] module_list /// The list of modules to look in for new locations. + /// + /// @param[in] send_event + /// If \b true, send a breakpoint location added event for non-internal breakpoints. //------------------------------------------------------------------ void - ResolveBreakpointInModules (ModuleList &changed_modules); - + ResolveBreakpointInModules (ModuleList &module_list, bool send_event = true); //------------------------------------------------------------------ + /// Tell this breakpoint to scan a given module list and resolve any + /// new locations that match the breakpoint's specifications. + /// + /// @param[in] changed_modules + /// The list of modules to look in for new locations. + /// + /// @param[in] new_locations + /// Fills new_locations with the new locations that were made. + //------------------------------------------------------------------ + void + ResolveBreakpointInModules (ModuleList &module_list, BreakpointLocationCollection &new_locations); + + //------------------------------------------------------------------ /// Like ResolveBreakpointInModules, but allows for "unload" events, in /// which case we will remove any locations that are in modules that got /// unloaded. @@ -538,10 +556,19 @@ public: /// This breakpoint's Target. //------------------------------------------------------------------ Target & - GetTarget (); + GetTarget () + { + return m_target; + } const Target & - GetTarget () const; + GetTarget () const + { + return m_target; + } + + const lldb::TargetSP + GetTargetSP (); void GetResolverDescription (Stream *s); @@ -600,6 +627,44 @@ public: return m_hardware; } + lldb::BreakpointResolverSP + GetResolver() + { + return m_resolver_sp; + } + + lldb::SearchFilterSP + GetSearchFilter() + { + return m_filter_sp; + } + + bool + AddName (const char *new_name, Error &error); + + void + RemoveName (const char *name_to_remove) + { + if (name_to_remove) + m_name_list.erase(name_to_remove); + } + + bool + MatchesName (const char *name) + { + return m_name_list.find(name) != m_name_list.end(); + } + + void + GetNames (std::vector<std::string> &names) + { + names.clear(); + for (auto name : m_name_list) + { + names.push_back(name); + } + } + protected: friend class Target; //------------------------------------------------------------------ @@ -650,12 +715,18 @@ protected: IgnoreCountShouldStop (); private: + // This one should only be used by Target to copy breakpoints from target to target - primarily from the dummy + // target to prime new targets. + Breakpoint (Target &new_target, + Breakpoint &bp_to_copy_from); + //------------------------------------------------------------------ // For Breakpoint only //------------------------------------------------------------------ bool m_being_created; bool m_hardware; // If this breakpoint is required to use a hardware breakpoint Target &m_target; // The target that holds this breakpoint. + std::unordered_set<std::string> m_name_list; // If not empty, this is the name of this breakpoint (many breakpoints can share the same name.) lldb::SearchFilterSP m_filter_sp; // The filter that constrains the breakpoint's domain. lldb::BreakpointResolverSP m_resolver_sp; // The resolver that defines this breakpoint. BreakpointOptions m_options; // Settable breakpoint options diff --git a/include/lldb/Breakpoint/BreakpointID.h b/include/lldb/Breakpoint/BreakpointID.h index 9e352100b9e1..5ca09634ee09 100644 --- a/include/lldb/Breakpoint/BreakpointID.h +++ b/include/lldb/Breakpoint/BreakpointID.h @@ -93,6 +93,21 @@ public: //------------------------------------------------------------------ + /// Takes an input string and checks to see whether it is a breakpoint name. + /// If it is a mal-formed breakpoint name, error will be set to an appropriate + /// error string. + /// + /// @param[in] input + /// A string containing JUST the breakpoint description. + /// @param[out] error + /// If the name is a well-formed breakpoint name, set to success, otherwise set to an error. + /// @return + /// \b true if the name is a breakpoint name (as opposed to an ID or range) false otherwise. + //------------------------------------------------------------------ + static bool + StringIsBreakpointName (const char *name, Error &error); + + //------------------------------------------------------------------ /// Takes a breakpoint ID and the breakpoint location id and returns /// a string containing the canonical description for the breakpoint /// or breakpoint location. diff --git a/include/lldb/Breakpoint/BreakpointIDList.h b/include/lldb/Breakpoint/BreakpointIDList.h index c9fcef0a783c..c42787066617 100644 --- a/include/lldb/Breakpoint/BreakpointIDList.h +++ b/include/lldb/Breakpoint/BreakpointIDList.h @@ -68,7 +68,7 @@ public: StringContainsIDRangeExpression (const char *in_string, size_t *range_start_len, size_t *range_end_pos); static void - FindAndReplaceIDRanges (Args &old_args, Target *target, CommandReturnObject &result, Args &new_args); + FindAndReplaceIDRanges (Args &old_args, Target *target, bool allow_locations, CommandReturnObject &result, Args &new_args); private: BreakpointIDArray m_breakpoint_ids; diff --git a/include/lldb/Breakpoint/BreakpointList.h b/include/lldb/Breakpoint/BreakpointList.h index 27f80d0ffe09..f4837e1ce956 100644 --- a/include/lldb/Breakpoint/BreakpointList.h +++ b/include/lldb/Breakpoint/BreakpointList.h @@ -204,11 +204,25 @@ protected: bp_collection::const_iterator GetBreakpointIDConstIterator(lldb::break_id_t breakID) const; + Mutex & + GetMutex () const + { + return m_mutex; + } + mutable Mutex m_mutex; bp_collection m_breakpoints; // The breakpoint list, currently a list. lldb::break_id_t m_next_break_id; bool m_is_internal; +public: + typedef LockingAdaptedIterable<bp_collection, lldb::BreakpointSP, list_adapter> BreakpointIterable; + BreakpointIterable + Breakpoints() + { + return BreakpointIterable(m_breakpoints, GetMutex()); + } + private: DISALLOW_COPY_AND_ASSIGN (BreakpointList); }; diff --git a/include/lldb/Breakpoint/BreakpointLocation.h b/include/lldb/Breakpoint/BreakpointLocation.h index ac4c28bb6e5f..8d5ebce411df 100644 --- a/include/lldb/Breakpoint/BreakpointLocation.h +++ b/include/lldb/Breakpoint/BreakpointLocation.h @@ -52,7 +52,6 @@ class BreakpointLocation : public StoppointLocation { public: - ~BreakpointLocation (); //------------------------------------------------------------------ @@ -374,7 +373,21 @@ public: m_is_reexported = is_reexported; } + //------------------------------------------------------------------ + /// Returns whether the two breakpoint locations might represent "equivalent locations". + /// This is used when modules changed to determine if a Location in the old module might + /// be the "same as" the input location. + /// + /// @param[in] location + /// The location to compare against. + /// + /// @return + /// \b true or \b false as given in the description above. + //------------------------------------------------------------------ + bool EquivalentToLocation(BreakpointLocation &location); + protected: + friend class BreakpointSite; friend class BreakpointLocationList; friend class Process; @@ -396,8 +409,14 @@ protected: bool IgnoreCountShouldStop(); - + private: + void + SwapLocation (lldb::BreakpointLocationSP swap_from); + + void + BumpHitCount(); + //------------------------------------------------------------------ // Constructors and Destructors diff --git a/include/lldb/Breakpoint/BreakpointLocationCollection.h b/include/lldb/Breakpoint/BreakpointLocationCollection.h index 7f6a659323be..004f8395122b 100644 --- a/include/lldb/Breakpoint/BreakpointLocationCollection.h +++ b/include/lldb/Breakpoint/BreakpointLocationCollection.h @@ -16,6 +16,7 @@ // Other libraries and framework includes // Project includes #include "lldb/lldb-private.h" +#include "lldb/Utility/Iterable.h" namespace lldb_private { @@ -202,6 +203,14 @@ private: collection m_break_loc_collection; +public: + typedef AdaptedIterable<collection, lldb::BreakpointLocationSP, vector_adapter> BreakpointLocationCollectionIterable; + BreakpointLocationCollectionIterable + BreakpointLocations() + { + return BreakpointLocationCollectionIterable(m_break_loc_collection); + } + }; } // namespace lldb_private diff --git a/include/lldb/Breakpoint/BreakpointLocationList.h b/include/lldb/Breakpoint/BreakpointLocationList.h index 0d8062eb644c..f67ef89ad705 100644 --- a/include/lldb/Breakpoint/BreakpointLocationList.h +++ b/include/lldb/Breakpoint/BreakpointLocationList.h @@ -19,6 +19,7 @@ #include "lldb/lldb-private.h" #include "lldb/Core/Address.h" #include "lldb/Host/Mutex.h" +#include "lldb/Utility/Iterable.h" namespace lldb_private { @@ -248,12 +249,18 @@ protected: AddLocation (const Address &addr, bool resolve_indirect_symbols, bool *new_location = NULL); + + void + SwapLocation (lldb::BreakpointLocationSP to_location_sp, lldb::BreakpointLocationSP from_location_sp); bool RemoveLocation (const lldb::BreakpointLocationSP &bp_loc_sp); void RemoveInvalidLocations (const ArchSpec &arch); + + void + Compact(); typedef std::vector<lldb::BreakpointLocationSP> collection; typedef std::map<lldb_private::Address, @@ -266,6 +273,14 @@ protected: mutable Mutex m_mutex; lldb::break_id_t m_next_id; BreakpointLocationCollection *m_new_location_recorder; +public: + typedef AdaptedIterable<collection, lldb::BreakpointLocationSP, vector_adapter> BreakpointLocationIterable; + BreakpointLocationIterable + BreakpointLocations() + { + return BreakpointLocationIterable(m_locations); + } + }; } // namespace lldb_private diff --git a/include/lldb/Breakpoint/BreakpointResolver.h b/include/lldb/Breakpoint/BreakpointResolver.h index 184bdc950cbc..6ba53ea92f36 100644 --- a/include/lldb/Breakpoint/BreakpointResolver.h +++ b/include/lldb/Breakpoint/BreakpointResolver.h @@ -44,6 +44,8 @@ namespace lldb_private { class BreakpointResolver : public Searcher { +friend class Breakpoint; + public: //------------------------------------------------------------------ /// The breakpoint resolver need to have a breakpoint for "ResolveBreakpoint @@ -122,7 +124,8 @@ public: AddressResolver, // This is an instance of BreakpointResolverAddress NameResolver, // This is an instance of BreakpointResolverName FileRegexResolver, - ExceptionResolver + ExceptionResolver, + LastKnownResolverType = ExceptionResolver }; //------------------------------------------------------------------ @@ -133,6 +136,9 @@ public: return SubclassID; } + virtual lldb::BreakpointResolverSP + CopyForBreakpoint (Breakpoint &breakpoint) = 0; + protected: //------------------------------------------------------------------ /// SetSCMatchesByLine - Takes a symbol context list of matches which supposedly represent the same file and diff --git a/include/lldb/Breakpoint/BreakpointResolverAddress.h b/include/lldb/Breakpoint/BreakpointResolverAddress.h index 4ca4a405957e..c8f034d7345b 100644 --- a/include/lldb/Breakpoint/BreakpointResolverAddress.h +++ b/include/lldb/Breakpoint/BreakpointResolverAddress.h @@ -34,27 +34,27 @@ public: virtual ~BreakpointResolverAddress (); - virtual void - ResolveBreakpoint (SearchFilter &filter); + void + ResolveBreakpoint (SearchFilter &filter) override; - virtual void + void ResolveBreakpointInModules (SearchFilter &filter, - ModuleList &modules); + ModuleList &modules) override; - virtual Searcher::CallbackReturn + Searcher::CallbackReturn SearchCallback (SearchFilter &filter, SymbolContext &context, Address *addr, - bool containing); + bool containing) override; - virtual Searcher::Depth - GetDepth (); + Searcher::Depth + GetDepth () override; - virtual void - GetDescription (Stream *s); + void + GetDescription (Stream *s) override; - virtual void - Dump (Stream *s) const; + void + Dump (Stream *s) const override; /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const BreakpointResolverAddress *) { return true; } @@ -62,6 +62,9 @@ public: return V->getResolverID() == BreakpointResolver::AddressResolver; } + lldb::BreakpointResolverSP + CopyForBreakpoint (Breakpoint &breakpoint) override; + protected: Address m_addr; diff --git a/include/lldb/Breakpoint/BreakpointResolverFileLine.h b/include/lldb/Breakpoint/BreakpointResolverFileLine.h index cc1633ce1705..cd62bcd032b0 100644 --- a/include/lldb/Breakpoint/BreakpointResolverFileLine.h +++ b/include/lldb/Breakpoint/BreakpointResolverFileLine.h @@ -37,20 +37,20 @@ public: virtual ~BreakpointResolverFileLine (); - virtual Searcher::CallbackReturn + Searcher::CallbackReturn SearchCallback (SearchFilter &filter, SymbolContext &context, Address *addr, - bool containing); + bool containing) override; - virtual Searcher::Depth - GetDepth (); + Searcher::Depth + GetDepth () override; - virtual void - GetDescription (Stream *s); + void + GetDescription (Stream *s) override; - virtual void - Dump (Stream *s) const; + void + Dump (Stream *s) const override; /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const BreakpointResolverFileLine *) { return true; } @@ -58,6 +58,9 @@ public: return V->getResolverID() == BreakpointResolver::FileLineResolver; } + lldb::BreakpointResolverSP + CopyForBreakpoint (Breakpoint &breakpoint) override; + protected: friend class Breakpoint; FileSpec m_file_spec; // This is the file spec we are looking for. diff --git a/include/lldb/Breakpoint/BreakpointResolverFileRegex.h b/include/lldb/Breakpoint/BreakpointResolverFileRegex.h index f1c2b1409e92..2c05ac1c87da 100644 --- a/include/lldb/Breakpoint/BreakpointResolverFileRegex.h +++ b/include/lldb/Breakpoint/BreakpointResolverFileRegex.h @@ -34,20 +34,20 @@ public: virtual ~BreakpointResolverFileRegex (); - virtual Searcher::CallbackReturn + Searcher::CallbackReturn SearchCallback (SearchFilter &filter, SymbolContext &context, Address *addr, - bool containing); + bool containing) override; - virtual Searcher::Depth - GetDepth (); + Searcher::Depth + GetDepth () override; - virtual void - GetDescription (Stream *s); + void + GetDescription (Stream *s) override; - virtual void - Dump (Stream *s) const; + void + Dump (Stream *s) const override; /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const BreakpointResolverFileRegex *) { return true; } @@ -55,6 +55,9 @@ public: return V->getResolverID() == BreakpointResolver::FileRegexResolver; } + lldb::BreakpointResolverSP + CopyForBreakpoint (Breakpoint &breakpoint) override; + protected: friend class Breakpoint; RegularExpression m_regex; // This is the line expression that we are looking for. diff --git a/include/lldb/Breakpoint/BreakpointResolverName.h b/include/lldb/Breakpoint/BreakpointResolverName.h index f481aa9c5338..c2a5b180f289 100644 --- a/include/lldb/Breakpoint/BreakpointResolverName.h +++ b/include/lldb/Breakpoint/BreakpointResolverName.h @@ -64,20 +64,20 @@ public: virtual ~BreakpointResolverName (); - virtual Searcher::CallbackReturn + Searcher::CallbackReturn SearchCallback (SearchFilter &filter, SymbolContext &context, Address *addr, - bool containing); + bool containing) override; - virtual Searcher::Depth - GetDepth (); + Searcher::Depth + GetDepth () override; - virtual void - GetDescription (Stream *s); + void + GetDescription (Stream *s) override; - virtual void - Dump (Stream *s) const; + void + Dump (Stream *s) const override; /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const BreakpointResolverName *) { return true; } @@ -85,7 +85,12 @@ public: return V->getResolverID() == BreakpointResolver::NameResolver; } + lldb::BreakpointResolverSP + CopyForBreakpoint (Breakpoint &breakpoint) override; + protected: + BreakpointResolverName(const BreakpointResolverName &rhs); + struct LookupInfo { ConstString name; @@ -113,8 +118,6 @@ protected: void AddNameLookup (const ConstString &name, uint32_t name_type_mask); -private: - DISALLOW_COPY_AND_ASSIGN(BreakpointResolverName); }; } // namespace lldb_private diff --git a/include/lldb/Breakpoint/BreakpointSite.h b/include/lldb/Breakpoint/BreakpointSite.h index 1d2cbea18f9f..c6dbef781f22 100644 --- a/include/lldb/Breakpoint/BreakpointSite.h +++ b/include/lldb/Breakpoint/BreakpointSite.h @@ -259,6 +259,12 @@ public: private: friend class Process; friend class BreakpointLocation; + // The StopInfoBreakpoint knows when it is processing a hit for a thread for a site, so let it be the + // one to manage setting the location hit count once and only once. + friend class StopInfoBreakpoint; + + void + BumpHitCounts(); //------------------------------------------------------------------ /// The method removes the owner at \a break_loc_id from this breakpoint list. |