From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32598 invoked by alias); 8 May 2008 00:29:38 -0000 Received: (qmail 32588 invoked by uid 22791); 8 May 2008 00:29:37 -0000 X-Spam-Check-By: sourceware.org Received: from rv-out-0708.google.com (HELO rv-out-0708.google.com) (209.85.198.241) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 08 May 2008 00:29:17 +0000 Received: by rv-out-0708.google.com with SMTP id b17so560355rvf.48 for ; Wed, 07 May 2008 17:29:16 -0700 (PDT) Received: by 10.141.27.16 with SMTP id e16mr1239979rvj.97.1210206556405; Wed, 07 May 2008 17:29:16 -0700 (PDT) Received: by 10.141.153.20 with HTTP; Wed, 7 May 2008 17:29:16 -0700 (PDT) Message-ID: Date: Thu, 08 May 2008 00:29:00 -0000 From: "Lokesh Kumar" To: gdb@sourceware.org Subject: Debugging new code using debug-info from old code MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-05/txt/msg00063.txt.bz2 Hi all, I am trying to debug a "transformed" C code using the debugging information of the "original" C code. Essentially, my code goes through some transformations that keeps its semantic structure same but add some extraneous function calls distributed throughout the code. I want that when a user debugs this new code, all the new additions are hidden away from him/her and (s)he feels as if (s)he is debugging the original code. What this means is that there should exists an underlying mapping between the transformed code and original code so that it could map the debugging commands for original code into corresponding commands for transformed code. I started out by trying to load the symbol table of the original executable while debugging the transformed binary but that doesn't seem to help since the function addresses and everything else has changed. My second thoughts seem to suggest that if I can update the debugging information in the transformed binary as per my original code, I may get what I want. However, I am not sure how this will work if there were some compile-time optimizations in one code and not in another but I am not thinking about that now. I think I can use some help here. Does anyone here have a better idea on how to do it ? Or perhaps, how can I update the debugging information from one binary to another ? Thanks in advance, -Lokesh -- "It is not God that is worshipped but the group or authority that claims to speak in His name. Sin becomes disobedience to authority not violation of integrity." Lokesh Kumar