By specifying the -d flag, libdtrace will dump the D script after it has applied
syntactical sugar transformations (e.g if/else). This is useful for both understanding
what dt_sugar does, as well as debugging it.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | ||
---|---|---|
199 | Probably clarify that it dumps to stdout. | |
cddl/contrib/opensolaris/lib/libdtrace/common/dt_sugar.c | ||
521 ↗ | (On Diff #117771) | Do we actually need to do this here? Why not have the compiler dump the output script after calling dt_compile_sugar()? That seems somewhat simpler. |
Comment Actions
This option is in the same vein as -S, whereas -x is used to set runtime parameters for the dtrace script. So, -x feels like the wrong place to me, but maybe I'm missing something?
Comment Actions
I don't think you are missing anything :) I just wonder if there is a way to avoid taking up a whole flag for a debug feature.
OTOH, I checked macOS DTrace implementation and they are not using -d for anything, so it seems it is fine if we dedicate -d to dumping D scripts post dt_sugar.
Comment Actions
remove if/else comment in dt_cc as dt_sugar now also performs transformations
on kinst probes.