aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorLuis Machado <luisgpm@br.ibm.com>2008-06-30 13:52:07 +0000
committerLuis Machado <luisgpm@br.ibm.com>2008-06-30 13:52:07 +0000
commit8340a3fbbe6c254754ef20aeb47125af2a1d5d86 (patch)
tree7ae6ead77b7d6d5368779308c99689b06440f9be /gdb
parentcfefc99a49d523d84da7292a1221a96c130cf614 (diff)
downloadgdb-8340a3fbbe6c254754ef20aeb47125af2a1d5d86.zip
gdb-8340a3fbbe6c254754ef20aeb47125af2a1d5d86.tar.gz
gdb-8340a3fbbe6c254754ef20aeb47125af2a1d5d86.tar.bz2
* source.c (select_source_symtab): Make sure we skip namespace
symtabs when showing cpp source code.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/source.c11
2 files changed, 12 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 32e09ac..cea722e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2008-06-30 Luis Machado <luisgpm@br.ibm.com>
+
+ * source.c (select_source_symtab): Make sure we skip namespace
+ symtabs when showing cpp source code.
+
2008-06-30 Hans-Peter Nilsson <hp@axis.com>
* MAINTAINERS (Authorized committers): Fix my email address.
diff --git a/gdb/source.c b/gdb/source.c
index fc5fe0b..e0ae0b1 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -250,7 +250,8 @@ select_source_symtab (struct symtab *s)
return;
}
- /* All right; find the last file in the symtab list (ignoring .h's). */
+ /* Alright; find the last file in the symtab list (ignoring .h's
+ and namespace symtabs). */
current_source_line = 1;
@@ -260,14 +261,15 @@ select_source_symtab (struct symtab *s)
{
const char *name = s->filename;
int len = strlen (name);
- if (!(len > 2 && strcmp(&name[len - 2], ".h") == 0))
+ if (!(len > 2 && (strcmp (&name[len - 2], ".h") == 0
+ || strcmp (name, "<<C++-namespaces>>") == 0)))
current_source_symtab = s;
}
}
if (current_source_symtab)
return;
- /* Howabout the partial symbol tables? */
+ /* How about the partial symbol tables? */
for (ofp = object_files; ofp != NULL; ofp = ofp->next)
{
@@ -275,7 +277,8 @@ select_source_symtab (struct symtab *s)
{
const char *name = ps->filename;
int len = strlen (name);
- if (!(len > 2 && strcmp (&name[len - 2], ".h") == 0))
+ if (!(len > 2 && (strcmp (&name[len - 2], ".h") == 0
+ || strcmp (name, "<<C++-namespaces>>") == 0)))
cs_pst = ps;
}
}