The only issue I have so far i srelated to libraries. I compiled the ST StdPeriph library and then used ar to make it into a library. Then I compiled my test app in a separate dir and linked against the library. This works fine and the code loads and executes however single stepping through with gdb throws an error when it tries to step into a library call - eg:
The library was compiled with the '--debug --out-fmt-elf' and single stepping still works, just doesn't show the source in the TUI window. Any suggestions?
S.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello and thanks for your interest in the stm8 binutils project.
I will include the cfg file in the next release.
Are you sure the library still contain debugging info like .debug_line section? (stm8-objdump <file.elf> -h)</file.elf>
Anyway, the way it should work is, for any function call without debug info should simply be stepped over regardless of stepping or nexting unless forcibly stepped into with 'si'.
You could post the library here with your source code if you want me to have a look.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have to revise my previous statement. It DOES work as excpected with my small test. I how ever discovered a couple of problems.
1) There is a bug in the startup code, the sp register is not initialized correctly. A freshly resetted system should work though.
2) If there is a function returning long long type makes gdb confused somehow showing argments wrongly.
Single stepping machine instructions will show the above <error reading="" variable=""> during the prolouge. This is normal. Line stepping will however stop on the first line in the function.</error>
Just a small hack on an existing config, tested with one of the multitude of super cheap dev boards fro mChina with this mcu:
The only issue I have so far i srelated to libraries. I compiled the ST StdPeriph library and then used ar to make it into a library. Then I compiled my test app in a separate dir and linked against the library. This works fine and the code loads and executes however single stepping through with gdb throws an error when it tries to step into a library call - eg:
GPIO_Init (GPIOx=<error reading="" variable:="" could="" not="" find="" the="" frame="" base="" for="" "gpio_init".="">,
GPIO_Pin=<error reading="" variable:="" could="" not="" find="" the="" frame="" base="" for="" "gpio_init".="">,
GPIO_Mode=<error reading="" variable:="" could="" not="" find="" the="" frame="" base="" for="" "gpio_init".="">) at stm8s_gpio.c:71</error></error></error>
The library was compiled with the '--debug --out-fmt-elf' and single stepping still works, just doesn't show the source in the TUI window. Any suggestions?
S.
Bah.. magled the formatting... tyring again:
Compile flags are: -mstm8 --std-sdcc99 --Werror --nostdlib -DSTM8S103 --out-fmt-elf --all-callee-saves --debug --stack-auto --fverbose-asm --float-reent --no-peep
Hello and thanks for your interest in the stm8 binutils project.
I will include the cfg file in the next release.
Are you sure the library still contain debugging info like .debug_line section? (stm8-objdump <file.elf> -h)</file.elf>
Anyway, the way it should work is, for any function call without debug info should simply be stepped over regardless of stepping or nexting unless forcibly stepped into with 'si'.
You could post the library here with your source code if you want me to have a look.
The file is of course <libfile.lib>.</libfile.lib>
I don't know if it makes any difference but don't you want to run the archiver with stm8-ar ?
Although I'm not sure if it is supposed to work with sdcc link?
Last edit: akre 2017-08-24
Hmm, I made a small test with a library and I get the same result.
I have to revise my previous statement. It DOES work as excpected with my small test. I how ever discovered a couple of problems.
1) There is a bug in the startup code, the sp register is not initialized correctly. A freshly resetted system should work though.
2) If there is a function returning long long type makes gdb confused somehow showing argments wrongly.
Single stepping machine instructions will show the above <error reading="" variable=""> during the prolouge. This is normal. Line stepping will however stop on the first line in the function.</error>
Find the attached test code.