Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: huzhongshan on March 25, 2013, 04:34:25 am

Title: Cannot find bounds of current function?
Post by: huzhongshan 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"
Title: Re: Cannot find bounds of current function?
Post by: Jenna 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 (http://forums.codeblocks.org/index.php/topic,9996.0.html).
Title: Re: Cannot find bounds of current function?
Post by: huzhongshan 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 (http://forums.codeblocks.org/index.php/topic,9996.0.html).
the c::b set wrong debugger settings ?
Title: Re: Cannot find bounds of current function?
Post by: Jenna 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 (http://forums.codeblocks.org/index.php/topic,9996.0.html).
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.
Title: Re: Cannot find bounds of current function?
Post by: huzhongshan 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.

Title: Re: Cannot find bounds of current function?
Post by: Jenna 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 .
Title: Re: Cannot find bounds of current function?
Post by: ollydbg 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)
Title: Re: Cannot find bounds of current function?
Post by: huzhongshan on March 25, 2013, 11:03:49 am
confused , is it caused by os? I use win7 32bit home basic edition.
Title: Re: Cannot find bounds of current function?
Post by: Jenna 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.
Title: Re: Cannot find bounds of current function?
Post by: huzhongshan 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
Title: Re: Cannot find bounds of current function?
Post by: huzhongshan on March 31, 2013, 11:58:45 am
I solved the problem.
I reinstalled the windows. the debug works OK
Title: Re: Cannot find bounds of current function?
Post by: huzhongshan 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?