简体   繁体   中英

C/C++ Remote Compilation, local Debug Session with ELF (Embedded, Cortex-M)

I do a lot of coding in C/C++ on my notebook. Unfortunately, the dual core has its limits when it comes to compilation, which I do a lot. but the advantage is that I'm mobile and I can carry my debugger (usb j-link) around (and no, the ethernet-j-link option is too expensive).

I do have a server with 24 cores. I would like to use the server for compilation and then copy the compiled files (mainly the ELF) over to my local machine for debugging.

Both machines use Ubuntu (Ubuntu Budgie for the notebook, Ubuntu Server for the server).

Sadly, the Eclipse GDB (Atollic 8.1) is no longer able to map the binary addresses to my source files in the graphical debugger (understandably).

I was wondering how the graphical debugger is possible to map addresses to the text (src). Is this path information within the ELF file? If so, how can I correct it so the remote-compiled-binary is able to debug-run on my notebook?

In gdb, you can do this:

set substitute-path from to

Define a source path substitution rule, and add it at the end of the current list of existing substitution rules. If a rule with the same from was already defined, then the old rule is also deleted. For example, if the file /foo/bar/baz.c was moved to /mnt/cross/baz.c, then the command (gdb) set substitute-path /foo/bar /mnt/cross will tell GDB to replace '/foo/bar' with '/mnt/cross', which will allow GDB to find the file baz.c even though it was moved. In the case when more than one substitution rule have been defined, the rules are evaluated one by one in the order where they have been defined. The first one matching, if any, is selected to perform the substitution. For instance, if we had entered the following commands: (gdb) set substitute-path /usr/src/include /mnt/include (gdb) set substitute-path /usr/src /mnt/src GDB would then rewrite /usr/src/include/defs.h into /mnt/include/defs.h by using the first rule. However, it would use the second rule to rewrite /usr/src/lib/foo.c into /mnt/src/lib/foo.c.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM