This is the mail archive of the
rda@sources.redhat.com
mailing list for the rda project.
[PATCH] rda/unix/linux-target.c, linux_write_reg: Usage of non-existant variable "pid"
- From: Corinna Vinschen <vinschen at redhat dot com>
- To: rda at sources dot redhat dot com
- Date: Wed, 11 Aug 2004 18:54:01 +0200
- Subject: [PATCH] rda/unix/linux-target.c, linux_write_reg: Usage of non-existant variable "pid"
Hi,
I found a bug in linux_write_reg(), which uses a variable "pid" when
printing a status message to stderr. But there's no local variable "pid"
defined in that function so that building rda/unix/linux-target.c fails
with "error: `pid' undeclared". I've applied the following patch:
* linux-target.c (linux_write_reg): Print process->pid in case of
an error.
Index: linux-target.c
===================================================================
RCS file: /cvs/src/src/rda/unix/linux-target.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -p -r1.12 -r1.13
--- linux-target.c 5 Apr 2004 23:11:41 -0000 1.12
+++ linux-target.c 11 Aug 2004 14:57:06 -0000 1.13
@@ -2250,7 +2250,7 @@ linux_write_reg (struct gdbserv *serv, i
if (errno)
{
fprintf (stderr, "PT_WRITE_U 0x%08lx from 0x%08lx in process %d\n",
- (long) regval, (long) regaddr, pid);
+ (long) regval, (long) regaddr, process->pid);
return -1;
}
else
Corinna