GUI / Application
FAQ G01 - How do I debug Simcenter Amesim models?
debug models
Category: Simcenter Amesim
Topic: GUI/Application
Access Level: End User
Publish Date: June 2008
Question
How do I debug Simcenter Amesim models?
Given:
One or more submodels (C code compiled with the Submodel Editor DEBUG option)
A Simcenter Amesim model containing these submodels
Microsoft Visual C++ or GNU GCC being the default Simcenter Amesim compiler
Results
The aim is to debug the whole Simcenter Amesim simulation and to set a breakpoint in the submodel C code with the Microsoft Visual C++ or GNU GCC compiler. If you have more than one submodel to debug, you must make sure that the submodels concerned are compiled in debug mode.
Answer
Let us assume that you want to debug a Simcenter Amesim model called test.ame.
First ensure that the following menu option is enabled in Simcenter Amesim:
Check the Tools > Advanced > Debug compilation menu item while yourSimcenter Amesim model is opened.
Procedure for Windows
Re-compile the Simcenter Amesim model in order to create the corresponding executable file (test_.exe).
If Microsoft Visual C++ is the default compiler, open Microsoft Visual C++ and use the File
Open menu in order to open the system executable file test_.exe. Then, debug it using the Start debug option.If GNU GCC is the default compiler, open an MS-DOS command window and type
gdb test_.exeto debug it. For more details about using gdb, typegdb -help.
Procedure for Linux
Re-compile the Simcenter Amesim model in order to create the corresponding executable file (test_).
In a console window, type
gdb test_to debug it. For more details about using gdb, typegdb -help.
Example for a submodel under Windows with the Microsoft Visual C++ compiler
In Submodel Editor, follow the steps below:
Procedure
Select the Tools > Options > Preferences menu:
In the Compilation tab, select Debug for the Default compilation mode:
Compile your Submodel Editor submodel, and make sure it is compiled in debug mode.
In Simcenter Amesim, open the system containing your submodel and force a model recompilation (Ctrl + T).
Switch to Submodel mode and select Debug compilation from the Tools
Advanced menu:
Switch to Simulation mode, and make sure the system is compiled in debug mode:
Save the system.
In Microsoft Visual C++, follow the steps below:
Procedure
Open the .exe file for your debug model (File > Open
Project/Solution):
Open the code of the model you want to debug (File > Open > File):
Set the breakpoints you require in the submodel C code:
Press F5 to start the run.
The following message will appear:
This is normal. Click Yes.
- The run starts, and you can observe the corresponding values by repeatedly clicking F5:
Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.faqs/xid1847168 · retrieved 2026-07-17