This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Capture debug output via gdb
- From: cheyman at scmmicro dot fr
- To: gdb at sources dot redhat dot com
- Date: Mon, 21 Oct 2002 14:29:40 +0200
- Subject: Capture debug output via gdb
Hello * ,
I am trying to debug my board using gdb-insight on an arm angel/ethernet
target.
I'd like to know if this way to write debug info in a file on my remote PC
could work (here is the source code), or if there is a better way more
often used :
#include <sys/unistd.h>
#include <sys/fcntl.h>
#include <string.h>
static int debugfd=-1;
int SimPrint(char *data) {
// Where data is a zero terminated string that must be send to the
PC
if (debugfd==-1) {
debugfd=open("debug.log", O_RDWR|O_CREAT|O_TRUNC,0660);
if (debugfd==-1) return -1;
}
int len=strlen(data);
write(debugfd, data, len);
return 0;
}
Actually, I suppose it does not work because I can't find any information
in debug.log.
Thanks in advance,
Cédric H