Re: [PATCH v2 6/8] Windows gdb: Get available XState features

Tom Tromey <[email protected]>
Newsgroups gmane.comp.gdb.patches
Message-ID <[email protected]>
>>>>> "Hannes" == Hannes Domani <[email protected]> writes:

Hannes> Also prepares the thread context for the additional registers.

SOme minor nits.

Hannes> +      CONTEXT *context = nullptr;
Hannes> +      if (!InitializeContext (th->context_buffer.get (),
Hannes> +			      context_flags, &context, &xstate_size))
Hannes> +	error ("InitializeContext failure %lu\n", GetLastError ());

How about throw_winerror_with_name instead?

Hannes> +#if defined __i386__ || defined __x86_64__
Hannes> +  if (GetEnabledXStateFeatures != nullptr
Hannes> +      && InitializeContext != nullptr
Hannes> +      && GetXStateFeaturesMask != nullptr
Hannes> +      && SetXStateFeaturesMask != nullptr
Hannes> +      && LocateXStateFeature != nullptr
Hannes> +#ifdef __x86_64__
Hannes> +      && RtlGetExtendedFeaturesMask != nullptr
Hannes> +      && RtlSetExtendedFeaturesMask != nullptr
Hannes> +      && RtlLocateExtendedFeature != nullptr
Hannes> +#endif
Hannes> +  )
Hannes> +    {
Hannes> +      /* Available XState features masked with implemented features.  */
Hannes> +      xstate_features = GetEnabledXStateFeatures ()
Hannes> +	& (X86_XSTATE_AVX_AVX512_MASK | X86_XSTATE_CET_U);

Formatting is off here, maybe parenthesize the RHS.

Tom
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.