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

Add debug output of asm instructions in pycdc #272

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ahaensler
Copy link

I found it useful to see assembly and block scopes next to each other.
The PR changes some disassembly functions to output strings instead of directly writing to the stdout.

Output (set ENABLE_ASM_DEBUG in cmake to see it)

3      SET_LINENO              0               1         (0)
6      LOAD_CONST              0: '\ntest_lo...1         (0)
9      STORE_NAME              0: __doc__      1         (0)
12     SET_LINENO              9               1         (0)
15     SET_LINENO              14              1         (0)
18     SETUP_LOOP              54 (to 72)      1         (0)
21     LOAD_NAME               1: args         1            while (72)
22     GET_ITER                                1            while (72)
25     SET_LINENO              14              1            while (72)
28     FOR_ITER                43 (to 71)      1            while (72)
31     STORE_NAME              2: term         1            for (72)
34     SET_LINENO              15              1            for (72)
37     SETUP_EXCEPT            18 (to 55)      1            for (72)
40     SET_LINENO              16              2                    try (55)
41     PRINT_NEWLINE                           2                    try (55)
44     SET_LINENO              17              2                    try (55)
47     CONTINUE_LOOP           22              2                    try (55)
50     SET_LINENO              18              2                    try (55)
51     PRINT_NEWLINE                           2                    try (55)
52     POP_BLOCK                               2                    try (55)
55     JUMP_FORWARD            13 (to 68)      1                CONTAINER (0)
58     SET_LINENO              19              2                    except (68)
59     POP_TOP                                 2                    except (68)
60     POP_TOP                                 2                    except (68)
61     POP_TOP                                 2                    except (68)
64     SET_LINENO              20              2                    except (68)
67     JUMP_FORWARD            1 (to 68)       2                    except (68)
68     END_FINALLY                             2                    except (68)
71     JUMP_ABSOLUTE           22              1            for (72)
72     POP_BLOCK                               1            for (72)
75     LOAD_CONST              1: None         2            else (72)
76     RETURN_VALUE                            1         (0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant