delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/07/23/05:00:37.1

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: "AndreA <andrea.galbusera"<Ihatespammers AT delorie DOT com>@teamware.it
Subject: Re: GDB on target w/o coprocessor
Newsgroups: comp.os.msdos.djgpp
References: <pqRLc.37726$5D1 DOT 1638448 AT news4 DOT tin DOT it> <2ma6n0FkuqsjU1 AT uni-berlin DOT de>
Lines: 56
Organization: TW
User-Agent: KNode/0.7.2
MIME-Version: 1.0
Message-ID: <4p4Mc.40386$5D1.1812630@news4.tin.it>
Date: Fri, 23 Jul 2004 08:56:32 GMT
NNTP-Posting-Host: 80.183.241.136
X-Complaints-To: "Please send abuse reports to abuse AT tin DOT it and technical notifications to newsmaster AT tin DOT it"
X-Trace: news4.tin.it 1090572992 80.183.241.136 (Fri, 23 Jul 2004 10:56:32 MET DST)
NNTP-Posting-Date: Fri, 23 Jul 2004 10:56:32 MET DST
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hans-Bernhard Broeker wrote:

> That's not supposed to be necessary.  DJGPP has an automatic dynamic
> load mechanism for an external 387 emulator.  You just have to install
> it and possibly copy it into the program's build installation
> directory.  See the FAQ for more.

Thanks for the tip. I installed the emulator and the exception run away.
 
Unfortunately I still cannot debug my fp emulated code. I first started with
a rather complex application, than I moved to something very simple, but
problems persist. This is what I´m trying to debug:

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

int main()
{

        float a,b;

        printf("Hello World: start!\n");
        a=10.5;
        b=12.8;
        printf("Floating point operation %f+%f returned: %f\n", a, b, a+b);

        printf("Hello World: end!\n");
        return 0;
}

This is what I experience:

* The program behaves as expected if run on the target outside gdb (both
compiled with or w/o -lemu). To make it run w/o -lemu I need to set both 
        set 387=N
        set emu387=c:\djgpp\bin\emu387.dxe

* When attached to gdb the program generate a couple of SIGEMTs in
_control87(). If I continue I run into a stack underflow exception. This
happens either building with o w/o -lemu.
        
        80387 Exception: stack underflow!
          SW: 0x00c1  top=0 cc=0000     CW: 0x033f
        Exiting due to signal SIGFPE
        Coprocessor Error at eip=00008d5f, x87 status=
        Program received signal SIGEMT, Emulation trap.
        0x0000dfe2 in _status87 ()

Am I doing something wrong? Non-fp applications debug smoothly on my target.

T.I.A

Andrea


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019