patches/ltrace/0.5.3/120-debian-ltrace_0.5.3-2.patch
author Remy Bohmer <linux@bohmer.net>
Sun Jul 11 22:23:34 2010 +0200 (2010-07-11)
changeset 2021 3e52a1510f87
permissions -rw-r--r--
debug/gdb: Fix compilation for Mingw hosts

GDB requires PDcurses instead of ncurses while running on Windows.
So, do not always compile ncurses in case GDB needs to build.

PDcurses is provided by an earlier build step and is not described in
this file.

Signed-off-by: Remy Bohmer <linux@bohmer.net>
[yann.morin.1998@anciense.nib.fr: we already have a way to detect ncurses usage]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
     1 Debian patch courtesy of the Debian ltrace maintainer Juan Cespedes <cespedes@debian.org>
     2 
     3 --- ltrace-0.5.3.orig/sysdeps/linux-gnu/breakpoint.c
     4 +++ ltrace-0.5.3/sysdeps/linux-gnu/breakpoint.c
     5 @@ -6,8 +6,6 @@
     6  #include "common.h"
     7  #include "arch.h"
     8  
     9 -static unsigned char break_insn[] = BREAKPOINT_VALUE;
    10 -
    11  #ifdef ARCH_HAVE_ENABLE_BREAKPOINT
    12  extern void arch_enable_breakpoint(pid_t, Breakpoint *);
    13  void
    14 @@ -20,6 +18,9 @@
    15  	arch_enable_breakpoint(pid, sbp);
    16  }
    17  #else
    18 +
    19 +static unsigned char break_insn[] = BREAKPOINT_VALUE;
    20 +
    21  void
    22  enable_breakpoint(pid_t pid, Breakpoint *sbp) {
    23  	unsigned int i, j;
    24 --- ltrace-0.5.3.orig/sysdeps/linux-gnu/arm/breakpoint.c
    25 +++ ltrace-0.5.3/sysdeps/linux-gnu/arm/breakpoint.c
    26 @@ -24,10 +24,7 @@
    27  
    28  #include <sys/ptrace.h>
    29  #include "config.h"
    30 -#include "arch.h"
    31 -#include "options.h"
    32 -#include "output.h"
    33 -#include "debug.h"
    34 +#include "common.h"
    35  
    36  void
    37  arch_enable_breakpoint(pid_t pid, Breakpoint *sbp) {
    38 @@ -59,8 +56,6 @@
    39  void
    40  arch_disable_breakpoint(pid_t pid, const Breakpoint *sbp) {
    41  	unsigned int i, j;
    42 -	const unsigned char break_insn[] = BREAKPOINT_VALUE;
    43 -	const unsigned char thumb_break_insn[] = THUMB_BREAKPOINT_VALUE;
    44  
    45  	debug(1, "arch_disable_breakpoint(%d,%p)", pid, sbp->addr);
    46  
    47 --- ltrace-0.5.3.orig/sysdeps/linux-gnu/ia64/plt.c
    48 +++ ltrace-0.5.3/sysdeps/linux-gnu/ia64/plt.c
    49 @@ -1,4 +1,5 @@
    50  #include <gelf.h>
    51 +#include <sys/ptrace.h>
    52  #include "common.h"
    53  
    54  /* A bundle is 128 bits */
    55 --- ltrace-0.5.3.orig/sysdeps/linux-gnu/ia64/breakpoint.c
    56 +++ ltrace-0.5.3/sysdeps/linux-gnu/ia64/breakpoint.c
    57 @@ -6,10 +6,7 @@
    58  
    59  #include <sys/ptrace.h>
    60  #include <string.h>
    61 -#include "arch.h"
    62 -#include "options.h"
    63 -#include "output.h"
    64 -#include "debug.h"
    65 +#include "common.h"
    66  
    67  static long long
    68  extract_bit_field(char *bundle, int from, int len) {
    69 --- ltrace-0.5.3.orig/sysdeps/linux-gnu/ia64/regs.c
    70 +++ ltrace-0.5.3/sysdeps/linux-gnu/ia64/regs.c
    71 @@ -7,7 +7,6 @@
    72  #include <asm/rse.h>
    73  
    74  #include <stddef.h>
    75 -#include "debug.h"
    76  #include "common.h"
    77  
    78  void *