This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]