This is the mail archive of the 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: [RFC] Support command "catch syscall" properly on different targets

On 03/03/2015 12:11 PM, Yao Qi wrote:
> Sergio Durigan Junior <> writes:
>> You mean it's possible to use "catch syscall" on HP-UX targets?  I
>> wonder how it works.
> Yes, that is what I meant, at least that is what I can tell from the
> source.

was supported by the HP-UX target long before GNU/Linux gained
support.  See inf-ttrace.c.  However, I don't think "catch syscall"
itself ever did.  inf_ttrace_enable_syscall_events is only used
for watchpoints.  Not that I find we should go fix it, mind you.

In gdb 6.8, for example, we had:

      /* Be careful not to try to gather much state about a thread
         that's in a syscall.  It's frequently a losing proposition.  */
      if (debug_infrun)
        fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_SYSCALL_ENTRY\n");
      resume (0, TARGET_SIGNAL_0);
      prepare_to_wait (ecs);

      /* Before examining the threads further, step this thread to
         get it entirely out of the syscall.  (We get notice of the
         event when the thread is just on the verge of exiting a
         syscall.  Stepping one instruction seems to get it back
         into user code.)  */
      if (debug_infrun)
        fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_SYSCALL_RETURN\n");
      target_resume (ecs->ptid, 1, TARGET_SIGNAL_0);
      prepare_to_wait (ecs);

I'd guess once this step after TARGET_WAITKIND_SYSCALL_RETURN
finishes, watchpoints end up processed.  Sounds like watchpoints
are broken on hpux then.  Not that anyone really cares though...

Pedro Alves

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