From: Jim Meyering <jim@meyering.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/9] tcg: declare __jit_debug_descriptor to be static
Date: Tue, 22 May 2012 12:26:54 +0200 [thread overview]
Message-ID: <87r4ucik9d.fsf@rho.meyering.net> (raw)
In-Reply-To: <CAFEAcA-L1YpJDELsJrKxqY-ZqdV=dyZbijBdpV=7kO7wD5fYOg@mail.gmail.com> (Peter Maydell's message of "Mon, 21 May 2012 21:31:31 +0100")
Peter Maydell wrote:
> On 21 May 2012 21:10, Jim Meyering <jim@meyering.net> wrote:
>> Peter Maydell wrote:
>>> On 21 May 2012 20:51, Jim Meyering <jim@meyering.net> wrote:
>>>> From: Jim Meyering <meyering@redhat.com>
>>>>
>>>>
>>>> Signed-off-by: Jim Meyering <meyering@redhat.com>
>>>> ---
>>>> tcg/tcg.c | 2 +-
>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/tcg/tcg.c b/tcg/tcg.c
>>>> index ab589c7..350fdad 100644
>>>> --- a/tcg/tcg.c
>>>> +++ b/tcg/tcg.c
>>>> @@ -2293,7 +2293,7 @@ void __jit_debug_register_code(void)
>>>>
>>>> /* Must statically initialize the version, because GDB may check
>>>> the version before we can set it. */
>>>> -struct jit_descriptor __jit_debug_descriptor = { 1, 0, 0, 0 };
>>>> +static struct jit_descriptor __jit_debug_descriptor = { 1, 0, 0, 0 };
>>>>
>>>> /* End GDB interface. */
>>>
>>> Nak. This symbol is global so that gdb can find it by fishing around
>>> in the executable's symbol table.
>>
>> Thanks for the quick feedback.
>>
>> How does the scope of the symbol affect whether gdb can find it?
>
> If you mark it 'static' the compiler can throw it away or completely
> rearrange it if it's feeling clever enough, I think.
>
> Anyway, we're following a prescribed interface here:
> http://sourceware.org/gdb/onlinedocs/gdb/Declarations.html
>
> and I don't think we should deviate from it. As the comment says,
> "THE FOLLOWING MUST MATCH GDB DOCS.".
>
>> If declaring this variable "static" is not appropriate,
>> then the comment saying that static initialization is desired
>> should be changed.
>
> The comment means "statically initialize this variable rather than
> doing it dynamically in some function at startup".
Thanks. I've clarified the comments and posted a V2.
next prev parent reply other threads:[~2012-05-22 10:27 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-21 19:51 [Qemu-devel] [PATCH 0/9] convert many more globals to "static" Jim Meyering
2012-05-21 19:51 ` [Qemu-devel] [PATCH 1/9] ccid: declare DEFAULT_ATR table to be "static const" Jim Meyering
2012-05-21 19:51 ` Jim Meyering
2012-05-21 19:51 ` [Qemu-devel] [PATCH 2/9] tcg: declare __jit_debug_descriptor to be static Jim Meyering
2012-05-21 19:51 ` Jim Meyering
2012-05-21 19:58 ` Peter Maydell
2012-05-21 20:10 ` Jim Meyering
2012-05-21 20:31 ` Peter Maydell
2012-05-22 10:26 ` Jim Meyering [this message]
2012-05-21 19:51 ` [Qemu-devel] [PATCH 3/9] alpha-dis: remove unused global; declare others " Jim Meyering
2012-05-21 19:56 ` Jim Meyering
2012-05-21 19:56 ` [Qemu-devel] [PATCH 4/9] linux-user: arg_table need not have global scope Jim Meyering
2012-05-21 19:56 ` [Qemu-devel] [PATCH 5/9] ccid: make backend_enum_table "static const" and adjust users Jim Meyering
2012-05-21 19:56 ` [Qemu-devel] [PATCH 6/9] sheepdog: declare bdrv_sheepdog to be static Jim Meyering
2012-05-21 19:56 ` [Qemu-devel] [PATCH 7/9] mips-dis: declare four globals to be "static" Jim Meyering
2012-05-21 19:56 ` [Qemu-devel] [PATCH 8/9] bonito: declare bonito_state to be static Jim Meyering
2012-05-21 19:56 ` [PATCH 9/9] convert many more globals to static Jim Meyering
2012-05-21 19:56 ` [Qemu-devel] " Jim Meyering
2012-08-17 13:37 ` [Qemu-devel] [PATCH 0/9] convert many more globals to "static" Jim Meyering
2012-08-17 13:45 ` Stefan Weil
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=87r4ucik9d.fsf@rho.meyering.net \
--to=jim@meyering.net \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.