This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: Moving disassembler_command to cli land and using newer disassembler code


On Mon, Sep 30, 2002 at 05:52:39PM -0400, Fernando Nasser wrote:
> As soon as I can solve the small output differences between what is printed 
> by the old code and what the new one prints I will be doing the following 
> code migration, removing one more cli command from the library and making 
> it use the disassembler code in disasm.c.
> 
> This will allow us to have an option to have disassembler in mixed source 
> and assembler mode in the CLI as well.  But that is for when I come back.
> 
> The differences in the output are the "+0" in symbolic addresses (which 
> I've mentioned in a separate message) and the leading zeros in the numeric 
> addresses (see printouts below).  The old code used print_address_numeric() 
> and the new code uses ui_out_field_core_addr().  W.r.t. this leading 
> zero(s), I am not sure if we should print it or not (I can just update the 
> test file).RFC:

> Output with old code:
> disassem foostatic
> Dump of assembler code for function foostatic:
> 0x8048153 <foostatic>:  push   %ebp
> 0x8048154 <foostatic+1>:        mov    %esp,%ebp
> 0x8048156 <foostatic+3>:        pop    %ebp
> 0x8048157 <foostatic+4>:        ret
> End of assembler dump.
> (gdb) PASS: gdb.asm/asm-source.exp: look at static function
> 
> Output with new code:
> disassem foostatic^M
> Dump of assembler code for function foostatic:^M
> 0x08048153 <foostatic+0>:       push   %ebp^M
> 0x08048154 <foostatic+1>:       mov    %esp,%ebp^M
> 0x08048156 <foostatic+3>:       pop    %ebp^M
> 0x08048157 <foostatic+4>:       ret    ^M
> End of assembler dump.^M
> (gdb) FAIL: gdb.asm/asm-source.exp: look at static function

Well, I prefer the new version... it is much clearer.  A little worried
about MIPS and 64-bit addresses, which will make this very wide and a
little hard to read, but I think we have the appropriate truncation
function somewhere?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]