From patchwork Sat Apr 20 05:56:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thiago Jung Bauermann X-Patchwork-Id: 56901 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3E13E3858429 for ; Sat, 20 Apr 2024 05:57:34 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id 5A3FD3858D33 for ; Sat, 20 Apr 2024 05:56:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5A3FD3858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5A3FD3858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::436 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713592623; cv=none; b=o8Jnlh8541YVI8ZH6Lg5f1zZnVjs4l67NOkc2EY98vEfkBXc2+tDw86HHJbVcFmURV/d+5h7Vo+RaNhTH2yKY/eXCFqtFZSLZ8HWe1qH54i8ygRT+/Iqpwxhol6XJp9e1xzBpyATvBSwNzpsStptFAnEYJVorg2/LOm7/T6GaSw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713592623; c=relaxed/simple; bh=Zh7ldgBxi4xSkynVyNPw+kycdnT3FQ8ZWDiobPidLm8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=UbgAJ+CGr+yMm7ScW3ghDRfTsgPd//hptYo2U3Jn0Cfcho9ruYQfprArBglg5oNcUyx2RdSDIwjnHNOa6nnEg1dbmDjlbx7h0MgfgY2L448yAvo8t1HjJoHu7K46gafGhRZwxen4a2xICP8RVT1GAZnmGXDUXzzicKjjgOE38FA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6ecf406551aso2432083b3a.2 for ; Fri, 19 Apr 2024 22:56:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713592617; x=1714197417; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=FAbXTwnNGLPhKEF/2XKdRYZ/g2Ygdc5hUsyYAixDT/k=; b=JTfQHHH8w23Lptt4I6HntDUxuAXyS+uBk1VjeQiP8T00JPMo3MMlE4zH/U2gsKa78i P/ughGtB39RUZ3ypUDPRDz8f6GXCO4CK+rs3RLLhhqGrLU01N1R0fKcyX4Dx13VnUC06 RhR5+I+V4UI5wjxZHs+7+D412mm0sTl0lV/fFdGx/M2olZf31UP9i508bnaUn1iPXOMc ySy37+G51TwhQojWeh2+xwsXUNFug5hfIBaZYbLFmbs3JeXbsG+tIt6QPBG+ZmsLfiSx HkUVKKpCUqXGCMcf4Op8EgQorfiSQH4amOP3SCTrEAMFZB1gleddNXCjNXb+fpodv0Ch cPwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713592617; x=1714197417; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FAbXTwnNGLPhKEF/2XKdRYZ/g2Ygdc5hUsyYAixDT/k=; b=vYkHiYWc4dDNthQM7cJfEfIuvzvIYu54Y48D1QbSOd3066j4IXihnixMmsqdf/viTM MLNGC6PchKj0KSy6uza5bnaEYZH5wdM3pUXJb31Yno/dGLuY3ED/b8004t8u56PMz7BS 2jUScQjdVBkJf19MeINrRE63N4Y4WISAdA1mrq8nb90opYzeB6KE/Y6gfx5jet66KEkW uQtuOK/3+FaE8hSTjwcePg64rgVy2PTnyFK/JQVEDe1kF4V6HoQwCpPferuSZY+YyDhy c/yJ5yCz3SEtMa7UwJfrzqI82dwZxzJjQrj1WczpYY1C14Kc6A3it6puYCFnm9zxvsQZ Y4BA== X-Gm-Message-State: AOJu0Yy68dS0Av6kIs4RdS2pljSHw+1bVu9+9gGckvt9CD37QF7fdIT7 gPv+XPOXAjOZkny5h/jP50T8gqE9dEZ2dMDZfIX/D3EbS/4F9ujGEy2tfMgdfgzX1bNL/Hiu9nj Q X-Google-Smtp-Source: AGHT+IFJerY759KWcNSaPIB/UPJzopsQLavHJiCVV+onQP4oQr2ozd8sQBbum3Qf5g70D1vAbn+6MA== X-Received: by 2002:a05:6a20:3951:b0:1a7:427b:8216 with SMTP id r17-20020a056a20395100b001a7427b8216mr5166863pzg.55.1713592617189; Fri, 19 Apr 2024 22:56:57 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8470:1348:72c4:7c65:61e7]) by smtp.gmail.com with ESMTPSA id i16-20020a17090332d000b001e0c568ae8fsm4296577plr.192.2024.04.19.22.56.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 22:56:56 -0700 (PDT) From: Thiago Jung Bauermann To: gdb-patches@sourceware.org Cc: Christophe Lyon , Luis Machado , Pedro Alves Subject: [PATCH v2 0/3] Fix attaching to process when it has zombie threads Date: Sat, 20 Apr 2024 02:56:49 -0300 Message-ID: <20240420055652.819024-1-thiago.bauermann@linaro.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Hello, Thank you for your review of the patches! This version incorporates the comments. Luis suggested adding macros to identify the field indexes in /proc/PID/stat, but Pedro doesn't think they help. I personally think they help, but I agree that not by that much, so I don't have a strong opinion. Since the previous version didn't have the macros, I'm sending v2 with them so that it's easy to compare both and decide. I can remove the macros if they're deemed unnecessary. v1 of this series is here: https://inbox.sourceware.org/gdb-patches/20240321231149.519549-1-thiago.bauermann@linaro.org/ Thiago Jung Bauermann (3): gdb/nat: Use procfs(5) indexes in linux_common_core_of_thread gdb/nat: Factor linux_proc_get_stat_field out of linux_common_core_of_thread gdb/nat/linux: Fix attaching to process when it has zombie threads gdb/nat/linux-osdata.c | 38 +++-------------- gdb/nat/linux-osdata.h | 3 ++ gdb/nat/linux-procfs.c | 96 ++++++++++++++++++++++++++++++++++++++++++ gdb/nat/linux-procfs.h | 11 +++++ 4 files changed, 115 insertions(+), 33 deletions(-) base-commit: edc27e2d90a2af3afddd68e7a534afcc428719e5