aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi/mi-cmd-stack.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-01-25 08:04:39 -0700
committerTom Tromey <tromey@adacore.com>2023-01-25 12:29:03 -0700
commit6121eeb72978cc5749c4c9f119b4dbaf637517c9 (patch)
tree42b306928f011663886ed20b4c37cb53d8db23ee /gdb/mi/mi-cmd-stack.c
parent0e46a09d12aa9c2c77d783ace336866e429ffa73 (diff)
downloadgdb-6121eeb72978cc5749c4c9f119b4dbaf637517c9.zip
gdb-6121eeb72978cc5749c4c9f119b4dbaf637517c9.tar.gz
gdb-6121eeb72978cc5749c4c9f119b4dbaf637517c9.tar.bz2
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.
Diffstat (limited to 'gdb/mi/mi-cmd-stack.c')
-rw-r--r--gdb/mi/mi-cmd-stack.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c
index 00e61e0..4666808 100644
--- a/gdb/mi/mi-cmd-stack.c
+++ b/gdb/mi/mi-cmd-stack.c
@@ -571,7 +571,6 @@ list_args_or_locals (const frame_print_options &fp_opts,
const struct block *block;
struct symbol *sym;
struct block_iterator iter;
- struct type *type;
const char *name_of_result;
struct ui_out *uiout = current_uiout;
@@ -649,17 +648,20 @@ list_args_or_locals (const frame_print_options &fp_opts,
switch (values)
{
case PRINT_SIMPLE_VALUES:
- type = check_typedef (sym2->type ());
- if (type->code () != TYPE_CODE_ARRAY
- && type->code () != TYPE_CODE_STRUCT
- && type->code () != TYPE_CODE_UNION)
- {
+ {
+ struct type *type = check_typedef (sym2->type ());
+ if (type->code () == TYPE_CODE_ARRAY
+ || type->code () == TYPE_CODE_STRUCT
+ || type->code () == TYPE_CODE_UNION)
+ break;
+ }
+ /* FALLTHROUGH */
+
case PRINT_ALL_VALUES:
if (sym->is_argument ())
read_frame_arg (fp_opts, sym2, fi, &arg, &entryarg);
else
read_frame_local (sym2, fi, &arg);
- }
break;
}