I think I may have written my problem wrong. I was following the guide for debugging the kernel, but it only seems to apply to a full image. One part of the documentation shows loading the debug symbols for the kernel so the debugger can step through functions, but I can't find the debug symbols for the spi-flash image. I can read registers fine, but when I run "monitor step" from gdb it says "cannot find bounds of current function"
Also, every time I run something like x/3i $eax in gdb it gives me the values, but openocd gives errors like this:
Error: calcaddr_pyhsfromlin page directory entry at 0x001dc000 is not present
Error: x86_32_common_read_memory failed to calculate physical address from 0x00000006
Have you enabled the kernel debug info options under the menuconfig when building the kernel? I’m not sure about this but it is possible that the kernel is not being configured with this information so this might be the problem. Other option would be to debug your kernel by using the printk function, but I’m not sure if this enough for your needs. I’m still looking into this so I hope to find some other suggestions.