Article View: gnu.gdb.bug
Article #9962Re-doing g++ inheritance in gdb
From: Per Bothner
Date: Sun, 12 Aug 1990 16:32
Date: Sun, 12 Aug 1990 16:32
36 lines
2057 bytes
2057 bytes
I've recently been hacking gdb to be a little more pleasant for g++ users. (Patches will be posted as soon as I've tried it out some more. These include improved support for multiple inheritance, finding mangled global names, and nicer output (in my opinion).) In addition, I would like to change some of the internal data strutures, unless someone can explain why it would be a bad idea. The basic idea is to get rid of the baseclasses array. Most of the information in it is redundant, since it basically duplicates the first N_BASECLASSES fields. In addition to being redundant, it is unhelpful, since it does not contain the offset within the derived class. This is why the routine lookup_basetype_type complains in the presence of multiple inheitance. Therefore instead of: #define TYPE_BASECLASS(thistype,index) (thistype)->baseclasses[index] I would use: #define TYPE_BASECLASS(thistype,index) (thistype)->fields[index-1] I would delete lookup_basetype_type. In 'struct type', I would merge the fields private_field_bits and protected_field_bits into one array: char *field_bits; #define FIELD_MASK_PRIVATE 1 #define FIELD_MASK_PROTECTED 2 #define FIELD_MASK_VIRTUAL 4 /* for virtual baseclasses */ #define BASETYPE_VIA_VIRTUAL(type, index) \ ((type)->field_bits[index] & FIELD_MASK_VIRTUAL) Etc. Please let me know of any objections or counter-proposals. -- --Per Bothner bothner@cs.wisc.edu Computer Sciences Dept, U. of Wisconsin-Madison
Technical Details
Message-ID:
<11028@spool.cs.wisc.edu>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!wuarchive!uwm.edu!uwvax!sevenlayer.cs.wisc.edu!bothnerShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f5053,c7981e237e6116ab,start X-Google-Attributes: gidf5053,public X-Google-ArrivalTime: 1990-08-12 10:00:18 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!wuarchive!uwm.edu!uwvax!sevenlayer.cs.wisc.edu!bothner From: bothner@sevenlayer.cs.wisc.edu (Per Bothner) Newsgroups: gnu.gdb.bug Subject: Re-doing g++ inheritance in gdb Message-ID: <11028@spool.cs.wisc.edu> Date: 12 Aug 90 16:32:32 GMT Sender: news@spool.cs.wisc.edu Organization: U of Wisconsin CS Dept Lines: 36 Posted: Sun Aug 12 17:32:32 1990