From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46760 invoked by alias); 10 Jan 2017 10:34:44 -0000 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 Received: (qmail 46738 invoked by uid 89); 10 Jan 2017 10:34:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: Yes, score=5.6 required=5.0 tests=BAYES_99,BAYES_999,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,MIME_BASE64_BLANKS,RP_MATCHES_RCVD,SPF_PASS autolearn=no version=3.3.2 spammy=H*M:163, H*F:D*163.com, 163com, 163.com X-HELO: m13-152.163.com Received: from m13-152.163.com (HELO m13-152.163.com) (220.181.13.152) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Jan 2017 10:34:37 +0000 Received: from xxhdx1985126$163.com ( [218.30.116.9] ) by ajax-webmail-wmsvr152 (Coremail) ; Tue, 10 Jan 2017 18:34:32 +0800 (CST) Date: Tue, 10 Jan 2017 10:34:00 -0000 From: xxhdx1985126 To: "gdb@sourceware.org" Subject: How to determine the thread holding a mutex? Content-Transfer-Encoding: base64 Content-Type: text/plain; charset=UTF-8 MIME-Version: 1.0 Message-ID: <65e6915e.b19a.15987f1923b.Coremail.xxhdx1985126@163.com> X-Coremail-Locale: zh_CN X-CM-TRANSID:mMGowACXgYy5uHRYBmOrAA--.30364W X-CM-SenderInfo: h00kv5yrzykiisw6il2tof0z/1tbiEQdaGFWBYuvFnQACsT X-Coremail-Antispam: 1U5529EdanIXcx71UUUUU7vcSsGvfC2KfnxnUU== X-IsSubscribed: yes X-SW-Source: 2017-01/txt/msg00001.txt.bz2 SGksIGV2ZXJ5b25lLgoKSSdtIHRyeWluZyB0byBkZWJ1ZyBhIHByb2JsZW0g dGhhdCBhcHBlYXJzIHRvIGJlwqBhIGRlYWRsb2NrLiBJIHdvbmRlciBpZiBJ IGNhbiB1c2UgZ2RiIHRvIGZpbmQgb3V0IHdoaWNoIHRocmVhZCBpcyBob2xk aW5nIGEgbXV0ZXguIElmIHNvLCBteSB3b3JrIHdvdWxkIGJlIG11Y2ggZWFz aWVyLCBhcyB0aGVyZSBhcmUgbWFueSB0aHJlYWRzIGluIG15IHByb2dyYW0u CgpQbGVhc2UgaGVscCBtZSwgVGhhbmsgeW91Oi0p >From gdb-return-45517-listarch-gdb=sources.redhat.com@sourceware.org Tue Jan 10 16:49:28 2017 Return-Path: Delivered-To: listarch-gdb@sources.redhat.com Received: (qmail 9439 invoked by alias); 10 Jan 2017 16:49:27 -0000 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 Delivered-To: mailing list gdb@sourceware.org Received: (qmail 9430 invoked by uid 89); 10 Jan 2017 16:49:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:sk:gdb@sou, remotely, Interrupt, lovely X-HELO: mail-it0-f54.google.com Received: from mail-it0-f54.google.com (HELO mail-it0-f54.google.com) (209.85.214.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Jan 2017 16:49:26 +0000 Received: by mail-it0-f54.google.com with SMTP id x2so92525227itf.1 for ; Tue, 10 Jan 2017 08:49:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Z1vx1P7S8nKJ/DY5VEr+mOnl6dACIXf+Icx3eDS5L0s=; b=Se2Ms2FKUSS8tXduYkz3wepvvPbngroC0zhpXB+Gy9zKakjrLwh+M+6ujU7bMnjIsF DlCop8X+zUy11xpXiBtwFKEjp63Bl1KhiPGxdKkvMV3tT2VNXLkUHtZ80CeBKWgnkoxd ghC4PGA0EjIHA8UekGvorGW2CLmODF9B3uniyDDH/onmAsXMFQZpDhxPBQfI3at4JtAC bJYiFhDem8++GfSWjLypPNO/MzrnQ3ISa/uNpHwFpuiO07+RaDOs0qCQG8TNZ/hZn/3j O9QEfsAZICe/eAxPj845pY7/2diZ4Eme7t1k72kZiRLdjR6ZDHJbLwoNyhZQ0qVnU06W RruA== X-Gm-Message-State: AIkVDXKYOLIR0kXPPiKGKdWqSf6/qvZrzYcOwo6u8lUeGX3KhJ12dIJWzrAX6vyK6/OAyN88hcurW5H55F0GJg== X-Received: by 10.36.82.22 with SMTP id d22mr3948260itb.53.1484066964095; Tue, 10 Jan 2017 08:49:24 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.96.69 with HTTP; Tue, 10 Jan 2017 08:49:23 -0800 (PST) From: Salvatore Lionetti Date: Tue, 10 Jan 2017 16:49:00 -0000 Message-ID: Subject: gdb python: how to async stop and restart remote target To: gdb@sourceware.org Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2017-01/txt/msg00002.txt.bz2 Content-length: 1216 Hi, I'm trying to define and automatize test for a C/RTEMS application, using gdb 7.11.1 with the lovely python extension. I need to asynchronously stop the target remotely connected via TCP, ex. to inject a fault or an input packet, then restarting the remote system. What is the preferred way to do it? This is what I'm trying: (EXAMPLE1) gdb.execute('target remote ...') gdb.execute('continue&') time.sleep(2) gdb.execute('interrupt') The execution of "gdb --command ... --batch" leads to: ... Cannot execute this command while the target is running. Use the 'interrupt' command to stop the target and try again. That is related to the last line with the 'interrupt' command. The remote target is stopped. After that reading from target memory leads to the same error. (EXAMPLE2) gdb.execute('target remote ...') gdb.execute('continue&') time.sleep(2) gdb.execute('interrupt') time.sleep(2) gdb.execute('continue') The command reported above leads to: ... gdb.error: Cannot execute this command while the selected thread is running. Program received signal SIGINT, Interrupt In the remote target is running at the end of the script execution. But seems to be in an inconsistent state. Have a good day