Skip to content
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

Using debug.dump_callstack() with -d callstack causes a C error #23323

Open
RpxdYTX opened this issue Dec 30, 2024 · 1 comment
Open

Using debug.dump_callstack() with -d callstack causes a C error #23323

RpxdYTX opened this issue Dec 30, 2024 · 1 comment
Labels
Bug This tag is applied to issues which reports bugs. Modules: debug Bugs/feature requests, that are related to v.debug module. Status: Confirmed This bug has been confirmed to be valid by a contributor.

Comments

@RpxdYTX
Copy link

RpxdYTX commented Dec 30, 2024

Using debug.dump_callstack() with -d callstack errors with

================== C compilation error (from cc): ==============
cc:        |                                       ~~                                                                            ^~~~~~~~~
cc: /data/data/com.termux/files/usr/tmp/v_10246/hex.01JGC68SV7BHYMXC3HWJVJ2FB0.tmp.c:26377:15: error: expected expression
cc:  26377 |         bool ret = f(, );
cc:        |                      ^
cc: /data/data/com.termux/files/usr/tmp/v_10246/hex.01JGC68SV7BHYMXC3HWJVJ2FB0.tmp.c:26377:17: error: expected expression
cc:  26377 |         bool ret = f(, );
cc:        |                        ^
cc: /data/data/com.termux/files/usr/tmp/v_10246/hex.01JGC68SV7BHYMXC3HWJVJ2FB0.tmp.c:26408:15: error: expected expression
cc:  26408 |         bool ret = f(, );
cc:        |                      ^
cc: /data/data/com.termux/files/usr/tmp/v_10246/hex.01JGC68SV7BHYMXC3HWJVJ2FB0.tmp.c:26408:17: error: expected expression
cc:  26408 |         bool ret = f(, );
... (the original output was 26 lines long, and was truncated to 12 lines)
================================================================
(You can pass `-cg`, or `-show-c-output` as well, to print all the C error messages).

On function

import v.debug

@[noreturn]
pub fn todo() {
    debug.dump_callstack()
    panic("TODO")
}

Runinng without -d callstack makes the code run, but then todo is useless

Originally posted by @RpxdYTX in #23312 (comment)

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@felipensp felipensp added Bug This tag is applied to issues which reports bugs. Modules: debug Bugs/feature requests, that are related to v.debug module. Status: Confirmed This bug has been confirmed to be valid by a contributor. labels Dec 30, 2024
@felipensp
Copy link
Member

felipensp commented Dec 30, 2024

This is because the func call is related to a callback with parameters. The trace generated fns must receive the parameters to be passed to the callback one.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs. Modules: debug Bugs/feature requests, that are related to v.debug module. Status: Confirmed This bug has been confirmed to be valid by a contributor.
Projects
None yet
Development

No branches or pull requests

2 participants