Author Topic: Splitting debugger in two - specific debugger and common GUI  (Read 431369 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #360 on: December 06, 2010, 12:11:10 am »
Next patch: http://smrt.is-a-geek.org/codeblocks/patches/dbg/dbg_refactor0018.1.patch

Fixed problems:
1. Stopping (Break command) doesn't work when attach to process is used on windows.
   The problem was happening because the child pid wasn't detected when attaching to process.
   I've added another regex and now the child pid should be detected correctly
2. When stopping the debugger, the kill and quit commands weren't executed.
   The reason is that m_pProcess->CloseOutput() is called too early.

cbexaminr, thanks for the report, but your patch was a workaround, I've fixed (hopefully) the real problem :)

Please test and report any problems, I hope to test it on linux in the next couple of days
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline xhpohanka

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #361 on: December 08, 2010, 08:03:41 am »
Hi,
I wanted to try your version of debugger, but I was not successful in applying the posted patch (dbg_refactor0018.1.patch). From it's code I thought it has to be applied to the svn version 6872.

Code
$ patch -p0 < dbg_refactor0018.1.patch
(Stripping trailing CRs from patch.)
patching file src/plugins/debuggergdb/debuggergdb.cpp
Hunk #1 FAILED at 1640.
1 out of 1 hunk FAILED -- saving rejects to file src/plugins/debuggergdb/debuggergdb.cpp.rej
(Stripping trailing CRs from patch.)
patching file src/plugins/debuggergdb/gdb_driver.h
Hunk #1 succeeded at 115 (offset -10 lines).
(Stripping trailing CRs from patch.)
patching file src/plugins/debuggergdb/gdb_driver.cpp
Hunk #1 succeeded at 69 (offset -5 lines).
Hunk #2 succeeded at 83 (offset -5 lines).
Hunk #3 succeeded at 483 (offset -19 lines).
Hunk #4 succeeded at 540 with fuzz 1 (offset -21 lines).
Hunk #5 succeeded at 552 with fuzz 2 (offset -28 lines).
Hunk #6 FAILED at 768.
patch unexpectedly ends in middle of line
Hunk #7 succeeded at 761 with fuzz 1 (offset -35 lines).
1 out of 7 hunks FAILED -- saving rejects to file src/plugins/debuggergdb/gdb_driver.cpp.rej

I hope that I'm not missing something obvious...

regards
Jan

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #362 on: December 08, 2010, 08:06:47 am »
Hi,
I wanted to try your version of debugger, but I was not successful in applying the posted patch (dbg_refactor0018.1.patch). From it's code I thought it has to be applied to the svn version 6872.

Code
$ patch -p0 < dbg_refactor0018.1.patch
(Stripping trailing CRs from patch.)
patching file src/plugins/debuggergdb/debuggergdb.cpp
Hunk #1 FAILED at 1640.
1 out of 1 hunk FAILED -- saving rejects to file src/plugins/debuggergdb/debuggergdb.cpp.rej
(Stripping trailing CRs from patch.)
patching file src/plugins/debuggergdb/gdb_driver.h
Hunk #1 succeeded at 115 (offset -10 lines).
(Stripping trailing CRs from patch.)
patching file src/plugins/debuggergdb/gdb_driver.cpp
Hunk #1 succeeded at 69 (offset -5 lines).
Hunk #2 succeeded at 83 (offset -5 lines).
Hunk #3 succeeded at 483 (offset -19 lines).
Hunk #4 succeeded at 540 with fuzz 1 (offset -21 lines).
Hunk #5 succeeded at 552 with fuzz 2 (offset -28 lines).
Hunk #6 FAILED at 768.
patch unexpectedly ends in middle of line
Hunk #7 succeeded at 761 with fuzz 1 (offset -35 lines).
1 out of 7 hunks FAILED -- saving rejects to file src/plugins/debuggergdb/gdb_driver.cpp.rej

I hope that I'm not missing something obvious...

regards
Jan

did you use the debugger_branch?? this patch is already in the branch

see the log: rev 6873

Quote

* debugger_branch: applied patch dbg_refactor0018.1:
- stopping (break command) doesn't work when attach to process is used on windows
- when stopping the debugger, the kill and quit commands weren't executed

-------------------------------
M : /branches/wxpropgrid_debugger/src/plugins/debuggergdb/debuggergdb.cpp 
M : /branches/wxpropgrid_debugger/src/plugins/debuggergdb/gdb_driver.cpp 
M : /branches/wxpropgrid_debugger/src/plugins/debuggergdb/gdb_driver.h 
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline xhpohanka

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #363 on: December 08, 2010, 08:19:04 am »

did you use the debugger_branch?? this patch is already in the branch


You are right, my fault. Thank you...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #364 on: December 18, 2010, 04:18:30 pm »
Next patch: http://smrt.is-a-geek.org/codeblocks/patches/dbg/dbg_refactor0019.0.patch

Fixes:
1. Step into executes start instead of run (regression caused by the patch 0017.x)
2. Console window is hidden when remote debugging on windows (thanks Pecan)
3. The string used in evaluate tooltip is trimmed and only the first line is used
4. Fixed some parsing issues related to the '<repeats X times>'
5. Fixed a spelling error in the name of MainFrame::OnGetActiveLogWindow
6. Added more tests to the test project for the debugger

Killerbot: can you build a nightly, so we can test this last changes and hopefully get this code in trunk?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #365 on: December 18, 2010, 04:40:47 pm »
oh yes, I am just waiting for a merge of the trunk to debugger branch, we want some goodies from that one first ;-)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #366 on: December 18, 2010, 05:07:22 pm »
oh yes, I am just waiting for a merge of the trunk to debugger branch, we want some goodies from that one first ;-)
Go ahead! It's all done. ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #367 on: December 18, 2010, 06:21:14 pm »
starting to build, release probably tomorrow morning

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #368 on: January 16, 2011, 02:28:41 pm »
Next patch: http://smrt.is-a-geek.org/codeblocks/patches/dbg/dbg_refactor0019.1.patch

Changes:
1. The Watches are refreshed, when the watches dialog is shown and the debugger is running (fixes bug reported by killerbot)
2. Added a virtual method, so a debugger plugin can modify the context menu in the watches dialog (the SDK API is broken)
3. Used the new feature SDK to reimplement "dereference pointer" feature
4. Removed some unused member variables in the class DebuggerGDB

Test please :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline etheranger

  • Single posting newcomer
  • *
  • Posts: 4
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #369 on: January 21, 2011, 02:54:42 pm »
Someone suggested I port my CDB fixes to the branch, so here 'tis (against 6930):

https://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=3122&group_id=5358
Changes:
+ Grab the PID at launch so that process break / killing works - this allows setting breakpoints while running
+ NotifyDebuggeeContinued on Continue so that the cursor doesn't disappear forever after setting breakpoints while running
+ Slightly improve recognising breakpoint & assert hits
+ Added workaround to correctly set working dir (can still be disabled by #undefining ENABLE_WORKINGDIR_WORKAROUND.

I'd appreciate some feedback on the last point at http://forums.codeblocks.org/index.php/topic,14085.0.html if you have an opinion :)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #370 on: January 21, 2011, 03:25:35 pm »
Thank you, I was that someone.

I'll look at it tonight or in the weekend...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #371 on: January 21, 2011, 03:54:11 pm »
I'll look at it tonight or in the weekend...
Ok - so you will take care and tell me if it's working properly and is applied in the branch so I can close the ticket, please? :-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #372 on: January 21, 2011, 04:39:23 pm »
Yes, can you test it, too?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #373 on: January 21, 2011, 04:43:24 pm »
Yes, can you test it, too?
I must admit that I never worked a lot with CDB, but I can try.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Splitting debugger in two - specific debugger and common GUI
« Reply #374 on: January 26, 2011, 01:36:31 am »
+ Added workaround to correctly set working dir (can still be disabled by #undefining ENABLE_WORKINGDIR_WORKAROUND.

Have you tried to pass the .create command in the -c command line option?

Quote
-c "command"
Specifies the initial debugger command to run at start-up. This command must be surrounded with quotation marks. Multiple commands can be separated with semicolons. (If you have a long command list, it may be easier to put them in a script and then use the -c option with the $<, $><, $><, $$>< (Run Script File) command.)

Hm, it seems that the breakpoints are a bit broken. The current position marker is displayed 1 line after the breakpoint.
Etheranger, Morten do you see this problem, too?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]