News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Splitting debugger in two - specific debugger and common GUI

Started by oBFusCATed, July 26, 2009, 01:27:44 PM

Previous topic - Next topic

oBFusCATed

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!]

xhpohanka

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.

$ 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

ollydbg

Quote from: xhpohanka 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.

$ 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.

xhpohanka

Quote from: ollydbg on December 08, 2010, 08:06:47 AM

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


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

oBFusCATed

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!]

killerbot

oh yes, I am just waiting for a merge of the trunk to debugger branch, we want some goodies from that one first ;-)

MortenMacFly

Quote from: killerbot 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 ;-)
Go ahead! It's all done. ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

killerbot


oBFusCATed

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!]

etheranger

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.next.codeblocks.org/index.php/topic,14085.0.html if you have an opinion :)

oBFusCATed

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!]

MortenMacFly

Quote from: oBFusCATed on January 21, 2011, 03:25:35 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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

oBFusCATed

(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!]

MortenMacFly

Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

oBFusCATed

Quote from: etheranger on January 21, 2011, 02:54:42 PM
+ 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!]