AVR gdb misinterprets what function I am in
Carl Peto <[email protected]> Wed, 12 Jan 2022 12:00:24 +0000
| Newsgroups | gmane.comp.hardware.avr.gcc |
|---|---|
| Message-ID | <[email protected]> |
Hi, I don=E2=80=99t know if this is the correct mailing list. I=E2=80=99m = looking for help with avr-gdb. I'm not sure if this is a dumb question! I'm debugging a firmware image = I wrote, connecting to simulator via target remote. When I do = disassemble 0, I get the correct assembly for address 0x0000 on my image = (it's an AVR program by the way). But, gdb seems to think it's in some = random function that has nothing to do with the startup code=E2=80=A6 (gdb) disassemble 0x0000 Dump of assembler code for function = _ZN5swift9RefCountsINS_21SideTableRefCountBitsEE11doDecrementILNS_13Perfor= mDeinitE0EEEbm: 0x00000000 <+0>: jmp 0x90 ; 0x90 <__init> =E2=80=A6 (this is the start of program memory at 0x0000 on the AVR chip, the = reset vector and interrupt vectors) As a sanity check, using avr-objdump, that symbol is not defined as = 0x0000...=20 00001186 w F .text 00000226 = _ZN5swift9RefCountsINS_21SideTableRefCountBitsEE11doDecrementILNS_13Perfor= mDeinitE0EEEbm Why is gdb thinking the code at 0x0000 is in some other, random = function? (It seems to change all the time, one random symbol after = another, different each time I start a debugging session like this!)