Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3FF3AC433EF for ; Tue, 19 Oct 2021 05:01:41 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D240960FD8 for ; Tue, 19 Oct 2021 05:01:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D240960FD8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=etri.re.kr Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2E72B82BD6; Tue, 19 Oct 2021 07:01:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=etri.re.kr Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=dooray.com header.i=@dooray.com header.b="HN3x2hJ+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E8FE582C88; Tue, 19 Oct 2021 07:01:35 +0200 (CEST) Received: from mscreen.etri.re.kr (mscreen.etri.re.kr [129.254.9.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CD35A81F74 for ; Tue, 19 Oct 2021 07:01:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=etri.re.kr Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ckim@etri.re.kr Received: from unknown (HELO send001-relay.gov-dooray.com) (211.180.235.152) by 129.254.9.16 with ESMTP; 19 Oct 2021 14:01:24 +0900 X-Original-SENDERIP: 211.180.235.152 X-Original-MAILFROM: ckim@etri.re.kr X-Original-RCPTTO: u-boot@lists.denx.de Received: from [10.162.225.106] (HELO smtp001-imp.gov-dooray.com) ([10.162.225.106]) by send001-relay.gov-dooray.com with SMTP id e553cd77616e5124; Tue, 19 Oct 2021 14:01:24 +0900 DKIM-Signature: a=rsa-sha256; b=HN3x2hJ+dpSGeVXO8yIss7IIfWtIHCPOUtnTa91q5f6wB4JonnWKzkOFmsHvThN3lpsuvZbQ1f SsAHPgz9Yk/UDWDp46mjFB5vMJ4T8YhtMyrLwB5L8y4+alp/9qUAY5jKDKyX21IHNG9D3cFukpkF qVyDQ2S083Glmax80cQM5F9ksXSQToqEpayqajEKjh8qKatmgddGaBvfDeHpqoCcx0OOiMLSy+yx 4erI79x6RpedweKt437oKhj8nanMUVtxtqO4ory8wbjshsdcDCixbs7SBm5+u11eSuvm6cSoEUpD pc6lQAsYU0Ehx98LNedIl42hqXO17wgjtwqXYWgw==; c=relaxed/relaxed; s=selector; d=dooray.com; v=1; bh=C0r2P+LYG7hhMznsqNNzhvru0eqz1HRVQr4O7ttgyeY=; h=From:To:Subject:Message-ID; Received: from [129.254.132.39] (HELO CHANKIMPC) ([129.254.132.39]) by smtp001-imp.gov-dooray.com with SMTP id f644740c616e5124; Tue, 19 Oct 2021 14:01:24 +0900 From: "Chan Kim" To: "'Jaehoon Chung'" , "'U-Boot Mailing List'" References: <010401d7c490$0c44a900$24cdfb00$@etri.re.kr> <2b389932-b25d-5023-2bc3-fdf195778739@samsung.com> In-Reply-To: <2b389932-b25d-5023-2bc3-fdf195778739@samsung.com> Subject: RE: How to compile u-boot with debug option? Date: Tue, 19 Oct 2021 14:01:23 +0900 Message-ID: <011801d7c4a6$5d6d0500$18470f00$@etri.re.kr> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQG3ySCSGKj1SPtrIXP6O0jU5fNjqQFESwT0AaBMBamsApIeEA== Content-Language: ko X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Hello, Jaehoon and all, I tried setting in menuconfig TOOLS_DEBUG but no change. It's strainge, = when I add "V=3D1" in the make command, I can see the commands run = during the make. The cc command has -g options, a typical command being = like this : aarch64-none-elf-gcc -Wp,-MD,lib/.asm-offsets.s.d -nostdinc -isystem = /home/ckim/prj/abdsn/ab21cv/tools/cc_zeus/gcc-arm-9.2-2019.12-x86_64-aarc= h64-none-elf/bin/../lib/gcc/aarch64-none-elf/9.2.1/include -Iinclude = -I./arch/arm/include -include ./include/linux/kconfig.h -D__KERNEL__ = -D__UBOOT__ -Wall -Wstrict-prototypes -Wno-format-security -fno-builtin = -ffreestanding -std=3Dgnu11 -fshort-wchar -fno-strict-aliasing -fno-PIE = -Os -fno-stack-protector -fno-delete-null-pointer-checks = -Wno-pointer-sign -Wno-stringop-truncation -Wno-array-bounds = -Wno-stringop-overflow -Wno-maybe-uninitialized = -fmacro-prefix-map=3D./=3D -g -fstack-usage -Wno-format-nonliteral = -Wno-address-of-packed-member -Wno-unused-but-set-variable = -Werror=3Ddate-time -Wno-packed-not-aligned -D__ARM__ -fno-pic = -mstrict-align -ffunction-sections -fdata-sections -fno-common = -ffixed-r9 -mgeneral-regs-only -fno-common -ffixed-x18 -pipe = -march=3Darmv8-a+crc -D__LINUX_ARM_ARCH__=3D8 -DDO_DEPS_ONLY = -DKBUILD_BASENAME=3D'"asm_offsets"' -DKBUILD_MODNAME=3D'"asm_offsets"' = -fverbose-asm -S -o lib/asm-offsets.s lib/asm-offsets.c (you can see -g option near the middle place) I don't know why the final .elf file doesn't contain debuginfo. ckim@ckim-ubuntu:~/U-BOOT/u-boot$ readelf -S u-boot.elf There are 5 section headers, starting at offset 0xc8950: Section Headers: [Nr] Name Type Address Offset Size EntSize Flags Link Info Align [ 0] NULL 0000000000000000 00000000 0000000000000000 0000000000000000 0 0 0 [ 1] .data PROGBITS 0000000000000000 00010000 00000000000b8850 0000000000000000 WA 0 0 1 [ 2] .symtab SYMTAB 0000000000000000 000c8850 0000000000000090 0000000000000018 3 2 8 [ 3] .strtab STRTAB 0000000000000000 000c88e0 0000000000000049 0000000000000000 0 0 1 [ 4] .shstrtab STRTAB 0000000000000000 000c8929 0000000000000021 0000000000000000 0 0 1 Key to Flags: W (write), A (alloc), X (execute), M (merge), S (strings), I (info), L (link order), O (extra OS processing required), G (group), T (TLS), C (compressed), x (unknown), o (OS specific), E (exclude), p (processor specific) And there are many configs including pattern "DEBUG" like = CONFIG_DEBUG_UART_SANDBOX but it seems they are adding special debug = features in the program behavior. What I want is to run the u-boot = program itself in debug mode so that I can attach gdb and follow the = program steps. (continue, step-in, step-out things..) Any comment will be very much appreciated. Thank you, and best regards, Chan Kim > -----Original Message----- > From: Jaehoon Chung > Sent: Tuesday, October 19, 2021 12:26 PM > To: Chan Kim ; U-Boot Mailing List = > Subject: Re: How to compile u-boot with debug option? >=20 > On 10/19/21 11:21 AM, Chan Kim wrote: > > Hello, > > > > > > > > With these commands, > > > > make ARCH=3Darm CROSS_COMPILE=3Daarch64-none-elf- = qemu_arm64_defconfig > > > > make ARCH=3Darm CROSS_COMPILE=3Daarch64-none-elf- > > > > I see only u-boot.bin. How can I make u-boot.elf with debug info? > > > > I found > > = https://protect2.fireeye.com/v1/url?k=3D126d5a6e-4df662a4-126cd121-0cc47 > > = a31bee8-8e6c8ef0c2793943&q=3D1&e=3D4928b69d-166a-4647-b6c5-88bc2f73a780&u= =3D > > = https%3A%2F%2Flists.denx.de%2Fpipermail%2Fu-boot%2F2005-May%2F010240.h > > tml and tried adding >=20 > It's too old patch. It's not proper to current u-boot. >=20 > make ARCH=3Darm menucofig and check config relevant to DEBUG option. >=20 > Best Regards, > Jaehoon Chung >=20 > > > > -DDEBUG to CFLAGS_NON_EFI in arch/arm/config.mk and adding CFLAGS = +=3D > > -DDEBUG in arch/arm/cpu/armv8/config.mk > > > > But after doing "make ARCH=3Darm CROSS_COMPILE=3Daarch64-none-elf- > > u-boot.elf", when I give file command for the u-boot.elf, it says > > > > > > > > u-boot.elf: ELF 64-bit LSB executable, ARM aarch64, version 1 = (SYSV), > > statically linked, not stripped > > > > > > > > I think I should see "with debug_info, not stripped". With = connecting > > gdb, I can't see the source file. The run responds to 'continue' = command > though. > > > > Could any tell me what I can do? > > > > > > > > Thank you, > > > > Chan Kim > > > > > > > > >=20