Dbg:Add CallableTracer for callables post()ed to boost.asio

This class and its macro allow us to trace the invocation of
callbacks as they're invoked by Boost.asio.
This commit is contained in:
2025-11-06 21:40:32 -04:00
parent eeb057effd
commit 457d0f9345
14 changed files with 212 additions and 35 deletions
+12 -1
View File
@@ -43,6 +43,9 @@ struct option OptionParser::longOptions[] = {
{"apipath", required_argument, 0, 'p'},
{"libpath", required_argument, 0, 'p'},
{"verbose", no_argument, 0, 'v'},
{"trace-callables", no_argument, 0, 't'},
{"call-trace", no_argument, 0, 't'},
{"calltrace", no_argument, 0, 't'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
@@ -58,7 +61,7 @@ void OptionParser::parseArguments(int argc, char *argv[], char **envp)
optind = 1; // Reset optind to 1 before parsing
opterr = 0;
while ((opt = getopt_long(
argc, argv, "s:d:a:p:vh?", longOptions, &optionIndex)) != -1)
argc, argv, "s:d:a:p:vht?", longOptions, &optionIndex)) != -1)
{
switch (opt)
{
@@ -91,6 +94,9 @@ void OptionParser::parseArguments(int argc, char *argv[], char **envp)
case 'v':
verbose = true;
break;
case 't':
traceCallables = true;
break;
case 'h':
throw JustPrintUsageNoError(*this);
case '?':
@@ -108,6 +114,7 @@ std::string OptionParser::getUsage() const
"[-a|--api-lib|--apilib|--api|--lib <filename>] "
"[-p|--api-lib-path|--apipath|--libpath <directory>] "
"[-v|--verbose] "
"[-t|--trace-callables|--call-trace|--calltrace] "
"[-h|--help]\n\n"
"Example DAP spec:\n"
" -s '+edev|my-cam|video-qualeiface|v4l2-video(fps-hz=30)|v4l2()|/dev/video0'";
@@ -121,6 +128,10 @@ std::string OptionParser::stringifyOptions(void) const
oss << "Verbose mode is on" << std::endl;
}
if (traceCallables) {
oss << "Callable tracing is enabled" << std::endl;
}
oss << "Cmdline DAP Specs: " << dapSpecs << std::endl;
oss << "DAP Spec Files: ";