Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] sim: avoid TRACE redefine warnings
Date: Mon, 15 Mar 2010 18:35:00 -0000	[thread overview]
Message-ID: <201003151435.17406.vapier@gentoo.org> (raw)
In-Reply-To: <20100315164934.GK3045@adacore.com>

[-- Attachment #1: Type: Text/Plain, Size: 2266 bytes --]

On Monday 15 March 2010 12:49:34 Joel Brobecker wrote:
> > as i mentioned in the first e-mail, "TRACE" is defined on the command
> > line, so any macro named "TRACE" has to be renamed.
> 
> I understood why you had to rename the macro.  The problem is that
> I'm wondering what this macro is supposed to be used for.  It's important
> because I suspect the change that you made might be incorrect, depending
> on the answer to the question above. For instance, I suspect that the
> use of the TRACE macro in that file might be related to
> --enable-sim-traces, and thus renaming TRACE to something else will break
> that.
> 
> That's why, IMO, we need to:
>   - Understand how --enable-sim-traces work to see if it is related
>     to the use of this TRACE macro;
>   - Find out how to properly fix your problem;
> 
> If you want, I can try doing some digging, but I think it's going to be
> a while before I can get to it, which is why I'm giving you as much info
> as I have (I really do not have much sim experience, but apparently we
> are short in reviewers for the sim code).

i'm not sure how the code today could possibly result in working behavior 
regardless of what is done in the autoconf stages.  the sim-traces configure 
option adds -DTRACE=0 or -DTRACE=1 to the command line.  the hw-properties.c 
then defines TRACE() after including everything.  so there is no chance for 
the -DTRACE logic to affect things here -- TRACE is always redefined from a 
0/1 value (or anything else) to a macro that expands into nothing.

if i had to divine intention, this is old code that was forgotten in the 
HW_TRACE() transition and so the correct fix would be:
	- delete the #define TRACE
	- change all TRACE call sites to HW_TRACE
	- change the non-existent "trace_devices" to "me"
this would have the code style match the rest of hw code in common/.

i didnt go this route originally because the sim/ dir is lacking in 
documentation, so i didnt want to break something inadvertently.  i'd rather 
have someone who knows the code ACK the idea.  but if the developer base for 
sim/ is as slim as the documentation, i'll be a bit more bold in my proposals 
based on my recent sim/ work for the Blackfin processor.
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2010-03-15 18:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-14 20:37 Mike Frysinger
2010-03-15  0:35 ` Joel Brobecker
2010-03-15  7:18   ` Mike Frysinger
2010-03-15 16:49     ` Joel Brobecker
2010-03-15 18:35       ` Mike Frysinger [this message]
2010-03-15  0:43 ` Pedro Alves
2010-03-15  7:18   ` Mike Frysinger
2010-03-15 10:53     ` Matt Rice
2010-03-15 13:03     ` Pedro Alves
2010-03-15 18:47 ` [PATCH v2] " Mike Frysinger
2010-03-16 16:06   ` Joel Brobecker
2010-03-22 22:56     ` Doug Evans

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201003151435.17406.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox