aboutsummaryrefslogtreecommitdiff
path: root/gdb/buildsym.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-09-21 17:41:45 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-09-21 17:41:45 +0000
commit8b05f64a705ca54f13007fb08912aef4ced6fc79 (patch)
tree825d364462c641a56b46aa40984f0148911baaa7 /gdb/buildsym.c
parentb342eba6cd2d8c3fd33fdc8668ed8bcb4066723a (diff)
downloadgdb-8b05f64a705ca54f13007fb08912aef4ced6fc79.zip
gdb-8b05f64a705ca54f13007fb08912aef4ced6fc79.tar.gz
gdb-8b05f64a705ca54f13007fb08912aef4ced6fc79.tar.bz2
* symfile.c (deduce_language_from_filename): Accept .cxx for C++.
* buildsym.c (start_subfile): Use deduce_language_from_filename rather than checking for .C or .cc ourself.
Diffstat (limited to 'gdb/buildsym.c')
-rw-r--r--gdb/buildsym.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index e8804cb..5a762af 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -422,18 +422,15 @@ start_subfile (name, dirname)
directives which specify a file name ending in .C.
So if the filename of this subfile ends in .C, then change the language
- of any pending subfiles from C to C++. .cc is also accepted, even
- though I don't think cfront allows it. */
+ of any pending subfiles from C to C++. We also accept any other C++
+ suffixes accepted by deduce_language_from_filename (in particular,
+ some people use .cxx with cfront). */
if (subfile->name)
{
- char *p;
struct subfile *s;
- p = strrchr (subfile->name, '.');
- if (p != NULL
- && ((p[1] == 'C' && p[2] == '\0')
- || (p[1] == 'c' && p[2] == 'c' && p[3] == '\0')))
+ if (deduce_language_from_filename (subfile->name) == language_cplus)
for (s = subfiles; s != NULL; s = s->next)
if (s->language == language_c)
s->language = language_cplus;