1

I'm trying to debug kernel with KVM and gdb, it works fine.

But the breakpoints on syscalls doesn't seem to work.

In gdb I set a breakpoint:

(gdb) b sys_uname
Breakpoint 1 at 0xffffffff8106f3b0: file kernel/sys.c, line 1341.

Then I type c to continue,

But when I run uname -a in the debugged system, it doesn't break.

From the output of strace, the uname command does made a uname syscall, so why didn't it stop?

daisy
  • 22,498
  • 29
  • 129
  • 265
  • There isn't always a 1:1 mapping of system call to context switch into the kernel. http://stackoverflow.com/questions/9728421/context-switching-when-a-thread-invokes-a-system-call. Given that the information returned by `uname` is static, it may be possible that this information is cached first time round, in order to save future system calls. `grep ctx /proc/$pid/status` to check actual count of system calls for a given process. – Digital Trauma Jan 13 '14 at 23:15

0 Answers0