| 1952 | } |
| 1953 | |
| 1954 | std::optional<Connection> getDebugServer( nlohmann::json& json ) { |
| 1955 | auto debugServerInt = json_get_if<int>( json, KEY_DEBUG_SERVER ); |
| 1956 | |
| 1957 | if ( debugServerInt ) |
| 1958 | return Connection{ *debugServerInt, "localhost" }; |
| 1959 | |
| 1960 | auto debugServerStr = json_get_if<std::string>( json, KEY_DEBUG_SERVER ); |
| 1961 | if ( debugServerStr ) { |
| 1962 | int port; |
| 1963 | if ( String::isNumber( *debugServerStr ) && String::fromString( port, *debugServerStr ) ) |
| 1964 | return Connection( port, "localhost" ); |
| 1965 | |
| 1966 | auto split = String::split( *debugServerStr, ':' ); |
| 1967 | if ( split.size() == 2 && String::fromString( port, split[1] ) ) |
| 1968 | return Connection( port, split[1] ); |
| 1969 | } |
| 1970 | |
| 1971 | return {}; |
| 1972 | } |
| 1973 | |
| 1974 | void DebuggerPlugin::prepareAndRun( DapTool debugger, DapConfig config, |
| 1975 | std::unordered_map<std::string, std::string> solvedInputs ) { |
no test coverage detected