From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Snyder To: Eli Zaretskii Cc: kettenis@wins.uva.nl, gdb-patches@sources.redhat.com Subject: Re: [PATCH]: Make Linux use the new unified x86 watchpoint support Date: Tue, 27 Mar 2001 11:57:00 -0000 Message-id: <3AC0F081.5923D16D@cygnus.com> References: <3AC0C414.2954@redhat.com> <200103271743.MAA08162@indy.delorie.com> X-SW-Source: 2001-03/msg00508.html Eli Zaretskii wrote: > > > Date: Tue, 27 Mar 2001 08:47:16 -0800 > > From: Michael Snyder > > > > The gdb was configured for native linux, but until this change, > > it was also able to be used to debug a remote embedded i386 > > target. This change breaks that, because it makes ptrace calls. > > How does GDB know if the target is local or remote? Can the Linux > implementation of I386_DR_LOW_* macros test that and avoid calling > ptrace in that case? If you say "run" it's native -- if you say "target remote /dev/tty0" it's remote. Or did you mean how can you tell programmatically? There is no clean way, other than to test "current_target", eg. if (strcmp (current_target.to_shortname, "remote") == 0) and that's obviously not the nicest approach. > Also, since I see that the Linux port of GDB was linking in > i386v-nat.c, and i386v-nat.c defined those same watchpoint-related > functions which called ptrace, and did that unconditionally, how did > that work before the last changes? I've no idea, I just know that it suddenly stopped working with these changes. And I'm not talking about watchpoints working -- I'm talking about _anything_ working. There is a call to STOPPED_BY_WATCHPOINT in wait_for_inferior, and you can't even connect to the target without wait_for_inferior being called.