Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Dec 2000 15:30:51 -0500 (EST)
From:      Zhiui Zhang <zzhang@cs.binghamton.edu>
To:        Brian Dean <bsd@bsdhome.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: ptrace(PT_GETDBREGS) message in remote debugging
Message-ID:  <Pine.SOL.4.21.0012071528160.21496-100000@onyx>
In-Reply-To: <20001206194209.B94389@vger.bsdhome.com>

next in thread | previous in thread | raw e-mail | index | archive | help

Thanks. I tried this on FreeBSD 4.2-Release (because I do not have a
stable or current), but I failed:

# make

Warning: Object directory not changed from original
/usr/src/gnu/usr.bin/binutils/gdb


cc: ../libbfd/libbfd.a: No such file or directory
cc: ../libopcodes/libopcodes.a: No such file or directory
cc: ../libiberty/libiberty.a: No such file or directory
*** Error code 1

Stop in /usr/src/gnu/usr.bin/binutils/gdb.

What should I do?

-Zhihui

On Wed, 6 Dec 2000, Brian Dean wrote:

> Index: freebsd-nat.c
> ===================================================================
> RCS file: /usr00/FreeBSD/mirror/ncvs/src/gnu/usr.bin/binutils/gdb/i386/freebsd-nat.c,v
> retrieving revision 1.21.4.2
> diff -u -r1.21.4.2 freebsd-nat.c
> --- freebsd-nat.c	2000/08/22 12:28:19	1.21.4.2
> +++ freebsd-nat.c	2000/12/07 00:31:52
> @@ -478,14 +478,16 @@
>  {
>    struct dbreg dbr;
>    extern int inferior_pid;
> -  
> +
>    if (inferior_pid != 0 && core_bfd == NULL) 
>      {
>        int pid = inferior_pid & ((1 << 17) - 1);	/* XXX extract pid from tid */
> -  
> +
>        if (ptrace(PT_GETDBREGS, pid, (caddr_t)&dbr, 0) == -1)
>  	{
> -	  perror("ptrace(PT_GETDBREGS) failed");
> +          /* don't complain on ESRCH, assume we are debugging a remote target */
> +          if (errno != ESRCH) 
> +              perror("ptrace(PT_GETDBREGS) failed");
>  	  return 0;
>  	}
>  #if WATCHPOINT_DEBUG > 1
> @@ -520,7 +522,10 @@
>  
>        if (ptrace(PT_GETDBREGS, pid, (caddr_t)&dbr, 0) == -1)
>  	{
> -	  perror("ptrace(PT_GETDBREGS) failed");
> +          /* don't complain on ESRCH, assume we are debugging a remote target */
> +          if (errno != ESRCH) 
> +              perror("ptrace(PT_GETDBREGS) failed");
> +              
>  	  return 0;
>  	}
>  
> @@ -615,7 +620,9 @@
>    
>        if (ptrace(PT_GETDBREGS, pid, (caddr_t)&dbr, 0) == -1)
>  	{
> -	  perror("ptrace(PT_GETDBREGS) failed");
> +          /* don't complain on ESRCH, assume we are debugging a remote target */
> +          if (errno != ESRCH) 
> +              perror("ptrace(PT_GETDBREGS) failed");
>  	  return 0;
>  	}
>  



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.4.21.0012071528160.21496-100000>