[v2,4/6] Minor cleanup in linespec.c:add_minsym

Message ID 20250110-linespec-state-cxx-v2-4-a17144fa5c36@tromey.com
State New
Headers
Series More linespec cleanups and C++-ification |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_check--master-arm fail Patch failed to apply

Commit Message

Tom Tromey Jan. 10, 2025, 9:29 p.m. UTC
  This cleans up a 'return' in linespec.c:add_minsym.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
---
 gdb/linespec.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
  

Patch

diff --git a/gdb/linespec.c b/gdb/linespec.c
index 09ce0d9df4a5f0f56137be99850988a670c5d68f..db979431002cc2048f9fcab52da0066793ef17c5 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -4122,11 +4122,8 @@  add_minsym (struct minimal_symbol *minsym, struct objfile *objfile,
     }
 
   /* Exclude data symbols when looking for breakpoint locations.  */
-  if (!list_mode && !msymbol_is_function (objfile, minsym))
-    return;
-
-  msyms->emplace_back (minsym, objfile);
-  return;
+  if (list_mode || msymbol_is_function (objfile, minsym))
+    msyms->emplace_back (minsym, objfile);
 }
 
 /* Search for minimal symbols called NAME.  If SEARCH_PSPACE