Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Removing breakpoint inside debugger_onBreakpoint() function?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
sgsgwv$6263
Advanced Cheater
Reputation: 0

Joined: 05 Aug 2020
Posts: 75

PostPosted: Sat Feb 25, 2023 2:05 am    Post subject: Removing breakpoint inside debugger_onBreakpoint() function? Reply with quote

Suppose my work is done inside the onBreakPoint function. Now I don't need the breakpoint. Can I simply call removeBreakpoint()? Will it cause any instability? Do we really need to call continueFromBreakpoint and do we really need to return anything(1 or 0) from that onBreakPoint function?

For now I am using a hockey to remove breakpoint. But I don't want that.
Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1055
Location: 0x90

PostPosted: Sat Feb 25, 2023 2:37 am    Post subject: Reply with quote

Logically speaking, when the breakpoint has triggered then the debuggee will remain in the paused state until the debuggee has been given instruction to continue so I would say that yes you do need to continueFromBreakpoint.

You continue/remove the breakpoint with the following functions:
Code:

debug_continueFromBreakpoint(continueMethod) : if the debugger is currently waiting to continue you can continue with this. Valid parameters are :co_run (just continue), co_stepinto(when on top of a call, follow it), co_stepover (when on top of a call run till after the call)
debug_removeBreakpoint(address) : if the given address is a part of a breakpoint it will be removed
Back to top
View user's profile Send private message
sgsgwv$6263
Advanced Cheater
Reputation: 0

Joined: 05 Aug 2020
Posts: 75

PostPosted: Sat Feb 25, 2023 2:44 am    Post subject: Reply with quote

Thanks. I know all that but can I do this:

Code:

function debugger_onBreakPoint ()
//some logic
//dont want breakpoint now.
debug_continueFromBreakpoint (co_run)
debug_removeBreakpoint(address)
return 1
end
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25288
Location: The netherlands

PostPosted: Sat Feb 25, 2023 3:10 am    Post subject: Reply with quote

yes you can remove a breakpoint there. It gets delay cleaned later anyhow.

also don't call debug_continueFromBreakpoint from onBreakpoint

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites