Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • QEMU QEMU
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 795
    • Issues 795
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Terraform modules
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Insights
    • Issue
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • QEMUQEMU
  • QEMUQEMU
  • Issues
  • #1488
Closed
Open
Issue created Feb 13, 2023 by etrommer@etrommer

Memory not accessible from GDB when using mps3-an547

Host environment

  • Operating system: Ubuntu 20.04.5 LTS
  • OS/kernel version: Linux 4.4.0-19041-Microsoft
  • Architecture: x86
  • QEMU flavor: qemu-system-arm
  • QEMU version: 7.2.0
  • QEMU command line:
    qemu-system-arm --machine mps3-an547 -serial mon:stdio -kernel test.elf -gdb tcp::1234 -S

Emulated/Virtualized environment

  • Operating system: none (bare-metal)
  • OS/kernel version: -
  • Architecture: cortex-m55, Armv8.1-M

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:
    int main(void) {
        int myvar = 42;
        for(;;)
    }
  2. Compile
     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
    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:
     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
    target remote :1234
    break main.c:18
    continue
    print myvar

Expected Output: 42
Actual Output: Cannot access memory at address 0x11fffe4

Additional Information

Running info mem in GDB results in:

Using memory regions provided by the target.
There are no memory regions defined.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking