This is the mail archive of the gdb-prs@sourceware.org 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]

symtab/2304: Disassembly output incorrect on Harvard architectures


>Number:         2304
>Category:       symtab
>Synopsis:       Disassembly output incorrect on Harvard architectures
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 29 12:08:01 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator:     jon@beniston.com
>Release:        6.6
>Organization:
>Environment:

>Description:
For targets with a Harvard memory architecture (i.e. one where instruction and data can appear at the same address), when using the "disassemble" command, the second column (i.e. function name) can contain data symbols instead of the function name.

E.g:

0x00007ff2 <main+136>:  call    0x6c8a <func1>
0x00007ff6 <main+140>:  sh      ([0x993e <data+14>]), r8
0x00007ffa <main+144>:  lh      r8, 7
0x00007ffc <main+146>:  call    0x6c8a <func2>
0x00008000 <variable1+0>:   nop
0x00008002 <variable2+0>:   lw      r6, (sp+[0])

Because we have code and data at address 0x8000+, GDB picks up the data symbols variable1 and variable2 and uses them, whereas in fact main+x should still be displayed.

Is this because the code in printcmd.c:build_address_symbolic doesn't use the section name when picking the nearest symbol (i.e. it should make sure the symbol is in .text, or perhaps, prefer symbols in .text over .data if .text is available and the address is with that range)


>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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