Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* RFA: Skip ARM ELF Mapping symbols when showing disassembly
@ 2003-11-13 14:29 Nick Clifton
  2003-11-13 14:45 ` Richard Earnshaw
  2003-11-18 16:15 ` Andrew Cagney
  0 siblings, 2 replies; 13+ messages in thread
From: Nick Clifton @ 2003-11-13 14:29 UTC (permalink / raw)
  To: gdb-patches; +Cc: binutils

Hi Guys,

  I have recently committed a patch to the arm-elf port of GAS which
  causes it to generate special mapping symbols as required by the ARM
  ELF spec.  Unfortunately this now means that when GDB shows a
  disassembly it can select one of the mapping symbols instead of the
  proper function name symbol.

  The patch below is a fix for this problem.  It is not elegant, but
  it does have the advantage of being entirely arm specific.  A
  cleaner patch would require changes to generic code, which I did not
  feel comfortable doing.

  May I apply this patch ?

Cheers
        Nick

2003-11-13  Nick Clifton  <nickc@redhat.com>

	* arm-tdep.c (arm_elf_make_msymbol_special): Intercept arm-elf
	mapping symbols and artificially alter their value so that they
	are not used for disassembly displays.

Index: gdb/arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.155
diff -c -3 -p -r1.155 arm-tdep.c
*** gdb/arm-tdep.c	11 Nov 2003 20:04:52 -0000	1.155
--- gdb/arm-tdep.c	13 Nov 2003 14:27:49 -0000
*************** coff_sym_is_thumb (int val)
*** 2675,2680 ****
--- 2675,2692 ----
  static void
  arm_elf_make_msymbol_special(asymbol *sym, struct minimal_symbol *msym)
  {
+   /* FIXME: We want gdb to ignore the ARM ELF mapping symbols when
+      displaying disassembly so we use this horrible hack here to
+      artifically set their address to the highest possible value.
+      This is wrong of course, and it prevents the symbols from being
+      used for their intended purpose - to distinguish between ARM
+      and THUMB code.  So we ought to find a better way to do this.  */
+   if (bfd_asymbol_name (sym)
+       && bfd_asymbol_name (sym)[0] == '$'
+       && bfd_asymbol_name (sym)[1] != 0
+       && bfd_asymbol_name (sym)[2] == 0)
+     SYMBOL_VALUE_ADDRESS(msym) = (CORE_ADDR) 0x7ffffffc;
+       
    /* Thumb symbols are of type STT_LOPROC, (synonymous with
       STT_ARM_TFUNC).  */
    if (ELF_ST_TYPE (((elf_symbol_type *)sym)->internal_elf_sym.st_info)


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

end of thread, other threads:[~2004-01-20 13:23 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-13 14:29 RFA: Skip ARM ELF Mapping symbols when showing disassembly Nick Clifton
2003-11-13 14:45 ` Richard Earnshaw
2003-11-13 15:20   ` Daniel Jacobowitz
2004-01-14 23:42   ` Daniel Jacobowitz
2004-01-20 13:23     ` Nick Clifton
2003-11-18 16:15 ` Andrew Cagney
2003-11-18 16:45   ` Richard Earnshaw
2003-11-18 17:20     ` Andrew Cagney
2003-11-18 17:29       ` Richard Earnshaw
2003-11-18 17:41         ` Andrew Cagney
2003-11-18 19:55   ` Nick Clifton
2003-11-25 12:25   ` Nick Clifton
2003-11-25 12:34     ` Richard Earnshaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox