blob: 9af70a04aaa1c9b14160587ac07ee39daa24253f (
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
|
graphic: 0.783
device: 0.724
instruction: 0.663
semantic: 0.654
socket: 0.564
assembly: 0.510
mistranslation: 0.499
vnc: 0.330
network: 0.287
boot: 0.152
other: 0.122
KVM: 0.068
Memory not accessible from GDB when using mps3-an547
Description of problem:
Memory (including variables) is not accessible when connecting to the emulated machine via GDB
Steps to reproduce:
1. Create minimal program `main.c`:
```c
int main(void) {
int myvar = 42;
for(;;)
}
```
2. Compile
```bash
arm-none-eabi-gcc -c -o build/main.o -c -mcpu=cortex-m55 -mfloat-abi=hard -mthumb -funsigned-char -mlittle-endian -O0 -g -std=c11 main.c
```
(ARM startup files and include directories omitted for brevity)
3. Link
```bash
arm-none-eabi-g++ -o build/test.elf build/main.o -mcpu=cortex-m55 -mfloat-abi=hard -mthumb -funsigned-char -mlittle-endian --entry=Reset_Handler -static -T./platform.ld -O0 -g
```
(ARM startup files omitted for brevity)
4. Run binary in QEMU:
```bash
qemu-system-arm --machine mps3-an547 -serial mon:stdio -kernel test.elf -gdb tcp::1234 -S
```
5. Attach using GDB `arm-none-eabi-gdb build/test.elf` and set break point to infinite loop
```gdb
target remote :1234
break main.c:18
continue
print myvar
```
Expected Output: 42
Actual Output: `Cannot access memory at address 0x11fffe4`
|