Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Debugging issues

<< < (3/3)

tiwag:

--- Quote ---Well, that should be enough ;)

--- End quote ---

well -  :shock:

actually i found out, that pressing F4 during an active debugging session actually set's a temporary breakpoint, but the run command isn't fired - but it works when you press Ctrl-F7 (after pressing F4)

tiwag:

regarding the problem, Run-to-cursor ( F4 ) does set a "tbreak" but doesn't continue debugging:

the problem is, that
DebuggerDriver::RunQueue()   (in plugins\debuggergdb\debuggerdriver.cpp)
sets
m_ProgramIsStopped = false;
regardless of the command and/or the actual state but in
DebuggerGDB::RunToCursor()  (in plugins\debuggergdb\debuggergdb.cpp)
you call afterwards
Continue();
which runs 
DebuggerGDB::RunCommand(int cmd)   
which tests the same flag by calling 
!IsStopped()   
in order to proceed or just leave the function without action.

in order to test the above said i did the following patch,
which doesn'tn set
m_ProgramIsStopped = false;
in case of the current command is a temporary breakpoint request.



--- Code: ---Index: D:/devel/CodeBlocks/trunk/src/plugins/debuggergdb/debuggerdriver.cpp
===================================================================
--- D:/devel/CodeBlocks/trunk/src/plugins/debuggergdb/debuggerdriver.cpp (revision 1986)
+++ D:/devel/CodeBlocks/trunk/src/plugins/debuggergdb/debuggerdriver.cpp (working copy)
@@ -96,7 +96,8 @@
     {
         m_QueueBusy = true;
         m_pDBG->SendCommand(CurrentCommand()->m_Cmd);
-        m_ProgramIsStopped = false;
+        if (!CurrentCommand()->m_Cmd.StartsWith(_T("tbreak ")))
+            m_ProgramIsStopped = false;
     }
 
     // Call Action()

--- End code ---


with this patch F4 works ok, but it is certainly not the right patch for solving this problem generally,
that is beyond my scope ... only want to share my results of investigation

mandrav:
Fixed in SVN.

tiwag:
Thanks Yiannis - the debugging works awesome now !

btw. is it correct in all cases just not to test the flag
(by NOT calling) !IsStopped()   
in  DebuggerGDB::RunCommand(int cmd)  ???

shouldn't be set the flag according to the real state of the debugger ?
sorry if this is a dumb question, but obviously i didn't well understand the reason for this flag.

mandrav:
IsStopped() is true when the debugging session isn't running or if it's idle.
In RunCommand() it's not necessary to check for it, because this function is only called by other functions (it's like a dispatcher) which check for the running state themselves.
So, yes, it's safe not to check for it inside RunCommand()...

Navigation

[0] Message Index

[*] Previous page

Go to full version