Using ddb to print softc variables

Hi all,
Somewhere in my code the member of a struct is changed but I can't seem to find where. I want to use ddb's watch feature but can't figure out how to pinpoint a memory address.

I cam find the softc address via 'show all devices', but i cannot figure out how to print the equivalent of softc->flags.

This is from a kernel module and it has kernel symbols present.

Can ddb do this? If not, what does watch do?

Thanks!
 
ddb is quite limited in what it can do.
You can use kgdb on a live system to find offsets of fields that interest you.
Then ,in ddb, you should be able to calculate an address of interest and set a watchpoint on it.
 
Thanks for the reply. I am on 14.0-CURRENT, and have the following in my GENERIC config already:
```
makeoptions DEBUG=-g
options KDB
options GDB
```

However, when I try to set the debugger to kdb, I receive an invalid argument error:
```
sudo sysctl debug.kdb.current=gdb
debug.kdb.current: ddb
sysctl: debug.kdb.current=gdb: Invalid argument
```

The documentation says the serial port might not be configured but I am running this from a console connection on a KVM VM.

The document I'm referencing: https://docs.freebsd.org/en/books/developers-handbook/kerneldebug/#kerneldebug-online-gdb

What am I doing wrong?
 
SirDice I apologize, I am on 15.0-CURRENT.

Andriy Is `kgdb` an executable I can install on Linux? if not, this means I need another FreeBSD VM. The problem I'm running into then is, how do I connect the serial ports of the two VMs together such that I can do this?

Problem after problem... :(
 
Back
Top