I have to have my code done for 32 and 64 bit machines on both Linux and
Solaris. Compiling, not a problem.
Testing 32 is not a problem.
But I get segmentation faults when I test on 64 bit machines.
Here's where my problem comes in. I have this macro:
static char thr_buf[2048];
#define THROW(msg) { sprintf(thr_buf ,"(%s,%s,%d) :
%s",__FILE__,__ FUNCTION__,__LI NE__,msg); throw(thr_buf); }
My test code looks like:
try { NodeNewArb(-20,1,NULL); }
catch(const char* s) { OK(strstr(s,"La yer < 0")); }
The function NodeNewArb looks like:
node_p NodeNewArb(int layer, int npts,xy_p pts)
{
if (layer < 0) THROW("Layer < 0");
There's more but this is as far as it gets, as it should with a -20 for a
layer.
Here's the result of a tb in gbd
Breakpoint 2, NodeNewArb (layer=-20, npts=1, pts=0x0) at Laff.cxx:6122
6122 if (layer < 0) THROW("Layer < 0");
(gdb) p layer
$1 = -20
(gdb) n
Program received signal SIGSEGV, Segmentation fault.
classify_object _over_fdes (ob=0x729e80, this_fde=0x61a9 58) at
unwind-dw2-fde.h:172
172 {
Current language: auto; currently c
(gdb) bt
#0 classify_object _over_fdes (ob=0x729e80, this_fde=0x61a9 58) at
unwind-dw2-fde.h:172
#1 0x0000000000566 9b9 in search_object (ob=0x729e80, pc=0x5651b1) at
unwind-dw2-fde.c:731
#2 0x0000000000566 d95 in _Unwind_Find_FD E (pc=0x5651b1, bases=0x7fbff11 698) at
unwind-dw2-fde.c:997
#3 0x0000000000564 71e in uw_frame_state_ for (context=0x7fbf f115f0,
fs=0x7fbff111d0 ) at /apps/local-source/gcc/gcc-3.4.1/gcc/unwind-dw2.c:1015
#4 0x0000000000564 edf in uw_init_context _1 (context=0x7fbf f115f0,
outer_cfa=0x7fb ff11710, outer_ra=0x549f b6)
at /apps/local-source/gcc/gcc-3.4.1/gcc/unwind-dw2.c:1281
#5 0x0000000000565 1b2 in _Unwind_RaiseEx ception (exc=0xd01980) at
unwind.inc:93
#6 0x0000000000549 fb6 in __cxa_throw (obj=0x0, tinfo=0x0, dest=0) at
/apps/local-source/gcc/gcc-3.4.1/libstdc++-v3/libsupc++/eh_throw.cc:75
#7 0x00000000004c5 2ce in NodeNewArb (layer=-20, npts=1, pts=0x0) at
Laff.cxx:6122
#8 0x000000000043e 343 in t_NodeMalloc () at test.cxx:2867
#9 0x00000000004af 957 in main (argc=1, argv=0x7fbff11b 28) at test.cxx:8321
(gdb) q
The program is running. Exit anyway? (y or n) y
___ _ ____ ___ __ __
/ _ )(_) / /_ __ / _ \___ _/ /_/ /____ ___
/ _ / / / / // / / ___/ _ `/ __/ __/ _ \/ _ \
/____/_/_/_/\_, / /_/ \_,_/\__/\__/\___/_//_/
/___/
Texas Instruments ASIC Circuit Design Methodology Group
Dallas, Texas, 214-480-4455, b-******@ti.com