Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:56

0001 //===-- ThreadPlanRunToAddress.h --------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_TARGET_THREADPLANRUNTOADDRESS_H
0010 #define LLDB_TARGET_THREADPLANRUNTOADDRESS_H
0011 
0012 #include <vector>
0013 
0014 #include "lldb/Target/ThreadPlan.h"
0015 #include "lldb/lldb-private.h"
0016 
0017 namespace lldb_private {
0018 
0019 class ThreadPlanRunToAddress : public ThreadPlan {
0020 public:
0021   ThreadPlanRunToAddress(Thread &thread, Address &address, bool stop_others);
0022 
0023   ThreadPlanRunToAddress(Thread &thread, lldb::addr_t address,
0024                          bool stop_others);
0025 
0026   ThreadPlanRunToAddress(Thread &thread,
0027                          const std::vector<lldb::addr_t> &addresses,
0028                          bool stop_others);
0029 
0030   ~ThreadPlanRunToAddress() override;
0031 
0032   void GetDescription(Stream *s, lldb::DescriptionLevel level) override;
0033 
0034   bool ValidatePlan(Stream *error) override;
0035 
0036   bool ShouldStop(Event *event_ptr) override;
0037 
0038   bool StopOthers() override;
0039 
0040   void SetStopOthers(bool new_value) override;
0041 
0042   lldb::StateType GetPlanRunState() override;
0043 
0044   bool WillStop() override;
0045 
0046   bool MischiefManaged() override;
0047 
0048 protected:
0049   bool DoPlanExplainsStop(Event *event_ptr) override;
0050 
0051   void SetInitialBreakpoints();
0052   bool AtOurAddress();
0053 
0054 private:
0055   bool m_stop_others;
0056   std::vector<lldb::addr_t>
0057       m_addresses; // This is the address we are going to run to.
0058                    // TODO: Would it be useful to have multiple addresses?
0059   std::vector<lldb::break_id_t> m_break_ids; // This is the breakpoint we are
0060                                              // using to stop us at m_address.
0061 
0062   ThreadPlanRunToAddress(const ThreadPlanRunToAddress &) = delete;
0063   const ThreadPlanRunToAddress &
0064   operator=(const ThreadPlanRunToAddress &) = delete;
0065 };
0066 
0067 } // namespace lldb_private
0068 
0069 #endif // LLDB_TARGET_THREADPLANRUNTOADDRESS_H