If any of the `CPPDAP_?SAN` sanitizers are enabled, then the build would fail as the compile flags would collide with hard-coded use of address sanitizer for the fuzzer.
Don't hard code address sanitizer for the fuzzer - just use the CMake flag options.
Define `JSON_NOEXCEPTION` to avoid raising exceptions.
Exceptions are usually disabled for Google projects (https://google.github.io/styleguide/cppguide.html#Exceptions).
Also pass `false` to the `allow_exceptions` parameter of `nlohmann::json::parse()`.
Issue identified by @kuafuwang in #26.
`DAP_IMPLEMENT_STRUCT_TYPEINFO_EXT` and `DAP_STRUCT_TYPEINFO_EXT` are two new flavors of `DAP_IMPLEMENT_STRUCT_TYPEINFO` and `DAP_STRUCT_TYPEINFO` that allow you to derive message types.
This involved a bit of reworking on the serializer interfaces.
Added test.
Issue: #32
presubmit.sh now runs presubmit-docker.sh using the new radial
docker image which contains various toolchains.
The `/bin/using.sh` bash script exports the `using` bash function
which can be called to configure toolchains at specific versions.
DAP usually consists of small packet requests, with small packet responses. When there are many frequent, blocking requests made, Nagle's algorithm can dramatically limit the request->response rates.
Example warning:
cppdap/include/dap/future.h:172:14: error: implicitly-declared ‘dap::ResponseOrError<dap::StackTraceResponse>& dap::ResponseOrError<dap::StackTraceResponse>::operator=(const dap::ResponseOrError<dap::StackTraceResponse>&)’ is deprecated [-Werror=deprecated-copy]
Add missing constructors and assignment operators.
This probably adds more than is absolutely necessary, but there's no
harm in being thorough.
I'm not convinced that `opt.value() = foo` is a desirable pattern,
and worse still it confuses some compilers about which overload to
use.
Just remove it.
Without this the vscode extension cannot find the example executable, and the example fails.
Also use $USERPROFILE instead of $HOME for finding the `.vscode` user directory for installing the extension.
Bug: #12
Empty structs were being serialized as `null`, when they should have been serialized as `{}`.
This was due to the type inference on the serializer - where no calls to `field()` would result in the default `null` type.
To solve this, the `serialize(const void* object, const std::initializer_list<Field>&)` inline helper has been promoted to a virtual function (and renamed to `fields()`).
The JSON serializer implementation of this now first sets the object type to `object`, even if there are no fields to serialize.
Added test for this.
Fixes: #10
The `body` field of the Response is optional. Do not error if it is missing.
If the typeinfo of the response. This was incorrectly using the Request type.
Authored by kuafuwang, squashed by ben-clayton.
The onError parameter of Server::start was default initialized with
OnError(), which is an 'invalid target', not a no-op implementation.
Replace with a true no-op implementation.
`nlohmann/json` raises a `size_t` to `int` MSVC warning that will fail the build if `CPPDAP_WARNINGS_AS_ERRORS` is enabled.
Given that this is not our code, the best we can do is to make an exception for this warning.