forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Debugging a C++ DLL from an FTN95 application

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
gordonaird



Joined: 25 Nov 2008
Posts: 2
Location: Glasgow

PostPosted: Wed Nov 26, 2008 12:18 pm    Post subject: Debugging a C++ DLL from an FTN95 application Reply with quote

I'm working with Visual Studio (2005). My solution contains two projects, an application written in Fortran and a C++ DLL. Both projects build fine and the application runs okay with the Fortran calling routines defined in the DLL. However, when I step through the Fortran source using the Visual Studio debugger I am not able to step into the C++ routines of the DLL. Is there something I can do to enable this?

Thanks
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Wed Nov 26, 2008 1:41 pm    Post subject: Reply with quote

I am not sure about this. The answer may depend on whether you are using the Silverfrost C++ compiler (SCC) or not.

If you are using SCC then make sure you are also using one of the debugging options. Try opening the relevant C++ file in the debugger and setting a manual break point before you run the main application.

In my experience you cannot step into a DLL function directly but in some situations you can set a manual break point in the DLL code and then run to it that way.

As I say, I am not sure about any of this but it may be worth a try.
Back to top
View user's profile Send private message AIM Address
Robert



Joined: 29 Nov 2006
Posts: 444
Location: Manchester

PostPosted: Sun Nov 30, 2008 11:22 pm    Post subject: Reply with quote

The simple answer is no you cannot step into it if the DLL is built with Visual C++. The reason is that when you debug an FTN95 application you are *really* using SDBG and it doesn't know anything about Visual C++ debugging. You could try running your program, setting breakpoints in C++ code and then attaching to the process with Visual Studio.

You should be able to debug Salford C/FTN95 seamlessly.
Back to top
View user's profile Send private message Visit poster's website
Andrew



Joined: 09 Sep 2004
Posts: 232
Location: Frankfurt, Germany

PostPosted: Mon Dec 08, 2008 12:14 pm    Post subject: Reply with quote

Is it not possible to set the C++ DLL project as the startup project in Visual Studio, but change the startup target to the Fortran program in the DLL debugging options? This should use the Fortran exe to startup the debugging session, but should enable you to debug the C DLL. You will not be able to step between the two however.

Edit: I can confirm this does work (at least in Visual Studio 2008). Set the C DLL project to be the startup poroject. Go into the project settings and under:

Configuration Properties -> Debugging -> Command

Set the path to the Fortran executable. If you set breakpoints within the C code, they then will be hit.
Back to top
View user's profile Send private message
gordonaird



Joined: 25 Nov 2008
Posts: 2
Location: Glasgow

PostPosted: Tue Jan 06, 2009 12:11 pm    Post subject: Reply with quote

Thanks for the help. Setting the DLL as the startup project with the debug target set to the Fortran executable looks like the best solution. You cannot jump between C++ and Fortran but it does mean you can choose what you want to debug for each run. Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group