I have never done any stack tracking, using the current program stack, though there may be a way to do it.
As for converting code to assembly, you can do it with "gcc -S hello.c". You can probably do this in any compiler. You would need to read the documentation for the compiler and/or IDE.
Source hello.c:
Code:
#include <stdio.h>
int main(void)
{
printf("Hello World!\n");
return 0;
}
Assembly hello.s:
Code:
.file "hello.c"
.text
.section .rodata
.LC0:
.string "Hello World!"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
leaq .LC0(%rip), %rax
movq %rax, %rdi
call puts@PLT
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.ident "GCC: (Debian 13.2.0-10) 13.2.0"
.section .note.GNU-stack,"",@progbits