BreakpointResolverFileLine.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //===-- BreakpointResolverFileLine.h ----------------------------*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #ifndef LLDB_BREAKPOINT_BREAKPOINTRESOLVERFILELINE_H
  9. #define LLDB_BREAKPOINT_BREAKPOINTRESOLVERFILELINE_H
  10. #include "lldb/Breakpoint/BreakpointResolver.h"
  11. #include "lldb/Core/SourceLocationSpec.h"
  12. namespace lldb_private {
  13. /// \class BreakpointResolverFileLine BreakpointResolverFileLine.h
  14. /// "lldb/Breakpoint/BreakpointResolverFileLine.h" This class sets breakpoints
  15. /// by file and line. Optionally, it will look for inlined instances of the
  16. /// file and line specification.
  17. class BreakpointResolverFileLine : public BreakpointResolver {
  18. public:
  19. BreakpointResolverFileLine(const lldb::BreakpointSP &bkpt,
  20. lldb::addr_t offset, bool skip_prologue,
  21. const SourceLocationSpec &location_spec);
  22. static BreakpointResolver *
  23. CreateFromStructuredData(const lldb::BreakpointSP &bkpt,
  24. const StructuredData::Dictionary &data_dict,
  25. Status &error);
  26. StructuredData::ObjectSP SerializeToStructuredData() override;
  27. ~BreakpointResolverFileLine() override = default;
  28. Searcher::CallbackReturn SearchCallback(SearchFilter &filter,
  29. SymbolContext &context,
  30. Address *addr) override;
  31. lldb::SearchDepth GetDepth() override;
  32. void GetDescription(Stream *s) override;
  33. void Dump(Stream *s) const override;
  34. /// Methods for support type inquiry through isa, cast, and dyn_cast:
  35. static inline bool classof(const BreakpointResolverFileLine *) {
  36. return true;
  37. }
  38. static inline bool classof(const BreakpointResolver *V) {
  39. return V->getResolverID() == BreakpointResolver::FileLineResolver;
  40. }
  41. lldb::BreakpointResolverSP
  42. CopyForBreakpoint(lldb::BreakpointSP &breakpoint) override;
  43. protected:
  44. void FilterContexts(SymbolContextList &sc_list, bool is_relative);
  45. friend class Breakpoint;
  46. SourceLocationSpec m_location_spec;
  47. bool m_skip_prologue;
  48. private:
  49. BreakpointResolverFileLine(const BreakpointResolverFileLine &) = delete;
  50. const BreakpointResolverFileLine &
  51. operator=(const BreakpointResolverFileLine &) = delete;
  52. };
  53. } // namespace lldb_private
  54. #endif // LLDB_BREAKPOINT_BREAKPOINTRESOLVERFILELINE_H