Skip to content

Commit 6121eeb

Browse files
committed
Clean up unusual code in mi-cmd-stack.c
I noticed some unusual code in mi-cmd-stack.c. This code is a switch, where one of the cases appears in the middle of another block. It seemed cleaner to me to have the earlier case just conditionally fall through.
1 parent 0e46a09 commit 6121eeb

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

gdb/mi/mi-cmd-stack.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,6 @@ list_args_or_locals (const frame_print_options &fp_opts,
571571
const struct block *block;
572572
struct symbol *sym;
573573
struct block_iterator iter;
574-
struct type *type;
575574
const char *name_of_result;
576575
struct ui_out *uiout = current_uiout;
577576

@@ -649,17 +648,20 @@ list_args_or_locals (const frame_print_options &fp_opts,
649648
switch (values)
650649
{
651650
case PRINT_SIMPLE_VALUES:
652-
type = check_typedef (sym2->type ());
653-
if (type->code () != TYPE_CODE_ARRAY
654-
&& type->code () != TYPE_CODE_STRUCT
655-
&& type->code () != TYPE_CODE_UNION)
656-
{
651+
{
652+
struct type *type = check_typedef (sym2->type ());
653+
if (type->code () == TYPE_CODE_ARRAY
654+
|| type->code () == TYPE_CODE_STRUCT
655+
|| type->code () == TYPE_CODE_UNION)
656+
break;
657+
}
658+
/* FALLTHROUGH */
659+
657660
case PRINT_ALL_VALUES:
658661
if (sym->is_argument ())
659662
read_frame_arg (fp_opts, sym2, fi, &arg, &entryarg);
660663
else
661664
read_frame_local (sym2, fi, &arg);
662-
}
663665
break;
664666
}
665667

0 commit comments

Comments
 (0)