Skip to content

[lldb] Fix help syntax for add-dsym (target symbols add) #98976

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 1 commit into from
Jul 16, 2024

Conversation

JDevlieghere
Copy link
Member

The help output incorrectly states that this command takes a shared library name () while really it takes a path to a symbol file.

rdar://131777043

The help output incorrectly states that this command takes a shared
library name (<shlib-name>) while really it takes a path to a symbol
file.

rdar://131777043
@JDevlieghere JDevlieghere requested a review from jimingham July 15, 2024 23:30
@llvmbot llvmbot added the lldb label Jul 15, 2024
@llvmbot
Copy link
Member

llvmbot commented Jul 15, 2024

@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)

Changes

The help output incorrectly states that this command takes a shared library name (<shlib-name>) while really it takes a path to a symbol file.

rdar://131777043


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

2 Files Affected:

  • (modified) lldb/source/Commands/CommandObjectTarget.cpp (+1-1)
  • (modified) lldb/test/Shell/SymbolFile/add-dsym.test (+3)
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index 80181a9b3cb71..d594330934ad7 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -4252,7 +4252,7 @@ class CommandObjectTargetSymbolsAdd : public CommandObjectParsed {
     m_option_group.Append(&m_current_stack_option, LLDB_OPT_SET_2,
                           LLDB_OPT_SET_2);
     m_option_group.Finalize();
-    AddSimpleArgumentList(eArgTypeShlibName);
+    AddSimpleArgumentList(eArgTypeFilename);
   }
 
   ~CommandObjectTargetSymbolsAdd() override = default;
diff --git a/lldb/test/Shell/SymbolFile/add-dsym.test b/lldb/test/Shell/SymbolFile/add-dsym.test
index cdcba641957d1..52d1a1363feef 100644
--- a/lldb/test/Shell/SymbolFile/add-dsym.test
+++ b/lldb/test/Shell/SymbolFile/add-dsym.test
@@ -1,5 +1,8 @@
 # REQUIRES: system-darwin
 
+# RUN: %lldb -o 'help add-dsym' | FileCheck %s --check-prefix=HELP
+# HELP: Syntax: add-dsym <cmd-options> <filename>
+
 # RUN: yaml2obj %S/Inputs/a.yaml -o %t.out
 # RUN: LLDB_APPLE_DSYMFORUUID_EXECUTABLE=%S/Inputs/dsymforuuid.sh %lldb %t.out -o 'add-dsym -u 41945CA4-5D9D-3CDE-82B4-37E4C09750B5' 2>&1 | FileCheck %s
 # CHECK: UUID information was not found

@jimingham
Copy link
Collaborator

I'm a little surprised we don't have an argument type for eArgTypeSymbolFile. But I guess this is really the only command that uses it.
I don't think it matters all that much, however, eArgTypeFilename is fine.

Copy link
Collaborator

@jimingham jimingham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine.

@JDevlieghere JDevlieghere merged commit b3e1f1b into llvm:main Jul 16, 2024
6 of 7 checks passed
@JDevlieghere JDevlieghere deleted the rdar/131777043 branch July 16, 2024 04:11
yuxuanchen1997 pushed a commit that referenced this pull request Jul 25, 2024
Summary:
The help output incorrectly states that this command takes a shared
library name (<shlib-name>) while really it takes a path to a symbol
file.

rdar://131777043

Test Plan: 

Reviewers: 

Subscribers: 

Tasks: 

Tags: 


Differential Revision: https://phabricator.intern.facebook.com/D60251520
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants