-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debug tracing #652
Comments
And all instances of I find that there is a huge amount of code being run when debug is disabled! E.g. in do // for ENTERFUNC
{
++rig->state.depth;
do
{
strcpy (debugmsgsave2, debugmsgsave);
snprintf (debugmsgsave, sizeof (debugmsgsave), "%.*s%d:%s(%d):%s entered\n", rig->state.depth, spaces(), rig->state.depth, (strrchr ("src/rig.c",
'/') ? strrchrfile, '/') + 1 : "src/rig.c"), 7285, __func__);
(rig_debug) (RIG_DEBUG_VERBOSE, "%.*s%d:%s(%d):%s entered\n", rig->state.depth, spaces(), rig->state.depth, (strrchr ("src/rig.c", '/') ? strrchrfile,
'/') + 1 : "src/rig.c"), 7285, __func__);
}
while (0);
}
while (0);
int retval = write_block_sync (&rs->rigport, send, send_len);
if (retval < 0)
{
do // For rig_debug():
{
strcpy (debugmsgsave2, debugmsgsave);
snprintf (debugmsgsave, sizeof (debugmsgsave), "%s: write_block_sync() failed, result=%d\n", __func__, retval);
(rig_debug) (RIG_DEBUG_ERR, "%s: write_block_sync() failed, result=%d\n", __func__, retval);
}
while (0);
} |
This provides intelligent debug information for apps like WSJTX/JTDX and others when errors occur. The strerror() function returns the debug history even if it's not turned on. |
Into |
save2 and save3 are deprecated. Will be removed eventually.
Where do think strerror is used incorrectly? Quite possible...
On Monday, June 6, 2022, 08:42:44 AM CDT, Gisle Vanem ***@***.***> wrote:
... function returns the debug history even if it's not turned on.
Into debugmsgsave[]? But what are debugmsgsave2[] and debugmsgsave3[] used for?
But I think strerror() is wrongly used on Windows in many places.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you modified the open/close state.Message ID: ***@***.***>
|
2 places in |
I found one and fixed it.
Which two did you find?
Mike
On Monday, June 6, 2022, 09:17:44 AM CDT, Gisle Vanem ***@***.***> wrote:
Where do think strerror is used incorrectly?
2 places in src/network.c for example.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you modified the open/close state.Message ID: ***@***.***>
|
See if we can provide a "level" indication in the debug messages to show the function call depth. Would make reviewing the debug info easier to trace.
So level 1 at top and each level down would increment by 1 on entry and decrement by 1 on exit.
This can probably be done via the ENTERFUNC and RETURNFUNC. But RETURNFUNC may be called without an associated ENTERFUNC and vice versa so a state machine will be needed to determine when to increment/decrement.
ENTERFUNC would be if (state==RETURNFUNC) ++depth
RETURNFUNC would be if (state == ENTERRFUNC) ++ depth
ENTERFUNC would set ENTERFUNC state
RETURNFUNC would set RETURNFUNC state
get_depth function/macro would return depth when state==ENTERFUNC and depth+1 when state==RETURNFUNC
ENTERFUNC would only increment depth if state==RETURNFUNC
RETURNFUNC would only decrement depth if state==ENTERFUNC
The text was updated successfully, but these errors were encountered: