RE: [ng-spice-devel] ACS on Win32 with MinGW


To "'ng-spice-devel@ieee.ing.uniroma1.it'" <ng-spice-devel@ieee.ing.uniroma1.it>
From "Gillespie, Alan" <Alan.Gillespie@analog.com>
Date Thu, 26 Apr 2001 12:19:55 +0100
Delivered-To mailing list ng-spice-devel@ieee.ing.uniroma1.it
Mailing-List contact ng-spice-devel-help@ieee.ing.uniroma1.it; run by ezmlm
Reply-To ng-spice-devel@ieee.ing.uniroma1.it


> It works fine with the "cygwin" version of gcc.

Yup. It works fine with Borland C++, and other people
have got it working with MSVC++. It also works on Solaris
with gcc.

> > Does anyone know how you debug that part of a C++
> > program with gdb ?
> 
> The same way as any other part of the program.
> 
> For me, the most useful feature is the back-trace.  This is the 
> command "bt" in gdb.  It usually points directly to the problem.

I get :-

C:\GCC-29~1.2\HOME\SRC\ACS-0.28\SRC>gdb acs.exe
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-mingw32"...
(gdb) run
run
Starting program: C:\gcc-2.95.2\HOME\src\acs-0.28\src/acs.exe
78000000:C:/WINDOWS/SYSTEM/MSVCRT.DLL
bff70000:C:/WINDOWS/SYSTEM/KERNEL32.DLL

Program received signal SIGSEGV, Segmentation fault.
0x9 in ?? ()
(gdb) where
where
#0  0x9 in ?? ()
#1  0x49438e in global destructors keyed to DEV_SUBCKT::_count ()
    at d_subckt.cc:46
#2  0x4d4e0d in __do_global_ctors () at main.cc:106
#3  0x4d4e42 in __main () at main.cc:106
#4  0x4ca2c1 in main (argc=1, argv=0x2f80e80) at main.cc:20
(gdb)


I just noticed that it says "global DESTRUCTORS", not constructors,
although it's in __do_global_ctors (), which I would take  to mean
constructors.

I've tried a print statement as the first line of main(), and
it never gets there. That's another reason why I assumed it was
a constructor problem.

In d_subckt.cc you have :-

int DEV_SUBCKT::_count = 0;
int SUBCKT_COMMON::_count = -1;
int MODEL_SUBCKT::_count = 0;
static SUBCKT_COMMON Default_SUBCKT(CC_STATIC);

struct SSNODE {
  std::string _name;
  CARD_LIST::fat_iterator pb;
  explicit SSNODE() :_name(), pb(&CARD_LIST::card_list) {}
  explicit SSNODE(const std::string Name, CARD_LIST::fat_iterator c)
    :_name(Name), pb(c) {}
};
static std::list<SSNODE> substack;

That seems to be the area that it's complaining about.

Cheers,

Alan

Partial thread listing: