-
Notifications
You must be signed in to change notification settings - Fork 14.8k
[Dexter] Implement DexStepFunction and DexContinue #152721
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
Open
OCHyams
wants to merge
3
commits into
users/OCHyams/dex-skeletons
Choose a base branch
from
users/OCHyams/dex-new-cmds-impl
base: users/OCHyams/dex-skeletons
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[Dexter] Implement DexStepFunction and DexContinue #152721
OCHyams
wants to merge
3
commits into
users/OCHyams/dex-skeletons
from
users/OCHyams/dex-new-cmds-impl
+310
−38
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Aug 8, 2025
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
You can test this locally with the following command:git-clang-format --diff HEAD~1 HEAD --extensions cpp -- cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/control/dex-continue.cpp cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/control/dex_step_function.cpp View the diff from clang-format here.diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/control/dex-continue.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/control/dex-continue.cpp
index bb51b85cb..0e9c36c22 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/control/dex-continue.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/control/dex-continue.cpp
@@ -21,8 +21,7 @@ int c(int) {
return 0;
}
-__attribute__((always_inline))
-int b(int) {
+__attribute__((always_inline)) int b(int) {
++g;
return c(g);
}
@@ -34,9 +33,7 @@ int a(int) {
return g;
}
-void f() {
- ++g;
-}
+void f() { ++g; }
int main() {
int x = a(g);
@@ -52,13 +49,20 @@ int main() {
// DexStepFunction('f')
// CHECK: ## BEGIN ##
-// CHECK-NEXT: . [0, "a(int)", "{{.*}}dex-continue.cpp", 31, 3, "StopReason.BREAKPOINT", "StepKind.FUNC", []]
-// CHECK-NEXT: . [1, "a(int)", "{{.*}}dex-continue.cpp", 32, 5, "StopReason.STEP", "StepKind.VERTICAL_FORWARD", []]
-// CHECK-NEXT: . . . [2, "c(int)", "{{.*}}dex-continue.cpp", 16, 3, "StopReason.BREAKPOINT", "StepKind.FUNC", []]
-// CHECK-NEXT: . . . [3, "c(int)", "{{.*}}dex-continue.cpp", 17, 3, "StopReason.BREAKPOINT", "StepKind.VERTICAL_FORWARD", []]
-// CHECK-NEXT: . . . [4, "c(int)", "{{.*}}dex-continue.cpp", 19, 3, "StopReason.BREAKPOINT", "StepKind.VERTICAL_FORWARD", []]
-// CHECK-NEXT: . . . [5, "c(int)", "{{.*}}dex-continue.cpp", 20, 3, "StopReason.BREAKPOINT", "StepKind.VERTICAL_FORWARD", []]
-// CHECK-NEXT: . [6, "a(int)", "{{.*}}dex-continue.cpp", 33, 3, "StopReason.BREAKPOINT", "StepKind.VERTICAL_FORWARD", []]
-// CHECK-NEXT: . [8, "f()", "{{.*}}dex-continue.cpp", 38, 3, "StopReason.BREAKPOINT", "StepKind.VERTICAL_FORWARD", []]
-// CHECK-NEXT: . [9, "f()", "{{.*}}dex-continue.cpp", 39, 1, "StopReason.STEP", "StepKind.VERTICAL_FORWARD", []]
-// CHECK-NEXT: ## END (9 steps) ##
+// CHECK-NEXT: . [0, "a(int)", "{{.*}}dex-continue.cpp", 31, 3,
+// "StopReason.BREAKPOINT", "StepKind.FUNC", []] CHECK-NEXT: . [1, "a(int)",
+// "{{.*}}dex-continue.cpp", 32, 5, "StopReason.STEP",
+// "StepKind.VERTICAL_FORWARD", []] CHECK-NEXT: . . . [2, "c(int)",
+// "{{.*}}dex-continue.cpp", 16, 3, "StopReason.BREAKPOINT", "StepKind.FUNC",
+// []] CHECK-NEXT: . . . [3, "c(int)", "{{.*}}dex-continue.cpp", 17, 3,
+// "StopReason.BREAKPOINT", "StepKind.VERTICAL_FORWARD", []] CHECK-NEXT: . .
+// . [4, "c(int)", "{{.*}}dex-continue.cpp", 19, 3, "StopReason.BREAKPOINT",
+// "StepKind.VERTICAL_FORWARD", []] CHECK-NEXT: . . . [5, "c(int)",
+// "{{.*}}dex-continue.cpp", 20, 3, "StopReason.BREAKPOINT",
+// "StepKind.VERTICAL_FORWARD", []] CHECK-NEXT: . [6, "a(int)",
+// "{{.*}}dex-continue.cpp", 33, 3, "StopReason.BREAKPOINT",
+// "StepKind.VERTICAL_FORWARD", []] CHECK-NEXT: . [8, "f()",
+// "{{.*}}dex-continue.cpp", 38, 3, "StopReason.BREAKPOINT",
+// "StepKind.VERTICAL_FORWARD", []] CHECK-NEXT: . [9, "f()",
+// "{{.*}}dex-continue.cpp", 39, 1, "StopReason.STEP",
+// "StepKind.VERTICAL_FORWARD", []] CHECK-NEXT: ## END (9 steps) ##
diff --git a/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/control/dex_step_function.cpp b/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/control/dex_step_function.cpp
index e7e666d0e..4aaabb47f 100644
--- a/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/control/dex_step_function.cpp
+++ b/cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/control/dex_step_function.cpp
@@ -23,17 +23,19 @@ int a(int) {
return b(g);
}
-int main() {
- return a(g);
-}
+int main() { return a(g); }
// DexStepFunction('a')
// DexStepFunction('c')
// CHECK: ## BEGIN ##
-// CHECK-NEXT:. [0, "a(int)", "{{.*}}dex_step_function.cpp", 22, 3, "StopReason.BREAKPOINT", "StepKind.FUNC", []]
-// CHECK-NEXT:. [1, "a(int)", "{{.*}}dex_step_function.cpp", 23, 12, "StopReason.STEP", "StepKind.VERTICAL_FORWARD", []]
-// CHECK-NEXT:. . . [2, "c(int)", "{{.*}}dex_step_function.cpp", 12, 3, "StopReason.BREAKPOINT", "StepKind.FUNC", []]
-// CHECK-NEXT:. . . [3, "c(int)", "{{.*}}dex_step_function.cpp", 13, 3, "StopReason.STEP", "StepKind.VERTICAL_FORWARD", []]
-// CHECK-NEXT:. [6, "a(int)", "{{.*}}dex_step_function.cpp", 23, 3, "StopReason.STEP", "StepKind.HORIZONTAL_BACKWARD", []]
-// CHECK-NEXT: ## END (5 steps) ##
+// CHECK-NEXT:. [0, "a(int)", "{{.*}}dex_step_function.cpp", 22, 3,
+// "StopReason.BREAKPOINT", "StepKind.FUNC", []] CHECK-NEXT:. [1, "a(int)",
+// "{{.*}}dex_step_function.cpp", 23, 12, "StopReason.STEP",
+// "StepKind.VERTICAL_FORWARD", []] CHECK-NEXT:. . . [2, "c(int)",
+// "{{.*}}dex_step_function.cpp", 12, 3, "StopReason.BREAKPOINT",
+// "StepKind.FUNC", []] CHECK-NEXT:. . . [3, "c(int)",
+// "{{.*}}dex_step_function.cpp", 13, 3, "StopReason.STEP",
+// "StepKind.VERTICAL_FORWARD", []] CHECK-NEXT:. [6, "a(int)",
+// "{{.*}}dex_step_function.cpp", 23, 3, "StopReason.STEP",
+// "StepKind.HORIZONTAL_BACKWARD", []] CHECK-NEXT: ## END (5 steps) ##
|
✅ With the latest revision this PR passed the Python code formatter. |
f42e8d1
to
3c16976
Compare
Adding together in a single commit as their implementations are linked. Only supported for DAP debuggers. These two commands make it a bit easier to drive dexter: DexStepFunction tells dexter to step-next though a function and DexContinue tells dexter to continue (run free) from one breakpoint to another within the current DexStepFunction function. When the DexStepFunction function breakpoint is triggered, dexter sets an instruction breakpoint at the return-address. This is so that stepping can resume in any other DexStepFunctions deeps in the call stack.
18b6dc8
to
07cee24
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adding together in a single commit as their implementations are linked.
Only supported for DAP debuggers. These two commands make it a bit easier to
drive dexter: DexStepFunction tells dexter to step-next though a function and
DexContinue tells dexter to continue (run free) from one breakpoint to another
within the current DexStepFunction function.
When the DexStepFunction function breakpoint is triggered, dexter sets an
instruction breakpoint at the return-address. This is so that stepping can
resume in any other DexStepFunctions deeps in the call stack.