home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!ocsmd!gumby!obi
- From: obi@gumby.ocs.com (Kuryan "Obi" Thomas)
- Subject: Problem with MPW 32-bit code?
- Message-ID: <Bs4wn7.Mnu@gumby.ocs.com>
- Sender: obi@gumby (Kuryan "Obi" Thomas)
- Reply-To: obi@gumby.ocs.com
- Organization: Online Computer Systems, Inc.
- Date: Wed, 29 Jul 1992 05:01:55 GMT
- Lines: 35
-
- I seem to be having a problem with MPW's "32-bit everything" code. Version
- numbers are: MPW Shell and C 3.2; C++ 3.1.
-
- It looks as though when a CODE segment is unloaded and then loaded later
- at a different address, the PC addresses are all screwed up. For example:
-
- #pragma segment FooSeg
- void Foo::Bar()
- {
- AnotherFooProc(); /* this method is also in the FooSeg segment */
- }
-
- Let's say that a routine in the Main segment unloads the FooSeg segment.
- Later, another routine in Main makes an (intersegment) call to Foo::Bar().
- This works fine; I end up in the function above. But now comes an
- intrasegment call to Foo::AnotherFooProc(), which is also in the FooSeg
- segment. The PC skids off into the weeds and I get an illegal instruction
- fault. I've traced through this with MacsBug and observed it happen.
-
- I'm quite positive that I'm calling UnloadSeg() on the FooSeg segment only
- at approved times -- all UnloadSeg()s are in my main event loop, which is
- in the Main segment.
-
- Absolutely everything in the entire application is compiled with -model
- far. (Everything except the MPW libraries, that is.) I am not using
- MacApp.
-
- Has anyone else succeeded in using UnloadSeg() with the new 32-bit model
- in MPW C? Am I doing something wrong here?
-
- Please reply by email if you can help. Thank you all in advance.
-
- obi@gumby.ocs.com
- ocsmd!gumby!obi@uunet.uu.net
- ...!uunet!ocsmd!gumby!obi
-