MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / ToggleBreakpoint

Method ToggleBreakpoint

neo/tools/debugger/DebuggerWindow.cpp:2182–2215  ·  view source on GitHub ↗

================ rvDebuggerWindow::ToggleBreakpoint Toggles the breakpoint on the current script line ================ */

Source from the content-addressed store, hash-verified

2180================
2181*/
2182void rvDebuggerWindow::ToggleBreakpoint ( void )
2183{
2184 rvDebuggerBreakpoint* bp;
2185 DWORD sel;
2186 int line;
2187
2188 // Find the currently selected line
2189 SendMessage ( mWndScript, EM_GETSEL, (WPARAM)&sel, 0 );
2190 line = SendMessage ( mWndScript, EM_LINEFROMCHAR, sel, 0 ) + 1;
2191
2192 // If there is already a breakpoint there then just remove it, otherwise
2193 // we need to create a new breakpoint
2194 bp = mClient->FindBreakpoint ( mScripts[mActiveScript]->GetFilename ( ), line );
2195 if ( !bp )
2196 {
2197 // Make sure the line is code before letting them add a breakpoint there
2198 if ( !mScripts[mActiveScript]->IsLineCode ( line ) )
2199 {
2200 MessageBeep ( MB_ICONEXCLAMATION );
2201 return;
2202 }
2203
2204 mClient->AddBreakpoint ( mScripts[mActiveScript]->GetFilename(), line );
2205 }
2206 else
2207 {
2208 mClient->RemoveBreakpoint ( bp->GetID ( ) );
2209 }
2210
2211 // Force a repaint of the script window
2212 InvalidateRect ( mWndScript, NULL, FALSE );
2213
2214 UpdateBreakpointList();
2215}
2216
2217/*
2218================

Callers 1

MarginWndProcMethod · 0.80

Calls 6

FindBreakpointMethod · 0.80
AddBreakpointMethod · 0.80
RemoveBreakpointMethod · 0.80
GetFilenameMethod · 0.45
IsLineCodeMethod · 0.45
GetIDMethod · 0.45

Tested by

no test coverage detected