[lldb] Fix frame-format string missing space when module is invalid#172767
[lldb] Fix frame-format string missing space when module is invalid#172767medismailben merged 1 commit intollvm:mainfrom
Conversation
|
@llvm/pr-subscribers-lldb Author: Med Ismail Bennani (medismailben) ChangesThis patch is a follow-up to 96c733e to fix a missing space in the frame.pc format entity. This space was intended to be prepended to the module format entity scope but in case the module is not valid, which is often the case for python pc-less scripted frames, the space between the pc and the function name is missing. Full diff: https://github.com/llvm/llvm-project/pull/172767.diff 1 Files Affected:
diff --git a/lldb/source/Core/CoreProperties.td b/lldb/source/Core/CoreProperties.td
index a54d5538f4c0c..99bb5a3fc6f73 100644
--- a/lldb/source/Core/CoreProperties.td
+++ b/lldb/source/Core/CoreProperties.td
@@ -59,7 +59,7 @@ let Definition = "debugger" in {
Desc<"The default disassembly format string to use when disassembling instruction sequences.">;
def FrameFormat: Property<"frame-format", "FormatEntity">,
Global,
- DefaultStringValue<"frame #${frame.index}: {${ansi.fg.cyan}${frame.pc}${ansi.normal}}{ ${module.file.basename}{`}}{${function.name-with-args}{${frame.no-debug}${function.pc-offset}}}{ at ${ansi.fg.cyan}${line.file.basename}${ansi.normal}:${ansi.fg.yellow}${line.number}${ansi.normal}{:${ansi.fg.yellow}${line.column}${ansi.normal}}}${frame.kind}{${function.is-optimized} [opt]}{${function.is-inlined} [inlined]}{${frame.is-artificial} [artificial]}\\\\n">,
+ DefaultStringValue<"frame #${frame.index}: {${ansi.fg.cyan}${frame.pc}${ansi.normal} }{${module.file.basename}{`}}{${function.name-with-args}{${frame.no-debug}${function.pc-offset}}}{ at ${ansi.fg.cyan}${line.file.basename}${ansi.normal}:${ansi.fg.yellow}${line.number}${ansi.normal}{:${ansi.fg.yellow}${line.column}${ansi.normal}}}${frame.kind}{${function.is-optimized} [opt]}{${function.is-inlined} [inlined]}{${frame.is-artificial} [artificial]}\\\\n">,
Desc<"The default frame format string to use when displaying stack frame information for threads.">;
def NotiftVoid: Property<"notify-void", "Boolean">,
Global,
@@ -235,7 +235,7 @@ let Definition = "debugger" in {
Desc<"If true, LLDB will automatically escape non-printable and escape characters when formatting strings.">;
def FrameFormatUnique: Property<"frame-format-unique", "FormatEntity">,
Global,
- DefaultStringValue<"frame #${frame.index}: {${ansi.fg.cyan}${frame.pc}${ansi.normal}}{ ${module.file.basename}{`}}{${function.name-without-args}{${frame.no-debug}${function.pc-offset}}}{ at ${ansi.fg.cyan}${line.file.basename}${ansi.normal}:${ansi.fg.yellow}${line.number}${ansi.normal}{:${ansi.fg.yellow}${line.column}${ansi.normal}}}${frame.kind}{${function.is-optimized} [opt]}{${function.is-inlined} [inlined]}{${frame.is-artificial} [artificial]}\\\\n">,
+ DefaultStringValue<"frame #${frame.index}: {${ansi.fg.cyan}${frame.pc}${ansi.normal} }{${module.file.basename}{`}}{${function.name-without-args}{${frame.no-debug}${function.pc-offset}}}{ at ${ansi.fg.cyan}${line.file.basename}${ansi.normal}:${ansi.fg.yellow}${line.number}${ansi.normal}{:${ansi.fg.yellow}${line.column}${ansi.normal}}}${frame.kind}{${function.is-optimized} [opt]}{${function.is-inlined} [inlined]}{${frame.is-artificial} [artificial]}\\\\n">,
Desc<"The default frame format string to use when displaying stack frame information for threads from thread backtrace unique.">;
def ShowAutosuggestion: Property<"show-autosuggestion", "Boolean">,
Global,
|
6dad74d to
fedb0e6
Compare
|
✅ With the latest revision this PR passed the Python code formatter. |
This patch is a follow-up to 96c733e to fix a missing space in the frame.pc format entity. This space was intended to be prepended to the module format entity scope but in case the module is not valid, which is often the case for python pc-less scripted frames, the space between the pc and the function name is missing. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
fedb0e6 to
bad0eb0
Compare
DavidSpickett
left a comment
There was a problem hiding this comment.
LGTM assuming returning a frame index is intentional.
| return ValidPCNoModuleFrame(self.thread, 1, 0x5678000, "unknown_function_2") | ||
| elif index - 2 < len(self.input_frames): | ||
| # Pass through original frames | ||
| return index - 2 |
There was a problem hiding this comment.
Not familiar with the details, but I'd expect to return some frame object here to follow the pattern of the rest.
If it returns a number does something else look that up in the real frames?
There was a problem hiding this comment.
@DavidSpickett Exactly, if we return an integer (which is a valid frame index), it will create a BorrowStackFrame out of it and include it in the new backtrace: https://github.com/llvm/llvm-project/blob/main/lldb/source/Plugins/SyntheticFrameProvider/ScriptedFrameProvider/ScriptedFrameProvider.cpp#L168-L177
…lvm#172767) This patch is a follow-up to 96c733e to fix a missing space in the frame.pc format entity. This space was intended to be prepended to the module format entity scope but if the module is not valid, which is often the case for python pc-less scripted frames, the space between the pc and the function name is missing. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
…lvm#172767) This patch is a follow-up to 96c733e to fix a missing space in the frame.pc format entity. This space was intended to be prepended to the module format entity scope but if the module is not valid, which is often the case for python pc-less scripted frames, the space between the pc and the function name is missing. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
…lvm#172767) This patch is a follow-up to 96c733e to fix a missing space in the frame.pc format entity. This space was intended to be prepended to the module format entity scope but if the module is not valid, which is often the case for python pc-less scripted frames, the space between the pc and the function name is missing. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma> (cherry picked from commit 6767b86)
This patch is a follow-up to 96c733e to fix a missing space in the frame.pc format entity. This space was intended to be prepended to the module format entity scope but if the module is not valid, which is often the case for python pc-less scripted frames, the space between the pc and the function name is missing.