(ctx: UIActionContext)
| 186 | |
| 187 | |
| 188 | def set_follow_reg(ctx: UIActionContext): |
| 189 | bv = ctx.binaryView |
| 190 | if bv is not None: |
| 191 | if bv.platform is not None: |
| 192 | regs = list(bv.platform.arch.regs.keys()) |
| 193 | idx = interaction.get_large_choice_input("Choose", "Choose Followed Register", regs) |
| 194 | |
| 195 | # Save choice both in QSettings and on the RenderLayer object instance |
| 196 | layer = RenderLayer[FollowRegRenderLayer.name] |
| 197 | if idx is None: |
| 198 | layer.followed_reg = None |
| 199 | QSettings().remove("layer/followed_reg") |
| 200 | else: |
| 201 | layer.followed_reg = regs[idx] |
| 202 | QSettings().setValue("layer/followed_reg", regs[idx]) |
| 203 | |
| 204 | # Trigger view refresh |
| 205 | ctx.context.refreshCurrentViewContents() |
| 206 | |
| 207 | |
| 208 | def can_set_follow_reg(ctx: UIActionContext) -> bool: |
nothing calls this directly
no test coverage detected