-/* Ugly hack to convert method stubs into method types.
-
- He ain't kiddin'. This demangles the name of the method into a string
- including argument types, parses out each argument type, generates
- a string casting a zero to that type, evaluates the string, and stuffs
- the resulting type into an argtype vector!!! Then it knows the type
- of the whole function (including argument types for overloading),
- which info used to be in the stab's but was removed to hack back
- the space required for them. */
-void
-check_stub_method (type, i, j)
- struct type *type;
- int i, j;
-{
- extern char *gdb_mangle_name (), *strchr ();
- struct fn_field *f = TYPE_FN_FIELDLIST1 (type, i);
- char *mangled_name = gdb_mangle_name (type, i, j);
- char *demangled_name = cplus_demangle (mangled_name, 0);
- char *argtypetext, *p;
- int depth = 0, argcount = 1;
- struct type **argtypes;
-
- /* Now, read in the parameters that define this type. */
- argtypetext = strchr (demangled_name, '(') + 1;
- p = argtypetext;
- while (*p)
- {
- if (*p == '(')
- depth += 1;
- else if (*p == ')')
- depth -= 1;
- else if (*p == ',' && depth == 0)
- argcount += 1;
-
- p += 1;
- }
- /* We need one more slot for the void [...] or NULL [end of arglist] */
- argtypes = (struct type **)xmalloc ((argcount+1) * sizeof (struct type *));
- p = argtypetext;
- argtypes[0] = lookup_pointer_type (type);
- argcount = 1;
-
- if (*p != ')') /* () means no args, skip while */
- {
- depth = 0;
- while (*p)
- {
- if (depth <= 0 && (*p == ',' || *p == ')'))
- {
- argtypes[argcount] =
- parse_and_eval_type (argtypetext, p - argtypetext);
- argcount += 1;
- argtypetext = p + 1;
- }
-
- if (*p == '(')
- depth += 1;
- else if (*p == ')')
- depth -= 1;
-
- p += 1;
- }
- }
-
- if (p[-2] != '.') /* ... */
- argtypes[argcount] = builtin_type_void; /* Ellist terminator */
- else
- argtypes[argcount] = NULL; /* List terminator */
+ Extracting bits depends on endianness of the machine. Compute the
+ number of least significant bits to discard. For big endian machines,
+ we compute the total number of bits in the anonymous object, subtract
+ off the bit count from the MSB of the object to the MSB of the
+ bitfield, then the size of the bitfield, which leaves the LSB discard
+ count. For little endian machines, the discard count is simply the
+ number of bits from the LSB of the anonymous object to the LSB of the
+ bitfield.