This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix debugging kfreebsd-amd64 lockup


On 05/24/2013 09:27 PM, Hector Oron wrote:
> Hello,
> 
>   The patch is missing a changelog entry, but could you please comment
> on the following code:

Please see:

http://sourceware.org/gdb/wiki/ContributionChecklist

> 
> --- a/gdb/common/signals.c
> +++ b/gdb/common/signals.c
> @@ -600,6 +600,15 @@
>        return SIGINFO;
>  #endif
> 
> +#if defined(__GLIBC__) && defined(__FreeBSD_kernel__)
> +    case TARGET_SIGNAL_LINUXTHREADS_RESTART:
> +      return 32;
> +    case TARGET_SIGNAL_LINUXTHREADS_CANCEL:
> +      return 33;
> +    case TARGET_SIGNAL_LINUXTHREADS_DEBUG:
> +      return 34;
> +#endif

Note signals have been renamed GDB_SIGNAL_XXX from
TARGET_SIGNAL_XXX a while ago.

But GDB_SIGNAL_LINUXTHREADS_RESTART etc. aren't defined anywhere
in upstream GDB AFAICS.  Looks like this depends on other patches.

The downstream bug report is pretty vague.  :-(

32-34 would be the first realtime signals, right?

Why aren't these bits in that same file working for you then? :

/* Always use __SIGRTMIN if it's available.  SIGRTMIN is the lowest
   _available_ realtime signal, not the lowest supported; glibc takes
   several for its own use.  */

#ifndef REALTIME_LO
# if defined(__SIGRTMIN)
#  define REALTIME_LO __SIGRTMIN
#  define REALTIME_HI (__SIGRTMAX + 1)
# elif defined(SIGRTMIN)
#  define REALTIME_LO SIGRTMIN
#  define REALTIME_HI (SIGRTMAX + 1)
# endif
#endif

...

#if defined (REALTIME_LO)
  if (hostsig >= REALTIME_LO && hostsig < REALTIME_HI)
    {
      /* This block of GDB_SIGNAL_REALTIME value is in order.  */
      if (33 <= hostsig && hostsig <= 63)
	return (enum gdb_signal)
	  (hostsig - 33 + (int) GDB_SIGNAL_REALTIME_33);
      else if (hostsig == 32)
	return GDB_SIGNAL_REALTIME_32;
      else if (64 <= hostsig && hostsig <= 127)
	return (enum gdb_signal)
	  (hostsig - 64 + (int) GDB_SIGNAL_REALTIME_64);
      else
	error (_("GDB bug: target.c (gdb_signal_from_host): "
	       "unrecognized real-time signal"));
    }
#endif

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]