char *p;
enum Z_packet_type packet = watchpoint_to_Z_packet (type);
- if (m_features.packet_support (PACKET_Z0 + packet) == PACKET_DISABLE)
+ if (m_features.packet_support ((to_underlying (PACKET_Z0)
+ + to_underlying (packet))) == PACKET_DISABLE)
return 1;
/* Make sure the remote is pointing at the right process, if
putpkt (rs->buf);
getpkt (&rs->buf, 0);
- switch (m_features.packet_ok (rs->buf, PACKET_Z0 + packet))
+ switch (m_features.packet_ok (rs->buf, (to_underlying (PACKET_Z0)
+ + to_underlying (packet))))
{
case PACKET_ERROR:
return -1;
char *p;
enum Z_packet_type packet = watchpoint_to_Z_packet (type);
- if (m_features.packet_support (PACKET_Z0 + packet) == PACKET_DISABLE)
+ if (m_features.packet_support ((to_underlying (PACKET_Z0)
+ + to_underlying (packet))) == PACKET_DISABLE)
return -1;
/* Make sure the remote is pointing at the right process, if
putpkt (rs->buf);
getpkt (&rs->buf, 0);
- switch (m_features.packet_ok (rs->buf, PACKET_Z0 + packet))
+ switch (m_features.packet_ok (rs->buf, (to_underlying (PACKET_Z0)
+ + to_underlying (packet))))
{
case PACKET_ERROR:
case PACKET_UNKNOWN:
/* Hide the upper halves of the cvs0~cvs31 registers. */
if (PPC_CVSR0_UPPER_REGNUM <= regno
- && regno < PPC_CVSR0_UPPER_REGNUM + ppc_num_gprs)
+ && regno < (to_underlying (PPC_CVSR0_UPPER_REGNUM)
+ + to_underlying (ppc_num_gprs)))
return "";
/* Check if the SPE pseudo registers are available. */
#include <string>
#include <functional>
+#include "gdbsupport/underlying.h"
+
/* Reasons for calling throw_exceptions(). NOTE: all reason values
must be different from zero. enum value 0 is reserved for internal
use as the return value from an initial setjmp(). */
{
size_t operator() (const gdb_exception &exc) const
{
- size_t result = exc.reason + exc.error;
+ size_t result = to_underlying (exc.reason) + to_underlying (exc.error);
if (exc.message != nullptr)
result += std::hash<std::string> {} (*exc.message);
return result;