diff options
author | Dale Johannesen <dalej@apple.com> | 2002-08-06 23:36:22 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@gcc.gnu.org> | 2002-08-06 23:36:22 +0000 |
commit | 8d3e27d16b03f8d0ac468366502e4672188eabd9 (patch) | |
tree | 3ecabcec22dac5b68ecff720a8e42a6ed6a73862 /gcc | |
parent | 8b219a762a962a9776603018672c9a6cdaf95a2d (diff) | |
download | gcc-8d3e27d16b03f8d0ac468366502e4672188eabd9.zip gcc-8d3e27d16b03f8d0ac468366502e4672188eabd9.tar.gz gcc-8d3e27d16b03f8d0ac468366502e4672188eabd9.tar.bz2 |
Mark __func__ with line number 0, to avoid confusing debuggers.
From-SVN: r56081
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/c-common.c | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3cd7f55..2e3a9b8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2002-08-06 Dale Johannesen <dalej@apple.com> + * c-common.c (fname_decl): Use line number 0 for + __func__, to avoid confusing debuggers. + 2002-08-06 Nathan Sidwell <nathan@codesourcery.com> * gcov.c: Tidy. diff --git a/gcc/c-common.c b/gcc/c-common.c index 363e72f..fabc181 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -1102,6 +1102,13 @@ fname_decl (rid, id) if (!decl) { tree saved_last_tree = last_tree; + /* If a tree is built here, it would normally have the lineno of + the current statement. Later this tree will be moved to the + beginning of the function and this line number will be wrong. + To avoid this problem set the lineno to 0 here; that prevents + it from appearing in the RTL. */ + int saved_lineno = lineno; + lineno = 0; decl = (*make_fname_decl) (id, fname_vars[ix].pretty); if (last_tree != saved_last_tree) @@ -1117,6 +1124,7 @@ fname_decl (rid, id) saved_function_name_decls); } *fname_vars[ix].decl = decl; + lineno = saved_lineno; } if (!ix && !current_function_decl) pedwarn_with_decl (decl, "`%s' is not defined outside of function scope"); |