projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* stabsread.c (get_substring): Declare second arg as int.
[deliverable/binutils-gdb.git]
/
gdb
/
stabsread.c
diff --git
a/gdb/stabsread.c
b/gdb/stabsread.c
index 2b65dd1b209b5476864c353bf752e01db109a776..8c03a6f7de764dc1f55f946964a02710f3376641 100644
(file)
--- a/
gdb/stabsread.c
+++ b/
gdb/stabsread.c
@@
-75,6
+75,13
@@
struct field_info
} *fnlist;
};
} *fnlist;
};
+static void
+read_one_struct_field PARAMS ((struct field_info *, char **, char *,
+ struct type *, struct objfile *));
+
+static char *
+get_substring PARAMS ((char **, int));
+
static struct type *
dbx_alloc_type PARAMS ((int [2], struct objfile *));
static struct type *
dbx_alloc_type PARAMS ((int [2], struct objfile *));
@@
-145,10
+152,6
@@
read_cpp_abbrev PARAMS ((struct field_info *, char **, struct type *,
/* new functions added for cfront support */
/* new functions added for cfront support */
-extern void
-resolve_cfront_continuation PARAMS ((struct objfile *, struct symbol *,
- char * p));
-
static int
copy_cfront_struct_fields PARAMS ((struct field_info *, struct type *,
struct objfile *));
static int
copy_cfront_struct_fields PARAMS ((struct field_info *, struct type *,
struct objfile *));
@@
-455,7
+458,7
@@
patch_block_stabs (symbols, stabs, objfile)
SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
SYMBOL_CLASS (sym) = LOC_OPTIMIZED_OUT;
SYMBOL_NAME (sym) =
SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
SYMBOL_CLASS (sym) = LOC_OPTIMIZED_OUT;
SYMBOL_NAME (sym) =
- obs
tack_copy0 (&objfile->symbol_obstack, name, pp - name
);
+ obs
avestring (name, pp - name, &objfile->symbol_obstack
);
pp += 2;
if (*(pp-1) == 'F' || *(pp-1) == 'f')
{
pp += 2;
if (*(pp-1) == 'F' || *(pp-1) == 'f')
{
@@
-535,16
+538,17
@@
read_type_number (pp, typenums)
/* This code added to support parsing of ARM/Cfront stabs strings */
/* This code added to support parsing of ARM/Cfront stabs strings */
-/* get substring from string up to char c
- advance string pointer past suibstring */
+/* Get substring from string up to char c, advance string pointer past
+ suibstring. */
+
static char *
static char *
-get_substring(p, c)
+get_substring
(p, c)
char ** p;
char ** p;
-
char
c;
+
int
c;
{
{
- char *
str;
+ char *str;
str = *p;
str = *p;
- *p = strchr
(*p,
c);
+ *p = strchr
(*p,
c);
if (*p)
{
**p = 0;
if (*p)
{
**p = 0;
@@
-555,35
+559,36
@@
get_substring(p, c)
return str;
}
return str;
}
-/* Physname gets strcat'd onto sname in order to recreate the mangled
name
-
(see funtion gdb_mangle_name in gdbtypes.c). For cfront, make the physnam
e
- look like that of g++ - take out the initial mangling
+/* Physname gets strcat'd onto sname in order to recreate the mangled
+
name (see funtion gdb_mangle_name in gdbtypes.c). For cfront, mak
e
+ the physname look like that of g++ - take out the initial mangling
eg: for sname="a" and fname="foo__1aFPFs_i" return "FPFs_i" */
eg: for sname="a" and fname="foo__1aFPFs_i" return "FPFs_i" */
+
static char *
static char *
-get_cfront_method_physname(fname)
- char *
fname;
+get_cfront_method_physname
(fname)
+ char *fname;
{
{
- int len
=
0;
+ int len
=
0;
/* FIXME would like to make this generic for g++ too, but
that is already handled in read_member_funcctions */
char * p = fname;
/* search ahead to find the start of the mangled suffix */
if (*p == '_' && *(p+1)=='_') /* compiler generated; probably a ctor/dtor */
/* FIXME would like to make this generic for g++ too, but
that is already handled in read_member_funcctions */
char * p = fname;
/* search ahead to find the start of the mangled suffix */
if (*p == '_' && *(p+1)=='_') /* compiler generated; probably a ctor/dtor */
- p
+=2;
- while (p && ((p+1) - fname) < strlen
(fname) && *(p+1)!=
'_')
- p = strchr
(p,
'_');
- if (!(p && *p
=='_' && *(p+1)==
'_'))
- error("Invalid mangled function name %s",fname);
- p
+=
2; /* advance past '__' */
+ p
+= 2;
+ while (p && ((p+1) - fname) < strlen
(fname) && *(p+1) !=
'_')
+ p = strchr
(p,
'_');
+ if (!(p && *p
== '_' && *(p+1) ==
'_'))
+ error
("Invalid mangled function name %s",fname);
+ p
+=
2; /* advance past '__' */
/* struct name length and name of type should come next; advance past it */
/* struct name length and name of type should come next; advance past it */
- while (isdigit(*p))
+ while (isdigit
(*p))
{
{
- len = len
*
10 + (*p - '0');
+ len = len
*
10 + (*p - '0');
p++;
}
p++;
}
- p
+=
len;
+ p
+=
len;
return p;
}
return p;
}
@@
-595,37
+600,36
@@
get_cfront_method_physname(fname)
A:ZcA;;foopri__1AFv foopro__1AFv __ct__1AFv __ct__1AFRC1A foopub__1AFv ;;;
^
*/
A:ZcA;;foopri__1AFv foopro__1AFv __ct__1AFv __ct__1AFRC1A foopub__1AFv ;;;
^
*/
+
static int
static int
-read_cfront_baseclasses(fip, pp, type, objfile)
+read_cfront_baseclasses
(fip, pp, type, objfile)
struct field_info *fip;
struct field_info *fip;
- struct objfile *
objfile;
+ struct objfile *objfile;
char ** pp;
char ** pp;
- struct type *
type;
+ struct type *type;
{
{
- static struct complaint msg_noterm = {"\
- Base classes not terminated while reading stabs string %s.\n",
- 0, 0};
static struct complaint msg_unknown = {"\
Unsupported token in stabs string %s.\n",
0, 0};
static struct complaint msg_notfound = {"\
Unable to find base type for %s.\n",
0, 0};
static struct complaint msg_unknown = {"\
Unsupported token in stabs string %s.\n",
0, 0};
static struct complaint msg_notfound = {"\
Unable to find base type for %s.\n",
0, 0};
- int bnum
=
0;
+ int bnum
=
0;
char * p;
int i;
struct nextfield *new;
char * p;
int i;
struct nextfield *new;
- if (**pp
==';')
/* no base classes; return */
+ if (**pp
== ';')
/* no base classes; return */
{
++(*pp);
{
++(*pp);
- return;
+ return
1
;
}
/* first count base classes so we can allocate space before parsing */
}
/* first count base classes so we can allocate space before parsing */
- for (p = *pp; p && *p && *p
!=
';'; p++)
+ for (p = *pp; p && *p && *p
!=
';'; p++)
{
{
- if (*p==' ') bnum++;
+ if (*p == ' ')
+ bnum++;
}
bnum++; /* add one more for last one */
}
bnum++; /* add one more for last one */
@@
-638,12
+642,12
@@
read_cfront_baseclasses(fip, pp, type, objfile)
{
int num_bytes = B_BYTES (TYPE_N_BASECLASSES (type));
char *pointer;
{
int num_bytes = B_BYTES (TYPE_N_BASECLASSES (type));
char *pointer;
+
pointer = (char *) TYPE_ALLOC (type, num_bytes);
TYPE_FIELD_VIRTUAL_BITS (type) = (B_TYPE *) pointer;
}
B_CLRALL (TYPE_FIELD_VIRTUAL_BITS (type), TYPE_N_BASECLASSES (type));
pointer = (char *) TYPE_ALLOC (type, num_bytes);
TYPE_FIELD_VIRTUAL_BITS (type) = (B_TYPE *) pointer;
}
B_CLRALL (TYPE_FIELD_VIRTUAL_BITS (type), TYPE_N_BASECLASSES (type));
-
for (i = 0; i < TYPE_N_BASECLASSES (type); i++)
{
new = (struct nextfield *) xmalloc (sizeof (struct nextfield));
for (i = 0; i < TYPE_N_BASECLASSES (type); i++)
{
new = (struct nextfield *) xmalloc (sizeof (struct nextfield));
@@
-687,7
+691,7
@@
read_cfront_baseclasses(fip, pp, type, objfile)
if (**pp!='@')
{
complain (&msg_unknown, *pp);
if (**pp!='@')
{
complain (&msg_unknown, *pp);
- return;
+ return
1
;
}
++(*pp);
}
++(*pp);
@@
-715,7
+719,7
@@
read_cfront_baseclasses(fip, pp, type, objfile)
if (!bname || !*bname)
{
complain (&msg_unknown, *pp);
if (!bname || !*bname)
{
complain (&msg_unknown, *pp);
- return;
+ return
1
;
}
/* FIXME! attach base info to type */
bsym = lookup_symbol (bname, 0, STRUCT_NAMESPACE, 0, 0); /*demangled_name*/
}
/* FIXME! attach base info to type */
bsym = lookup_symbol (bname, 0, STRUCT_NAMESPACE, 0, 0); /*demangled_name*/
@@
-727,7
+731,7
@@
read_cfront_baseclasses(fip, pp, type, objfile)
else
{
complain (&msg_notfound, *pp);
else
{
complain (&msg_notfound, *pp);
- return;
+ return
1
;
}
}
}
}
@@
-747,6
+751,7
@@
read_cfront_baseclasses(fip, pp, type, objfile)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*/
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*/
+static int
read_cfront_member_functions(fip, pp, type, objfile)
struct field_info *fip;
char **pp;
read_cfront_member_functions(fip, pp, type, objfile)
struct field_info *fip;
char **pp;
@@
-877,7
+882,8
@@
read_cfront_member_functions(fip, pp, type, objfile)
for public, set new_sublist->fn_field.is_protected = 1) */
/* Unable to distinguish const/volatile from stabs definition!
for public, set new_sublist->fn_field.is_protected = 1) */
/* Unable to distinguish const/volatile from stabs definition!
- Assuming normal for now. FIXME!
+ Assuming normal for now. FIXME! */
+
new_sublist -> fn_field.is_const = 0;
new_sublist -> fn_field.is_volatile = 0; /* volatile not implemented in cfront */
new_sublist -> fn_field.is_const = 0;
new_sublist -> fn_field.is_volatile = 0; /* volatile not implemented in cfront */
@@
-958,7
+964,6
@@
resolve_cfront_continuation(objfile, sym, p)
char * sname;
/* snarfed from read_struct_type */
struct field_info fi;
char * sname;
/* snarfed from read_struct_type */
struct field_info fi;
- struct field_info * fip = &fi;
struct type *type;
struct cleanup *back_to;
struct type *type;
struct cleanup *back_to;
@@
-1864,7
+1869,6
@@
read_type (pp, objfile)
register struct type *type = 0;
struct type *type1;
int typenums[2];
register struct type *type = 0;
struct type *type1;
int typenums[2];
- int xtypenums[2];
char type_descriptor;
/* Size in bits of type if specified by a type attribute, or -1 if
char type_descriptor;
/* Size in bits of type if specified by a type attribute, or -1 if
@@
-3346,8
+3350,6
@@
read_cfront_static_fields(fip, pp, type, objfile)
struct type *type;
struct objfile *objfile;
{
struct type *type;
struct objfile *objfile;
{
- int nfields = TYPE_NFIELDS(type);
- int i;
struct nextfield * new;
struct type *stype;
char * sname;
struct nextfield * new;
struct type *stype;
char * sname;
@@
-3356,7
+3358,7
@@
read_cfront_static_fields(fip, pp, type, objfile)
if (**pp==';') /* no static data; return */
{
++(*pp);
if (**pp==';') /* no static data; return */
{
++(*pp);
- return;
+ return
1
;
}
/* Process each field in the list until we find the terminating ";" */
}
/* Process each field in the list until we find the terminating ";" */
@@
-4327,6
+4329,7
@@
common_block_end (objfile)
sym = (struct symbol *)
obstack_alloc (&objfile -> symbol_obstack, sizeof (struct symbol));
memset (sym, 0, sizeof (struct symbol));
sym = (struct symbol *)
obstack_alloc (&objfile -> symbol_obstack, sizeof (struct symbol));
memset (sym, 0, sizeof (struct symbol));
+ /* Note: common_block_name already saved on symbol_obstack */
SYMBOL_NAME (sym) = common_block_name;
SYMBOL_CLASS (sym) = LOC_BLOCK;
SYMBOL_NAME (sym) = common_block_name;
SYMBOL_CLASS (sym) = LOC_BLOCK;
This page took
0.02757 seconds
and
4
git commands to generate.