2

This may be a very simple question, but being new to Visual Studio and C++, I'm having hard time with this problem.

Background: I am working on a source code (OpenSEES), Which is completely written in Visual Studio C++. I downloaded the complete source code and compiled it in Visual Studio (C++) 2010. The source code gave me a ".exe" file.

The inputs parameters need to be written in ".tcl" file (as shown in figure - 1), then using the ".exe" file (as shown in figure - 2, which actually looks like a command window, in which I will give a command like this, source myfile.tcl), I will run the tcl input file, finally the program will give me some outputs in ".out" files (which contains all the results, that I need).

Problem: When I run the input file using the opensees executable, the program is not giving me the values I expected, there is some problem within the code. Hence, I have no way but to understand the functioning of the source code, line by line using break points.

I want to know, Is there any way to debug my ".tcl" input file, line by line using break points in the source code.

I found one answer similar to my problem (link) on this stackoverflow.com, but it is written for command line arguments, I need for ".tcl" input file.

Is there somewhere I can link my ".tcl" input file, to the source code and then debug in the visual studio.

Example Picture:

Figure - 1, Input file, which contains series of commands Figure - 2, Opensees.exe, which complied form the source code

The_Learner
  • 589
  • 1
  • 6
  • 16
  • You might need to give the full path to the .tcl file when you run from the debugger -- so not just myfile.tcl -- but c:\dir\dir\dir\myfile.tcl -- where dir is replaced with the real full path of the file. – Lou Franco May 17 '18 at 14:32
  • Do you want to set break points in the tcl script source too, or just in the c++ code? If you just want to debug the c++ while running a particular script you can use the debugger settings from the linked question to point it to the right script by passing the script as a command line argument (consider the working directory you are running or follow @Lou Franco's advice and give it the absolute path. See Batch mode: http://opensees.berkeley.edu/wiki/index.php/Getting_Started_with_OpenSees_--_Run_OpenSees – PaulR May 17 '18 at 16:40
  • 1
    Yes, I need to set break points in the tcl scripts and C++ code both. I implemented the path as said by [LouFranco](https://stackoverflow.com/users/3937/lou-franco) , I am able to set break points in the c++ code and able to run the tcl file. But could you please suggest me how to set the break points in the tcl file. @PaulR – The_Learner May 18 '18 at 05:18
  • Debugging both at once may be something of a pain. Depending on what the tcl interpreter used by OpenSees is, there may be standard tcl debugging options using the introspection of tcl. The problem is, that since the debugger is part of the executable controlled by the Visual studio debugger, it will not work once the whole executable is stopped by a C++ breakpoint. On the other hand, the tcl interpreter may be straightforward, so you may find a way to understand some of the tcl code by debugging the interpreter with Visual Studio. – PaulR May 18 '18 at 10:47

0 Answers0