summary refs log tree commit diff stats
path: root/results/classifier/118/semantic-arm/714
blob: 51dacda8ecb7ec02b99463ba49e4c33439e607d9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
semantic: 0.914
arm: 0.888
ppc: 0.810
graphic: 0.775
user-level: 0.767
performance: 0.751
device: 0.697
vnc: 0.667
risc-v: 0.651
permissions: 0.639
architecture: 0.617
kernel: 0.616
assembly: 0.487
i386: 0.486
mistranslation: 0.482
socket: 0.476
VMM: 0.440
x86: 0.416
network: 0.387
PID: 0.370
TCG: 0.359
debug: 0.349
register: 0.347
hypervisor: 0.332
files: 0.302
peripherals: 0.287
boot: 0.277
KVM: 0.188
virtual: 0.094
--------------------
arm: 0.948
user-level: 0.751
TCG: 0.203
files: 0.140
virtual: 0.125
debug: 0.094
PID: 0.019
register: 0.012
device: 0.011
semantic: 0.007
performance: 0.004
architecture: 0.003
network: 0.002
boot: 0.002
graphic: 0.002
socket: 0.002
peripherals: 0.002
assembly: 0.001
permissions: 0.001
hypervisor: 0.001
risc-v: 0.001
VMM: 0.001
mistranslation: 0.001
kernel: 0.000
KVM: 0.000
vnc: 0.000
ppc: 0.000
x86: 0.000
i386: 0.000

Command line arguments are not passed correctly with user-space semihosting
Description of problem:
The emulated process always receives a value of 1 for `argc`, with `argv[0]` returning seemingly random characters (in Ubuntu packaged qemu 5.2), but correlating with command-line input (output below from master built qemu 6.1):
```
$ qemu-arm -cpu cortex-m7 ./a.out 123 test
argc: 1
argv: 
 - @@@

$ qemu-arm -cpu cortex-m7 ./a.out 
argc: 1
argv:
 [0] @
```
Steps to reproduce:
1. Compile the following program with [ARM embedded toolchain](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads):
```cpp
#include <iostream>

int main(int argc, char* argv[]) {
	std::cout << "argc: " << argc << "\n";
	std::cout << "argv: \n";

	for (int i = 0; i < argc; i++)
		std::cout << " [" << i << "] " << argv[i] << "\n";
	return 0;
}
```

```
$ $CXX --version
arm-none-eabi-g++ (GNU Arm Embedded Toolchain 10-2020-q4-major) 10.2.1 20201103 (release)
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ $CXX main.cpp --specs=rdimon.specs -mcpu=cortex-m7
```

2. Run in user-space (semihosted):
```
$ qemu-arm -cpu cortex-m7 ./a.out 
```