home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / aix / 12986 < prev    next >
Encoding:
Internet Message Format  |  1993-01-04  |  2.5 KB

  1. Path: sparky!uunet!munnari.oz.au!spool.mu.edu!olivea!pagesat!spssig.spss.com!brent
  2. From: brent@spss.com (Brent Lambert)
  3. Newsgroups: comp.unix.aix
  4. Subject: Dynamically Loaded Shared Libraries and dbx
  5. Message-ID: <C0CIJC.5CL@spss.com>
  6. Date: 4 Jan 93 20:06:47 GMT
  7. Sender: news@spss.com (Net News Admin)
  8. Organization: SPSS, Inc. - portable code group
  9. Lines: 67
  10.  
  11. SUMMARY:
  12.  
  13. Program and libraries have proper common resolution, but dbx doesn't.
  14.  
  15.  
  16. PROGRAM ARCHITECTURE:
  17.  
  18. Mixed C & FORTRAN main executable exports a common block.
  19. FORTRAN shared library imports the common block.
  20. Main executable dynamically loads shared library (load & loadbind),
  21. then invokes a subroutine in the shared library (exported, of course).
  22. The subroutine references the exported common in the process of
  23. performing it's function.
  24.  
  25.  
  26. PROBLEM:
  27.  
  28. This program works fine!  Even in dbx.  But dbx doesn't work fine.
  29.  
  30. While stepping through a subroutine in the library, I attempt to print
  31. the value of a common variable exported from the main executable, and
  32. dbx gives a value which I know not to be true, and which would break
  33. the program if it were.
  34.  
  35. Here's a partial transcript (with the names changed for clarity) to
  36. show you what I mean.  The main characters are:
  37.     GLOBVAR, a common variable which is exported from the main executable
  38.     LOCVAR, a local variable (in the subroutine)
  39.  
  40. -----Begin-Debugging-Transcript------------------------
  41. stopped in file1 at line 96 in file "file1.f"
  42.    96         LOCVAR = GLOBVAR
  43. (dbx) p LOCVAR,GLOBVAR
  44. 0 -1 
  45. (dbx) n
  46. stopped in file1 at line 97 in file "file1.f"
  47.    97         IPTNDI = 0
  48. (dbx) p LOCVAR,GLOBVAR
  49. 51195 -1 
  50. (dbx) whatis LOCVAR
  51.  integer*4 locvar
  52. (dbx) whatis GLOBVAR
  53.  integer*4 globvar
  54. -----End-Debugging-Transcript--------------------------
  55.  
  56.  
  57. DISCUSSION:
  58.  
  59. I believe that the debugger is looking at a local copy of the common,
  60. rather than the exported copy that the actual code uses.  What I'm
  61. looking for is a way to tell dbx to look at the same common the
  62. program uses.
  63.  
  64. Since this is a large project, with more than 50 shared libraries,
  65. hundreds of common blocks, thousands of source files, and half a dozen
  66. developers, I'm looking for a general debugging solution which doesn't
  67. require code changes.
  68.  
  69. If anyone has any suggestions, please Email me at brent@spss.com then
  70. I'll summarize to the net.  Thanks.
  71.  
  72.  
  73. -- 
  74. The above statements are not the opinions or policies of SPSS Inc.
  75. The above statements may not be the opinions of Brent Lambert.
  76. The first disclaimer is a policy of SPSS Inc.
  77. Subsequent disclaimers are probably the opinion of Brent Lambert.
  78.