Hello all,
Here is an example MI snippet with a warning issued by GDB:
004,691 52-exec-continue --thread 1
004,707 52^running
004,707 *running,thread-id="all"
004,760 53-thread-select 1
004,847 (gdb)
004,847 53^error,msg="Cannot execute this command while the target is running.\nUse the \"interrupt\\
" command to stop the target\nand then try again."
004,847 (gdb)
005,108 =breakpoint-modified,bkpt={number="15",type="breakpoint",disp="keep",enabled="y",addr="0x080\
01808",func="SVC_Handler",file="C:/Users/svenssot/STM32Cube/Repository/STM32Cube_FW_F4_V1.27.0/Proje\
cts/STM32F4-Discovery/Examples/GPIO/GPIO_EXTI/Src/stm32f4xx_it.c",fullname="C:\\Users\\svenssot\\STM\
32Cube\\Repository\\STM32Cube_FW_F4_V1.27.0\\Projects\\STM32F4-Discovery\\Examples\\GPIO\\GPIO_EXTI\\
\Src\\stm32f4xx_it.c",line="112",thread-groups=["i1"],times="1",original-location="C:\\\\Users\\\\sv\
[message truncated to 5 lines. More lines can be set in the Preference->Debug->GDB eclipse preference page.]
005,108 =breakpoint-modified,bkpt={number="20",type="breakpoint",disp="del",enabled="y",addr="0x0800\
1808",func="SVC_Handler",file="C:/Users/svenssot/STM32Cube/Repository/STM32Cube_FW_F4_V1.27.0/Projec\
ts/STM32F4-Discovery/Examples/GPIO/GPIO_EXTI/Src/stm32f4xx_it.c",fullname="C:\\Users\\svenssot\\STM3\
2Cube\\Repository\\STM32Cube_FW_F4_V1.27.0\\Projects\\STM32F4-Discovery\\Examples\\GPIO\\GPIO_EXTI\\\
Src\\stm32f4xx_it.c",line="112",thread-groups=["i1"],times="1",original-location="SVC_Handler"}
005,478 ~"\n"
005,478 ~"Breakpoint 15, SVC_Handler () at C:/Users/svenssot/STM32Cube/Repository/STM32Cube_FW_F4_V1\
.27.0/Projects/STM32F4-Discovery/Examples/GPIO/GPIO_EXTI/Src/stm32f4xx_it.c:112\n"
005,478 ~"112\t\t asm(\"push {r0, r1}\");\n"
005,478 *stopped,reason="breakpoint-hit",disp="keep",bkptno="15",frame={addr="0x08001808",func="SVC_\
Handler",args=[],file="C:/Users/svenssot/STM32Cube/Repository/STM32Cube_FW_F4_V1.27.0/Projects/STM32\
F4-Discovery/Examples/GPIO/GPIO_EXTI/Src/stm32f4xx_it.c",fullname="C:\\Users\\svenssot\\STM32Cube\\R\
epository\\STM32Cube_FW_F4_V1.27.0\\Projects\\STM32F4-Discovery\\Examples\\GPIO\\GPIO_EXTI\\Src\\stm\
32f4xx_it.c",line="112",arch="armv7e-m"},thread-id="1",stopped-threads="all",core="0"
005,493 =breakpoint-deleted,id="20"
005,493 54-stack-info-depth --thread 1 11
005,509 55-data-disassemble --thread 1 -s 134223880 -e 134223924 -- 3
006,011 &"warning: Could not fetch FPCAR content. Further unwinding of FP register values
will be un\
reliable.\n"
006,228 54^done,depth="5"
006,228 (gdb)
006,281 56-stack-select-frame --thread 1 0
006,281 57-list-thread-groups
006,281 58-thread-info 1
006,312 55^done,asm_insns=[src_and_asm_line={line="112",file="C:/Users/svenssot/STM32Cube/Repository\
/STM32Cube_FW_F4_V1.27.0/Projects/STM32F4-Discovery/Examples/GPIO/GPIO_EXTI/Src/stm32f4xx_it.c",full\
name="C:\\Users\\svenssot\\STM32Cube\\Repository\\STM32Cube_FW_F4_V1.27.0\\Projects\\STM32F4-Discove\
ry\\Examples\\GPIO\\GPIO_EXTI\\Src\\stm32f4xx_it.c",line_asm_insn=[{address="0x08001808",func-name="\
SVC_Handler",offset="4",opcodes="03 b4",inst="push\t{r0, r1}"}]},src_and_asm_line={line="113",file="\
[message truncated to 5 lines. More lines can be set in the Preference->Debug->GDB eclipse preference page.]
006,312 (gdb)
006,312 56^done
006,312 (gdb)
006,381 59-stack-list-frames --thread 1
006,381 57^done,groups=[{id="i1",type="process",pid="42000",executable="C:\\Users\\svenssot\\STM32Cu\
be\\Repository\\STM32Cube_FW_F4_V1.27.0\\Projects\\STM32F4-Discovery\\Examples\\GPIO\\GPIO_EXTI\\SW4\
STM32\\STM32F4-Discovery\\Debug\\STM32F4-Discovery.elf",cores=["0"]}]
006,381 (gdb)
006,459 58^done,threads=[{id="1",target-id="Thread 1",name="main",frame={level="0",addr="0x08001808"\
,func="SVC_Handler",args=[],file="C:/Users/svenssot/STM32Cube/Repository/STM32Cube_FW_F4_V1.27.0/Pro\
jects/STM32F4-Discovery/Examples/GPIO/GPIO_EXTI/Src/stm32f4xx_it.c",fullname="C:\\Users\\svenssot\\S\
TM32Cube\\Repository\\STM32Cube_FW_F4_V1.27.0\\Projects\\STM32F4-Discovery\\Examples\\GPIO\\GPIO_EXT\
I\\Src\\stm32f4xx_it.c",line="112",arch="armv7e-m"},state="stopped",core="0"}]
006,459 (gdb)
006,459 59^done,stack=[frame={level="0",addr="0x08001808",func="SVC_Handler",file="C:/Users/svenssot\
/STM32Cube/Repository/STM32Cube_FW_F4_V1.27.0/Projects/STM32F4-Discovery/Examples/GPIO/GPIO_EXTI/Src\
/stm32f4xx_it.c",fullname="C:\\Users\\svenssot\\STM32Cube\\Repository\\STM32Cube_FW_F4_V1.27.0\\Proj\
ects\\STM32F4-Discovery\\Examples\\GPIO\\GPIO_EXTI\\Src\\stm32f4xx_it.c",line="112",arch="armv7e-m"}\
,frame={level="1",addr="0xffffffe1",func="<signal handler called>"},frame={level="2",addr="0x0800187\
[message truncated to 5 lines. More lines can be set in the Preference->Debug->GDB eclipse preference page.]
006,459 (gdb)
I’ve highlighted MI command that produces the warning message with yellow background color.
So far, I’m only aware of the warning messages that I’ve added and they are not overlapping the registers themselves.
In CDT 10.6.x on Windows, the warning message is printed in the “Debugger console” view, but I’m uncertain how that works
on other platforms with the multi-UI support for GDB
In the case of a normal CLI session with GDB, it’s possible to know what frame that caused the problem, but with MI, this
context is not available.
Kind regards,
Torbjörn
From: Jonah Graham <jonah@xxxxxxxxxxxxxxxx>
Sent: den 7 oktober 2022 20:14
To: CDT General developers list. <cdt-dev@xxxxxxxxxxx>
Cc: Torbjorn SVENSSON <torbjorn.svensson@xxxxxx>
Subject: Re: [cdt-dev] GDB might send additional message on -stack-info-depth MI command
Hi Torbjörn,
Cool - thanks for getting your ST improvements back into GDB.
What does the MI trace look like in this case? In the case of a warning, I think we should avoid a pop-up. For an unrecoverable error pop-up is probably fine.
Here is my brainstorm idea:
In the warning case, perhaps a warning triangle in the ruler? Like when there is a problem with the breakpoint. The warning triangle can be on the "Debug Current Instruction Pointer" and/or "Debug Call Stack" markers? The advantage of putting
it there is that it can have a hover with more information. Maybe having the warning on the call stack itself in the Debug view would be good too.
Does the warning give enough info to know which registers are (possibly?) incorrect? If so, maybe a warning overlay on the registers themselves?
Does the warning/error still come out to CLI when doing the MI command? That means that the Debugger Console view should show it too.