aboutsummaryrefslogtreecommitdiff
path: root/gdb/nat
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-10-15 11:09:07 -0600
committerTom Tromey <tom@tromey.com>2023-11-29 14:29:43 -0700
commitd182e39881061b11d1eb85426d9a6953e3171bf5 (patch)
treec292f0615eee648207c86ae7035479cb518ea81a /gdb/nat
parenta0dc1f9a12a4394463b9dbf5927166f2ab8518a6 (diff)
downloadbinutils-d182e39881061b11d1eb85426d9a6953e3171bf5.zip
binutils-d182e39881061b11d1eb85426d9a6953e3171bf5.tar.gz
binutils-d182e39881061b11d1eb85426d9a6953e3171bf5.tar.bz2
Use C++17 [[fallthrough]] attribute
This changes gdb to use the C++17 [[fallthrough]] attribute rather than special comments. This was mostly done by script, but I neglected a few spellings and so also fixed it up by hand. I suspect this fixes the bug mentioned below, by switching to a standard approach that, presumably, clang supports. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=23159 Approved-By: John Baldwin <jhb@FreeBSD.org> Approved-By: Luis Machado <luis.machado@arm.com> Approved-By: Pedro Alves <pedro@palves.net>
Diffstat (limited to 'gdb/nat')
-rw-r--r--gdb/nat/linux-btrace.c3
-rw-r--r--gdb/nat/windows-nat.c4
-rw-r--r--gdb/nat/x86-dregs.c2
3 files changed, 4 insertions, 5 deletions
diff --git a/gdb/nat/linux-btrace.c b/gdb/nat/linux-btrace.c
index c0cebbb..89bf28b 100644
--- a/gdb/nat/linux-btrace.c
+++ b/gdb/nat/linux-btrace.c
@@ -895,8 +895,7 @@ linux_read_pt (btrace_data_pt *btrace, linux_btrace_target_info *tinfo,
case BTRACE_READ_NEW:
if (!perf_event_new_data (&tinfo->pev))
return BTRACE_ERR_NONE;
-
- /* Fall through. */
+ [[fallthrough]];
case BTRACE_READ_ALL:
perf_event_read_all (&tinfo->pev, &btrace->data, &btrace->size);
return BTRACE_ERR_NONE;
diff --git a/gdb/nat/windows-nat.c b/gdb/nat/windows-nat.c
index 7951bc3..ea95f95 100644
--- a/gdb/nat/windows-nat.c
+++ b/gdb/nat/windows-nat.c
@@ -454,7 +454,7 @@ windows_process_info::handle_exception (struct target_waitstatus *ourstatus,
break;
}
#endif
- /* FALLTHROUGH */
+ [[fallthrough]];
case STATUS_WX86_BREAKPOINT:
DEBUG_EXCEPTION_SIMPLE ("EXCEPTION_BREAKPOINT");
ourstatus->set_stopped (GDB_SIGNAL_TRAP);
@@ -493,7 +493,7 @@ windows_process_info::handle_exception (struct target_waitstatus *ourstatus,
break;
}
/* treat improperly formed exception as unknown */
- /* FALLTHROUGH */
+ [[fallthrough]];
default:
/* Treat unhandled first chance exceptions specially. */
if (current_event.u.Exception.dwFirstChance)
diff --git a/gdb/nat/x86-dregs.c b/gdb/nat/x86-dregs.c
index 731093d..16669f6 100644
--- a/gdb/nat/x86-dregs.c
+++ b/gdb/nat/x86-dregs.c
@@ -289,7 +289,7 @@ Invalid hardware breakpoint type %d in x86_length_and_rw_bits.\n"),
case 8:
if (TARGET_HAS_DR_LEN_8)
return (DR_LEN_8 | rw);
- /* FALL THROUGH */
+ [[fallthrough]];
default:
internal_error (_("\
Invalid hardware breakpoint length %d in x86_length_and_rw_bits.\n"), len);