home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!munnari.oz.au!spool.mu.edu!olivea!pagesat!spssig.spss.com!brent
- From: brent@spss.com (Brent Lambert)
- Newsgroups: comp.unix.aix
- Subject: Dynamically Loaded Shared Libraries and dbx
- Message-ID: <C0CIJC.5CL@spss.com>
- Date: 4 Jan 93 20:06:47 GMT
- Sender: news@spss.com (Net News Admin)
- Organization: SPSS, Inc. - portable code group
- Lines: 67
-
- SUMMARY:
-
- Program and libraries have proper common resolution, but dbx doesn't.
-
-
- PROGRAM ARCHITECTURE:
-
- Mixed C & FORTRAN main executable exports a common block.
- FORTRAN shared library imports the common block.
- Main executable dynamically loads shared library (load & loadbind),
- then invokes a subroutine in the shared library (exported, of course).
- The subroutine references the exported common in the process of
- performing it's function.
-
-
- PROBLEM:
-
- This program works fine! Even in dbx. But dbx doesn't work fine.
-
- While stepping through a subroutine in the library, I attempt to print
- the value of a common variable exported from the main executable, and
- dbx gives a value which I know not to be true, and which would break
- the program if it were.
-
- Here's a partial transcript (with the names changed for clarity) to
- show you what I mean. The main characters are:
- GLOBVAR, a common variable which is exported from the main executable
- LOCVAR, a local variable (in the subroutine)
-
- -----Begin-Debugging-Transcript------------------------
- stopped in file1 at line 96 in file "file1.f"
- 96 LOCVAR = GLOBVAR
- (dbx) p LOCVAR,GLOBVAR
- 0 -1
- (dbx) n
- stopped in file1 at line 97 in file "file1.f"
- 97 IPTNDI = 0
- (dbx) p LOCVAR,GLOBVAR
- 51195 -1
- (dbx) whatis LOCVAR
- integer*4 locvar
- (dbx) whatis GLOBVAR
- integer*4 globvar
- -----End-Debugging-Transcript--------------------------
-
-
- DISCUSSION:
-
- I believe that the debugger is looking at a local copy of the common,
- rather than the exported copy that the actual code uses. What I'm
- looking for is a way to tell dbx to look at the same common the
- program uses.
-
- Since this is a large project, with more than 50 shared libraries,
- hundreds of common blocks, thousands of source files, and half a dozen
- developers, I'm looking for a general debugging solution which doesn't
- require code changes.
-
- If anyone has any suggestions, please Email me at brent@spss.com then
- I'll summarize to the net. Thanks.
-
-
- --
- The above statements are not the opinions or policies of SPSS Inc.
- The above statements may not be the opinions of Brent Lambert.
- The first disclaimer is a policy of SPSS Inc.
- Subsequent disclaimers are probably the opinion of Brent Lambert.
-