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]

PATCH ARM Linux -> ARM GNU/Linux


No functional change.

2002-02-19  Richard Earnshaw  <rearnsha@arm.com>

	* arm-linux-nat.c: Linux -> GNU/Linux when not talking about the 
	kernel.
	* arm-linux-tdep.c: Likewise.
	* config/arm/tm-linux.h: Likewise.


Index: arm-linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-linux-nat.c,v
retrieving revision 1.17
diff -p -r1.17 arm-linux-nat.c
*** arm-linux-nat.c	2002/02/12 00:58:19	1.17
--- arm-linux-nat.c	2002/02/19 14:26:46
*************** typedef struct tagFPA11
*** 63,71 ****
  FPA11;
  
  /* The following variables are used to determine the version of the
!    underlying Linux operating system.  Examples:
  
!    Linux 2.0.35                 Linux 2.2.12
     os_version = 0x00020023      os_version = 0x0002020c
     os_major = 2                 os_major = 2
     os_minor = 0                 os_minor = 2
--- 63,71 ----
  FPA11;
  
  /* The following variables are used to determine the version of the
!    underlying GNU/Linux operating system.  Examples:
  
!    GNU/Linux 2.0.35             GNU/Linux 2.2.12
     os_version = 0x00020023      os_version = 0x0002020c
     os_major = 2                 os_major = 2
     os_minor = 0                 os_minor = 2
*************** FPA11;
*** 78,88 ****
  
  static unsigned int os_version, os_major, os_minor, os_release;
  
! /* On Linux, threads are implemented as pseudo-processes, in which
     case we may be tracing more than one process at a time.  In that
     case, inferior_ptid will contain the main process ID and the
!    individual thread (process) ID.  get_thread_id () is used to
!    get the thread id if it's available, and the process id otherwise. */
  
  int
  get_thread_id (ptid_t ptid)
--- 78,88 ----
  
  static unsigned int os_version, os_major, os_minor, os_release;
  
! /* On GNU/Linux, threads are implemented as pseudo-processes, in which
     case we may be tracing more than one process at a time.  In that
     case, inferior_ptid will contain the main process ID and the
!    individual thread (process) ID.  get_thread_id () is used to get
!    the thread id if it's available, and the process id otherwise.  */
  
  int
  get_thread_id (ptid_t ptid)
*************** get_linux_version (unsigned int *vmajor,
*** 676,682 ****
  
    if (-1 == uname (&info))
      {
!       warning ("Unable to determine Linux version.");
        return -1;
      }
  
--- 676,682 ----
  
    if (-1 == uname (&info))
      {
!       warning ("Unable to determine GNU/Linux version.");
        return -1;
      }
  
Index: arm-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-linux-tdep.c,v
retrieving revision 1.17
diff -p -r1.17 arm-linux-tdep.c
*** arm-linux-tdep.c	2002/02/18 13:35:29	1.17
--- arm-linux-tdep.c	2002/02/19 14:26:46
***************
*** 35,46 ****
  #include "symfile.h"
  #include "objfiles.h"
  
! /* Under ARM Linux the traditional way of performing a breakpoint is to
!    execute a particular software interrupt, rather than use a particular
!    undefined instruction to provoke a trap.  Upon exection of the software
!    interrupt the kernel stops the inferior with a SIGTRAP, and wakes the
!    debugger.  Since ARM Linux is little endian, and doesn't support Thumb
!    at the moment we only override the ARM little-endian breakpoint.  */
  
  static const char arm_linux_arm_le_breakpoint[] = {0x01,0x00,0x9f,0xef};
  
--- 35,47 ----
  #include "symfile.h"
  #include "objfiles.h"
  
! /* Under ARM GNU/Linux the traditional way of performing a breakpoint
!    is to execute a particular software interrupt, rather than use a
!    particular undefined instruction to provoke a trap.  Upon exection
!    of the software interrupt the kernel stops the inferior with a
!    SIGTRAP, and wakes the debugger.  Since ARM GNU/Linux is little
!    endian, and doesn't support Thumb at the moment we only override
!    the ARM little-endian breakpoint.  */
  
  static const char arm_linux_arm_le_breakpoint[] = {0x01,0x00,0x9f,0xef};
  
*************** arm_linux_extract_return_value (struct t
*** 72,78 ****
  				char *valbuf)
  {
    /* ScottB: This needs to be looked at to handle the different
!      floating point emulators on ARM Linux.  Right now the code
       assumes that fetch inferior registers does the right thing for
       GDB.  I suspect this won't handle NWFPE registers correctly, nor
       will the default ARM version (arm_extract_return_value()).  */
--- 73,79 ----
  				char *valbuf)
  {
    /* ScottB: This needs to be looked at to handle the different
!      floating point emulators on ARM GNU/Linux.  Right now the code
       assumes that fetch inferior registers does the right thing for
       GDB.  I suspect this won't handle NWFPE registers correctly, nor
       will the default ARM version (arm_extract_return_value()).  */
*************** arm_linux_push_arguments (int nargs, str
*** 223,230 ****
  }
  
  /*
!    Dynamic Linking on ARM Linux
!    ----------------------------
  
     Note: PLT = procedure linkage table
     GOT = global offset table
--- 224,231 ----
  }
  
  /*
!    Dynamic Linking on ARM GNU/Linux
!    --------------------------------
  
     Note: PLT = procedure linkage table
     GOT = global offset table
*************** arm_linux_push_arguments (int nargs, str
*** 251,261 ****
     When the executable or library is first loaded, each GOT entry is
     initialized to point to the code which implements dynamic name
     resolution and code finding.  This is normally a function in the
!    program interpreter (on ARM Linux this is usually ld-linux.so.2,
!    but it does not have to be).  On the first invocation, the function
!    is located and the GOT entry is replaced with the real function
!    address.  Subsequent calls go through steps 1, 2 and 3 and end up
!    calling the real code.
  
     1) In the code: 
  
--- 252,262 ----
     When the executable or library is first loaded, each GOT entry is
     initialized to point to the code which implements dynamic name
     resolution and code finding.  This is normally a function in the
!    program interpreter (on ARM GNU/Linux this is usually
!    ld-linux.so.2, but it does not have to be).  On the first
!    invocation, the function is located and the GOT entry is replaced
!    with the real function address.  Subsequent calls go through steps
!    1, 2 and 3 and end up calling the real code.
  
     1) In the code: 
  
*************** skip_hurd_resolver (CORE_ADDR pc)
*** 388,394 ****
       It's kind of gross to do all these checks every time we're
       called, since they don't change once the executable has gotten
       started.  But this is only a temporary hack --- upcoming versions
!      of Linux will provide a portable, efficient interface for
       debugging programs that use shared libraries.  */
  
    struct objfile *objfile;
--- 389,395 ----
       It's kind of gross to do all these checks every time we're
       called, since they don't change once the executable has gotten
       started.  But this is only a temporary hack --- upcoming versions
!      of GNU/Linux will provide a portable, efficient interface for
       debugging programs that use shared libraries.  */
  
    struct objfile *objfile;
*************** arm_linux_sigcontext_register_address (C
*** 469,475 ****
  
    inst = read_memory_integer (pc, 4);
  
!   if (inst == ARM_LINUX_SIGRETURN_INSTR || inst == ARM_LINUX_RT_SIGRETURN_INSTR)
      {
        CORE_ADDR sigcontext_addr;
  
--- 470,477 ----
  
    inst = read_memory_integer (pc, 4);
  
!   if (inst == ARM_LINUX_SIGRETURN_INSTR
!       || inst == ARM_LINUX_RT_SIGRETURN_INSTR)
      {
        CORE_ADDR sigcontext_addr;
  
Index: config/arm/tm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/arm/tm-linux.h,v
retrieving revision 1.13
diff -p -r1.13 tm-linux.h
*** tm-linux.h	2002/02/18 13:35:31	1.13
--- tm-linux.h	2002/02/19 14:26:47
*************** extern void arm_linux_extract_return_val
*** 63,91 ****
  extern CORE_ADDR arm_linux_push_arguments (int, struct value **, CORE_ADDR, 
  					   int, CORE_ADDR);
  
! /* The first page is not writeable in ARM Linux.  */
  #undef LOWEST_PC
  #define LOWEST_PC	0x8000
  
! /* Define NO_SINGLE_STEP if ptrace(PT_STEP,...) fails to function correctly
!    on ARM Linux.  This is the case on 2.0.x kernels, 2.1.x kernels and some 
!    2.2.x kernels.  This will include the implementation of single_step()
!    in armlinux-tdep.c.  See armlinux-ss.c for more details. */
  /* #define NO_SINGLE_STEP	1 */
  
  /* Offset to saved PC in sigcontext structure, from <asm/sigcontext.h> */
  #define SIGCONTEXT_PC_OFFSET	(sizeof(unsigned long) * 18)
  
! /* On ARM Linux, each call to a library routine goes through a small piece
!    of trampoline code in the ".plt" section.  The  wait_for_inferior() 
!    routine uses this macro to detect when we have stepped into one of 
!    these fragments.  We do not use lookup_solib_trampoline_symbol_by_pc,
!    because we cannot always find the shared library trampoline symbols.  */
  extern int in_plt_section (CORE_ADDR, char *);
  #define IN_SOLIB_CALL_TRAMPOLINE(pc, name) in_plt_section((pc), (name))
  
! /* On ARM Linux, a call to a library routine does not have to go through
!    any trampoline code.  */
  #define IN_SOLIB_RETURN_TRAMPOLINE(pc, name)	0
  
  /* If PC is in a shared library trampoline code, return the PC
--- 63,93 ----
  extern CORE_ADDR arm_linux_push_arguments (int, struct value **, CORE_ADDR, 
  					   int, CORE_ADDR);
  
! /* The first page is not writeable in ARM GNU/Linux.  */
  #undef LOWEST_PC
  #define LOWEST_PC	0x8000
  
! /* Define NO_SINGLE_STEP if ptrace(PT_STEP,...) fails to function
!    correctly on ARM Linux kernel.  This is the case on 2.0.x kernels,
!    2.1.x kernels and some 2.2.x kernels.  This will include the
!    implementation of single_step() in armlinux-tdep.c.  See
!    armlinux-ss.c for more details. */
  /* #define NO_SINGLE_STEP	1 */
  
  /* Offset to saved PC in sigcontext structure, from <asm/sigcontext.h> */
  #define SIGCONTEXT_PC_OFFSET	(sizeof(unsigned long) * 18)
  
! /* On ARM GNU/Linux, each call to a library routine goes through a
!    small piece of trampoline code in the ".plt" section.  The
!    wait_for_inferior() routine uses this macro to detect when we have
!    stepped into one of these fragments.  We do not use
!    lookup_solib_trampoline_symbol_by_pc, because we cannot always find
!    the shared library trampoline symbols.  */
  extern int in_plt_section (CORE_ADDR, char *);
  #define IN_SOLIB_CALL_TRAMPOLINE(pc, name) in_plt_section((pc), (name))
  
! /* On ARM GNU/Linux, a call to a library routine does not have to go
!    through any trampoline code.  */
  #define IN_SOLIB_RETURN_TRAMPOLINE(pc, name)	0
  
  /* If PC is in a shared library trampoline code, return the PC

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