Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Fernando Nasser <fnasser@redhat.com>
To: Josef Ezra <jezra@emc.com>
Cc: Michael Snyder <msnyder@redhat.com>, gdb-patches@sources.redhat.com
Subject: Re: [RFA] new command: 'maintenance info lines'
Date: Thu, 26 Sep 2002 10:45:00 -0000	[thread overview]
Message-ID: <3D9347D4.9010204@redhat.com> (raw)
In-Reply-To: <3D9310D8.3060401@emc.com>

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 <main>: save  %sp, -120, %sp
> 0x50ce8 <main+4>:       std  %i0, [ %fp + -24 ]
> 0x50cec <main+8>:       sethi  %hi(0x50000), %o0
> 0x50cf0 <main+12>:      or  %o0, 0x16c, %o0     ! 0x5016c <captured_main>
> 0x50cf4 <main+16>:      sethi  %hi(0x2a7c00), %o2
>    Line ../gdb/main.c:759
> 0x50cf8 <main+20>:      add  %fp, -24, %o1
> 0x50cfc <main+24>:      or  %o2, 0x3c0, %o2
> 0x50d00 <main+28>:      call  0xb2374 <catch_errors>
> 0x50d04 <main+32>:      mov  6, %o3
>    Line ../gdb/main.c:775
> 0x50d08 <main+36>:      ret
> 0x50d0c <main+40>:      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


  reply	other threads:[~2002-09-26 17:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-18  8:11 should gdb require '.text' and '.data' sections? josef ezra
2002-04-18 11:15 ` Michael Snyder
2002-04-22  6:32   ` Josef Ezra
2002-04-24  6:45   ` [RFA] " Josef Ezra
2002-06-13 10:06   ` Request for new gdb command: 'info orientation' Josef Ezra
2002-06-13 10:35     ` Andrew Cagney
2002-06-13 11:06     ` Michael Snyder
2002-06-13 11:20       ` Josef Ezra
2002-06-17 12:34       ` [RFA] new command: 'maintenance info lines' Josef Ezra
2002-06-17 22:26         ` Eli Zaretskii
2002-06-18 13:47           ` josef ezra
2002-06-18 14:42             ` Michael Snyder
2002-06-18 22:42             ` Eli Zaretskii
2002-06-19  7:27               ` Josef Ezra
2002-06-18 14:35         ` Michael Snyder
2002-09-06  5:08           ` Josef Ezra
2002-09-18 22:33             ` Eli Zaretskii
2002-09-23  8:06               ` Josef Ezra
2002-09-23 22:12                 ` Eli Zaretskii
2002-09-25 13:26             ` Fernando Nasser
2002-09-26  6:49               ` Josef Ezra
2002-09-26 10:45                 ` Fernando Nasser [this message]
2002-09-26 19:03                   ` Andrew Cagney
2002-09-06 13:44           ` Josef Ezra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D9347D4.9010204@redhat.com \
    --to=fnasser@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jezra@emc.com \
    --cc=msnyder@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox