Author Topic: how gdb works in feap?  (Read 4211 times)

halleluja

  • Full Member
  • ***
  • Posts: 80
how gdb works in feap?
« on: January 15, 2020, 05:59:58 AM »
Hi everyone,

i have written a user element for 2D problem. It works fine if i do a test for a 10*10 mesh problem and the result coinsider with the result from feap own element. But if i test with a finer mesh e.g. 12*12, i got 
Code: [Select]
  *ERROR* Residual norm is NaN or Inf, whereas if i use feap own element, it still works fine. So i want to use gdb to find concretely where is NaN or Inf in my own element code.

I have seen some video on Youtube how man uses gdb. But i still don't know how to apply it in feap. Can anyone give me a small example to show how use gdb in feap?


Best

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1165
Re: how gdb works in feap?
« Reply #1 on: January 15, 2020, 06:55:33 AM »
There are two primary steps.

1. add the -g tag to the FFOPTFLAG environment variable in makefile.in (if it is not already there).  If it was not already there, recompile your program.  At a minimum recompile you new element's files.

2. at the command prompt type 'gdb feap' to start feap in gdb.  at the gdb prompt type run.

What do next depends on how gdb reacts.  If it does not stop automatically and indicate an error someplace, then you will need to set break points in your element to locate the problem more manually.

halleluja

  • Full Member
  • ***
  • Posts: 80
Re: how gdb works in feap?
« Reply #2 on: January 15, 2020, 02:42:00 PM »
Thanks for reply.

So i modify the makefile.in
Code: [Select]
  FFOPTFLAG = -g -O2 -Wall
  CCOPTFLAG = -O2 -Wall

Then i
Code: [Select]
jacob@jacob:~/FEAP_VER84/VER84$ make
After that
Code: [Select]
jacob@jacob:~/FEAP_VER84/VER84/main$ gdb feap
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 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-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from feap...(no debugging symbols found)...done.
(gdb)

But it was "no debugging symbols found". How can i test with my feap input file?

Best

Prof. S. Govindjee

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 1165
Re: how gdb works in feap?
« Reply #3 on: January 15, 2020, 09:52:09 PM »
Two things to check.

(1) I don't think it will make a difference but you can add -g just after $(FF) on the feap target.

(2) If you are running on a MAC (OS X), cd main, then run 'dsymutil feap'.  This generates symbol table information for gdb on the MAC.