Article View: gnu.g++.bug
Article #987Template problem with -g on ISC
From: Dave Daney
Date: Wed, 07 Oct 1992 03:21
Date: Wed, 07 Oct 1992 03:21
42 lines
1905 bytes
1905 bytes
Some one on this group had the same problem I did. I am reposting my patch
here because I can't remember their address.
The Problem:
gcc-2.2.2 running on Interactive Unix 2.2.1 (Sysv/386 R3.2) compiling
c++ with templates creates illegal assembler code with -g option.
Here is an example of the problem, the assembler does not like the '<,'
or the '>'.
.def tree_element<int>; .scl 10; .type 010;\
.size 28; .endef
My solution:
I changed it to this:
.def tree_element_int_; .scl 10; .type 010;\
.size 28; .endef
It might make some things look a bit strange in gdb, not sure about
this though.
I put this in i386isc.h, but I think perhaps att386.h is where it should
go.
/*----------------------------------------------------------*/
/* Assembler does not like '<' or '>' in labels (from template's
in c++) so we change them to '_'. */
#undef ASM_OUTPUT_LABELREF
#define ASM_OUTPUT_LABELREF(FILE,NAME) \
do{ \
char *p = &((NAME)[0]); \
while(*p) \
{ \
if('<' == *p || '>' == *p) \
putc('_', (FILE)); \
else \
putc(*p, (FILE)); \
p++; \
} \
} while(0)
/*----------------------------------------------------------*/
Dave Daney daney@mermaid.micro.umn.edu
Technical Details
Message-ID:
<199210071321.AA02086@mermaid.micro.umn.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!mermaid.micro.umn.edu!daneyShow Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug Path: arc1-ca.pugleaf.net!sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!mermaid.micro.umn.edu!daney From: daney@mermaid.micro.umn.edu (Dave Daney) Subject: Template problem with -g on ISC Message-ID: <199210071321.AA02086@mermaid.micro.umn.edu> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Wed, 7 Oct 1992 03:21:40 GMT Approved: bug-g++@prep.ai.mit.edu Lines: 43