From: Lyle Newsgroups: comp.os.msdos.djgpp Subject: Re: Perculiar bug fix? Date: Wed, 13 Aug 1997 20:46:19 +1000 Organization: Monash Uni Lines: 61 Message-ID: <33F1907B.E4196932@NO_SPAMccds.cc.monash.edu> References: <33EEE76F DOT 2F4B904 AT NO_SPAMccds DOT cc DOT monash DOT edu> <01bca6b4$ae002360$45111d0f AT p1675cra DOT rose DOT hp DOT com> NNTP-Posting-Host: ascend-1-30.cc.monash.edu.au Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Hi, Andrew Crabtree wrote: > > > the exact same code, compiled under Borland TC++ V3.0? Is this normal? > > Is there something i;m doing wrong (most certainly!). > Were you accessing data via structure pointers?? If so note that djgpp > tends to pad data more than some of the older dos compilers, > and the default size of 'int' is 32 bits, not 16. You could try using > __attribute__ ((packed)) to get rid of the padding, and replace ints with > shorts as needed. See the docs on gcc extensions for packing data. It may > also be in the FAQ. ahh i see - that would explain why the structures were being read weird. Not a problem, i just deleted the files and started again. I surmised something was different, but i'm thankfull to now know what :) > > > I still also have the problem that i cannot debug any of my code that i > > have '#include' into modules? Do i have to link all my source files, > > instead of just all my modules? > > Putting code in header files is generally a poor idea. I suspsect you have > run into one of the limitations of sdb debugging format. The files are not header files, but source code. i.e, i have an object with approx 5,000 lines of code. To mkae it easier for me to debug, i simply split the object further up into more source files. I'm sure there is nothing wrong with that! > The easist way to do what you want (shameless plug following) is to get > pgcc from www.goof.com. Its fairly stable right now, with a few quirks > with known workarounds. Just compile your code with -gstabs, and as long > as you use gdb you should be OK. Another option would be > to get Robert's patch to gcc and recompile it yourself. > > Andrew Robert's Patch? I'm using RHIDE (lattest ver as i have checked recently)? If i put gstabs on should it work? I just tried it with -gstabs+, i got the error "-gstabs+ not supported by this GCC". So i tried it with -g ang -gstabs+ and it worked. However, i still could not trace into my sub-source code. The only thing i can assume is that the -g took precedence and, ineffect, the -gstabs+ did nothing?? Thanks for your contructive reply! Cheers, Lyle -- NOTE: Remove The comment "NO_SPAM" To Reply via Email! -------------------------------[ **NEW ADDRESS** lpak1 AT ccds DOT cc DOT monash DOT edu DOT au] " Hello Chevra Kadish, You Kill 'em, We Chill 'em " .----, | oO | HTTP://www-personal.monash.edu.au/~lpak1/ | \/ | `----'