Good afternoon, I would like to announce the breakthrough in extending gdb with non intrusive instructions and functions tracing on ARM processors using Coresight ETM traces, as described in previous mails. the source code is made public in the git repository https://github.com/gzied/binutils-gdb/ in the branch gdb_arm_coresight. this implementation was compiled and tested on an STM32MP1 (ARMv7 Architecture) board running "Linux arm 5.3.10-armv7-lpae-x15" distribution where the device tree was modified to declare CoreSight components.
to build the software
checkout the software from the branch gdb_arm_coresight cd .. mkdir build cd build ../binutils-gdb/configure --with-arm-cs make
after a successful build gdb will be available in the folder build/gdb
to run the software build the software you would like to debug with debugging info (-g flag)
gcc -g software.c -o software
start debugging your software
gdb software
set a breakpoint at main (gdb) b main (gdb) run set a breakpoint in a location after the code you would like to trace (gdb) b my_function set your etm sink, sinks can be found by listing the folder /sys/bus/event_source/devices/cs_etm/sinks/. use a sink that is capable of storing the traces on chip (etf, etb ...) (gdb) set record btrace etm sink tmc_etf0 start recording etm traces (gdb) record btrace etm continue the execution of the program (gdb) c wait until the breakpoint is hit, analyse and display the traces - on assembly level (gdb) record instruction-history - on c level (gdb) record function-call-history /ilc you can increase the number of instructions displayed by using (gdb) set record instruction-history-size size (gdb) set record function-call-history-size size
the work is still in an early stage and needs to be improved, extended and stabilized. your feedback and contributions are welcome
Kind Regards Zied Guermazi
Hi Zied,
Luis here. I work on GDB for ARM architectures.
On 2/14/20 1:53 PM, Zied Guermazi wrote:
Good afternoon, I would like to announce the breakthrough in extending gdb with non intrusive instructions and functions tracing on ARM processors using Coresight ETM traces, as described in previous mails. the source code is made public in the git repository https://github.com/gzied/binutils-gdb/ in the branch gdb_arm_coresight. this implementation was compiled and tested on an STM32MP1 (ARMv7 Architecture) board running "Linux arm 5.3.10-armv7-lpae-x15" distribution where the device tree was modified to declare CoreSight components.
That's great news! Are you planning on pursuing such changes upstream?
I'd like to go over your work on GDB to understand how it works and how it integrates with CoreSight.
Let's keep in touch and we can discuss what is needed if you want to have this work integrated into the GDB repository, which should make the work available to a broader audience.
Best regards, Luis
hi Luisfor sure, I would like to pursue it upstream, and I will need your support here, as well as for completing the remote protocol extensions. Thanks for your proposal for support.A good introduction to this implementation can be found here https://www.mail-archive.com/linaro-toolchain@lists.linaro.org/msg06871.html... am available if you need further information.Kind RegardsZied Guermazi
On Friday, February 28, 2020, 05:42:00 PM GMT+1, Luis Machado luis.machado@linaro.org wrote:
Hi Zied,
Luis here. I work on GDB for ARM architectures.
On 2/14/20 1:53 PM, Zied Guermazi wrote:
Good afternoon, I would like to announce the breakthrough in extending gdb with non intrusive instructions and functions tracing on ARM processors using Coresight ETM traces, as described in previous mails. the source code is made public in the git repository https://github.com/gzied/binutils-gdb/ in the branch gdb_arm_coresight. this implementation was compiled and tested on an STM32MP1 (ARMv7 Architecture) board running "Linux arm 5.3.10-armv7-lpae-x15" distribution where the device tree was modified to declare CoreSight components.
That's great news! Are you planning on pursuing such changes upstream?
I'd like to go over your work on GDB to understand how it works and how it integrates with CoreSight.
Let's keep in touch and we can discuss what is needed if you want to have this work integrated into the GDB repository, which should make the work available to a broader audience.
Best regards, Luis _______________________________________________ CoreSight mailing list CoreSight@lists.linaro.org https://lists.linaro.org/mailman/listinfo/coresight