Author Topic: Problem with Debugger when upgrading MinGW  (Read 25620 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5216
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Problem with Debugger when upgrading MinGW
« Reply #15 on: February 13, 2011, 12:57:25 pm »
I just test your project. (you path was hard-coded, that I need to change a lot)
I do not have memory access error(I'm using loaden's gcc 4.4.5 and gdb GNU gdb (GDB) 7.2.50.20110110-cvs)
loaden's gcc and gdb can be found:http://code.google.com/p/qp-gcc/
 :D

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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5216
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Problem with Debugger when upgrading MinGW
« Reply #16 on: February 13, 2011, 01:42:30 pm »
I just test your project. (you path was hard-coded, that I need to change a lot)

BTW:
is it possible to copy the build option between projects.(this can save a lot of time)
currently, it only allowed to copy build option between targets.
Any ideas.
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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11654
    • Travis build status
Re: Problem with Debugger when upgrading MinGW
« Reply #17 on: February 13, 2011, 04:18:41 pm »
You can make a plugin that copies project options ...
(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 recobb

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: Problem with Debugger when upgrading MinGW
« Reply #18 on: February 13, 2011, 04:41:50 pm »
I just test your project. (you path was hard-coded, that I need to change a lot)
I do not have memory access error(I'm using loaden's gcc 4.4.5 and gdb GNU gdb (GDB) 7.2.50.20110110-cvs)
loaden's gcc and gdb can be found:http://code.google.com/p/qp-gcc/
 :D

Well, thanks for trying.  I just downloaded from the site above and tried that (slightly different version: GNU gdb (GDB) 7.2.50.20101012), and still same problem.  If I open the data file located in the project folder, single stepping works.  Open in a different folder, and it does not.  That makes 4 different 7.x versions that all have the same problem (for me).  Only the pre-packaged 6.8 version does not have the problem.


Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5216
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Problem with Debugger when upgrading MinGW
« Reply #19 on: February 14, 2011, 02:18:41 am »
If I open the data file located in the project folder, single stepping works.  Open in a different folder, and it does not. 
This was too strange, I will test it tonight.
BTW: I guess: does your anti-virus program cause this problem??? :D
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 recobb

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: Problem with Debugger when upgrading MinGW
« Reply #20 on: February 14, 2011, 02:24:40 am »
If I open the data file located in the project folder, single stepping works.  Open in a different folder, and it does not. 
This was too strange, I will test it tonight.
BTW: I guess: does your anti-virus program cause this problem??? :D

I don't think so - I don't have the problem using the 6.8 version.  I'm using Commodo, for whatever that is worth.

I've been wondering if somehow, when using the file open dialog, some path is set to the new location and it loses some connection to the source files in the project folder.  But that doesn't really make sense either, as I can set breakpoints in the source file and those still work.  I could effectively single step by setting a breakpoint at every line, then resuming at each breakpoint - but that's not a happy way of doing things  :(

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5216
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Problem with Debugger when upgrading MinGW
« Reply #21 on: February 14, 2011, 02:28:05 am »
so, the problem(gdb complain memory access error) only happens when you open a file in a different folder(not the project folder)?
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 recobb

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: Problem with Debugger when upgrading MinGW
« Reply #22 on: February 14, 2011, 02:33:12 am »
so, the problem(gdb complain memory access error) only happens when you open a file in a different folder(not the project folder)?

That's right - if I open the data file while it's in the project folder I don't have a problem.  It's only when I have to navigate to a different folder (using the file dialog) that the problem appears.

Offline recobb

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: Problem with Debugger when upgrading MinGW
« Reply #23 on: February 14, 2011, 03:18:58 pm »
so, the problem(gdb complain memory access error) only happens when you open a file in a different folder(not the project folder)?

That's right - if I open the data file while it's in the project folder I don't have a problem.  It's only when I have to navigate to a different folder (using the file dialog) that the problem appears.

Well, it gets stranger and stranger.  This morning I created a new project (with a different project name) in the same folder as the files for the test case.  I went through the wizard, created a blank wxwidgets project, then added the .cpp files from the other project once it was created.  The problem with single-stepping was not present.  OK, so it's something to do with the project settings I thought to myself.  So I went and rebuilt the project as included in the zip test case.  The problem had disappeared there too!  OK, so maybe there are some files that are being updated from one project that affect the other.  I did a 'clean' and verified that all object files and executables were removed (or I deleted them myself).  I also checked the dates of all the files in the main project folder.  The only files newer than the zip file I posted were for the newly created project (a .cbp and .depend), and a .layout file for the original project.  I opened the .layout file in an editor and could not see anything in there that would affect anything (it was only a couple of lines long).  I rebuilt again and tried the debugger - it's now working (this is the tdw version) as it should.

OK, so all I need to do is create a new project for my original (full) project, which I did.  The Single Step Problem is Still There...    :?

The Full Moon is only 4 days away, maybe that's it.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6489
    • My Best Post
Re: Problem with Debugger when upgrading MinGW
« Reply #24 on: February 14, 2011, 03:33:44 pm »
Note: The below assumes the OP is a Vista or Windows 7 user.
@recobb: You do realize that Vista and Windows 7 have different permissions per folder.
If either one of the below fixes the problem.
1. Run Code::Blocks as Admin does the problem go away.
2. Turn off UAC and if problem goes away it is a Windows Security issue.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline recobb

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: Problem with Debugger when upgrading MinGW
« Reply #25 on: February 14, 2011, 03:36:24 pm »
Note: The below assumes the OP is a Vista or Windows 7 user.
@recobb: You do realize that Vista and Windows 7 have different permissions per folder.
If either one of the below fixes the problem.
1. Run Code::Blocks as Admin does the problem go away.
2. Turn off UAC and if problem goes away it is a Windows Security issue.

Nope, XP, Pro x64, version 2003, SP2

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Problem with Debugger when upgrading MinGW
« Reply #26 on: February 14, 2011, 05:17:48 pm »
I don't think so - I don't have the problem using the 6.8 version.  I'm using Commodo, for whatever that is worth.
Did you try it with comodo disabled ?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9488
Re: Problem with Debugger when upgrading MinGW
« Reply #27 on: February 14, 2011, 08:38:53 pm »
I don't think so - I don't have the problem using the 6.8 version.  I'm using Commodo, for whatever that is worth.
Did you try it with comodo disabled ?
Definitely worth a try. I am using Comodo myself. But for a developer this can be a pain in the a**. It took me literally month to set it up so that it does not interfere with my development process / style.

Remember that Comodo has different modules (AV, Firewall, Defense+ and the sandbox) - they ALL caused pain for me, so try to disable them step-by-step or set them into training mode to be alerted if something is blocked. Once found the components you can fine-tune them.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline recobb

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: Problem with Debugger when upgrading MinGW
« Reply #28 on: February 15, 2011, 12:54:23 am »
Quote
Quote

Did you try it with comodo disabled ?
Definitely worth a try. I am using Comodo myself. But for a developer this can be a pain in the a**. It took me literally month to set it up so that it does not interfere with my development process / style.

Remember that Comodo has different modules (AV, Firewall, Defense+ and the sandbox) - they ALL caused pain for me, so try to disable them step-by-step or set them into training mode to be alerted if something is blocked. Once found the components you can fine-tune them.

That didn't seem to change anything.  I killed Commodo from it's menu, then looked in Process Explorer to see if it left anything still running.  I found the cmdagent process still running (part of Commodo, and it hogs a lot of CPU), so I killed that.  I couldn't identify any other processes associated with Commodo.  The problem is still there.

But it was worth a check.  I've certainly had my problems with Commodo and gdb/gcc/CB in the past, and had to do some tweaks to be able to use things at all without a whole lot of error/warning messages popping up.  I forget what I did, but I haven't been seeing those messages lately.

Offline recobb

  • Multiple posting newcomer
  • *
  • Posts: 30
Re: Problem with Debugger when upgrading MinGW
« Reply #29 on: February 15, 2011, 01:05:56 am »
More info - I said the problem went away with the project I had posted.  Not so.  But it appears to be more sensitive to file location than just being 'not in the project folder'.

When I reported that the problem was gone this morning, the file had been in the parent folder of the project folder, and that worked OK.  I also put the file in a sub-folder of the project folder (the bin folder), and that was OK.  But when I put the file in a folder parallel to the project folder, the problem appears.  That is, say the project is in folder ..\wxprojects\debugerror.  Then I have no problem if the data file is in ..\wxprojects\debugerror\bin or ..\wxprojects, but it does appear if it is in ..\wxprojects\otherfolder.

Please give that a try.