|
From: Michael S. <rin...@di...> - 2008-09-30 09:25:18
|
Øyvind Harboe wrote: >> But I can't use the IDE such as Eclipse, because the gdb can't apply >> the symbols before the MMU is enabled. > > I don't understand what it means to "apply" the symbols. > > A hardware breakpoint works on logical addresses, so does a symbol > file... The problem is that the code is linked to run at the final virtual addresses (say starting at 0xC0000000), so a function symbol points to address 0xC0001234, but before the MMU is turned on, the code itself is at 0x00001234. You can single-step that code using the assembly window in the debugger, but it will not recognize that PC=0x1234 should be displayed as "function_foo", so all you get is assembly code without any symbols, until you get to the point where the MMU is enabled and the code runs at 0xC000xxxx. That also means that you can not set a breakpoint on a function by name - if you tell gdb to break at "function_foo", the breakpoint will be set at physical address 0cC0001234 (it can not know this is supposed to be a virtual address, because the MMU is not yet enabled, and no MMU tables are available). Now when the PC reaches 0x1234, the breakpoint will not trigger. You need to manually apply the virtual->physical mapping and tell gdb to break at 0x1234. cu Michael |