public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* debug strings output order is arbitrary
@ 2014-03-16  2:58 Martin Uecker
  2014-03-17  8:44 ` Richard Biener
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Uecker @ 2014-03-16  2:58 UTC (permalink / raw)
  To: gcc


Hi list,

the strings in the ".debug_str" section are output
in an arbitrary order. Could this be changed?

The function 'output_indirect_strings' in 'gcc/dwarf2out.c'
uses htab_traverse which then outputs the string in the
order they appear in the hash table. Instead, it would
be nicer to output them based on their labels (which are
assigned based on the order of creation).

This would minimize differences between builds with
slightly different build environments, e.g. directory.

Martin



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: debug strings output order is arbitrary
  2014-03-16  2:58 debug strings output order is arbitrary Martin Uecker
@ 2014-03-17  8:44 ` Richard Biener
  2014-03-17 21:01   ` Martin Uecker
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Biener @ 2014-03-17  8:44 UTC (permalink / raw)
  To: Martin Uecker; +Cc: GCC Development

On Sun, Mar 16, 2014 at 3:58 AM, Martin Uecker <uecker@eecs.berkeley.edu> wrote:
>
> Hi list,
>
> the strings in the ".debug_str" section are output
> in an arbitrary order. Could this be changed?
>
> The function 'output_indirect_strings' in 'gcc/dwarf2out.c'
> uses htab_traverse which then outputs the string in the
> order they appear in the hash table. Instead, it would
> be nicer to output them based on their labels (which are
> assigned based on the order of creation).
>
> This would minimize differences between builds with
> slightly different build environments, e.g. directory.

Can you propose a patch?  Note that at creation time only
the string itself is known, so sorting after the string may
be another possibility.

Richard.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: debug strings output order is arbitrary
  2014-03-17  8:44 ` Richard Biener
@ 2014-03-17 21:01   ` Martin Uecker
  2014-03-18  9:04     ` Richard Biener
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Uecker @ 2014-03-17 21:01 UTC (permalink / raw)
  To: Richard Biener; +Cc: GCC Development

Am Mon, 17 Mar 2014 09:44:53 +0100
schrieb Richard Biener <richard.guenther@gmail.com>:

> On Sun, Mar 16, 2014 at 3:58 AM, Martin Uecker <uecker@eecs.berkeley.edu> wrote:
> >
> > Hi list,
> >
> > the strings in the ".debug_str" section are output
> > in an arbitrary order. Could this be changed?
> >
> > The function 'output_indirect_strings' in 'gcc/dwarf2out.c'
> > uses htab_traverse which then outputs the string in the
> > order they appear in the hash table. Instead, it would
> > be nicer to output them based on their labels (which are
> > assigned based on the order of creation).
> >
> > This would minimize differences between builds with
> > slightly different build environments, e.g. directory.
> 
> Can you propose a patch?  Note that at creation time only
> the string itself is known, so sorting after the string may
> be another possibility.

I will propose a patch.

Sorting at the end would be easiest, but one could also keep
track of the order. Is this performance critical?

Also it seems there is other stuff which is output/indexed
in hash table order, maybe this should be changed to.

Martin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: debug strings output order is arbitrary
  2014-03-17 21:01   ` Martin Uecker
@ 2014-03-18  9:04     ` Richard Biener
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Biener @ 2014-03-18  9:04 UTC (permalink / raw)
  To: Martin Uecker; +Cc: GCC Development

On Mon, Mar 17, 2014 at 10:01 PM, Martin Uecker
<uecker@eecs.berkeley.edu> wrote:
> Am Mon, 17 Mar 2014 09:44:53 +0100
> schrieb Richard Biener <richard.guenther@gmail.com>:
>
>> On Sun, Mar 16, 2014 at 3:58 AM, Martin Uecker <uecker@eecs.berkeley.edu> wrote:
>> >
>> > Hi list,
>> >
>> > the strings in the ".debug_str" section are output
>> > in an arbitrary order. Could this be changed?
>> >
>> > The function 'output_indirect_strings' in 'gcc/dwarf2out.c'
>> > uses htab_traverse which then outputs the string in the
>> > order they appear in the hash table. Instead, it would
>> > be nicer to output them based on their labels (which are
>> > assigned based on the order of creation).
>> >
>> > This would minimize differences between builds with
>> > slightly different build environments, e.g. directory.
>>
>> Can you propose a patch?  Note that at creation time only
>> the string itself is known, so sorting after the string may
>> be another possibility.
>
> I will propose a patch.
>
> Sorting at the end would be easiest, but one could also keep
> track of the order. Is this performance critical?

Sure it is.

> Also it seems there is other stuff which is output/indexed
> in hash table order, maybe this should be changed to.

Maybe.

Richard.

> Martin
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-03-18  9:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-16  2:58 debug strings output order is arbitrary Martin Uecker
2014-03-17  8:44 ` Richard Biener
2014-03-17 21:01   ` Martin Uecker
2014-03-18  9:04     ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).