All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: pahole displays type incorrectly
       [not found]   ` <20090817154228.GI12303-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
@ 2009-09-10 20:35     ` Arnaldo Carvalho de Melo
       [not found]       ` <20090910222256.GB2289@ghostprotocols.net>
       [not found]       ` <20090910203517.GA2289-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
  0 siblings, 2 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2009-09-10 20:35 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: dwarves-u79uwXL29TY76Z2rM5mHXA

Em Mon, Aug 17, 2009 at 12:42:28PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Mon, Aug 17, 2009 at 04:12:25PM +0200, Jan Engelhardt escreveu:
> > Hi,
> > 
> > 
> > given the following struct:
> > 
> >   struct x {
> >   	const char *const s;
> >   };
> > 
> > pahole will display it as:
> > 
> >   struct x {
> >         const const char *s; /* .. */
> >   };
> > 
> > And that is not quite right. The sparse(1) tool would say "how much more 
> > const do you want it to be?" :)
> > I used pahole.git commit f0435286c0b.
> 
> pahole is not properly handling that case at the moment, the DWARF chain
> is:
> 
> [acme@doppio pahole]$ readelf -wi object_samples/jengelh\@medozas.de/const_const
> <SNIP>
>  <1><2d>: Abbrev Number: 2 (DW_TAG_structure_type)
>     <2e>   DW_AT_name        : x        
>     <30>   DW_AT_byte_size   : 8        
>     <31>   DW_AT_decl_file   : 1        
>     <32>   DW_AT_decl_line   : 1        
>     <33>   DW_AT_sibling     : <0x44>   
>  <2><37>: Abbrev Number: 3 (DW_TAG_member)
>     <38>   DW_AT_name        : s        
>     <3a>   DW_AT_decl_file   : 1        
>     <3b>   DW_AT_decl_line   : 2        
>     <3c>   DW_AT_type        : <0x44>   
>     <40>   DW_AT_data_member_location: 2 byte block: 23 0
> (DW_OP_plus_uconst: 0)
>  <1><44>: Abbrev Number: 4 (DW_TAG_const_type)
>     <45>   DW_AT_type        : <0x49>   
>  <1><49>: Abbrev Number: 5 (DW_TAG_pointer_type)
>     <4a>   DW_AT_byte_size   : 8        
>     <4b>   DW_AT_type        : <0x4f>   
>  <1><4f>: Abbrev Number: 4 (DW_TAG_const_type)
>     <50>   DW_AT_type        : <0x54>   
>  <1><54>: Abbrev Number: 6 (DW_TAG_base_type)
>     <55>   DW_AT_byte_size   : 1        
>     <56>   DW_AT_encoding    : 6        (signed char)
>     <57>   DW_AT_name        : (indirect string, offset: 0x72): char    
> 
> <SNIP>
> 
> So if we find a const at the start of the chain, we must render it
> first, then the type, but if we find it inside the chain, it has to be
> rendered at the end of the chain... I'm reworking the code that
> recursively traverses the chain to fix this, but I'm being sidetracked
> with some other work, stay tuned and I'll get this fixed today
> 
> Thanks for the report!

Sorry for the delay, should be fixed by the latest commit, please give
it a try!

http://git.kernel.org/?p=linux/kernel/git/acme/pahole.git;a=commitdiff;h=846927a3f87f730e0ae201b5f0b3b46212a7bb8e

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe dwarves" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: pahole displays type incorrectly
       [not found]         ` <20090910222256.GB2289-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
@ 2009-09-11  4:54           ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2009-09-11  4:54 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: dwarves-u79uwXL29TY76Z2rM5mHXA

Em Thu, Sep 10, 2009 at 07:22:56PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Thu, Sep 10, 2009 at 05:35:17PM -0300, Arnaldo Carvalho de Melo escreveu:
> > > So if we find a const at the start of the chain, we must render it
> > > first, then the type, but if we find it inside the chain, it has to be
> > > rendered at the end of the chain... I'm reworking the code that
> > > recursively traverses the chain to fix this, but I'm being sidetracked
> > > with some other work, stay tuned and I'll get this fixed today
> > > 
> > > Thanks for the report!
> > 
> > Sorry for the delay, should be fixed by the latest commit, please give
> > it a try!
> > 
> > http://git.kernel.org/?p=linux/kernel/git/acme/pahole.git;a=commitdiff;h=846927a3f87f730e0ae201b5f0b3b46212a7bb8e
> 
> Bogus patch, right fix should come soon.

Please do a git pull and see if it now works properly.

Thanks,

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe dwarves" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: pahole displays type incorrectly
       [not found]       ` <20090910203517.GA2289-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
@ 2009-09-12  1:41         ` Jan Engelhardt
       [not found]           ` <alpine.LSU.2.00.0909120340020.444-SHaQjdQMGhDmsUXKMKRlFA@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Engelhardt @ 2009-09-12  1:41 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: dwarves-u79uwXL29TY76Z2rM5mHXA


On Thursday 2009-09-10 22:35, Arnaldo Carvalho de Melo wrote:
>
>Sorry for the delay, should be fixed by the latest commit, please give
>it a try!
>
>http://git.kernel.org/?p=linux/kernel/git/acme/pahole.git;a=commitdiff;h=846927a3f87f730e0ae201b5f0b3b46212a7bb8e

Yes it does work. The testcase seems to be reducable to just the
struct without a function, but still with a non-static definition
(instance) of the struct. I.e. on the file level:

struct foo {
	const char *const z;
};
struct foo x;
--
To unsubscribe from this list: send the line "unsubscribe dwarves" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: pahole displays type incorrectly
       [not found]           ` <alpine.LSU.2.00.0909120340020.444-SHaQjdQMGhDmsUXKMKRlFA@public.gmane.org>
@ 2009-09-12 13:24             ` Arnaldo Carvalho de Melo
       [not found]               ` <20090912132405.GB3545-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2009-09-12 13:24 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: dwarves-u79uwXL29TY76Z2rM5mHXA

Em Sat, Sep 12, 2009 at 03:41:56AM +0200, Jan Engelhardt escreveu:
> 
> On Thursday 2009-09-10 22:35, Arnaldo Carvalho de Melo wrote:
> >
> >Sorry for the delay, should be fixed by the latest commit, please give
> >it a try!
> >
> >http://git.kernel.org/?p=linux/kernel/git/acme/pahole.git;a=commitdiff;h=846927a3f87f730e0ae201b5f0b3b46212a7bb8e
> 
> Yes it does work. The testcase seems to be reducable to just the
> struct without a function, but still with a non-static definition
> (instance) of the struct. I.e. on the file level:
> 
> struct foo {
> 	const char *const z;
> };
> struct foo x;

Thanks for testing! I'll update the test case to reduce it.

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe dwarves" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: pahole displays type incorrectly
       [not found]               ` <20090912132405.GB3545-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
@ 2009-09-12 14:49                 ` Arnaldo Carvalho de Melo
       [not found]                   ` <20090912144939.GA14242-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2009-09-12 14:49 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: dwarves-u79uwXL29TY76Z2rM5mHXA

Em Sat, Sep 12, 2009 at 10:24:05AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Sat, Sep 12, 2009 at 03:41:56AM +0200, Jan Engelhardt escreveu:
> > 
> > On Thursday 2009-09-10 22:35, Arnaldo Carvalho de Melo wrote:
> > >
> > >Sorry for the delay, should be fixed by the latest commit, please give
> > >it a try!
> > >
> > >http://git.kernel.org/?p=linux/kernel/git/acme/pahole.git;a=commitdiff;h=846927a3f87f730e0ae201b5f0b3b46212a7bb8e
> > 
> > Yes it does work. The testcase seems to be reducable to just the
> > struct without a function, but still with a non-static definition
> > (instance) of the struct. I.e. on the file level:
> > 
> > struct foo {
> > 	const char *const z;
> > };
> > struct foo x;
> 
> Thanks for testing! I'll update the test case to reduce it.

While running regtest I noticed it is still buggy :-\ It works when you
have a "const char *const x"  case, but reverses both "const char *x"
and "char *const x", but now parents are visiting, time to go AFK :-)

If anybody feels like looking at the latest commits to see how it
should't be done and comes with a patch, I'd appreciate 8-)

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe dwarves" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: pahole displays type incorrectly
       [not found]                   ` <20090912144939.GA14242-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
@ 2009-09-12 22:47                     ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2009-09-12 22:47 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: dwarves-u79uwXL29TY76Z2rM5mHXA

Em Sat, Sep 12, 2009 at 11:49:39AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Sat, Sep 12, 2009 at 10:24:05AM -0300, Arnaldo Carvalho de Melo escreveu:
> > Em Sat, Sep 12, 2009 at 03:41:56AM +0200, Jan Engelhardt escreveu:
> > > 
> > > On Thursday 2009-09-10 22:35, Arnaldo Carvalho de Melo wrote:
> > > >
> > > >Sorry for the delay, should be fixed by the latest commit, please give
> > > >it a try!
> > > >
> > > >http://git.kernel.org/?p=linux/kernel/git/acme/pahole.git;a=commitdiff;h=846927a3f87f730e0ae201b5f0b3b46212a7bb8e
> > > 
> > > Yes it does work. The testcase seems to be reducable to just the
> > > struct without a function, but still with a non-static definition
> > > (instance) of the struct. I.e. on the file level:
> > > 
> > > struct foo {
> > > 	const char *const z;
> > > };
> > > struct foo x;
> > 
> > Thanks for testing! I'll update the test case to reduce it.
> 
> While running regtest I noticed it is still buggy :-\ It works when you
> have a "const char *const x"  case, but reverses both "const char *x"
> and "char *const x", but now parents are visiting, time to go AFK :-)
> 
> If anybody feels like looking at the latest commits to see how it
> should't be done and comes with a patch, I'd appreciate 8-)

Should be ok now. See lest cset, with test cases for:

const char *x;
char *const x;
const char *const x;

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe dwarves" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2009-09-12 22:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <alpine.LSU.2.00.0908171610490.31821@fbirervta.pbzchgretzou.qr>
     [not found] ` <20090817154228.GI12303@ghostprotocols.net>
     [not found]   ` <20090817154228.GI12303-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2009-09-10 20:35     ` pahole displays type incorrectly Arnaldo Carvalho de Melo
     [not found]       ` <20090910222256.GB2289@ghostprotocols.net>
     [not found]         ` <20090910222256.GB2289-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2009-09-11  4:54           ` Arnaldo Carvalho de Melo
     [not found]       ` <20090910203517.GA2289-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2009-09-12  1:41         ` Jan Engelhardt
     [not found]           ` <alpine.LSU.2.00.0909120340020.444-SHaQjdQMGhDmsUXKMKRlFA@public.gmane.org>
2009-09-12 13:24             ` Arnaldo Carvalho de Melo
     [not found]               ` <20090912132405.GB3545-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2009-09-12 14:49                 ` Arnaldo Carvalho de Melo
     [not found]                   ` <20090912144939.GA14242-f8uhVLnGfZaxAyOMLChx1axOck334EZe@public.gmane.org>
2009-09-12 22:47                     ` Arnaldo Carvalho de Melo

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.