Trying to print _rhs using gdb

Post Reply
roybens
Posts: 39
Joined: Fri Mar 14, 2008 7:57 am

Trying to print _rhs using gdb

Post by roybens » Thu Sep 29, 2016 8:21 pm

Hi,
I am trying to print rhs for each time step of my simulation using gdb.
I tried to configure with CXXFLAGS='-g' and CFLAGS='-g'.
but when executing gdb nrniv i get the symbols load but i cannot access files in the oc folder.
I am trying to step through nrn_rhs proc at treeset.c
Is there anything else i should do except using the flags?
Thanks in advance
Roy

hines
Site Admin
Posts: 1528
Joined: Wed May 18, 2005 3:32 pm

Re: Trying to print _rhs using gdb

Post by hines » Fri Sep 30, 2016 3:24 pm

You can only use gdb if you build from sources. The nrniv.exe and libraries distributed in the setup.exe installer are stripped
by the nrn/src/mswin/batch/instalmingw.sh script to minimise the size of the installer.

hines
Site Admin
Posts: 1528
Joined: Wed May 18, 2005 3:32 pm

Re: Trying to print _rhs using gdb

Post by hines » Fri Sep 30, 2016 3:29 pm

Hmm. I guess your mention of CFLAGS is a clue that you are building from sources on MSWin
Are you using MingW or Cygwin? In any case, I presume you copy the nrniv.exe and nrniv.dll over the c:/nrn/bin files of an existing installation.

roybens
Posts: 39
Joined: Fri Mar 14, 2008 7:57 am

Re: Trying to print _rhs using gdb

Post by roybens » Fri Sep 30, 2016 3:43 pm

So i should have mentioned it in the first post,
I am using bash on windows - which is a ubuntu linux shell on windows 10 (pretty new feature for win)
And i go to '~/neuron/nrn/x86_64/bin$' and run gdb nrniv from there.
When trying to set a breakpoint at nrn_rhs i cannot
typing (gdb) break nrn (then hitting tab for completion)
i get:
nrn_global_argc
nrn_global_argv
nrnisaac_new
nrnisaac_new@got.plt
nrnisaac_new@plt
nrn_isdouble
nrn_isdouble@got.plt
nrn_isdouble@plt
nrn_is_python_extension
nrn_istty_
nrnmain.cpp
nrn_main_launch
nrn_mech_dll
nrnmpi.h
nrnmpi_numprocs
nrn_nobanner_
nrn_nopython
nrn_nvkludge_dummy()
nrn_optarg(char const*, int*, char const**)
nrn_optargint(char const*, int*, char const**, int)
nrn_optarg_on(char const*, int*, char const**)
nrnpy_guigetstr
nrnpy_guigetval
nrnpy_guisetval
nrnpy_nositeflag
nrn_vecsim_add(void*, bool)
nrn_vecsim_add(void*, bool)@got.plt
nrn_vecsim_add(void*, bool)@plt
nrn_vecsim_remove(void*)
nrn_vecsim_remove(void*)@got.plt
nrn_vecsim_remove(void*)@plt
nrn_version
nrn_version@got.plt
nrn_version@plt
(gdb) break nrn_
nrn_global_argc
nrn_global_argv
nrn_isdouble
nrn_isdouble@got.plt
nrn_isdouble@plt
nrn_is_python_extension
nrn_istty_
nrn_main_launch
nrn_mech_dll
nrn_nobanner_
nrn_nopython
nrn_nvkludge_dummy()
nrn_optarg(char const*, int*, char const**)
nrn_optargint(char const*, int*, char const**, int)
nrn_optarg_on(char const*, int*, char const**)
nrn_vecsim_add(void*, bool)
nrn_vecsim_add(void*, bool)@got.plt
nrn_vecsim_add(void*, bool)@plt
nrn_vecsim_remove(void*)
nrn_vecsim_remove(void*)@got.plt
nrn_vecsim_remove(void*)@plt
nrn_version
nrn_version@got.plt
nrn_version@plt


Sorry for the long post but i just want to give as much data in order to solve this

hines
Site Admin
Posts: 1528
Joined: Wed May 18, 2005 3:32 pm

Re: Trying to print _rhs using gdb

Post by hines » Fri Sep 30, 2016 5:41 pm

Maybe the names are not loaded at the beginning because the dynamic library has not been loaded. Try
run
(ctrl)C
and then see if you have more names available. On a ubuntu system I see

Code: Select all

gdb nrniv
...
Reading symbols from nrniv...done.
(gdb) b nrn_rhs
Function "nrn_rhs" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y

Breakpoint 1 (nrn_rhs) pending.
(gdb) run
Starting program: /home/hines/neuron/nrnmpi/x86_64/bin/nrniv 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
NEURON -- VERSION 7.5 (1459:343629f66e9e) 2016-09-21
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2016
See http://neuron.yale.edu/neuron/credits

oc>finitialize()

Breakpoint 1, nrn_rhs (_nt=_nt@entry=0x638340)
    at ../../../nrn/src/nrnoc/treeset.c:344
344	void nrn_rhs(NrnThread* _nt) {
What happens on your system.

roybens
Posts: 39
Joined: Fri Mar 14, 2008 7:57 am

Re: Trying to print _rhs using gdb

Post by roybens » Fri Sep 30, 2016 5:44 pm

Ha! it worked Thanks!!

Post Reply