Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] GDB might send additional message on -stack-info-depth MI command
  • From: Torbjorn SVENSSON <torbjorn.svensson@xxxxxx>
  • Date: Thu, 13 Oct 2022 11:34:34 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=st.com; dmarc=pass action=none header.from=st.com; dkim=pass header.d=st.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GLAlyd0C7m2twODk1ArmUF9KcbuRtNdXlK61YKcVWrE=; b=Ssc1KFHtAdorBVGhIApOZSmMlwLtahhNWd/w8eq+VQYzZU+Ruv8kiAn5/vRcL26ZcFazibbNhjvlEDZNWffr86ITpei0uTOWxEUWyWKWHgN4lgu3Im+zBeZx51oNqcwsNxXep0xxt7cekCGK57C0878jGhizD+F2XzJ9E/K26vn0vaByeR2y8vwrK5pw0bq0fMKaaYNIevIof1a5UVvRbkobB0KndoWRJBToXvNjN0CB6uNqyWuh9agllxfk4cJg0LhS6CmkpVKKbGRjfP7kJusm07o7IcuHVQgG9kusqEIGg/PxpJO1zZxGIF+RX1IK1EVJXG9y7efxTJcpDFK5dw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aohG6vLtRlNapvOfQ5VISqVsngogAlVljf3cX6hEoeFfAxbk4ZGREyEmtQz9MJGu4ikjs264ChpCXwSK89TFicIdKK/G9XKjj9Q2D/zf+ztDZswkqwdn0/qwp6vlbjBkLQ3ps7kVnC8vI2JrqxYbx2uiFdAXx7z8o34lSP/RxSASV/ufQ0mwjkXVY3MA3d0S/hOdca69nG8PhgUvt+VmTuWak2np+Denh/H+WSDK0lPwKjRETJgrVsVx3iVthgqjVuxZZAqYq5uAl7BWKUbZhtC5vmwT2+hVm1yRj+Plvp49yu010wms6wl59vq0BI6jdu/q/RT8Muv1/QqiV27PVg==
  • Delivered-to: cdt-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/cdt-dev/>
  • List-help: <mailto:cdt-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/cdt-dev>, <mailto:cdt-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/cdt-dev>, <mailto:cdt-dev-request@eclipse.org?subject=unsubscribe>
  • Msip_labels: MSIP_Label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_Enabled=true; MSIP_Label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_SetDate=2022-10-13T11:34:32Z; MSIP_Label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_Method=Standard; MSIP_Label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_Name=23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0; MSIP_Label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_SiteId=75e027c9-20d5-47d5-b82f-77d7cd041e8f; MSIP_Label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_ActionId=fc12472c-c45a-4200-8bdf-9e7170814377; MSIP_Label_23add6c0-cfdb-4bb9-b90f-bf23b83aa6c0_ContentBits=2
  • Thread-index: AdjabDvvIjGidQWERk+WE6L26xYQdQADFzAAAR95+/A=
  • Thread-topic: [cdt-dev] GDB might send additional message on -stack-info-depth MI command

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

 

 

ST Restricted

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.

 

Sounds like a fun one!

 

Jonah

 


~~~
Jonah Graham
Kichwa Coders
www.kichwacoders.com

 

 

On Fri, 7 Oct 2022 at 13:34, Torbjorn SVENSSON via cdt-dev <cdt-dev@xxxxxxxxxxx> wrote:

Hello,

In recent version of GDB (https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=60c90d8c6d4b8345b41ab6a0b4d5169d5f78edb3), it's now possible for the stack unwinding to give additional information about the state of the unwind. In some situations, the unwind will be successful, but part of the registers that has been unwinded will have unreliable content.
In CDT, there is a check if the stack unwind was successful or not and if the '-stack-info-depth' command fails, we would simply try again with the '-stack-list-frames' command.

When running the GDB client in command line mode, the warning/error message would be printed to stdout (or stderr). How should we do it in CDT? Open a message box? Any better suggestions?

Here is the code that currently falls back to the '-stack-list-frames' command: https://github.com/eclipse-cdt/cdt/blob/main/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIStack.java#L1106


Any pointers is much appreciated.

Kind regards,
Torbjörn
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/cdt-dev


Back to the top