Re: gdbserver for arm does not support multi-process debugging
Luis Machado <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <[email protected]> |
Do let us know what you see. If it still doesn't work with the most recent versions, it may be a real bug somewhere (not necessarily in gdb/gdbserver). On 10/28/19 8:12 AM, 刘康 wrote: > Hi, > I see, maybe my gdbserver version is too old...I'll compile a latest > version and try again. > > Thank you so much for your help! > > > At 2019-10-24 18:38:46, "Luis Machado" <[email protected]> wrote: >>Hi, >> >>I just ran a quick check (foll-fork.exp and follow-vfork.exp tests) on a >>arm machine and things worked as expected. >> >>What version of GDB/kernel are you using? >> >>On 10/24/19 2:32 AM, 刘康 wrote: >>> Hi Luis, >>> >>> Yes, I know that gdbserver willcatch PTRACE_EVENT_FORK in >>> gdb/gdbserver/linux-low.c:handle_extended_wait and get the child >>> process's pid via PTRACE_GETEVENTMSG. >>> >>> I found the way of X86 version gdb to deal with PTRACE_EVENT_FORKwill >>> set waitstatus toTARGET_WAITKIND_FORKED and add a new inferior .What's >>> more ,it can trace child/parent process automatically as long as I set >>> "follow-fork-mode" to "child" or "parent". >>> >>> But it seems like gdbserver will not tell PTRACE_EVENT_FORK to thehost >>> arm-XXX-gdb this event ,as a result , user cannot trace child process or >>> add a new inferior no matter what value of "detach-on-fork off" and >>> "follow-fork-mode" I have tried. >>> >>> At 2019-10-18 20:27:19, "Luis Machado" <[email protected]> wrote: >>>>Hi, >>>> >>>>On 10/17/19 3:19 AM, 刘康 wrote: >>>>> Dear [email protected] >>>>> >>>>> >>>>> I am researching the gdbserver's source code for ARM, what confused me is that it does not support multi-process to debug the target's child process, cause it dose not interesting in PTRACE_EVENT_FORK, I don't know whether it's a bug or it's just a feature by design. >>>> >>>>The handling of PTRACE_EVENT_FORK, PTRACE_EVENT_VFORK and >>>>PTRACE_EVENT_CLONE is in generic linux code. See >>>>gdb/gdbserver/linux-low.c:handle_extended_wait. >>>> >>>>As long as the kernel supports reporting such events via ptrace and we >>>>are debugging using extended remote mode (not regular remote mode), it >>>>should work. If it doesn't, then we may have a problem that we should fix. >>>> >>>>Does that answer your question? >>>> >>>>Luis >>> >>> >>> > > >