From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 7C6AF3858D38 for ; Thu, 25 Apr 2024 15:18:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7C6AF3858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7C6AF3858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714058321; cv=none; b=rmI8i36Vk/CTXKTd4ctL21OMiuTXrnlpet3deWGSTDqieS3fyUe76PpwxjEqGgJRt7BDWnvjfxTp03KnKzQoDxISeMtqE1k9dpdg33fDfrsFnciyEpldyMugaqGFmJWr4GqiX90RwjYXCEEylmBOAlDHNSRfsGgJjXj271nKLAk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714058321; c=relaxed/simple; bh=BTbdcRUsL8BqVfC5o9zzgvg+Ms+Xc4JiXqwrJXA83xo=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=KNz3YsH46O6xoh4ssHY55pibTaJIhCiMhMRBiNKWymnOBX7fbGu8aDMQCrJwsgKDHGXYfK2Px57PEcYrRlQICFegNhZIIJzuzpSooDd+cZr8aBgIZFS51B3WkyxTq4GJmUBmyTqe2/g/uJeGQylm03cDjVZaeSCLbGRv0AMPsiA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s00rm-00031D-C1; Thu, 25 Apr 2024 11:18:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=KhoTHtuZsdtaotSvwkBl0ctE4uspKk+p6beKwJgNXRk=; b=pN6SYlTyzdpU LJX8Kz/VBKGb5kQK9gyRIgdfIf3+x0vvOhVVknuHW/JRXdsQ6gZOpgeDTIorum7UIj9xwx4YNoufb moqn2A/4KzhfDDpDZFGLyArXsy0ul+9gF4Xqvqhrx6I//jhUqneXksJFN6r15Ywb48nsu0zib9wIq E3EHE66gTrJAPutwle5tBLhR6O/sCLLI2TA53HvqaIW8VwJhS1fojKy6kDrjPz8MzaSCvde9WQrSE CTqlKgCHaBbmy3jvtNfAJ64PMwgTPOiRNbmiEg30zVmJrJ0sF07ZAr2r/10usIJJZz7NGOPDNr2vI GRXK2MYTDE1y58gQI9H0RA==; Date: Thu, 25 Apr 2024 18:17:56 +0300 Message-Id: <86frv91nff.fsf@gnu.org> From: Eli Zaretskii To: Luis Machado Cc: gdb@sourceware.org, tom@tromey.com, nd@arm.com In-Reply-To: <1575098d-c3de-4a87-9868-7ff5e5994312@arm.com> (message from Luis Machado on Thu, 25 Apr 2024 11:13:29 +0100) Subject: Re: Debugging with GDB and ASLR References: <86v8452237.fsf@gnu.org> <1575098d-c3de-4a87-9868-7ff5e5994312@arm.com> X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,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 List-Id: > Date: Thu, 25 Apr 2024 11:13:29 +0100 > Cc: nd > From: Luis Machado > > On 4/25/24 11:01, Eli Zaretskii via Gdb wrote: > > Hi, > > > > It is well known that ASLR can get in the way of debugging some > > problems because the addresses of data change between runs, and so > > what you have learned from one debugging session cannot always be > > safely used in another session, when ASLR is in effect. > > > > I'm told that GDB disables ASLR, at least on GNU/Linux, for that > > reason. If that is true, could someone please point me to the code > > which achieves that? Also, is this done on other systems as well, and > > specifically on MS-Windows when debugging native Windows programs? > > > > TIA > > On Linux, it does so through the personality function in gdb/nat/linux-personality.c. > > I heard there were issues with disabling ASLR for Windows, but we seem to try to do > it in gdb/nat/windows-nat.c:create_process_wrapper. Maybe the call to UpdateProcThreadAttribute > attempts to do it? Right, thanks.