You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
int main(int argc, char *argv[])
{
printf("tcargc %d\n",argc);
for (int i=0; i<argc; i+=1)
printf("tricore arg[%d]=%s\n",i,argv[i]);
return 0;
}
``
Delivers if called with the updates.
qemu-system-tricore -display none -M tricore_tsim162 -semihosting --semihosting-config enable=on,arg=123000,arg=123001,arg=123002,arg=123003,arg=123004,arg=123005 -kernel ./test_main_args.elf
tcargc 7
tricore arg[0]=./test_main_args.elf
tricore arg[1]=123000
tricore arg[2]=123001
tricore arg[3]=123002
tricore arg[4]=123003
tricore arg[5]=123004
tricore arg[6]=123005
There is a bug in qemu mainstream. What ever you do argv[0] should contain the file targeted for execution.
Fixed it in config.c.
The other stuff is in tricore and is not endangering the mainstream.
How does it work!
Find on which address main is, if main is reached, modify the stackpointer and pass the parameters in stack.
If main returns adapt sp.
main still should be reentrant capable
The parameter passing is only working if qemu is in semihosting, and no gdb is connected.
The text was updated successfully, but these errors were encountered:
See also: #1 (comment)
``#include <stdio.h>
int main(int argc, char *argv[])
{
printf("tcargc %d\n",argc);
for (int i=0; i<argc; i+=1)
printf("tricore arg[%d]=%s\n",i,argv[i]);
return 0;
}
``
Delivers if called with the updates.
qemu-system-tricore -display none -M tricore_tsim162 -semihosting --semihosting-config enable=on,arg=123000,arg=123001,arg=123002,arg=123003,arg=123004,arg=123005 -kernel ./test_main_args.elf
tcargc 7
tricore arg[0]=./test_main_args.elf
tricore arg[1]=123000
tricore arg[2]=123001
tricore arg[3]=123002
tricore arg[4]=123003
tricore arg[5]=123004
tricore arg[6]=123005
There is a bug in qemu mainstream. What ever you do argv[0] should contain the file targeted for execution.
Fixed it in config.c.
The other stuff is in tricore and is not endangering the mainstream.
How does it work!
Find on which address main is, if main is reached, modify the stackpointer and pass the parameters in stack.
If main returns adapt sp.
main still should be reentrant capable
The parameter passing is only working if qemu is in semihosting, and no gdb is connected.
The text was updated successfully, but these errors were encountered: