CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > SU2

gdb can't hit any break point when debug SU2

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 27, 2019, 08:00
Default gdb can't hit any break point when debug SU2
  #1
New Member
 
yankle liu
Join Date: Nov 2019
Posts: 2
Rep Power: 0
jackLiu is on a distinguished road
I have a problem when I try to debug SU2.
I run the follow command to compile SU2

./configure CFLAGS=-g --prefix=/home/lau/program/cfd/su2/debug
make install

Then, I run GDB, set point at the main program, then run

[lau@localhost bin]$ gdb SU2_CFD

GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-100.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/lau/program/su2/debug/bin/SU2_CFD...done.

(gdb) b main

Breakpoint 1 at 0x4082d0

(gdb) run inv_NACA0012.cfg

Starting program: /home/lau/program/su2/debug/bin/SU2_CFD inv_NACA0012.cfg
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, 0x00000000004082d0 in main ()
Missing separate debuginfos, use: debuginfo-install
glibc-2.17-222.el7.x86_64 libgcc-4.8.5-39.el7.x86_64
libstdc++-4.8.5-39.el7.x86_64

(gdb) step

After I enter the command "step", it will run until the end of program.
I check another shorter cpp program ,it works well.
The OS is Centos 7.0 and gcc is 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)

Last edited by jackLiu; November 27, 2019 at 08:09. Reason: missing some massage
jackLiu is offline   Reply With Quote

Old   December 2, 2019, 07:05
Default
  #2
New Member
 
na
Join Date: Jul 2018
Posts: 28
Rep Power: 4
TKatt is on a distinguished road
Hey,


CFLAGS are for the C-Compiler and CXXFLAGS are for the C++ compiler. I use CXXFLAGS and have no issues with gdb. So I guess this is where your issue comes from.


https://en.wikipedia.org/wiki/CFLAGS as a reference


I tend to set CXXFLAGS as well as envoronmental variable
Code:
export CXXFLAGS="-g -O0"
I hope this helps, cheers
Tobi
TKatt is offline   Reply With Quote

Old   December 2, 2019, 20:44
Default
  #3
New Member
 
yankle liu
Join Date: Nov 2019
Posts: 2
Rep Power: 0
jackLiu is on a distinguished road
Quote:
Originally Posted by TKatt View Post
Hey,


CFLAGS are for the C-Compiler and CXXFLAGS are for the C++ compiler. I use CXXFLAGS and have no issues with gdb. So I guess this is where your issue comes from.


https://en.wikipedia.org/wiki/CFLAGS as a reference


I tend to set CXXFLAGS as well as envoronmental variable
Code:
export CXXFLAGS="-g -O0"
I hope this helps, cheers
Tobi
Dear Tobi:

It works, think you!
But I think one have to make clean and remake the program after changed the configure arguments. If I just remake, It will not change the exe file.


Jack Liu
jackLiu is offline   Reply With Quote

Old   December 8, 2019, 16:21
Default
  #4
New Member
 
na
Join Date: Jul 2018
Posts: 28
Rep Power: 4
TKatt is on a distinguished road
Hey,


I personally have a 'make clean' before every new '(pre)configure' command. Just to make sure nothing funny happens (and I tend to build on a lot of cores so I have no trouble with time ).

I am unsure though if a make clean is really necessary ? It might be ok without... but I am by far no expert

What surely is necessary is another '(pre)configure' with the respective CXXFLAGS set: either as environmental variable or in the command directly.


Note that we slowly shift to meson as a build system (away from autotools). I found it pretty easy and straight-forward to use. Check out the docs for building from source on the su2-website https://su2code.github.io/docs_v7/Bu...2-Linux-MacOS/


Cheers, Tobi
TKatt is offline   Reply With Quote

Reply

Tags
debug, gdb, su2

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
block-structured mesh for t-junction Robert@cfd ANSYS Meshing & Geometry 20 November 11, 2011 04:59
Problem with UDF compiling for kTkLW model Wantami FLUENT 0 July 18, 2011 05:11
movingConeTopo tutorial from 1.5-dev crashes with Floating Point Exception jaswi OpenFOAM Running, Solving & CFD 2 April 26, 2009 10:21
[Gmsh] Gmsh and samplesurface touf OpenFOAM Meshing & Mesh Conversion 2 December 10, 2007 02:27
CFX4.3 -build analysis form Chie Min CFX 5 July 12, 2001 23:19


All times are GMT -4. The time now is 08:48.