1

I'm trying to debug os161 and am having trouble due to a lack of debug information. None of my functions have line number information, so I'm capable of doing something like "b lock_acquire" but then when I do "s" it says "Single stepping until exit from function lock_acquire, which has no line number information." I also get a "No line number known error" when I try to do "l lock_acquire", get "No symbol lock in current context." when I'm at lock_acquire and type "p lock". Furthermore when I type ptype curthread it says "data variable, no debug info found" instead of something useful. I used the config directions from here http://www.cdf.utoronto.ca/~csc369h/fall/docs/configure.shtml. Is there some way to add more debug info when you compile os161?

Edit: To start gdb I type

% cd ~/os161/root
% sys161 -w kernel

in one window and then type

% cd ~/os161/root
% cs161-gdb kernel
(gdb) target remote unix:.sockets/gdb

in a second window.

Joshua Snider
  • 705
  • 1
  • 8
  • 34

1 Answers1

0

There are few ways you can debug the kernel one way is directly add debug message to the kernel. For example add DEBUG macro in the system. (lib.h)

...
DEBUG(DB_SYSCALL, "Entering into user mode\n");
...

Another way you could use GDB like you just said. Instead of using 's' you should use 'n' and 'bt' to check the steps. Without reading any errors I don't know how to provide more information. I hope this helps.

Shang
  • 518
  • 3
  • 13