Remote Debug Error with Gdb

Remote debug error with GDB

Perhaps you need to execute something like set architecture i386 at the (gdb) prompt? What does show architecture say after you connect to the remote target?

Gdb: target remote connects at the wrong place?

When you connect to the target with target remote GDB asks the target for its current register state, including the $pc value. GDB does NOT (at that point) modify the remote state in any way.

When you first connected the remote reported a $pc value of 0x0. If the remote changed state for some reason, lets say, you ran something on the remote, then the $pc value might change, say to 0x08000bbe.

If you then disconnect and reconnect the remote target might still have a $pc value of 0x08000bbe which is what GDB will see.

As was mentioned in the comments, GDB is just trying to map the $pc value onto the debug information in your program. The ?? shows that GDB can't find any symbols at address 0x0. While GDB did find the symbol __c_m_sh_syscall near to address 0x08000bbe. However, this is information doesn't mean much at this point, you've not yet loaded anything onto the target, so you're not really in the function __c_m_sh_syscall, it's just the current address of the remote.

When you do the load command this is when GDB loads the executable onto the target, and writes to the $pc.

TL;DR; If your work flow is target remote then load, don't worry about the state of the target immediately after the target remote, this is just whatever random state happens to be in the target when you connect.



Related Topics



Leave a reply



Submit