lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 14 Apr 2021 22:15:30 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Andrii Nakryiko' <andrii@...nel.org>,
        "bpf@...r.kernel.org" <bpf@...r.kernel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "ast@...com" <ast@...com>,
        "daniel@...earbox.net" <daniel@...earbox.net>
CC:     "kernel-team@...com" <kernel-team@...com>
Subject: RE: [PATCH bpf-next 13/17] selftests/bpf: use -O0 instead of -Og in
 selftests builds

From: Andrii Nakryiko
> Sent: 14 April 2021 21:02
> 
> While -Og is designed to work well with debugger, it's still inferior to -O0
> in terms of debuggability experience. It will cause some variables to still be
> inlined, it will also prevent single-stepping some statements and otherwise
> interfere with debugging experience. So switch to -O0 which turns off any
> optimization and provides the best debugging experience.

Surely the selftests need to use the normal compiler options
so the compiler is generating the same type of code.
Otherwise you are likely to miss out some instructions completely.

For normal code I actually prefer using -O2 when dubugging.
If/when you need to look at the generated code you can see
the wood for the trees, with -O0 the code is typically
full of memory read/write to/from the stack.

About the only annoying thing is tail-calls.
They can get confusing.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ