Can't see function parameters using GDB

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Advancid
Posts: 1
Joined: Mon Aug 24, 2015 7:37 am
Freenode IRC: advancid

Can't see function parameters using GDB

Post by Advancid »

Hello,

I'm using GDB to debug my kernel with QEMU.
It works well but I can't see the function parameters.
It outputs the following for example:

Code: Select all

Breakpoint 3, memsetw (
    dest=<error reading variable: can't compute CFA for this frame>,
    val=<error reading variable: can't compute CFA for this frame>,
    count=<error reading variable: can't compute CFA for this frame>)
    at kernel/memory.c:26
26   uint16_t *memsetw(uint16_t *dest, uint16_t val, size_t count) {


I searched but I didn't find anything.
Here are the flags I'm using:
  • gcc (compiler and linker): -ffreestanding -Ikernel/include -Wall -Wextra -std=gnu99 -g -nostdlib
  • as: -g

Then I use the following command to start QEMU:

Code: Select all

qemu-system-i386 -kernel kernel/kernel-debug -s -S


And I connect to QEMU with GDB by using this command:

Code: Select all

gdb -ex "target remote localhost:1234" kernel/kernel-debug


Thank you for you help.
Post Reply