delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/10/25/23:23:18

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Help me
Date: Fri, 25 Oct 1996 19:15:07 -0700
Organization: Three pounds of chaos and a pinch of salt
Lines: 58
Message-ID: <3271742B.1C35@cs.com>
References: <AAe2OMX0pst AT mmf DOT univ DOT simbirsk DOT su>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp211.cs.com
Mime-Version: 1.0
To: "A.V. Kondratiev" <akondra AT mmf DOT univ DOT simbirsk DOT su>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

A.V. Kondratiev wrote:
> 
> I am a newcomer to djgpp and caught come problems with it.
> 
> 1. I have a large program written on Borland C++ using Turbo Vision
> library. My program uses multiple TGroup::{getData|setData} calls.
> The program crashes under djgpp because of structure fields alignment
> performed by compiler. Is it possible to tell the compiler do not
> align members of some particular structures.

Use the GNU __attribute__ extension to C/C++ as follows:

struct foo
{
    short bar;
    char baz[211];
}__attribute__((packed));

If you are still using DJGPP v2.00, there is a bug in the gcc compiler
that causes this not to work in C++.  I recommend upgrading to v2.01
which fixes this bug, but if you can't, then do the following:

#pragma pack(1)
struct foo
{
    short bar;
    char baz[211];
}__attribute__((packed));
#pragma pack()

Please refer to the gcc docs (gcc|C Extensions|Type Attributes) for more
information, and see the FAQ (v2/faq202b.zip) sections 22.9 and 22.10.

> 2. I have no experience using command line debuggers and it is very
> hard for me to work with gdb. I tried fsdb. According to source code
> it must support source level debugging. But after several F8 (one line
> execution) or F7 (strange, but source code pane key handling function
> does not distinguish them) presses in source code pane I get unhandled
> exceptions or some other funny effects. Are there any *source
> level full screen debuggers* for djgpp or newer versions of fsdb?

fsdb is _not_ a source-level debugger, despite having a pane for the
source.  gdb is probably the best debugger out there for source code,
and I really recommend that you try to learn how to use it - the
investment will be worth the reward.  I myself knew nothing of
command-line debuggers before getting DJGPP, but I wouldn't leave them
now.  :)

You may also want to wait for the next beta release of RHIDE, the DJGPP
integrated development environment, which will feature integrated
Turbo-C style debugging using gdb.

-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I  |        fighteer AT cs DOT com         |
| Plan:  To find ANYONE willing to |   http://www.cs.com/fighteer   |
| play Descent 2 on DWANGO!        | Tagline: <this space for rent> |
---------------------------------------------------------------------

- Raw text -


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