linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Best way to inspect the parse tree from Sparse
@ 2017-08-07 15:11 Dibyendu Majumdar
  2017-08-07 15:19 ` Christopher Li
  2017-08-07 18:46 ` Luc Van Oostenryck
  0 siblings, 2 replies; 14+ messages in thread
From: Dibyendu Majumdar @ 2017-08-07 15:11 UTC (permalink / raw)
  To: Linux-Sparse

Hi,

I would like to understand the structure of the parse tree generated
by Sparse a bit better. I am looking at the output from the show_*()
functions but it is not clear to me exactly what the output means. For
example:

extern int printf(const char *, ...);

int main(int argc, const char *argv[]) {
printf("hello world!\n");
return 0;
}

Results in:

.align 4
int extern [signed] [addressable] [toplevel] main( ... )
        movi.64         v2,&"hello world!\n"
        push.64         v2
        call            printf
        add.64          vSP,vSP,$8
        mov.32          v3,retval
        movi.32         v4,$0
        addi.64         v5,vFP,$offsetof(return:00000202755B1A98)
        st.32           v4,[v5]
        ret             (00000202755B1A98)
.L00000202755B1A98:
        addi.64         v6,vFP,$offsetof(return:00000202755B1A98)
        ld.32           v7,[v6]
        mov.32          retval,7
        ret


I get the first four lines, but the rest don't make sense to me. I
suppose that the dump is trying to show the parse tree in a linear
form ...  but is that useful? Would it be better to dump the parse
tree in a different form?

Regards
Dibyendu

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

end of thread, other threads:[~2017-08-10 19:59 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-07 15:11 Best way to inspect the parse tree from Sparse Dibyendu Majumdar
2017-08-07 15:19 ` Christopher Li
2017-08-07 18:46 ` Luc Van Oostenryck
2017-08-07 23:35   ` Christopher Li
2017-08-09 17:14     ` Dibyendu Majumdar
2017-08-09 17:42       ` Dibyendu Majumdar
2017-08-09 18:41         ` Christopher Li
2017-08-09 18:47           ` Dibyendu Majumdar
2017-08-09 19:22             ` Christopher Li
2017-08-09 19:46               ` Dibyendu Majumdar
2017-08-09 19:57                 ` Christopher Li
2017-08-09 20:03                   ` Dibyendu Majumdar
2017-08-09 20:21                     ` Christopher Li
2017-08-10 19:59                     ` Christopher Li

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 NNTP newsgroup(s).