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: 790523 Delivered-To: patch@linaro.org Received: by 2002:adf:e6ca:0:b0:346:15ad:a2a with SMTP id y10csp1416487wrm; Fri, 19 Apr 2024 22:57:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVtJdbeSnnmVk/+hyQhK7Qu1hSDE1JWLCgmI8hvHqO10ngpSTvSLzaKW5zvWMiPAxaKifWVVEfnrLqCZqJAm/yt X-Google-Smtp-Source: AGHT+IGCu5j2n90rDYxbUhDRydLq+FunG+ncEwj4VOuyeUtXMNal2ReGWCnTi9Y8SYvhUMG+EABU X-Received: by 2002:a05:620a:208c:b0:78d:7802:16fc with SMTP id e12-20020a05620a208c00b0078d780216fcmr4336839qka.49.1713592648622; Fri, 19 Apr 2024 22:57:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713592648; cv=pass; d=google.com; s=arc-20160816; b=FX9GHw2y/AKP79lm3U5iNN4jcg0ad1vybY+kppYvjILPRmIl5azTNnKbCWjlJM9LYN T6QU8TlL1mMMbTJQg+9hoUaedVBKJwrB2WCDMFFYhecZ8QkWbTfgpKoLE1UNeGRiTRXb 5rYZ5nshjrEwf6VIxDMVnVULFl5lsm9Yvydtiiz2z/onyenugv1nDKKGyFsb0mA+1g61 vce/m/TO5jkEVHmNIeln85XkG1Hxi34SkqasPp048p8P3LzI3GT1lWYCKoIMCDtox3v9 kyHl0LxKr4K0YBmD8OoBudAyfbYEJh5rzuMuuAGA7Oog8Ra/hR+TRWBEzVchX9bAlLHx lVtg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=FAbXTwnNGLPhKEF/2XKdRYZ/g2Ygdc5hUsyYAixDT/k=; fh=hiz3ehk7igAf1jDTyW+iD8dgiuxOgEsxZsLHCOrAJYo=; b=o9NxyziGlKubvUpmOAKnoORP2VpWziGTRAIRmATzgPshTZbf22xWZNyMvkQUtyfqAI +3IXXFdSfJdVrQX4sEXWJzDRYl0jWNaKGaccsPipbcKFfehjdM3lXk+Gc52kKmIq7NBQ GnVYaHSmu9LRD1WhR3JZ3ZcdDIzlGvjJ3NyBkZtNTWg9zqQIva2/9LNRfZLk8RT9o/r8 ctCewISMSA0PEWCv23fogoYvsCVrz1TELWl22Z5UaC3d1nSVcU11h/U13dEAfvHXZ9Cm VKqlthYsrKNsFVL/WkO20FyZNf5h8pKOkctQEBGLPCGc0f8V9UJxOAptFKFFcYQoia4F Vi0Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JTfQHHH8; arc=pass (i=1); spf=pass (google.com: domain of gdb-patches-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gdb-patches-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id u24-20020a05620a023800b007906050b1bfsi1389231qkm.703.2024.04.19.22.57.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 22:57:28 -0700 (PDT) Received-SPF: pass (google.com: domain of gdb-patches-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JTfQHHH8; arc=pass (i=1); spf=pass (google.com: domain of gdb-patches-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gdb-patches-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3199E3858D37 for ; Sat, 20 Apr 2024 05:57:28 +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-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+patch=linaro.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