How can I debug multiple applications by loading multiple symbol definitions in GDB?

I am developing embedded software. By nature, I have 3 different applications running at the same time, which are guaranteed to work in different ranges of virtual addresses, for example.

Application 1 runs on 0x10000000 - 0x20000000, App2 runs on 0x20000000 - 0x30000000, etc.

Generally, GDB apparently only accepts one character definition file. But in this case, I can potentially load all 3 definitions without a collision. How could I achieve this?

Secondly, suppose that I have all 3 applications running in the same virtual range, but something different each time I start, for example, suppose their address space identifier is in the same address, which gives me the key to downloading the application at that time.

How can I tell GDB to load all 3 character definitions, but automatically switch the definition based on this information?

+3
source share
1 answer

You tried

add-symbol-file app1 0x10000000
add-symbol-file app2 0x20000000
add-symbol-file app3 0x30000000

Since all addresses are different and all applications load at the same time, I don’t quite understand what you mean by “hint about which application is loading at that time”.

, GDB .

+1

Source: https://habr.com/ru/post/1759303/


All Articles