Skip to content

[LLDB][Docstrings] Fix some poorly formatted Docstrings #129605

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 7, 2025

Conversation

Jlalond
Copy link
Contributor

@Jlalond Jlalond commented Mar 3, 2025

I was looking earlier on the public doc website, and noticed the markdown was very badly mangled for this recent docstring that I added. So I'm dropping the backticks and just leaving the snippet.

image

@llvmbot
Copy link
Member

llvmbot commented Mar 3, 2025

@llvm/pr-subscribers-lldb

Author: Jacob Lalonde (Jlalond)

Changes

I was looking earlier on the public doc website, and noticed the markdown was very badly mangled for this recent docstring that I added. So I'm dropping the backticks and just leaving the snippet.

image


Full diff: https://github.com/llvm/llvm-project/pull/129605.diff

1 Files Affected:

  • (modified) lldb/bindings/interface/SBProcessDocstrings.i (+6-6)
diff --git a/lldb/bindings/interface/SBProcessDocstrings.i b/lldb/bindings/interface/SBProcessDocstrings.i
index b5b22052a6094..e2348795d10d9 100644
--- a/lldb/bindings/interface/SBProcessDocstrings.i
+++ b/lldb/bindings/interface/SBProcessDocstrings.i
@@ -261,11 +261,11 @@ SBProcess supports thread iteration. For example (from test/lldbutil.py), ::
 
 %feature("docstring", "
     Get a list of all the memory regions associated with this process.
-    ```
-        readable_regions = []
-        for region in process.GetMemoryRegions():
-            if region.IsReadable():
-                readable_regions.append(region)
-    ```
+    
+    readable_regions = []
+    for region in process.GetMemoryRegions():
+        if region.IsReadable():
+            readable_regions.append(region)
+    
 "
 ) lldb::SBProcess::GetMemoryRegions;

@Jlalond
Copy link
Contributor Author

Jlalond commented Mar 6, 2025

@JDevlieghere I should've closed this, but I'm actually going to fix a couple spots around the codebase. It looks like Swig will give a codeblock on ::, looking at SBTargetDocstrings.i. So I'm going to reuse this patch to fix atleast SBProcess, SBProgress, and I think MemoryRegionInfo.

Is there a good place to add a blurb about these swig gotcha's? Maybe a .md in bindings/swig?

@Jlalond Jlalond changed the title [LLDB][Docstrings] Drop markdown backticks for codeblock [LLDB][Docstrings] Fix some poorly formatted Docstrings Mar 6, 2025
@Jlalond
Copy link
Contributor Author

Jlalond commented Mar 6, 2025

Attached are some images of docstrings I'm cleaning up (I also made the mess :P).

SBSaveCore formatting breaks on the newline
image

SBProgress has quote blocks instead of just a code block
image

@Jlalond Jlalond requested a review from clayborg March 6, 2025 23:58
@Jlalond
Copy link
Contributor Author

Jlalond commented Mar 6, 2025

@clayborg These are those docstring cleanups I pinged you about

@Jlalond Jlalond force-pushed the fix-process-docstring branch from c942934 to fff16a7 Compare March 7, 2025 00:03
@Jlalond Jlalond merged commit 5b1c281 into llvm:main Mar 7, 2025
5 of 8 checks passed
@JDevlieghere
Copy link
Member

Is there a good place to add a blurb about these swig gotcha's? Maybe a .md in bindings/swig?

That's a great question. There's a lot of institutional knowledge about how SWIG is used in LLDB that hasn't been written down. I think it'd be worth it to have a page on the website (under the section "developing lldb") to cover that. I'd be happy to contribute with some of the caveats/challenges/intricacies of how we use SWIG in LLDB.

@Jlalond Jlalond deleted the fix-process-docstring branch March 7, 2025 19:19
jph-13 pushed a commit to jph-13/llvm-project that referenced this pull request Mar 21, 2025
I was looking earlier on the public doc website, and noticed the
markdown was very badly mangled for this recent docstring that I added.
So I'm dropping the backticks and just leaving the snippet.


![image](https://github.com/user-attachments/assets/de63ab73-3bd5-4f8f-a07c-9f6accfee7e1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants