From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) by sourceware.org (Postfix) with ESMTPS id 6A6B93858402 for ; Sun, 28 Nov 2021 13:54:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6A6B93858402 Received: by mail-yb1-xb30.google.com with SMTP id f186so34177995ybg.2 for ; Sun, 28 Nov 2021 05:54:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Ja6St5aueFeEO1m19L4Nw72eFN+fkEAQz4MYZpXwS24=; b=JmbVOPSDkHCQayY3X8cb0N5aiAg1oO05GBnbWgDMwzueovim4V0+dd4JEYdN1tghBz KV23yR1TVjxKft2ez6vfWivUt6wc1esYaZod4Fd7k1XApdaEXgXIyO1yizcHS3phxh3f ieOi1oORMjxgD5/JhzH2EeqwhkThtyPyvkjAP2pIofJnzG9e+r9j/QJBBsnUlPn9WbVv fPUohsXjz/ZZVc/4tIjmCMVxL+TNYxRktC0JPEN+M35KWuhn10c3TR5pMI6ImLLv4SYr fqemNMDIu5U8dCrNIbfZoGUAstRJwIqPmz2pK1KQ93DsB3nCsRvW98VeLvL233x1xA3k 2WPQ== X-Gm-Message-State: AOAM5301X9t1nA6vi6buY+nWvOBuV3YGvg5NIVXWj+bDo6o5olgJMDTt QtbptvBmHC4YsoZr1L3FvBe7vqoQAs/Kd+1F8jRSRUO+YQA= X-Google-Smtp-Source: ABdhPJwAEEQ1epWioraSA0YGsftrK6INtZmDeVWcpl1EtD3BpLb+kATpm2iSR3A+dDJQnwSXzR4P7lu9n6u1gl94CcY= X-Received: by 2002:a25:a0c8:: with SMTP id i8mr29428001ybm.322.1638107690704; Sun, 28 Nov 2021 05:54:50 -0800 (PST) MIME-Version: 1.0 From: Andy Fan Date: Sun, 28 Nov 2021 21:54:40 +0800 Message-ID: Subject: Record replay file conditionally in c program and reply it later To: gdb@sourceware.org X-Spam-Status: No, score=2.1 required=5.0 tests=BAYES_05, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2021 13:54:55 -0000 Hi: Suppose we have code like this: int res = a_very_complex_func(); assert(res > 0); -- crashed. And the above case is not easy to reproduce. so I want to record and reply to the situation later. int res = a_very_complex_func(); if (res <= 0) { record_gdb_file_start('/tmp/assert_gt_0'); a_very_complex_func(); -- rerun this function. record_gdb_file_stop(); Assert(res > 0) -- let is crash } Later, I can use gdb with /tmp/assert_gt_0 file to replay the workload. Is it something we can do now? Thanks! -- Best Regards Andy Fan