Re: Latest version of dwarflint?

2017-09-21 Thread Djordje Todorovic

Hi All,

I have managed to integrate dwarflint on the top of elfutils-0.170 release, so dwarflint and locstats can use all conveniences and improvements of the newest libdw library (such as 
handling ops like DW_OP_GNU_entry_value).


It is used internally by our compiler team. I have also managed to add some new enhancements for locstats, such as reporting summary either for formal parameter or local variable, 
reporting some kind of verbose info about particular variable or formal parameter of particular function.
But, beside these enhancements that were interested for our compiler team, dwarflint and locstats have a lot of good utilities that can be really useful to compiler developers. For 
example, dwarflint tool can detect mistakes in debug sections such as debug info, debug line etc., and help compiler developers to get rid of those mistakes. Locstats can 
apparently report useful summary and show progress of making better coverage for local variables or formal parameter in debug sections, so it can save a lot of time to compiler 
developers.


At least, maybe considering a making new branch called „dwarflint“ on elfuitls git repository, which follows the newest source code, would be good for the beginning, the same as it 
was on elfutils-0.152? Because, getting more feedback from users, these tools would be better and more useful, so it can be, one day, merged on to master branch.


If you are interested, I can share my patches.

Best regards,
Djordje Todorovic

On 21.09.2017. 17:59, Ananthakrishna Sowda (asowda) wrote:

Any interest in seeing some patches which upgrade dwarflint to latest 
elfutils-0.170?Djordje Todorovic  has more details about the patches.
Thanks,
Ananth

On 8/3/17, 2:13 AM, "Mark Wielaard"  wrote:

 On Wed, 2017-08-02 at 19:47 +, Ananthakrishna Sowda (asowda) wrote:
 > I found the dwarflint and locstats tools in the ‘dwarf ‘ branch of 
elfutils.
 >https://sourceware.org/elfutils/DwarfLint
 > Any plans of merging this into main branch?
 
 Currently not, sorry.
 
 > I get following error from locstats:

 >
 > error: .debug_info: DIE 0x3f10fc: dwarf_getlocation_addr: invalid DWARF
 >
 > This error is reported on DW_OP_GNU_entry_value in DWARF location list. 
Any newer version of these tools which can handle DWARF5 ops such as 
DW_OP_GNU_entry-value?
 
 There is a standalone version of dwlocstat here:

 https://github.com/pmachata/dwlocstat
 
 It should handle DW_OP_GNU_entry_value but is also a bit old so might

 not handle the latest DWARF extensions.
 
 Cheers,
 
 Mark
 



Re: Latest version of dwarflint?

2017-09-22 Thread Djordje Todorovic
Hi Mark,

Thank you for your comments!

>Could you take a look at the CONTRIBUTING file?
Sure.

How should I send this patches? Should I wait for you to make a new "dwarflint" 
branch which follows master branch or?

Thanks,
Djordje

 Original Message 
Subject: Re: Latest version of dwarflint?
Date: Thursday, September 21, 2017 21:00 CEST
From: Mark Wielaard 
To: Djordje Todorovic , "Ananthakrishna Sowda  
(asowda)" 
CC: "elfutils-devel@sourceware.org" 
References: <81113170-f590-4c51-bea0-c8ef3a442...@contoso.com>   
<1501751620.3741.132.ca...@klomp.org>   
<624331b2-472c-44ad-9034-05ad3cbba...@cisco.com>




> Hi Djordje,
>
> On Thu, 2017-09-21 at 18:07 +0200, Djordje Todorovic wrote:
> > I have managed to integrate dwarflint on the top of elfutils-0.170
> > release, so dwarflint and locstats can use all conveniences and
> > improvements of the newest libdw library (such as 
> > handling ops like DW_OP_GNU_entry_value).
>
> Very nice.
>
> > It is used internally by our compiler team. I have also managed to
> > add some new enhancements for locstats, such as reporting summary
> > either for formal parameter or local variable, 
> > reporting some kind of verbose info about particular variable or
> > formal parameter of particular function.
> > But, beside these enhancements that were interested for our compiler
> > team, dwarflint and locstats have a lot of good utilities that can be
> > really useful to compiler developers. For 
> > example, dwarflint tool can detect mistakes in debug sections such as
> > debug info, debug line etc., and help compiler developers to get rid
> > of those mistakes. Locstats can 
> > apparently report useful summary and show progress of making better
> > coverage for local variables or formal parameter in debug sections,
> > so it can save a lot of time to compiler 
> > developers.
>
> Yes, I know some compiler hackers have found it useful. And I was a
> little sad nobody had time to keep dwarflint up to date. It is really
> great to hear you have.
>
> > At least, maybe considering a making new branch called „dwarflint“ on
> > elfuitls git repository, which follows the newest source code, would
> > be good for the beginning, the same as it 
> > was on elfutils-0.152? Because, getting more feedback from users,
> > these tools would be better and more useful, so it can be, one day,
> > merged on to master branch.
> >
> > If you are interested, I can share my patches.
>
> Yes please do share. I cannot promise to have a lot of time reviewing
> the code. But I am certainly interested. Creating a public "dwarflint"
> branch sounds like a good idea.
>
> Could you take a look at the CONTRIBUTING file? We don't have to be
> very formal for code not directly going onto master. But having at
> least a Signed-off-by line on the patches makes sure we can eventually
> integrate them officially.
>
> Thanks,
>
> Mark





Re: Latest version of dwarflint?

2017-09-26 Thread Djordje Todorovic

> Do you have patches against the origin/dwarf branch that contained the
>original dwarlint? Or against current master (or the 0.170 release)
>branch?
I have patches that can be applied on top of 0.170 release. I have moved dwarflint and libdw/c++ directories from origin/dwarf branch and then add support in configure and 
makefiles to build it successfully. After that I made some fixes and improvements of the utilities.


> If you have them in a git branch and it is easy to extract them
>then using git send-email to this list would probably be easiest. Then
>we can create a new branch as base to apply them on top.

Yes, I have git branch, but these patches are pretty cumulative and I’m 
breaking up them into more logical pieces, so it would be easier for 
maintaining. I will be back in a few days.

Thanks,
Djordje


Re: Latest version of dwarflint?

2017-09-29 Thread Djordje Todorovic

> BTW. The *bz2 test binaries under dwarflint/tests were not in the zip
> file. If any of them didn't come from the dwarf branch could you sent
> them separately?
Are you applied the patch 0002-Add-dwarflint-from-origin-dwarf-branch.patch 
with 'git apply'?
Because, the 'patch' command would not include *bz2 files.


Re: [PATCH, dwarflint] Explicitly qualify specializations of elfutils::to_string

2018-02-23 Thread Djordje Todorovic
Hi David,

This looks good to me, but Mark or someone else must approve.

Thanks,
Djordje

On 23.02.2018. 15:54, David Malcolm wrote:
> I attempted to build the "dwarflint" branch with gcc 7.3.1 , but ran
> into various problems of the form:
> 
> c++/known.cc:220:1: error: explicit specialization of ‘template 
> std::__cxx11::string elfutils::to_string(const type&)’ outside its namespace 
> must use a nested-name-specifier [-fpermissive]
>  to_string (const dwarf::dwarf_enum &value)
>  ^~~~
> 
> The fix appears to be trivial.
> 
> libdw/ChangeLog:
>   * c++/edit-values.cc (to_string):
>   Explicitly qualify with "elfutils::".
>   * c++/known.cc (to_string): Likewise.
>   (to_string): Likewise.
>   * c++/output-values.cc (to_string):
>   Likewise.
>   * c++/values.cc (to_string): Likewise.
>   (to_string): Likewise.
>   (to_string): Likewise.
>   (to_string): Likewise.
> 
> Signed-off-by: David Malcolm 
> ---
>  libdw/c++/edit-values.cc   | 2 +-
>  libdw/c++/known.cc | 4 ++--
>  libdw/c++/output-values.cc | 2 +-
>  libdw/c++/values.cc| 8 
>  4 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/libdw/c++/edit-values.cc b/libdw/c++/edit-values.cc
> index aefb5fd1..ca83a967 100644
> --- a/libdw/c++/edit-values.cc
> +++ b/libdw/c++/edit-values.cc
> @@ -41,7 +41,7 @@ template class dwarf_data::value;
>  
>  template<>
>  std::string
> -to_string (const dwarf_edit::attribute &attr)
> +elfutils::to_string (const dwarf_edit::attribute 
> &attr)
>  {
>return attribute_string (attr);
>  }
> diff --git a/libdw/c++/known.cc b/libdw/c++/known.cc
> index bd84f52c..cb5fe693 100644
> --- a/libdw/c++/known.cc
> +++ b/libdw/c++/known.cc
> @@ -217,14 +217,14 @@ enum_string (const value_type &value)
>  
>  template<>
>  string
> -to_string (const dwarf::dwarf_enum &value)
> +elfutils::to_string (const dwarf::dwarf_enum &value)
>  {
>return enum_string (value);
>  }
>  
>  template<>
>  string
> -to_string (const dwarf_data::dwarf_enum &value)
> +elfutils::to_string (const dwarf_data::dwarf_enum 
> &value)
>  {
>return enum_string (value);
>  }
> diff --git a/libdw/c++/output-values.cc b/libdw/c++/output-values.cc
> index 199c72bd..60abc0b5 100644
> --- a/libdw/c++/output-values.cc
> +++ b/libdw/c++/output-values.cc
> @@ -46,7 +46,7 @@ template class dwarf_output::copier;
>  
>  template<>
>  std::string
> -to_string (const dwarf_output::attribute &attr)
> +elfutils::to_string (const dwarf_output::attribute 
> &attr)
>  {
>return attribute_string (attr);
>  }
> diff --git a/libdw/c++/values.cc b/libdw/c++/values.cc
> index 335074fb..c70d793f 100644
> --- a/libdw/c++/values.cc
> +++ b/libdw/c++/values.cc
> @@ -227,28 +227,28 @@ value_string (const value_type &value)
>  
>  template<>
>  string
> -to_string (const dwarf::attribute &attr)
> +elfutils::to_string (const dwarf::attribute &attr)
>  {
>return attribute_string (attr);
>  }
>  
>  template<>
>  string
> -to_string (const dwarf::attr_value &value)
> +elfutils::to_string (const dwarf::attr_value &value)
>  {
>return value_string (value);
>  }
>  
>  template<>
>  string
> -to_string (const dwarf_edit::attr_value &value)
> +elfutils::to_string (const dwarf_edit::attr_value 
> &value)
>  {
>return value_string (value);
>  }
>  
>  template<>
>  string
> -to_string (const dwarf_output::attr_value &value)
> +elfutils::to_string (const 
> dwarf_output::attr_value &value)
>  {
>return value_string (value);
>  }
> 


Re: [PATCH, dwarflint] Explicitly qualify specializations of elfutils::to_string

2018-02-23 Thread Djordje Todorovic
ccing David

On 23.02.2018. 17:47, Djordje Todorovic wrote:
> Hi David,
> 
> This looks good to me, but Mark or someone else must approve.
> 
> Thanks,
> Djordje
> 
> On 23.02.2018. 15:54, David Malcolm wrote:
>> I attempted to build the "dwarflint" branch with gcc 7.3.1 , but ran
>> into various problems of the form:
>>
>> c++/known.cc:220:1: error: explicit specialization of ‘template 
>> std::__cxx11::string elfutils::to_string(const type&)’ outside its namespace 
>> must use a nested-name-specifier [-fpermissive]
>>  to_string (const dwarf::dwarf_enum &value)
>>  ^~~~
>>
>> The fix appears to be trivial.
>>
>> libdw/ChangeLog:
>>  * c++/edit-values.cc (to_string):
>>  Explicitly qualify with "elfutils::".
>>  * c++/known.cc (to_string): Likewise.
>>  (to_string): Likewise.
>>  * c++/output-values.cc (to_string):
>>  Likewise.
>>  * c++/values.cc (to_string): Likewise.
>>  (to_string): Likewise.
>>  (to_string): Likewise.
>>  (to_string): Likewise.
>>
>> Signed-off-by: David Malcolm 
>> ---
>>  libdw/c++/edit-values.cc   | 2 +-
>>  libdw/c++/known.cc | 4 ++--
>>  libdw/c++/output-values.cc | 2 +-
>>  libdw/c++/values.cc| 8 
>>  4 files changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/libdw/c++/edit-values.cc b/libdw/c++/edit-values.cc
>> index aefb5fd1..ca83a967 100644
>> --- a/libdw/c++/edit-values.cc
>> +++ b/libdw/c++/edit-values.cc
>> @@ -41,7 +41,7 @@ template class dwarf_data::value;
>>  
>>  template<>
>>  std::string
>> -to_string (const dwarf_edit::attribute &attr)
>> +elfutils::to_string (const dwarf_edit::attribute 
>> &attr)
>>  {
>>return attribute_string (attr);
>>  }
>> diff --git a/libdw/c++/known.cc b/libdw/c++/known.cc
>> index bd84f52c..cb5fe693 100644
>> --- a/libdw/c++/known.cc
>> +++ b/libdw/c++/known.cc
>> @@ -217,14 +217,14 @@ enum_string (const value_type &value)
>>  
>>  template<>
>>  string
>> -to_string (const dwarf::dwarf_enum &value)
>> +elfutils::to_string (const dwarf::dwarf_enum &value)
>>  {
>>return enum_string (value);
>>  }
>>  
>>  template<>
>>  string
>> -to_string (const dwarf_data::dwarf_enum &value)
>> +elfutils::to_string (const dwarf_data::dwarf_enum 
>> &value)
>>  {
>>return enum_string (value);
>>  }
>> diff --git a/libdw/c++/output-values.cc b/libdw/c++/output-values.cc
>> index 199c72bd..60abc0b5 100644
>> --- a/libdw/c++/output-values.cc
>> +++ b/libdw/c++/output-values.cc
>> @@ -46,7 +46,7 @@ template class dwarf_output::copier;
>>  
>>  template<>
>>  std::string
>> -to_string (const dwarf_output::attribute &attr)
>> +elfutils::to_string (const dwarf_output::attribute 
>> &attr)
>>  {
>>return attribute_string (attr);
>>  }
>> diff --git a/libdw/c++/values.cc b/libdw/c++/values.cc
>> index 335074fb..c70d793f 100644
>> --- a/libdw/c++/values.cc
>> +++ b/libdw/c++/values.cc
>> @@ -227,28 +227,28 @@ value_string (const value_type &value)
>>  
>>  template<>
>>  string
>> -to_string (const dwarf::attribute &attr)
>> +elfutils::to_string (const dwarf::attribute &attr)
>>  {
>>return attribute_string (attr);
>>  }
>>  
>>  template<>
>>  string
>> -to_string (const dwarf::attr_value &value)
>> +elfutils::to_string (const dwarf::attr_value &value)
>>  {
>>return value_string (value);
>>  }
>>  
>>  template<>
>>  string
>> -to_string (const dwarf_edit::attr_value &value)
>> +elfutils::to_string (const dwarf_edit::attr_value 
>> &value)
>>  {
>>return value_string (value);
>>  }
>>  
>>  template<>
>>  string
>> -to_string (const dwarf_output::attr_value &value)
>> +elfutils::to_string (const 
>> dwarf_output::attr_value &value)
>>  {
>>return value_string (value);
>>  }
>>