From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id 1F08438376C4 for ; Wed, 25 May 2022 22:13:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1F08438376C4 Received: by mail-ej1-x62c.google.com with SMTP id f21so30625395ejh.11 for ; Wed, 25 May 2022 15:13:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-description:content-disposition:in-reply-to; bh=rhxcg1qqp1WHegoIs4SKfJxc5RYcFQjU5z3Vu5CQwgE=; b=TLfzHZO//qvRvGtacolxf3uqhUG1+h0SaQn5fb2XXt5nYAMCxi2TJo5dYcqDtTdrfS BvOaRposvYr1XKMGJkfY8jKf7Vc+EiGV6G21Sd1LOR8RNalJiR/gC00YOxhbQuKBAvyO xB3gje8L4cR82PC+dRAIOjR3QOtR2nleTJcZrG8tWc5a3iSyiBrDHQsgWeLAZcglbtLr sLvgDZow00/v9iwixeS6Ey4ZVfjoFXm4k90U57il0nNmbgxet5xPhWSXQZ2ZMEXwSFXs 1ET+w/2u9XCcCF2GgfBfAvg26h2khXV1XkQwX/uOAW9xDC72Y65RQOJ9/xRtS79QY/HK hjZQ== X-Gm-Message-State: AOAM531W/fWUXdsV4p1XTPQz/O/fVkdy3oAXu46e2KQWTxJ6Xo3TElJ+ FG9kXjoXQneJ/SSAcCd8Xck= X-Google-Smtp-Source: ABdhPJy63XPsggP7F3EoyJ4fMqf3W++brQeSP12LWCHxu8a6dOZUw5t8Kr3Ac07EnMPiFD3lh4q8SA== X-Received: by 2002:a17:906:60cd:b0:6fd:d95c:3e34 with SMTP id f13-20020a17090660cd00b006fdd95c3e34mr31495302ejk.250.1653516783774; Wed, 25 May 2022 15:13:03 -0700 (PDT) Received: from gmail.com ([2a03:1b20:3:f011::a01d]) by smtp.gmail.com with ESMTPSA id c22-20020a170906529600b006feba31171bsm5270752ejm.11.2022.05.25.15.13.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 May 2022 15:13:03 -0700 (PDT) Date: Thu, 26 May 2022 00:13:06 +0200 From: Shahab Vahedi To: Wolfgang Wallner Cc: gdb@sourceware.org Subject: Re: Removing old symbols when debugging code that relocates itself Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Description: workaround Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2022 22:13:08 -0000 Hi Wolfgang, On Wed, May 25, 2022 at 11:14:28PM +0200, Wolfgang Wallner via Gdb wrote: > It seems I can only remove the symbols that I have added with > add-symbol-file, but not the initial ones ... Maybe you could extract the symbol file [1] and then strip it away from the binary [2]. This way, you have to use "add-symbol-file" to add it in different stages and according to what you say you should be able to remove it after each adding. Cheers, Shahab [1] $ objcopy --only-keep-debug uboot.bin uboot.sym [2] $ objcopy --strip-all uboot.bin uboot.strp