From: Eli Zaretskii <eliz@gnu.org>
To: Luis Machado <luis.machado@arm.com>
Cc: gdb@sourceware.org, tom@tromey.com, nd@arm.com
Subject: Re: Debugging with GDB and ASLR
Date: Thu, 25 Apr 2024 18:17:56 +0300 [thread overview]
Message-ID: <86frv91nff.fsf@gnu.org> (raw)
In-Reply-To: <1575098d-c3de-4a87-9868-7ff5e5994312@arm.com> (message from Luis Machado on Thu, 25 Apr 2024 11:13:29 +0100)
> Date: Thu, 25 Apr 2024 11:13:29 +0100
> Cc: nd <nd@arm.com>
> From: Luis Machado <luis.machado@arm.com>
>
> 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.
prev parent reply other threads:[~2024-04-25 15:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-25 10:01 Eli Zaretskii
2024-04-25 10:13 ` Luis Machado
2024-04-25 15:17 ` Eli Zaretskii [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86frv91nff.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=gdb@sourceware.org \
--cc=luis.machado@arm.com \
--cc=nd@arm.com \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).