diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2024-07-16 23:52:00 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2024-08-12 10:31:09 -0400 |
commit | c8979ae4fbcc2b84b4192d0596597c3352fa430b (patch) | |
tree | f5a24bbbe6ab8b3aee270ce5bb586933371fae93 /gdb/p-lang.c | |
parent | 03b40f6f55bed82bd16b2a1fd94fb8c8dbf797bf (diff) | |
download | binutils-c8979ae4fbcc2b84b4192d0596597c3352fa430b.zip binutils-c8979ae4fbcc2b84b4192d0596597c3352fa430b.tar.gz binutils-c8979ae4fbcc2b84b4192d0596597c3352fa430b.tar.bz2 |
gdb: make lookup_minimal_symbol objf and sfile parameters optional
Most calls to lookup_minimal_symbol don't pass a value for sfile and
objf. Make these parameters optional (have a default value of
nullptr). And since passing a value to `objf` is much more common than
passing a value to `sfile`, swap the order so `objf` comes first, to
avoid having to pass a nullptr value to `sfile` when wanting to pass a
value to `objf`.
Change-Id: I8e9cc6b942e593bec640f9dfd30f62786b0f5a27
Reviewed-by: Keith Seitz <keiths@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb/p-lang.c')
-rw-r--r-- | gdb/p-lang.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gdb/p-lang.c b/gdb/p-lang.c index 9a8a35d..70f28c9 100644 --- a/gdb/p-lang.c +++ b/gdb/p-lang.c @@ -59,21 +59,20 @@ static const char GPC_MAIN_PROGRAM_NAME_2[] = "pascal_main_program"; const char * pascal_main_name (void) { - bound_minimal_symbol msym - = lookup_minimal_symbol (GPC_P_INITIALIZE, NULL, NULL); + bound_minimal_symbol msym = lookup_minimal_symbol (GPC_P_INITIALIZE); /* If '_p_initialize' was not found, the main program is likely not written in Pascal. */ if (msym.minsym == NULL) return NULL; - msym = lookup_minimal_symbol (GPC_MAIN_PROGRAM_NAME_1, NULL, NULL); + msym = lookup_minimal_symbol (GPC_MAIN_PROGRAM_NAME_1); if (msym.minsym != NULL) { return GPC_MAIN_PROGRAM_NAME_1; } - msym = lookup_minimal_symbol (GPC_MAIN_PROGRAM_NAME_2, NULL, NULL); + msym = lookup_minimal_symbol (GPC_MAIN_PROGRAM_NAME_2); if (msym.minsym != NULL) { return GPC_MAIN_PROGRAM_NAME_2; |