🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Dirk Grunwald Wed, 17 May 1989 21:43
bug in sdbout.c, sdbout_params
#2005
Author: Dirk Grunwald
Date: Wed, 17 May 1989 21:43
48 lines
1654 bytes
This is w.r.t 1.35

Not certain if this is a gcc or g++ bug.

in sdbout.c, sdbout_parms, there is no check for DECL_NAME(parms) being
null, as is done in dbxout.c, dbxout_parms. The following is a guess
as to what should be done in that case; a higher level blessing is
needed.

This corrects the problem (in g++ at least) of -g0 producing lines such
as
	.def	_^R; .tag etc etc etc

However, there appears to be a remaining problem with, as the Encore assembler
puts it,

Assembler: FOO.s
        aline 392(cline 13): Unbalanced Symbol Table Entries-Too Many Scope Ends

which is unrelated to this problem, but still pretty annoying. I couldn't find
the problem from inspecting the files.

----------------------------------------------------------------------

static void
sdbout_parms (parms1)
     tree parms1;
{
  tree type;
  tree parms;

  for (parms = parms1; parms; parms = TREE_CHAIN (parms))
    {
      int current_sym_value = DECL_OFFSET (parms) / BITS_PER_UNIT;

      if (DECL_NAME(parms))
	{
	  PUT_SDB_DEF (IDENTIFIER_POINTER (DECL_NAME (parms)));
	}
      else
	{
	  PUT_SDB_DEF ("$anon");
	}
--
Dirk Grunwald
Univ. of Illinois
grunwald@flute.cs.uiuc.edu
Re: bug in sdbout.c, sdbout_params
#2027
Author: Michael Meissner
Date: Tue, 23 May 1989 15:25
75 lines
2649 bytes
In article <GRUNWALD.89May17164336@flute.cs.uiuc.edu>
grunwald@flute.cs.uiuc.edu (Dirk Grunwald) writes:

| This is w.r.t 1.35
| 
| Not certain if this is a gcc or g++ bug.
| 
| in sdbout.c, sdbout_parms, there is no check for DECL_NAME(parms) being
| null, as is done in dbxout.c, dbxout_parms. The following is a guess
| as to what should be done in that case; a higher level blessing is
| needed.
| 
| This corrects the problem (in g++ at least) of -g0 producing lines such
| as
| 	.def	_^R; .tag etc etc etc

	...

| static void
| sdbout_parms (parms1)
|      tree parms1;
| {
|   tree type;
|   tree parms;
| 
|   for (parms = parms1; parms; parms = TREE_CHAIN (parms))
|     {
|       int current_sym_value = DECL_OFFSET (parms) / BITS_PER_UNIT;
| 
|       if (DECL_NAME(parms))
| 	{
| 	  PUT_SDB_DEF (IDENTIFIER_POINTER (DECL_NAME (parms)));
| 	}
|       else
| 	{
| 	  PUT_SDB_DEF ("$anon");
| 	}

	...

Rather than hard coding the name to '$anon', which might be used by
the programmer if DOLLARS_IN_IDENTIFIERS is used, you might want to
consider using the same logic that creates the .<n>fake names used for
tags.  For example:

static void
sdbout_parms (parms1)
     tree parms1;
{
  tree type;
  tree parms;
  char *name;

  for (parms = parms1; parms; parms = TREE_CHAIN (parms))
    {
      int current_sym_value = DECL_OFFSET (parms) / BITS_PER_UNIT;

      name = IDENTIFIER_POINTER (DECL_NAME (parms));
      if (name == (char *)0 || *name == '\0')
	name = gen_fake_label ();

      PUT_SDB_DEF (name);

	...

By the way, as long as I'm talking about GCC and sdb, I should warn
people that I had problems with `sdbout_reg_parms' generating the
wrong information for parameters passed in registers.  I've fixed the
problem locally, and hope to give the changes back to GNU central
shortly.
--
Michael Meissner, Data General.
Uucp:		...!mcnc!rti!xyzzy!meissner		If compiles were much
Internet:	meissner@dg-rtp.DG.COM			faster, when would we
Old Internet:	meissner%dg-rtp.DG.COM@relay.cs.net	have time for netnews?
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads