Author Topic: Cannot find bounds of current function?  (Read 20070 times)

Offline huzhongshan

  • Multiple posting newcomer
  • *
  • Posts: 109
Cannot find bounds of current function?
« on: March 25, 2013, 04:34:25 am »
I use codeblocks (12.11 TDMgcc 4.7.1 ) to debug a dll , I write a application to call dll functions (dll compiled with -g , no optimization) , when I step into function in dll , Debugger says "Cannot find bounds of current function"

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Cannot find bounds of current function?
« Reply #1 on: March 25, 2013, 06:13:53 am »
And where is the relation to C::B ?

It looks either like a compiler, gdb or user issue.
In the first two case ask in the appropriate forums, mailing lists or irc-channels of gcc or gdb.
To be sure it's not the last case, double-check the build options of your dll and your application, and check that the correct version of the dll is used.

ANd please reread the forum rules.

Offline huzhongshan

  • Multiple posting newcomer
  • *
  • Posts: 109
Re: Cannot find bounds of current function?
« Reply #2 on: March 25, 2013, 08:16:22 am »
And where is the relation to C::B ?

It looks either like a compiler, gdb or user issue.
In the first two case ask in the appropriate forums, mailing lists or irc-channels of gcc or gdb.
To be sure it's not the last case, double-check the build options of your dll and your application, and check that the correct version of the dll is used.

ANd please reread the forum rules.
the c::b set wrong debugger settings ?

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Cannot find bounds of current function?
« Reply #3 on: March 25, 2013, 08:47:15 am »
And where is the relation to C::B ?

It looks either like a compiler, gdb or user issue.
In the first two case ask in the appropriate forums, mailing lists or irc-channels of gcc or gdb.
To be sure it's not the last case, double-check the build options of your dll and your application, and check that the correct version of the dll is used.

ANd please reread the forum rules.
the c::b set wrong debugger settings ?
I guess not.

Did you search the web for the error ?

There are many related topics, that might guide you into the correct direction, probably a programming error (overridden stack frame, due to a buffer overflow, or something similar).
It seems that in some cases a stripped dll can cause this error, too.

Offline huzhongshan

  • Multiple posting newcomer
  • *
  • Posts: 109
Re: Cannot find bounds of current function?
« Reply #4 on: March 25, 2013, 10:33:10 am »
I searched the topic , but I find no useful info.
I create a very simple application and a dll .  I attach the source code.

the caller is

int main()
{
    char FileName[1024];
    SomeFunction("Hello");  // cb can step into this function in dll
    GetFileName(NULL , FileName , "title"); //when this functions called
    SomeFunction("Hello");  // cb cannot step into .

    cout << "Hello world!" << endl;
    return 0;
}

I think GetFileName changes the directory , and then cb(gdb) can not step in the Next function(in dll).
I use CB 12.11 with gcc ( 4.7.1 ) , just downloaded from official site.


Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Cannot find bounds of current function?
« Reply #5 on: March 25, 2013, 10:50:05 am »
I just downloaded your test project and can debug it flawlessly.
Stepping into the dll in both calls is no problem.
Windos XP SP3, C::B 12.11 with default compiler/debugger .

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5249
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Cannot find bounds of current function?
« Reply #6 on: March 25, 2013, 10:50:14 am »
I create a very simple application and a dll .  I attach the source code.
I can not reproduce the bug, step into works fine.(I'm using PCX mingw 4.6.3 and gdb CVS head build myself)
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 huzhongshan

  • Multiple posting newcomer
  • *
  • Posts: 109
Re: Cannot find bounds of current function?
« Reply #7 on: March 25, 2013, 11:03:49 am »
confused , is it caused by os? I use win7 32bit home basic edition.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Cannot find bounds of current function?
« Reply #8 on: March 25, 2013, 11:15:38 am »
Also tested on Win7 Pro all updates with C::B 12.11.
No such issue.

I slightly modified your project-files and added a workspace to get rid of the copy in the post-build-step and use project dependencies therefore.
I attach it.
Just build (or rebuild) the dllcall-project the dll-project will be updated if needed.

Offline huzhongshan

  • Multiple posting newcomer
  • *
  • Posts: 109
Re: Cannot find bounds of current function?
« Reply #9 on: March 25, 2013, 11:27:22 am »
Also tested on Win7 Pro all updates with C::B 12.11.
No such issue.

I slightly modified your project-files and added a workspace to get rid of the copy in the post-build-step and use project dependencies therefore.
I attach it.
Just build (or rebuild) the dllcall-project the dll-project will be updated if needed.

I will reinstall cb. Maybe something is wrong in my computer.
the project dependencies is really good . No copy anymore. Just learned this method from you.  ;D

Offline huzhongshan

  • Multiple posting newcomer
  • *
  • Posts: 109
Re: Cannot find bounds of current function?
« Reply #10 on: March 31, 2013, 11:58:45 am »
I solved the problem.
I reinstalled the windows. the debug works OK

Offline huzhongshan

  • Multiple posting newcomer
  • *
  • Posts: 109
Re: Cannot find bounds of current function?
« Reply #11 on: April 02, 2013, 05:58:46 am »
Also tested on Win7 Pro all updates with C::B 12.11.
No such issue.

I slightly modified your project-files and added a workspace to get rid of the copy in the post-build-step and use project dependencies therefore.
I attach it.
Just build (or rebuild) the dllcall-project the dll-project will be updated if needed.

I will reinstall cb. Maybe something is wrong in my computer.
the project dependencies is really good . No copy anymore. Just learned this method from you.  ;D

How to modified the project? I use dependancies ,but when I debug the dllcall , it still prompted cannot find the .dll.
I use project dependancy (check the dll box) and external dependany ( add the .dll)
Can you tell me more detailed steps?