* Load and parse RTL from textual dump files
@ 2017-12-18 10:30 HEBBAL Yacine
2017-12-18 12:31 ` Kyrill Tkachov
0 siblings, 1 reply; 3+ messages in thread
From: HEBBAL Yacine @ 2017-12-18 10:30 UTC (permalink / raw)
To: gcc
Hello,
In one of my projects, I need to determine automatically what are the names
and types of data fields manipulated by functions in binary code of a given
program (e.g. Linux kernel).
I found that RTL dumps contains most of information I need in a form very
close to the one of the binary code.
For this end, I need to parse generated RTL expressions in order to extract
operands properties.
Is it possible to load and parse RTL expressions from textual dump files
using existing code in GCC ? Thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Load and parse RTL from textual dump files
2017-12-18 10:30 Load and parse RTL from textual dump files HEBBAL Yacine
@ 2017-12-18 12:31 ` Kyrill Tkachov
2017-12-20 9:44 ` HEBBAL Yacine
0 siblings, 1 reply; 3+ messages in thread
From: Kyrill Tkachov @ 2017-12-18 12:31 UTC (permalink / raw)
To: HEBBAL Yacine, gcc
Hi,
On 18/12/17 10:30, HEBBAL Yacine wrote:
> Hello,
> In one of my projects, I need to determine automatically what are the
> names
> and types of data fields manipulated by functions in binary code of a
> given
> program (e.g. Linux kernel).
> I found that RTL dumps contains most of information I need in a form very
> close to the one of the binary code.
> For this end, I need to parse generated RTL expressions in order to
> extract
> operands properties.
> Is it possible to load and parse RTL expressions from textual dump files
> using existing code in GCC ? Thanks
Since version 7 GCC does contain functionality to parse RTL input.
This is mostly used for writing more targeted unit tests for the RTL passes.
Have a look at https://gcc.gnu.org/onlinedocs/gccint/RTL-Tests.html or
grep for "__RTL"
in the gcc testsuite (gcc/testsuite in the source tree) to see examples
of how it's used.
Not sure how useful it will be for large-scale analysis of source code
though.
You may want to write/use a GCC plugin for that.
Kyrill
P.S. This list is used for discussions about the development of GCC itself.
For help using GCC please use the gcc-help list in the future.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Load and parse RTL from textual dump files
2017-12-18 12:31 ` Kyrill Tkachov
@ 2017-12-20 9:44 ` HEBBAL Yacine
0 siblings, 0 replies; 3+ messages in thread
From: HEBBAL Yacine @ 2017-12-20 9:44 UTC (permalink / raw)
To: Kyrill Tkachov; +Cc: gcc
Hi Kyrill,
Thank you for your response.
I looked at GCC RTL tests and I saw that the RTL format in these files is
embedded in C functions and slightly different from the one in dump files
generated with -fdump-rtl-expand option.
So for large scale analysis, do you think that writing a GCC plugin is a
reliable solution for my use case ? thanks
Yacine
2017-12-18 13:31 GMT+01:00 Kyrill Tkachov <kyrylo.tkachov@foss.arm.com>:
> Hi,
>
>
> On 18/12/17 10:30, HEBBAL Yacine wrote:
>
>> Hello,
>> In one of my projects, I need to determine automatically what are the
>> names
>> and types of data fields manipulated by functions in binary code of a
>> given
>> program (e.g. Linux kernel).
>> I found that RTL dumps contains most of information I need in a form very
>> close to the one of the binary code.
>> For this end, I need to parse generated RTL expressions in order to
>> extract
>> operands properties.
>> Is it possible to load and parse RTL expressions from textual dump files
>> using existing code in GCC ? Thanks
>>
>
> Since version 7 GCC does contain functionality to parse RTL input.
> This is mostly used for writing more targeted unit tests for the RTL
> passes.
> Have a look at https://gcc.gnu.org/onlinedocs/gccint/RTL-Tests.html or
> grep for "__RTL"
> in the gcc testsuite (gcc/testsuite in the source tree) to see examples of
> how it's used.
>
> Not sure how useful it will be for large-scale analysis of source code
> though.
> You may want to write/use a GCC plugin for that.
>
> Kyrill
>
> P.S. This list is used for discussions about the development of GCC itself.
> For help using GCC please use the gcc-help list in the future.
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-12-20 9:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-18 10:30 Load and parse RTL from textual dump files HEBBAL Yacine
2017-12-18 12:31 ` Kyrill Tkachov
2017-12-20 9:44 ` HEBBAL Yacine
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).