home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / hp / 13049 < prev    next >
Encoding:
Text File  |  1992-11-18  |  1.9 KB  |  50 lines

  1. Newsgroups: comp.sys.hp
  2. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!watserv2.uwaterloo.ca!madmax.uwaterloo.ca!gordon
  3. From: gordon@madmax.uwaterloo.ca (Gordon R. Strachan)
  4. Subject: Re: xdb accessing 'opaque' data structures
  5. Message-ID: <Bxx17C.7KF@watserv2.uwaterloo.ca>
  6. Sender: news@watserv2.uwaterloo.ca
  7. Organization: University of Waterloo
  8. References: <6153@tivoli.UUCP> <BxvEA1.4p9@fc.sde.hp.com>
  9. Date: Wed, 18 Nov 1992 14:21:11 GMT
  10. Lines: 38
  11.  
  12. In article <BxvEA1.4p9@fc.sde.hp.com> bruno@fc.hp.com (Bruno Melli) writes:
  13. >The reason xdb can't show you what a widget looks like is that it has
  14. >no debug info about widgets. If you look at Intrinsic.h you get:
  15. >
  16. >typedef struct _WidgetRec *Widget;
  17. >
  18. >Try to find _WidgetRec in intrinsic.h. You won't find it.
  19. >So xdb knows that a Widget is a pointer to a struct _WidgetRec but
  20. >has no idea what the _WidgetRec struct looks like.
  21. >
  22. >To work around this problem you need to have a file include CoreP.h.
  23. >You could link in a dummy object file when you build your debugable
  24. >executable, or you could have something like this in one of your
  25. >source file.
  26.  
  27. Are you absolutely sure about this?  I have been writing my own widget which
  28. naturally defines its own widget structue.  Now the file includes the
  29. private header files for both my widget and the CoreP.h files.  So my
  30. program knows exactly what is in the structure so presumably the debugger
  31. should as well.  However, if you try to print out the widget structure the
  32. debugger still claims it doesn't know what it is.  Interestingly enough, if
  33. I cast the widget prior to printing then it will work.  Ie: the xdb command
  34.  
  35. p w
  36.  
  37. were w is the widget won't work but
  38.  
  39. p *(struct _MyWidgetRec *)w
  40.  
  41. will.  So the debugger know what _MyWidgetRec structure looks like, it just
  42. can't figure out that typedef MyWidget.  It all very strange to me.
  43.  
  44. >
  45. >bruno.
  46.  
  47. Gordon
  48.  
  49.  
  50.