aboutsummaryrefslogtreecommitdiff
path: root/gdb/partial-stab.h
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2001-06-01 20:37:11 +0000
committerJim Blandy <jimb@codesourcery.com>2001-06-01 20:37:11 +0000
commit531017dfa40f63d3ff26cb80e0962a68eedbbccf (patch)
treec5bc120a880c85df1b8150e7cced595c3beaab65 /gdb/partial-stab.h
parent80643fbcdadad42b26b407c62a37f7148ece8191 (diff)
downloadgdb-531017dfa40f63d3ff26cb80e0962a68eedbbccf.zip
gdb-531017dfa40f63d3ff26cb80e0962a68eedbbccf.tar.gz
gdb-531017dfa40f63d3ff26cb80e0962a68eedbbccf.tar.bz2
* partial-stab.h: New complaint: function_outside_compilation_unit.
(case N_FUN: case 'f':, case N_FUN: case 'F':): If pst is zero, complain, and don't try to set pst's start address.
Diffstat (limited to 'gdb/partial-stab.h')
-rw-r--r--gdb/partial-stab.h39
1 files changed, 31 insertions, 8 deletions
diff --git a/gdb/partial-stab.h b/gdb/partial-stab.h
index fcfb2ef..d6c6fd5 100644
--- a/gdb/partial-stab.h
+++ b/gdb/partial-stab.h
@@ -40,6 +40,9 @@
switch (CUR_SYMBOL_TYPE)
{
+ static struct complaint function_outside_compilation_unit = {
+ "function `%s' appears to be defined outside of all compilation units", 0, 0
+ };
char *p;
/*
* Standard, external, non-debugger, symbols
@@ -576,6 +579,14 @@ switch (CUR_SYMBOL_TYPE)
continue;
case 'f':
+ if (! pst)
+ {
+ int name_len = p - namestring;
+ char *name = xmalloc (name_len + 1);
+ memcpy (name, namestring, name_len);
+ name[name_len] = '\0';
+ complain (&function_outside_compilation_unit, name);
+ }
CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
#ifdef DBXREAD_ONLY
/* Kludges for ELF/STABS with Sun ACC */
@@ -600,10 +611,12 @@ switch (CUR_SYMBOL_TYPE)
the bounds created by N_SO symbols. If that's the case
use the address of this function as the low bound for
the partial symbol table. */
- if (textlow_not_set
- || (pst && CUR_SYMBOL_VALUE < pst->textlow
- && CUR_SYMBOL_VALUE
- != ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile))))
+ if (pst
+ && (textlow_not_set
+ || (CUR_SYMBOL_VALUE < pst->textlow
+ && (CUR_SYMBOL_VALUE
+ != ANOFFSET (objfile->section_offsets,
+ SECT_OFF_TEXT (objfile))))))
{
pst->textlow = CUR_SYMBOL_VALUE;
textlow_not_set = 0;
@@ -620,6 +633,14 @@ switch (CUR_SYMBOL_TYPE)
are put into the global psymtab like one would expect.
They're also in the minimal symbol table. */
case 'F':
+ if (! pst)
+ {
+ int name_len = p - namestring;
+ char *name = xmalloc (name_len + 1);
+ memcpy (name, namestring, name_len);
+ name[name_len] = '\0';
+ complain (&function_outside_compilation_unit, name);
+ }
CUR_SYMBOL_VALUE += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
#ifdef DBXREAD_ONLY
/* Kludges for ELF/STABS with Sun ACC */
@@ -647,10 +668,12 @@ switch (CUR_SYMBOL_TYPE)
the bounds created by N_SO symbols. If that's the case
use the address of this function as the low bound for
the partial symbol table. */
- if (textlow_not_set
- || (pst && CUR_SYMBOL_VALUE < pst->textlow
- && CUR_SYMBOL_VALUE
- != ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile))))
+ if (pst
+ && (textlow_not_set
+ || (CUR_SYMBOL_VALUE < pst->textlow
+ && (CUR_SYMBOL_VALUE
+ != ANOFFSET (objfile->section_offsets,
+ SECT_OFF_TEXT (objfile))))))
{
pst->textlow = CUR_SYMBOL_VALUE;
textlow_not_set = 0;