/* stabs.c -- Parse stabs debugging information
- Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com>.
#include "debug.h"
#include "budbg.h"
#include "filenames.h"
-
-/* Meaningless definition needs by aout64.h. FIXME. */
-#define BYTES_IN_WORD 4
-
#include "aout/aout64.h"
#include "aout/stab_gnu.h"
static debug_type parse_stab_enum_type
PARAMS ((PTR, const char **));
static debug_type parse_stab_struct_type
- PARAMS ((PTR, struct stab_handle *, const char *, const char **, bfd_boolean,
- const int *));
+ PARAMS ((PTR, struct stab_handle *, const char *, const char **,
+ bfd_boolean, const int *));
static bfd_boolean parse_stab_baseclasses
PARAMS ((PTR, struct stab_handle *, const char **, debug_baseclass **));
static bfd_boolean parse_stab_struct_fields
PARAMS ((PTR, struct stab_handle *, const char *, int,
enum debug_type_kind));
static debug_type *stab_demangle_argtypes
- PARAMS ((PTR, struct stab_handle *, const char *, bfd_boolean *, unsigned int));
+ PARAMS ((PTR, struct stab_handle *, const char *, bfd_boolean *,
+ unsigned int));
/* Save a string in memory. */
/* Note that even though strtoul overflowed, it should have set *pp
to the end of the number, which is where we want it. */
-
if (sizeof (bfd_vma) > sizeof (unsigned long))
{
const char *p;
bfd_vma v;
/* Our own version of strtoul, for a bfd_vma. */
-
p = orig;
neg = FALSE;
/* If we get here, the number is too large to represent in a
bfd_vma. */
-
if (poverflow != NULL)
*poverflow = TRUE;
else
case N_SLINE:
if (! debug_record_line (dhandle, desc,
- value + info->function_start_offset))
+ value + (info->within_function
+ ? info->function_start_offset : 0)))
return FALSE;
break;
address on a big endian machine if it is smaller than an int.
We have no way to do that, since we don't really know much
about the target. */
-
break;
case 'P':
/* FIXME: At this point gdb checks to combine pairs of 'p' and
'r' stabs into a single 'P' stab. */
-
break;
case 'S':
- /* Static symbol at top level of file */
+ /* Static symbol at top level of file. */
dtype = parse_stab_type (dhandle, info, (const char *) NULL, &p,
(debug_type **) NULL);
if (dtype == DEBUG_TYPE_NULL)
return DEBUG_TYPE_NULL;
if (**pp != '=')
- {
- /* Type is not being defined here. Either it already
- exists, or this is a forward reference to it. */
- return stab_find_type (dhandle, info, typenums);
- }
+ /* Type is not being defined here. Either it already
+ exists, or this is a forward reference to it. */
+ return stab_find_type (dhandle, info, typenums);
/* Only set the slot if the type is being defined. This means
that the mapping from type numbers to types will only record
const char *attr;
if (ISDIGIT (*p) || *p == '(' || *p == '-')
- {
- /* Member type. */
- break;
- }
+ /* Member type. */
+ break;
/* Type attributes. */
attr = p;
const char *q1, *q2, *p;
/* A cross reference to another type. */
-
switch (**pp)
{
case 's':
int xtypenums[2];
/* This type is defined as another type. */
-
(*pp)--;
hold = *pp;
{
/* gcc will emit range stabs for long long types. Handle this
as a special case. FIXME: This needs to be more general. */
-#define LLLOW "01000000000000000000000;"
-#define LLHIGH "0777777777777777777777;"
+#define LLLOW "01000000000000000000000;"
+#define LLHIGH "0777777777777777777777;"
#define ULLHIGH "01777777777777777777777;"
if (index_type == DEBUG_TYPE_NULL)
{