Re: [PATCH] Listing cpp source code in mainless binaries

Daniel Jacobowitz
2008-06-26T14:18:23Z

On Tue, Jun 10, 2008 at 03:28:45PM -0300, Luis Machado wrote:
> - /* All right; find the last file in the symtab list (ignoring .h's). */
> + /* All right; find the last file in the symtab list (ignoring .h's)
> + and namespace symtabs. */

That should be inside the parentheses :-)

> @@ -260,7 +261,8 @@
> {
> 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;
> }
> }
>

Also, the same check is needed a few lines down. Otherwise OK.

--
Daniel Jacobowitz
CodeSourcery