From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7970 invoked by alias); 10 Dec 2012 15:00:33 -0000 Received: (qmail 7943 invoked by uid 22791); 10 Dec 2012 15:00:30 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from vl05.dinaserver.com (HELO vl05.dinaserver.com) (82.98.145.70) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 10 Dec 2012 15:00:19 +0000 Received: from linux-8yvd.site (110.Red-79-156-132.staticIP.rima-tde.net [79.156.132.110]) by vl05.dinaserver.com (Postfix) with ESMTPA id 0B2991E9F2; Mon, 10 Dec 2012 16:00:05 +0100 (CET) Message-ID: <50C5F90B.90204@larraioz.com> Date: Mon, 10 Dec 2012 15:00:00 -0000 From: John Martin User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120328 Thunderbird/11.0.1 MIME-Version: 1.0 To: jan.kratochvil@redhat.com CC: gdb@sourceware.org Subject: Doubts with GDB and GDBSERVER References: <50C5F681.8050505@larraioz.com> In-Reply-To: <50C5F681.8050505@larraioz.com> X-Forwarded-Message-Id: <50C5F681.8050505@larraioz.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DinaScanner-Information: DinaScanner. Filtro anti-Spam y anti-Virus X-MailScanner-ID: 0B2991E9F2.35C5E X-DinaScanner: Libre de Virus X-DinaScanner-SpamCheck: no es spam, SpamAssassin (not cached, puntaje=-4.399, requerido 6, autolearn=not spam, ALL_TRUSTED -1.80, BAYES_00 -2.60) X-DinaScanner-From: jmartin@larraioz.com Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-12/txt/msg00043.txt.bz2 Hello Jan, Great, it works. Without binary in host computer, I can read symbol table from remote target. By other hand, I am using GDB with interpreter MI (Machine Interface). It works fine but there is a bit problem. I have tried to send commands from C program to GDB using libmigdb library. Example code: //************************************************************************************ void InitGDBmi () { mi_set_gdb_exe(nameGDB); h = mi_connect_local(); if (!h) printf("Connect failed\n"); // mi_set_console_cb(h,cb_console,NULL); // mi_set_target_cb(h,cb_target,NULL); // mi_set_log_cb(h,cb_log,NULL); // mi_set_async_cb(h,cb_async,NULL); // mi_set_to_gdb_cb(h,cb_to,NULL); mi_set_from_gdb_cb(h,cb_from,NULL); gmi_set_exec(h, "LINMOT_TEST", "-qws"); } int CallWhatis(char *data) { memset(&mensaje[0], 0, sizeof(mensaje)); strcpy(mensaje, "whatis "); strcat(mensaje, data); mi_send(h,"%s\n",mensaje); return mi_res_simple_done(h); } int CallPtype(char *data) { memset(&mensaje[0], 0, sizeof(mensaje)); strcpy(mensaje, "ptype "); strcat(mensaje, data); mi_send(h,"%s\n",mensaje); return mi_res_simple_done(h); } int CallSizeOf(char *data) { memset(&mensaje[0], 0, sizeof(mensaje)); strcpy(mensaje, "p sizeof("); strcat(mensaje, data); strcat(mensaje, ")"); mi_send(h,"%s\n",mensaje); return mi_res_simple_done(h); } int CallAddr(char *data) { memset(&mensaje[0], 0, sizeof(mensaje)); strcpy(mensaje, "p &"); strcat(mensaje, data); mi_send(h,"%s\n",mensaje); return mi_res_simple_done(h); } //************************************************************************************ In other part of the programm, I call all functions: void VarInfo (void) { CallWhatis(nameVar); CallPtype(nameVar); CallAddr(nameVar); CallSizeOf(nameVar); } And after it, gdb give a response: << &"whatis PCISRAM_FD\n" << ~"type = INT\n" << ^done << (gdb) << &"ptype PCISRAM_FD\n" << ~"type = short int\n" << ^done << (gdb) << &"p &PCISRAM_FD\n" << ~"$1 = (INT *) 0x8670296 \n" << ^done << (gdb) But gdb does not send me response about size of variable. But if I call again VarInfo function, gdb return me ..... << &"p sizeof(PCISRAM_FD)\n" << ~"$2 = 2" << ~"\n" << ^done << (gdb) << &"whatis panel_access_code\n" << ~"type = INT\n" << ^done << (gdb) Fwd: Fwd: Fwd: Re: << &"ptype panel_access_code\n" << ~"type = short int\n" << ^done << (gdb) << &"p &panel_access_code\n" << ~"$3 = (INT *) 0x8670324 \n" << ^done << (gdb) I have received the size of var last request and receive new infromation of new var less sizeof. Could somebody known gdb does not return me all request at the same time??? Best regards.