Provided app2 is triggered by app1 in which there is something like system("./app2"). app1 also does a lot of preparation such as creating dirs, files, configuration... for app2 running.
How can I gdb app2 from the first line of its main()?
What I tried as below doesn't work.
gdb app2
b main
shell ./app1