Deleted Added
full compact
stabs.c (89857) stabs.c (104834)
1/* stabs.c -- Parse stabs debugging information
2 Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001
3 Free Software Foundation, Inc.
4 Written by Ian Lance Taylor <ian@cygnus.com>.
5
6 This file is part of GNU Binutils.
7
8 This program is free software; you can redistribute it and/or modify

--- 352 unchanged lines hidden (view full) ---

361 const char *p;
362 const char *err;
363{
364 fprintf (stderr, _("Warning: %s: %s\n"), err, p);
365}
366
367/* Create a handle to parse stabs symbols with. */
368
1/* stabs.c -- Parse stabs debugging information
2 Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001
3 Free Software Foundation, Inc.
4 Written by Ian Lance Taylor <ian@cygnus.com>.
5
6 This file is part of GNU Binutils.
7
8 This program is free software; you can redistribute it and/or modify

--- 352 unchanged lines hidden (view full) ---

361 const char *p;
362 const char *err;
363{
364 fprintf (stderr, _("Warning: %s: %s\n"), err, p);
365}
366
367/* Create a handle to parse stabs symbols with. */
368
369/*ARGSUSED*/
370PTR
371start_stab (dhandle, abfd, sections, syms, symcount)
372 PTR dhandle ATTRIBUTE_UNUSED;
373 bfd *abfd;
374 boolean sections;
375 asymbol **syms;
376 long symcount;
377{

--- 179 unchanged lines hidden (view full) ---

557 if (info->so_string == NULL)
558 info->so_string = xstrdup (string);
559 else
560 {
561 char *f;
562
563 f = info->so_string;
564
369PTR
370start_stab (dhandle, abfd, sections, syms, symcount)
371 PTR dhandle ATTRIBUTE_UNUSED;
372 bfd *abfd;
373 boolean sections;
374 asymbol **syms;
375 long symcount;
376{

--- 179 unchanged lines hidden (view full) ---

556 if (info->so_string == NULL)
557 info->so_string = xstrdup (string);
558 else
559 {
560 char *f;
561
562 f = info->so_string;
563
565 if (IS_ABSOLUTE_PATH (string))
564 if (IS_ABSOLUTE_PATH (string))
566 info->so_string = xstrdup (string);
567 else
568 info->so_string = concat (info->so_string, string,
569 (const char *) NULL);
570 free (f);
571 }
572
573 info->so_value = value;

--- 1333 unchanged lines hidden (view full) ---

1907 (void) parse_number (pp, (boolean *) NULL);
1908 if (**pp != ';')
1909 {
1910 bad_stab (orig);
1911 return DEBUG_TYPE_NULL;
1912 }
1913 ++*pp;
1914
565 info->so_string = xstrdup (string);
566 else
567 info->so_string = concat (info->so_string, string,
568 (const char *) NULL);
569 free (f);
570 }
571
572 info->so_value = value;

--- 1333 unchanged lines hidden (view full) ---

1906 (void) parse_number (pp, (boolean *) NULL);
1907 if (**pp != ';')
1908 {
1909 bad_stab (orig);
1910 return DEBUG_TYPE_NULL;
1911 }
1912 ++*pp;
1913
1915 /* The second number is always 0, so ignore it too. */
1914 /* The second number is always 0, so ignore it too. */
1916 (void) parse_number (pp, (boolean *) NULL);
1917 if (**pp != ';')
1918 {
1919 bad_stab (orig);
1920 return DEBUG_TYPE_NULL;
1921 }
1922 ++*pp;
1923
1915 (void) parse_number (pp, (boolean *) NULL);
1916 if (**pp != ';')
1917 {
1918 bad_stab (orig);
1919 return DEBUG_TYPE_NULL;
1920 }
1921 ++*pp;
1922
1924 /* The third number is the number of bits for this type. */
1923 /* The third number is the number of bits for this type. */
1925 bits = parse_number (pp, (boolean *) NULL);
1926
1927 /* The type *should* end with a semicolon. If it are embedded
1928 in a larger type the semicolon may be the only way to know where
1929 the type ends. If this type is at the end of the stabstring we
1930 can deal with the omitted semicolon (but we don't have to like
1931 it). Don't bother to complain(), Sun's compiler omits the semicolon
1932 for "void". */

--- 36 unchanged lines hidden (view full) ---

1969 return DEBUG_TYPE_NULL;
1970 }
1971
1972 if (details == NF_COMPLEX
1973 || details == NF_COMPLEX16
1974 || details == NF_COMPLEX32)
1975 return debug_make_complex_type (dhandle, bytes);
1976
1924 bits = parse_number (pp, (boolean *) NULL);
1925
1926 /* The type *should* end with a semicolon. If it are embedded
1927 in a larger type the semicolon may be the only way to know where
1928 the type ends. If this type is at the end of the stabstring we
1929 can deal with the omitted semicolon (but we don't have to like
1930 it). Don't bother to complain(), Sun's compiler omits the semicolon
1931 for "void". */

--- 36 unchanged lines hidden (view full) ---

1968 return DEBUG_TYPE_NULL;
1969 }
1970
1971 if (details == NF_COMPLEX
1972 || details == NF_COMPLEX16
1973 || details == NF_COMPLEX32)
1974 return debug_make_complex_type (dhandle, bytes);
1975
1977 return debug_make_float_type (dhandle, bytes);
1976 return debug_make_float_type (dhandle, bytes);
1978}
1979
1980/* Handle an enum type. */
1981
1982static debug_type
1983parse_stab_enum_type (dhandle, pp)
1984 PTR dhandle;
1985 const char **pp;

--- 317 unchanged lines hidden (view full) ---

2303 return false;
2304 ++c;
2305 continue;
2306 }
2307
2308 /* Look for the ':' that separates the field name from the field
2309 values. Data members are delimited by a single ':', while member
2310 functions are delimited by a pair of ':'s. When we hit the member
1977}
1978
1979/* Handle an enum type. */
1980
1981static debug_type
1982parse_stab_enum_type (dhandle, pp)
1983 PTR dhandle;
1984 const char **pp;

--- 317 unchanged lines hidden (view full) ---

2302 return false;
2303 ++c;
2304 continue;
2305 }
2306
2307 /* Look for the ':' that separates the field name from the field
2308 values. Data members are delimited by a single ':', while member
2309 functions are delimited by a pair of ':'s. When we hit the member
2311 functions (if any), terminate scan loop and return. */
2310 functions (if any), terminate scan loop and return. */
2312
2313 p = strchr (p, ':');
2314 if (p == NULL)
2315 {
2316 bad_stab (orig);
2317 return false;
2318 }
2319

--- 434 unchanged lines hidden (view full) ---

2754 /* Must be g++ version 1. */
2755 context = DEBUG_TYPE_NULL;
2756 }
2757 else
2758 {
2759 /* Figure out from whence this virtual function
2760 came. It may belong to virtual function table of
2761 one of its baseclasses. */
2311
2312 p = strchr (p, ':');
2313 if (p == NULL)
2314 {
2315 bad_stab (orig);
2316 return false;
2317 }
2318

--- 434 unchanged lines hidden (view full) ---

2753 /* Must be g++ version 1. */
2754 context = DEBUG_TYPE_NULL;
2755 }
2756 else
2757 {
2758 /* Figure out from whence this virtual function
2759 came. It may belong to virtual function table of
2760 one of its baseclasses. */
2762 look_ahead_type = parse_stab_type (dhandle, info,
2763 (const char *) NULL,
2764 pp,
2765 (debug_type **) NULL);
2766 if (**pp == ':')
2767 {
2768 /* g++ version 1 overloaded methods. */
2769 context = DEBUG_TYPE_NULL;
2770 }
2771 else
2772 {
2773 context = look_ahead_type;
2774 look_ahead_type = DEBUG_TYPE_NULL;
2775 if (**pp != ';')
2776 {
2777 bad_stab (orig);
2778 return false;
2779 }
2780 ++*pp;
2781 }
2782 }
2761 look_ahead_type = parse_stab_type (dhandle, info,
2762 (const char *) NULL,
2763 pp,
2764 (debug_type **) NULL);
2765 if (**pp == ':')
2766 {
2767 /* g++ version 1 overloaded methods. */
2768 context = DEBUG_TYPE_NULL;
2769 }
2770 else
2771 {
2772 context = look_ahead_type;
2773 look_ahead_type = DEBUG_TYPE_NULL;
2774 if (**pp != ';')
2775 {
2776 bad_stab (orig);
2777 return false;
2778 }
2779 ++*pp;
2780 }
2781 }
2783 break;
2784
2785 case '?':
2786 /* static member function. */
2787 ++*pp;
2788 staticp = true;
2789 voffset = 0;
2790 context = DEBUG_TYPE_NULL;

--- 239 unchanged lines hidden (view full) ---

3030 const char *hold;
3031 int vtypenums[2];
3032
3033 *retvptrbase = DEBUG_TYPE_NULL;
3034 *retownvptr = false;
3035
3036 orig = *pp;
3037
2782 break;
2783
2784 case '?':
2785 /* static member function. */
2786 ++*pp;
2787 staticp = true;
2788 voffset = 0;
2789 context = DEBUG_TYPE_NULL;

--- 239 unchanged lines hidden (view full) ---

3029 const char *hold;
3030 int vtypenums[2];
3031
3032 *retvptrbase = DEBUG_TYPE_NULL;
3033 *retownvptr = false;
3034
3035 orig = *pp;
3036
3038 /* If we are positioned at a ';', then skip it. */
3037 /* If we are positioned at a ';', then skip it. */
3039 if (**pp == ';')
3040 ++*pp;
3041
3042 if (**pp != '~')
3043 return true;
3044
3045 ++*pp;
3046
3047 if (**pp == '=' || **pp == '+' || **pp == '-')
3048 {
3049 /* Obsolete flags that used to indicate the presence of
3038 if (**pp == ';')
3039 ++*pp;
3040
3041 if (**pp != '~')
3042 return true;
3043
3044 ++*pp;
3045
3046 if (**pp == '=' || **pp == '+' || **pp == '-')
3047 {
3048 /* Obsolete flags that used to indicate the presence of
3050 constructors and/or destructors. */
3049 constructors and/or destructors. */
3051 ++*pp;
3052 }
3053
3054 if (**pp != '%')
3055 return true;
3056
3057 ++*pp;
3058

--- 24 unchanged lines hidden (view full) ---

3083 return false;
3084 }
3085
3086 *retvptrbase = vtype;
3087
3088 *pp = p + 1;
3089 }
3090
3050 ++*pp;
3051 }
3052
3053 if (**pp != '%')
3054 return true;
3055
3056 ++*pp;
3057

--- 24 unchanged lines hidden (view full) ---

3082 return false;
3083 }
3084
3085 *retvptrbase = vtype;
3086
3087 *pp = p + 1;
3088 }
3089
3091 return true;
3090 return true;
3092}
3093
3094/* Read a definition of an array type. */
3095
3096static debug_type
3097parse_stab_array_type (dhandle, info, pp, stringp)
3098 PTR dhandle;
3099 struct stab_handle *info;

--- 2101 unchanged lines hidden ---
3091}
3092
3093/* Read a definition of an array type. */
3094
3095static debug_type
3096parse_stab_array_type (dhandle, info, pp, stringp)
3097 PTR dhandle;
3098 struct stab_handle *info;

--- 2101 unchanged lines hidden ---