Re: [ng-spice] Debugging ng-spice


To ng-spice@ieee.ing.uniroma1.it
From Arno <A.W.Peters@ieee.org>
Date Fri, 29 Oct 1999 18:54:38 +0200
Delivered-To mailing list ng-spice@ieee.ing.uniroma1.it
In-Reply-To <XFMail.991029100221.awilson@mrcmicroe.com >; from awilson@mrcmicroe.com on Fri, Oct 29, 1999 at 10:02:21AM -0700
Mailing-List contact ng-spice-help@ieee.ing.uniroma1.it; run by ezmlm
References <Pine.LNX.3.96.991029073704.8234A-100000@ieee.ing.uniroma1.it > <XFMail.991029100221.awilson@mrcmicroe.com >
Reply-To ng-spice@ieee.ing.uniroma1.it
User-Agent Mutt/1.0pre4i

On Fri, Oct 29, 1999 at 10:02:21AM -0700, Anthony Wilson wrote:
> Has anyone been able to or tried to step thru ng-spice to debug it?

Apparently not.

> Well, in trying to do so I am getting a SIGSEGV error in the baseaddr()
> function in resource.c @ line 366.  Not sure what is happening here.  From 
>my
> understanding the SIGSEGV is an "invalid access to storage error".  Well, I
> guess I don't really understand what the baseaddr() function is trying to 
>do.
> Can I just #def that section out of the code when debugging? I guess I could
> try that.

The segfault is quite deliberate.  It lets the OS signal to the app
that it has reached its limits for memory usage.  Spice uses it to
measure the data segment it has available.  Under non-debugging usage,
the segfault gets caught by the function fault() which returns to the
main loop using a longjmp.

Under the debugger, however, the segfault gets caught by the debugger,
before the app sees it.  You can disable the check by setting an
environment variable:

in sh:

SPICE_NO_DATASEG_CHECK=yes
export SPICE_NO_DATASEG_CHECK

(The value actually is not relevant as long as the variable exists)

Hope it helps,

-- 
Arno

Partial thread listing: