[Qt-creator] Debugging code built with SDCC

André Pönitz apoenitz at t-online.de
Mon Jun 11 09:49:23 CEST 2018


On Mon, Jun 11, 2018 at 02:47:12PM +0200, Márton Miklós wrote:
> Hello all,
> 
> I am trying to put together a toolchain for a STM8 (bare metal) target
> based on QtCreator, openOCD, SDCC and GDB.
> 
> I am proceeding great so far: the debugging of the target works, but I only
> able to debug the code at assembly level (even when the Debug menu ->
> Operate by instruction is unchecked).
> 
> I am using the following command to build the elf file:
> 
> sdcc -lstm8 -mstm8 blinky.c --out-fmt-elf --all-callee-saves --debug
> --verbose --stack-auto --fverbose-asm  --float-reent --no-peep
> 
> If I debug it separately from QtCreator with GDB it shows the C code when
> it stops at the breakpoint for e.g.
> 
> Here is the output of the debugger log pane:
> 
> https://pastebin.com/Nzi7YQ7w
> 
> The only suspicious thing what I see is the following section:
> >&"set disassembly-flavor att\n"
> >&"No symbol \"disassembly\" in current context.\n"
> >2117^error,msg="No symbol \"disassembly\" in current context."

This one is harmless.
 
> Any help/hint about the further things to check would be highly appreciated!

It looks like there is debug information available, and interestingly
enough it is able to resolve the blinky.c:6 breakpoint to 0x8024.

The breakpoint is hit later, the response has
file="blinky.c",fullname="/home/mm/Projektek/sdcc-examples-stm8/blinky.c"

Does /home/mm/Projektek/sdcc-examples-stm8/blinky.c exist? If not, do you
have a blinky.c file elsewhere? If so, does setting up a source path mapping
under Tools->Options->Debugger->General help? If not, does moving/linking
your sources so that /home/mm/Projektek/sdcc-examples-stm8/blinky.c
exists help?

Andre'



More information about the Qt-creator mailing list