| 1 |
#ifndef DEBUG_SESSION_HPP |
| 2 |
#define DEBUG_SESSION_HPP |
| 3 |
|
| 4 |
#include "clDapSettingsStore.hpp" |
| 5 |
#include "dap/dap.hpp" |
| 6 |
#include "processreaderthread.h" |
| 7 |
#include "ssh_account_info.h" |
| 8 |
|
| 9 |
#include <vector> |
| 10 |
#include <wx/string.h> |
| 11 |
|
| 12 |
struct DebugSession { |
| 13 |
std::vector<wxString> command; |
| 14 |
wxString working_directory; |
| 15 |
clEnvList_t environment; |
| 16 |
bool need_to_set_breakpoints = false; |
| 17 |
bool debug_over_ssh = false; |
| 18 |
SSHAccountInfo ssh_acount; |
| 19 |
DapEntry dap_server; |
| 20 |
int m_pid = wxNOT_FOUND; // when attaching to process, this holds the process ID |
| 21 |
|
| 22 |
void Clear() |
| 23 |
{ |
| 24 |
need_to_set_breakpoints = false; |
| 25 |
working_directory.clear(); |
| 26 |
debug_over_ssh = false; |
| 27 |
ssh_acount = {}; |
| 28 |
command.clear(); |
| 29 |
environment.clear(); |
| 30 |
dap_server = {}; |
| 31 |
m_pid = wxNOT_FOUND; |
| 32 |
} |
| 33 |
|
| 34 |
dap::Environment MakeEnvironment() |
| 35 |
{ |
| 36 |
dap::Environment dap_env; |
| 37 |
dap_env.format = dap_server.GetEnvFormat(); |
| 38 |
if(dap_env.format != dap::EnvFormat::NONE) { |
| 39 |
for(const auto& p : environment) { |
| 40 |
dap_env.vars.insert({ p.first, p.second }); |
| 41 |
} |
| 42 |
} |
| 43 |
return dap_env; |
| 44 |
} |
| 45 |
}; |
| 46 |
|
| 47 |
#endif // DEBUG_SESSION_HPP |