From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26878 invoked by alias); 26 Sep 2002 17:45:59 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 26871 invoked from network); 26 Sep 2002 17:45:56 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 26 Sep 2002 17:45:56 -0000 Received: from redhat.com (totem.toronto.redhat.com [172.16.14.242]) by touchme.toronto.redhat.com (Postfix) with ESMTP id 31E6180021E; Thu, 26 Sep 2002 13:45:56 -0400 (EDT) Message-ID: <3D9347D4.9010204@redhat.com> Date: Thu, 26 Sep 2002 10:45:00 -0000 From: Fernando Nasser Organization: Red Hat , Inc. - Toronto User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020827 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Josef Ezra Cc: Michael Snyder , gdb-patches@sources.redhat.com Subject: Re: [RFA] new command: 'maintenance info lines' References: <02ea01c1e6eb$65f850c0$ad219fa8@lss.emc.com> <3CBEFC88.37807AEF@redhat.com> <3D08D15E.7030805@emc.com> <3D08DB87.A8119A1D@redhat.com> <3D0E39E6.5060701@emc.com> <3D0FA3CD.5681BF89@redhat.com> <3D789AF5.4020406@subdimension.com> <3D921C02.9020906@redhat.com> <3D9310D8.3060401@emc.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-09/txt/msg00637.txt.bz2 Josef Ezra wrote: > Fernando Nasser wrote: > >> The maintenance commands are to be used to debug (or test) GDB only. >> We could say you'd be dumping the line table but that is hardly what >> is being done and we don't have a real need for that anyway. >> > well, WE have a real need for this command That is the problem. We can't go and add things to GDB to the use of each individual need. That is why the MI was added so that any tool developer can use that to talk to GDB. > (is there a wrong way to use > gdb?). > Definitively parsing CLI output is one. >> If you really want to use a CLI command, you need to add a set/show >> variable to request that the source lines are included in the >> 'disassemble' command output. > > > do you mean something like: > > (gdb) set disassem dump-source-or-something 1 > (gdb) disassemble main > Dump of assembler code for function main: > Line ../gdb/main.c:757 > 0x50ce4
: save %sp, -120, %sp > 0x50ce8 : std %i0, [ %fp + -24 ] > 0x50cec : sethi %hi(0x50000), %o0 > 0x50cf0 : or %o0, 0x16c, %o0 ! 0x5016c > 0x50cf4 : sethi %hi(0x2a7c00), %o2 > Line ../gdb/main.c:759 > 0x50cf8 : add %fp, -24, %o1 > 0x50cfc : or %o2, 0x3c0, %o2 > 0x50d00 : call 0xb2374 > 0x50d04 : mov 6, %o3 > Line ../gdb/main.c:775 > 0x50d08 : ret > 0x50d0c : restore %g0, 0, %o0 > End of assembler dump. > Exactly, but the source line itself (if available) will be displayed as well. > that would be a great solution for our needs. how about setting the > dump-source to 1 to show line location, and 2 to try presenting the > actual source lines (like mixed list and disassemble) > Actually, I was thinking of set/show mixed-disassembly on/off There is no point in not showing the source lines themselves on the CLI output. Tools using GDB as the backend may want to manipulate the source files themselves, and that is why the MI output only have the line number (not the content of the source file line). >> The newer disassembler code that handles mixed output is still in the >> MI subdirectory (and in an older form in the gdbtk subdir) but it is >> intended to replace the one in printcmd.c. It shouldn't be too >> difficult and you can always ask if you have any doubts. > > > ?? please explain > Sure. The newest code for disassembly is in the file mi/mi-cmd-disas.c. This is supposed to replace the old one in printcmd.c which was not capable of mixed-mode disassembly. Once this code is in the libgdb proper, all interfaces (CLI, MI and gdbtk) will use this same code. Maybe it helps if you know the story: .the code in printcmd.c came first .it was improved in gdbtk land to allow mixed-mode disassembly .it was copied with small changes to MI land .the code in MI was improved to be more modular (and facilitate splitting the UI and core parts). .MISSING: Replace the old code and use the new one (from mi-cmd-disas.c) and use it everywhere, getting rid of all the other versions. We are slowly doing this. It was not a priority as it is already working on the MI and having mixed-mode disassembly in the CLI is just an enhancement no one has ever asked for (although I think it would be nice). We are doing it more like a clean-up. I will take a look and see if I can find time and do it. Or do you want to give it a try yourself? Regards, Fernando -- Fernando Nasser Red Hat - Toronto E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9