PINCE icon indicating copy to clipboard operation
PINCE copied to clipboard

Auto pause & continue

Open Symbai opened this issue 4 years ago • 10 comments

I've noticed for many actions PINCE wants the target to be paused. This is quite annoying to retrieve the message and then manually pause, perform the action (i.e. place breakpoint) and then resume the target.

I think this can be automated by PINCE. If target game is running => pause => do action => resume. If target game is already paused => do action (like as of now). This is also what CE does. And it can be an opt-in if someone thinks this is a problem somehow.

Symbai avatar Feb 27 '20 20:02 Symbai

I actually implemented this before, it was done with the execute_with_temporary_interruption function in GDB_Engine.py. But I've disabled it to stay true to the working behaviour of GDB. I can enable it again for some functionalities of PINCE if you want. How about we start from the breakpoints as you mentioned? If you like the implementation I'll continue doing the same for other functionalities.

korcankaraokcu avatar Feb 29 '20 18:02 korcankaraokcu

Yes breakpoints (set & unset alias stop) it would be really helpful. If this can cause issues etc. I would still say it's fine to make it an opt-in feature so people (like me) can turn this on if wanted.

Symbai avatar Feb 29 '20 18:02 Symbai

Aight, thanks for reporting. I'll check my schedule and fix this asap

korcankaraokcu avatar Feb 29 '20 19:02 korcankaraokcu

I've added this feature for breakpoints with the latest patch (23ee793a597284dbdd3b44fccd49316d922b7010). Test it and tell me if you encounter any bugs

Changes:

  • execute_with_temporary_interruption is now a decorator. Upon usage, it'll apply the effect above to the decorated function

korcankaraokcu avatar Mar 02 '20 16:03 korcankaraokcu

I've downloaded it again from github and overwritten the existing files. Then run PINCE but there is still a message box. Is there any specific instruction on how to update PINCE or what else am I doing wrong?

Symbai avatar Mar 10 '20 22:03 Symbai

Running git pull in the root directory of PINCE is enough to update unless there's a structural change (like gdb version update)

The bug you've encountered is legit. I've noticed that if the auto-pause breakpoint is triggered the moment it's set, you'll see that messagebox. The process will be stopped and then ran afterwards as intended, so the feature works, but you'll still see that messagebox. I think there's a race condition in PyQT notifiers. I'll look into this condition further asap.

korcankaraokcu avatar Mar 11 '20 17:03 korcankaraokcu

So what's the status on this. I was about to create an issue suggesting the same thing. Is it available as of now?

eLeCtrOssSnake avatar Oct 02 '21 09:10 eLeCtrOssSnake

It's available for certain functions but most of the GDB functionality requires you to stop manually. Auto-pause might cause unstable behaviour for some functions so I don't think that I'll apply this feature to all of them. Is there any specific feature you'd like to use auto-pause on?

korcankaraokcu avatar Oct 02 '21 11:10 korcankaraokcu

Well when skimming through the disassembly it's ok to press f2 for the time being, but when ticking what reads/writes this address it's kinda strange that you have to halt the process, to then instantly start it again because there will be no use.

eLeCtrOssSnake avatar Oct 05 '21 17:10 eLeCtrOssSnake

I've now applied auto-pause on that feature, have fun

korcankaraokcu avatar Oct 10 '21 23:10 korcankaraokcu

PINCE now uses background execution for gdb, you don't need auto-pause anymore, closing this issue

korcankaraokcu avatar Aug 05 '23 20:08 korcankaraokcu