gdb simulator exit status

Andrew STUBBS andrew.stubbs@st.com
Thu Jan 17 14:32:00 GMT 2008


M R Swami Reddy wrote:
> Can you please suggest the way (if any) to get the gdb simulator's exit 
> status with "echo $status" command"?

Well, it works for me (target sh-elf), but maybe I'm using a more recent 
GDB or something.

Anyway, obviously it isn't working for you, so try this:

gdb --batch-silent \
	--return-child-result \
	-ex "target sim" \
	-ex load \
	-ex run \
	a.out

Hope that helps

Andrew



More information about the Gdb mailing list