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