public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/29930] New: disassemble does not show symbol name sometimes
@ 2022-12-21 22:18 development at efficientek dot com
  2023-02-10 18:44 ` [Bug gdb/29930] " tromey at sourceware dot org
  0 siblings, 1 reply; 2+ messages in thread
From: development at efficientek dot com @ 2022-12-21 22:18 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29930

            Bug ID: 29930
           Summary: disassemble does not show symbol name sometimes
           Product: gdb
           Version: 12.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: development at efficientek dot com
  Target Milestone: ---

Here is the output of disassemble that shows this issue:

(gdb) disassemble
Dump of assembler code for function grub_cmd_read:
   0x000000007bec6720 <+0>:     push   %r15
   0x000000007bec6722 <+2>:     push   %r14
   0x000000007bec6724 <+4>:     push   %r13
   0x000000007bec6726 <+6>:     push   %r12
   0x000000007bec6728 <+8>:     mov    %esi,%r12d
   0x000000007bec672b <+11>:    push   %rbp
   0x000000007bec672c <+12>:    push   %rbx
   0x000000007bec672d <+13>:    sub    $0x18,%rsp
   0x000000007bec6731 <+17>:    mov    0x8(%rdi),%rax
=> 0x000000007bec6735 <+21>:    mov    $0x5,%edi
   0x000000007bec673a <+26>:    mov    %rdx,0x8(%rsp)
   0x000000007bec673f <+31>:    mov    (%rax),%r14d
   0x000000007bec6742 <+34>:    movabs $0x7da81596,%rax
   0x000000007bec674c <+44>:    call   *%rax
   0x000000007bec674e <+46>:    test   %rax,%rax
   0x000000007bec6751 <+49>:    je     0x7bec67f7 <grub_cmd_read+215>
   0x000000007bec6757 <+55>:    movabs $0x7da87eff,%r15
   0x000000007bec6761 <+65>:    mov    %rax,%rbp
...

(gdb) info symbol 0x7da81596
grub_malloc in section .text of
/home/grub-tester/bootloader/build/obj-x86_64-efi/grub-core/kernel.exec


We can see here that gdb knows of symbol grub_malloc at 0x7da81596, however, in
the disassembly at the second line below the one starting with '=>', the value
$0x7da81596 is not substituted for "grub_malloc".

Perhaps this can be turned on by setting special flags to the disassembler, but
I've not encountered any. Nor have I seen any gdb settings that might turn this
on.

I believe this happens for all literals that are in instructions that do not
potentially change the instruction pointer, like movabs, whereas instructions
that do, like je, have the symbol.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug gdb/29930] disassemble does not show symbol name sometimes
  2022-12-21 22:18 [Bug gdb/29930] New: disassemble does not show symbol name sometimes development at efficientek dot com
@ 2023-02-10 18:44 ` tromey at sourceware dot org
  0 siblings, 0 replies; 2+ messages in thread
From: tromey at sourceware dot org @ 2023-02-10 18:44 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29930

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-02-10
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
Offhand I don't know whether this is a bug in gdb or in libopcodes.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-10 18:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-21 22:18 [Bug gdb/29930] New: disassemble does not show symbol name sometimes development at efficientek dot com
2023-02-10 18:44 ` [Bug gdb/29930] " tromey at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).