- Upgrade to GDB 6.7. Drop redundant patches, forward-port remaining ones.

- Fix rereading of the main executable on its change.
This commit is contained in:
Jan Kratochvil 2007-11-01 20:24:20 +00:00
parent cc171577b7
commit eb9d945afa
55 changed files with 1705 additions and 7918 deletions

View File

@ -1 +1 @@
gdb-6.6.tar.bz2 gdb-6.7.tar.bz2

View File

@ -11,16 +11,14 @@ testsuite/gdb.base:
* setshow.exp: Add testing of "set backtrace past-zero-pc" option. * setshow.exp: Add testing of "set backtrace past-zero-pc" option.
Index: gdb-6.5/gdb/testsuite/gdb.base/setshow.exp 2007-10-15 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.7.
Index: gdb-6.7/gdb/testsuite/gdb.base/setshow.exp
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/testsuite/gdb.base/setshow.exp 2006-07-11 02:46:50.000000000 -0300 --- gdb-6.7.orig/gdb/testsuite/gdb.base/setshow.exp 2007-08-23 20:14:17.000000000 +0200
+++ gdb-6.5/gdb/testsuite/gdb.base/setshow.exp 2006-07-11 02:47:24.000000000 -0300 +++ gdb-6.7/gdb/testsuite/gdb.base/setshow.exp 2007-10-15 21:34:52.000000000 +0200
@@ -1,4 +1,4 @@
-# Copyright 1992, 1994, 1996, 1997, 1998, 2001, 2003
+# Copyright 1992, 1994, 1996, 1997, 1998, 2001, 2003, 2005
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -106,6 +106,16 @@ if { ![target_info exists use_gdb_stub] @@ -106,6 +106,16 @@ if { ![target_info exists use_gdb_stub]
delete_breakpoints delete_breakpoints
gdb_test "run" "Starting program:.*foo bar blup baz bubble.*" "passing args" gdb_test "run" "Starting program:.*foo bar blup baz bubble.*" "passing args"
@ -38,11 +36,11 @@ Index: gdb-6.5/gdb/testsuite/gdb.base/setshow.exp
#test set check range on #test set check range on
gdb_test "set check range on" "" "set check range on" gdb_test "set check range on" "" "set check range on"
#test show check range on #test show check range on
Index: gdb-6.5/gdb/frame.c Index: gdb-6.7/gdb/frame.c
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/frame.c 2006-07-11 02:46:50.000000000 -0300 --- gdb-6.7.orig/gdb/frame.c 2007-10-12 22:35:58.000000000 +0200
+++ gdb-6.5/gdb/frame.c 2006-07-11 02:51:20.000000000 -0300 +++ gdb-6.7/gdb/frame.c 2007-10-15 21:34:52.000000000 +0200
@@ -131,6 +131,16 @@ Whether backtraces should continue past @@ -133,6 +133,16 @@ Whether backtraces should continue past
value); value);
} }
@ -59,7 +57,7 @@ Index: gdb-6.5/gdb/frame.c
static int backtrace_past_entry; static int backtrace_past_entry;
static void static void
show_backtrace_past_entry (struct ui_file *file, int from_tty, show_backtrace_past_entry (struct ui_file *file, int from_tty,
@@ -1313,9 +1323,7 @@ get_prev_frame (struct frame_info *this_ @@ -1483,9 +1493,7 @@ get_prev_frame (struct frame_info *this_
} }
if (this_frame->level > 0 if (this_frame->level > 0
@ -70,7 +68,7 @@ Index: gdb-6.5/gdb/frame.c
&& get_frame_type (this_frame) == NORMAL_FRAME && get_frame_type (this_frame) == NORMAL_FRAME
&& get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME && get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME
&& get_frame_pc (this_frame) == 0) && get_frame_pc (this_frame) == 0)
@@ -1629,6 +1637,17 @@ the rest of the stack trace."), @@ -1850,6 +1858,17 @@ the rest of the stack trace."),
&set_backtrace_cmdlist, &set_backtrace_cmdlist,
&show_backtrace_cmdlist); &show_backtrace_cmdlist);

View File

@ -1,427 +0,0 @@
2007-02-08 Joel Brobecker <brobecker@gnat.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
Daniel Jacobowitz <dan@codesourcery.com>
* rs6000-tdep.c (bl_to_blrl_insn_p): New function.
(skip_prologue): Allow bl->blrl used by PIC code.
--- ./gdb/rs6000-tdep.c 9 Jan 2007 17:58:57 -0000 1.260
+++ ./gdb/rs6000-tdep.c 8 Feb 2007 14:22:53 -0000 1.261
@@ -902,6 +902,30 @@ store_param_on_stack_p (unsigned long op
return 0;
}
+/* Assuming that INSN is a "bl" instruction located at PC, return
+ nonzero if the destination of the branch is a "blrl" instruction.
+
+ This sequence is sometimes found in certain function prologues.
+ It allows the function to load the LR register with a value that
+ they can use to access PIC data using PC-relative offsets. */
+
+static int
+bl_to_blrl_insn_p (CORE_ADDR pc, int insn)
+{
+ const int opcode = 18;
+ const CORE_ADDR dest = branch_dest (opcode, insn, pc, -1);
+ int dest_insn;
+
+ if (dest == -1)
+ return 0; /* Should never happen, but just return zero to be safe. */
+
+ dest_insn = read_memory_integer (dest, 4);
+ if ((dest_insn & 0xfc00ffff) == 0x4c000021) /* blrl */
+ return 1;
+
+ return 0;
+}
+
static CORE_ADDR
skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata)
{
@@ -1133,6 +1157,12 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l
to save fprs??? */
fdata->frameless = 0;
+
+ /* If the return address has already been saved, we can skip
+ calls to blrl (for PIC). */
+ if (lr_reg != -1 && bl_to_blrl_insn_p (pc, op))
+ continue;
+
/* Don't skip over the subroutine call if it is not within
the first three instructions of the prologue and either
we have no line table information or the line info tells
2007-03-27 Andreas Schwab <schwab@suse.de>
Daniel Jacobowitz <dan@codesourcery.com>
* dwarf2-frame.c (dwarf2_frame_eh_frame_regnum): Rename to...
(dwarf2_frame_adjust_regnum): ...this. Make static. Add eh_frame_p
argument. Update all callers.
(struct dwarf2_frame_ops): Replace eh_frame_regnum with adjust_regnum.
(dwarf2_frame_set_eh_frame_regnum): Rename to...
(dwarf2_frame_set_adjust_regnum): ...this. Update argument type.
* dwarf2frame.h (dwarf2_frame_set_eh_frame_regnum): Rename to...
(dwarf2_frame_set_adjust_regnum): ...this.
(dwarf2_frame_eh_frame_regnum): Delete prototype.
* rs6000-tdep.c: Include "dwarf2-frame.h".
(rs6000_adjust_frame_regnum): Define.
(rs6000_gdbarch_init): Enable use of DWARF CFI frame unwinder.
Register rs6000_adjust_frame_regnum.
* Makefile.in (rs6000-tdep.o): Update dependencies.
--- ./gdb/dwarf2-frame.c 27 Feb 2007 20:17:18 -0000 1.68
+++ ./gdb/dwarf2-frame.c 27 Mar 2007 19:02:42 -0000 1.69
@@ -107,6 +107,9 @@ struct dwarf2_fde
};
static struct dwarf2_fde *dwarf2_frame_find_fde (CORE_ADDR *pc);
+
+static int dwarf2_frame_adjust_regnum (struct gdbarch *gdbarch, int regnum,
+ int eh_frame_p);
/* Structure describing a frame state. */
@@ -314,8 +317,7 @@ execute_cfa_program (gdb_byte *insn_ptr,
else if ((insn & 0xc0) == DW_CFA_offset)
{
reg = insn & 0x3f;
- if (eh_frame_p)
- reg = dwarf2_frame_eh_frame_regnum (gdbarch, reg);
+ reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
insn_ptr = read_uleb128 (insn_ptr, insn_end, &utmp);
offset = utmp * fs->data_align;
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
@@ -326,8 +328,7 @@ execute_cfa_program (gdb_byte *insn_ptr,
{
gdb_assert (fs->initial.reg);
reg = insn & 0x3f;
- if (eh_frame_p)
- reg = dwarf2_frame_eh_frame_regnum (gdbarch, reg);
+ reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
if (reg < fs->initial.num_regs)
fs->regs.reg[reg] = fs->initial.reg[reg];
@@ -368,8 +369,7 @@ register %s (#%d) at 0x%s"),
case DW_CFA_offset_extended:
insn_ptr = read_uleb128 (insn_ptr, insn_end, &reg);
- if (eh_frame_p)
- reg = dwarf2_frame_eh_frame_regnum (gdbarch, reg);
+ reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
insn_ptr = read_uleb128 (insn_ptr, insn_end, &utmp);
offset = utmp * fs->data_align;
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
@@ -380,35 +380,30 @@ register %s (#%d) at 0x%s"),
case DW_CFA_restore_extended:
gdb_assert (fs->initial.reg);
insn_ptr = read_uleb128 (insn_ptr, insn_end, &reg);
- if (eh_frame_p)
- reg = dwarf2_frame_eh_frame_regnum (gdbarch, reg);
+ reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
fs->regs.reg[reg] = fs->initial.reg[reg];
break;
case DW_CFA_undefined:
insn_ptr = read_uleb128 (insn_ptr, insn_end, &reg);
- if (eh_frame_p)
- reg = dwarf2_frame_eh_frame_regnum (gdbarch, reg);
+ reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
fs->regs.reg[reg].how = DWARF2_FRAME_REG_UNDEFINED;
break;
case DW_CFA_same_value:
insn_ptr = read_uleb128 (insn_ptr, insn_end, &reg);
- if (eh_frame_p)
- reg = dwarf2_frame_eh_frame_regnum (gdbarch, reg);
+ reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAME_VALUE;
break;
case DW_CFA_register:
insn_ptr = read_uleb128 (insn_ptr, insn_end, &reg);
- if (eh_frame_p)
- reg = dwarf2_frame_eh_frame_regnum (gdbarch, reg);
+ reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
insn_ptr = read_uleb128 (insn_ptr, insn_end, &utmp);
- if (eh_frame_p)
- utmp = dwarf2_frame_eh_frame_regnum (gdbarch, utmp);
+ utmp = dwarf2_frame_adjust_regnum (gdbarch, utmp, eh_frame_p);
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAVED_REG;
fs->regs.reg[reg].loc.reg = utmp;
@@ -456,9 +451,8 @@ bad CFI data; mismatched DW_CFA_restore_
case DW_CFA_def_cfa_register:
insn_ptr = read_uleb128 (insn_ptr, insn_end, &fs->cfa_reg);
- if (eh_frame_p)
- fs->cfa_reg = dwarf2_frame_eh_frame_regnum (gdbarch,
- fs->cfa_reg);
+ fs->cfa_reg = dwarf2_frame_adjust_regnum (gdbarch, fs->cfa_reg,
+ eh_frame_p);
fs->cfa_how = CFA_REG_OFFSET;
break;
@@ -484,8 +478,7 @@ bad CFI data; mismatched DW_CFA_restore_
case DW_CFA_expression:
insn_ptr = read_uleb128 (insn_ptr, insn_end, &reg);
- if (eh_frame_p)
- reg = dwarf2_frame_eh_frame_regnum (gdbarch, reg);
+ reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
insn_ptr = read_uleb128 (insn_ptr, insn_end, &utmp);
fs->regs.reg[reg].loc.exp = insn_ptr;
@@ -496,8 +489,7 @@ bad CFI data; mismatched DW_CFA_restore_
case DW_CFA_offset_extended_sf:
insn_ptr = read_uleb128 (insn_ptr, insn_end, &reg);
- if (eh_frame_p)
- reg = dwarf2_frame_eh_frame_regnum (gdbarch, reg);
+ reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
insn_ptr = read_sleb128 (insn_ptr, insn_end, &offset);
offset *= fs->data_align;
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
@@ -535,9 +527,8 @@ bad CFI data; mismatched DW_CFA_restore_
case DW_CFA_def_cfa_sf:
insn_ptr = read_uleb128 (insn_ptr, insn_end, &fs->cfa_reg);
- if (eh_frame_p)
- fs->cfa_reg = dwarf2_frame_eh_frame_regnum (gdbarch,
- fs->cfa_reg);
+ fs->cfa_reg = dwarf2_frame_adjust_regnum (gdbarch, fs->cfa_reg,
+ eh_frame_p);
insn_ptr = read_sleb128 (insn_ptr, insn_end, &offset);
fs->cfa_offset = offset * fs->data_align;
fs->cfa_how = CFA_REG_OFFSET;
@@ -581,6 +572,7 @@ bad CFI data; mismatched DW_CFA_restore_
case DW_CFA_GNU_negative_offset_extended:
insn_ptr = read_uleb128 (insn_ptr, insn_end, &reg);
+ reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
insn_ptr = read_uleb128 (insn_ptr, insn_end, &offset);
offset *= fs->data_align;
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
@@ -617,8 +607,9 @@ struct dwarf2_frame_ops
trampoline. */
int (*signal_frame_p) (struct gdbarch *, struct frame_info *);
- /* Convert .eh_frame register number to DWARF register number. */
- int (*eh_frame_regnum) (struct gdbarch *, int);
+ /* Convert .eh_frame register number to DWARF register number, or
+ adjust .debug_frame register number. */
+ int (*adjust_regnum) (struct gdbarch *, int, int);
};
/* Default architecture-specific register state initialization
@@ -726,29 +717,30 @@ dwarf2_frame_signal_frame_p (struct gdba
return ops->signal_frame_p (gdbarch, next_frame);
}
-/* Set the architecture-specific mapping of .eh_frame register numbers to
- DWARF register numbers. */
+/* Set the architecture-specific adjustment of .eh_frame and .debug_frame
+ register numbers. */
void
-dwarf2_frame_set_eh_frame_regnum (struct gdbarch *gdbarch,
- int (*eh_frame_regnum) (struct gdbarch *,
- int))
+dwarf2_frame_set_adjust_regnum (struct gdbarch *gdbarch,
+ int (*adjust_regnum) (struct gdbarch *,
+ int, int))
{
struct dwarf2_frame_ops *ops = gdbarch_data (gdbarch, dwarf2_frame_data);
- ops->eh_frame_regnum = eh_frame_regnum;
+ ops->adjust_regnum = adjust_regnum;
}
-/* Translate a .eh_frame register to DWARF register. */
+/* Translate a .eh_frame register to DWARF register, or adjust a .debug_frame
+ register. */
-int
-dwarf2_frame_eh_frame_regnum (struct gdbarch *gdbarch, int regnum)
+static int
+dwarf2_frame_adjust_regnum (struct gdbarch *gdbarch, int regnum, int eh_frame_p)
{
struct dwarf2_frame_ops *ops = gdbarch_data (gdbarch, dwarf2_frame_data);
- if (ops->eh_frame_regnum == NULL)
+ if (ops->adjust_regnum == NULL)
return regnum;
- return ops->eh_frame_regnum (gdbarch, regnum);
+ return ops->adjust_regnum (gdbarch, regnum, eh_frame_p);
}
static void
@@ -1726,10 +1718,10 @@ decode_frame_entry_1 (struct comp_unit *
else
cie->return_address_register = read_unsigned_leb128 (unit->abfd, buf,
&bytes_read);
- if (eh_frame_p)
- cie->return_address_register
- = dwarf2_frame_eh_frame_regnum (current_gdbarch,
- cie->return_address_register);
+ cie->return_address_register
+ = dwarf2_frame_adjust_regnum (current_gdbarch,
+ cie->return_address_register,
+ eh_frame_p);
buf += bytes_read;
--- ./gdb/dwarf2-frame.h 9 Jan 2007 17:58:50 -0000 1.14
+++ ./gdb/dwarf2-frame.h 27 Mar 2007 19:02:42 -0000 1.15
@@ -94,18 +94,13 @@ extern void
int (*signal_frame_p) (struct gdbarch *,
struct frame_info *));
-/* Set the architecture-specific mapping of .eh_frame register numbers to
- DWARF register numbers. */
+/* Set the architecture-specific adjustment of .eh_frame and .debug_frame
+ register numbers. */
extern void
- dwarf2_frame_set_eh_frame_regnum (struct gdbarch *gdbarch,
- int (*eh_frame_regnum) (struct gdbarch *,
- int));
-
-/* Translate a .eh_frame register to DWARF register. */
-
-extern int
- dwarf2_frame_eh_frame_regnum (struct gdbarch *gdbarch, int regnum);
+ dwarf2_frame_set_adjust_regnum (struct gdbarch *gdbarch,
+ int (*adjust_regnum) (struct gdbarch *,
+ int, int));
/* Return the frame unwind methods for the function that contains PC,
or NULL if it can't be handled by DWARF CFI frame unwinder. */
--- ./gdb/rs6000-tdep.c 13 Mar 2007 17:34:22 -0000 1.266
+++ ./gdb/rs6000-tdep.c 27 Mar 2007 19:02:42 -0000 1.267
@@ -40,6 +40,7 @@
#include "sim-regno.h"
#include "gdb/sim-ppc.h"
#include "reggroups.h"
+#include "dwarf2-frame.h"
#include "libbfd.h" /* for bfd_default_set_arch_mach */
#include "coff/internal.h" /* for libcoff.h */
@@ -2294,6 +2295,69 @@ rs6000_dwarf2_reg_to_regnum (int num)
}
}
+/* Translate a .eh_frame register to DWARF register, or adjust a
+ .debug_frame register. */
+
+static int
+rs6000_adjust_frame_regnum (struct gdbarch *gdbarch, int num, int eh_frame_p)
+{
+ /* GCC releases before 3.4 use GCC internal register numbering in
+ .debug_frame (and .debug_info, et cetera). The numbering is
+ different from the standard SysV numbering for everything except
+ for GPRs and FPRs. We can not detect this problem in most cases
+ - to get accurate debug info for variables living in lr, ctr, v0,
+ et cetera, use a newer version of GCC. But we must detect
+ one important case - lr is in column 65 in .debug_frame output,
+ instead of 108.
+
+ GCC 3.4, and the "hammer" branch, have a related problem. They
+ record lr register saves in .debug_frame as 108, but still record
+ the return column as 65. We fix that up too.
+
+ We can do this because 65 is assigned to fpsr, and GCC never
+ generates debug info referring to it. To add support for
+ handwritten debug info that restores fpsr, we would need to add a
+ producer version check to this. */
+ if (!eh_frame_p)
+ {
+ if (num == 65)
+ return 108;
+ else
+ return num;
+ }
+
+ /* .eh_frame is GCC specific. For binary compatibility, it uses GCC
+ internal register numbering; translate that to the standard DWARF2
+ register numbering. */
+ if (0 <= num && num <= 63) /* r0-r31,fp0-fp31 */
+ return num;
+ else if (68 <= num && num <= 75) /* cr0-cr8 */
+ return num - 68 + 86;
+ else if (77 <= num && num <= 108) /* vr0-vr31 */
+ return num - 77 + 1124;
+ else
+ switch (num)
+ {
+ case 64: /* mq */
+ return 100;
+ case 65: /* lr */
+ return 108;
+ case 66: /* ctr */
+ return 109;
+ case 76: /* xer */
+ return 101;
+ case 109: /* vrsave */
+ return 356;
+ case 110: /* vscr */
+ return 67;
+ case 111: /* spe_acc */
+ return 99;
+ case 112: /* spefscr */
+ return 612;
+ default:
+ return num;
+ }
+}
/* Support for CONVERT_FROM_FUNC_PTR_ADDR (ARCH, ADDR, TARG).
@@ -3428,6 +3492,10 @@ rs6000_gdbarch_init (struct gdbarch_info
(gdbarch, rs6000_in_solib_return_trampoline);
set_gdbarch_skip_trampoline_code (gdbarch, rs6000_skip_trampoline_code);
+ /* Hook in the DWARF CFI frame unwinder. */
+ frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer);
+ dwarf2_frame_set_adjust_regnum (gdbarch, rs6000_adjust_frame_regnum);
+
/* Hook in ABI-specific overrides, if they have been registered. */
gdbarch_init_osabi (info, gdbarch);
--- ./gdb/Makefile.in.orig 2007-07-31 16:42:29.000000000 -0400
+++ ./gdb/Makefile.in 2007-08-01 13:42:51.000000000 -0400
@@ -2468,7 +2468,7 @@ rs6000-tdep.o: rs6000-tdep.c $(defs_h) $
$(reggroups_h) $(libbfd_h) $(coff_internal_h) $(libcoff_h) \
$(coff_xcoff_h) $(libxcoff_h) $(elf_bfd_h) $(solib_svr4_h) \
$(ppc_tdep_h) $(gdb_assert_h) $(dis_asm_h) $(trad_frame_h) \
- $(frame_unwind_h) $(frame_base_h) $(rs6000_tdep_h)
+ $(frame_unwind_h) $(frame_base_h) $(rs6000_tdep_h) $(dwarf2_frame_h)
rs6000-aix-tdep.o: rs6000-aix-tdep.c $(defs_h) $(osabi_h) $(rs6000_tdep_h)
s390-nat.o: s390-nat.c $(defs_h) $(tm_h) $(regcache_h) $(inferior_h) \
$(s390_tdep_h) $(observer_h) $(linux_nat_h)
s390-tdep.o: s390-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) $(inferior_h) \
2007-04-10 Andreas Schwab <schwab@suse.de>
* rs6000-tdep.c (rs6000_dwarf2_reg_to_regnum): Decode 64 as CR
register.
--- ./gdb/rs6000-tdep.c 1 Apr 2007 18:24:59 -0000 1.269
+++ ./gdb/rs6000-tdep.c 10 Apr 2007 16:02:41 -0000 1.270
@@ -2274,6 +2274,8 @@ rs6000_dwarf2_reg_to_regnum (int num)
else
switch (num)
{
+ case 64:
+ return tdep->ppc_cr_regnum;
case 67:
return tdep->ppc_vrsave_regnum - 1; /* vscr */
case 99:

View File

@ -16,10 +16,10 @@
+ /* no decoration */ + /* no decoration */
+ break; + break;
+ case gnu_v3_base_object_ctor: + case gnu_v3_base_object_ctor:
+ d_append_string_constant (dpi, "$base"); + d_append_string (dpi, "$base");
+ break; + break;
+ case gnu_v3_complete_object_allocating_ctor: + case gnu_v3_complete_object_allocating_ctor:
+ d_append_string_constant (dpi, "$allocate"); + d_append_string (dpi, "$allocate");
+ break; + break;
+ } + }
return; return;
@ -30,13 +30,13 @@
+ switch (dc->u.s_dtor.kind) + switch (dc->u.s_dtor.kind)
+ { + {
+ case gnu_v3_deleting_dtor: + case gnu_v3_deleting_dtor:
+ d_append_string_constant (dpi, "$delete"); + d_append_string (dpi, "$delete");
+ break; + break;
+ case gnu_v3_complete_object_dtor: + case gnu_v3_complete_object_dtor:
+ /* no decoration */ + /* no decoration */
+ break; + break;
+ case gnu_v3_base_object_dtor: + case gnu_v3_base_object_dtor:
+ d_append_string_constant (dpi, "$base"); + d_append_string (dpi, "$base");
+ break; + break;
+ } + }
return; return;

View File

@ -43,18 +43,15 @@
(breakpoint_re_set_one): New variables ID_S, ID, PC_LIST, NUM_PC_VALUES. (breakpoint_re_set_one): New variables ID_S, ID, PC_LIST, NUM_PC_VALUES.
Parse the "%42" suffix of the multiple-PC breakpoints's ADDR_STRINGs. Parse the "%42" suffix of the multiple-PC breakpoints's ADDR_STRINGs.
Index: gdb-6.5/gdb/mi/mi-cmd-disas.c 2007-10-14 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.7.
Index: gdb-6.7/gdb/mi/mi-cmd-disas.c
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/mi/mi-cmd-disas.c 2006-07-11 01:30:43.000000000 -0300 --- gdb-6.7.orig/gdb/mi/mi-cmd-disas.c 2007-08-23 20:08:48.000000000 +0200
+++ gdb-6.5/gdb/mi/mi-cmd-disas.c 2006-07-11 02:16:07.000000000 -0300 +++ gdb-6.7/gdb/mi/mi-cmd-disas.c 2007-10-14 23:26:23.000000000 +0200
@@ -1,5 +1,5 @@ @@ -143,11 +143,18 @@ mi_cmd_disassemble (char *command, char
/* MI Command Set - disassemble commands.
- Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
Contributed by Cygnus Solutions (a Red Hat company).
This file is part of GDB.
@@ -145,11 +145,18 @@ mi_cmd_disassemble (char *command, char
if (line_seen && file_seen) if (line_seen && file_seen)
{ {
@ -74,19 +71,11 @@ Index: gdb-6.5/gdb/mi/mi-cmd-disas.c
if (find_pc_partial_function (start, NULL, &low, &high) == 0) if (find_pc_partial_function (start, NULL, &low, &high) == 0)
error (_("mi_cmd_disassemble: No function contains specified address")); error (_("mi_cmd_disassemble: No function contains specified address"));
} }
Index: gdb-6.5/gdb/tui/tui-layout.c Index: gdb-6.7/gdb/tui/tui-layout.c
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/tui/tui-layout.c 2006-07-11 01:30:43.000000000 -0300 --- gdb-6.7.orig/gdb/tui/tui-layout.c 2007-08-23 20:08:50.000000000 +0200
+++ gdb-6.5/gdb/tui/tui-layout.c 2006-07-11 02:16:07.000000000 -0300 +++ gdb-6.7/gdb/tui/tui-layout.c 2007-10-14 23:26:23.000000000 +0200
@@ -1,6 +1,6 @@ @@ -516,7 +516,8 @@ extract_display_start_addr (void)
/* TUI layout window management.
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software
Foundation, Inc.
Contributed by Hewlett-Packard Company.
@@ -511,7 +511,8 @@ extract_display_start_addr (void)
{ {
enum tui_layout_type cur_layout = tui_current_layout (); enum tui_layout_type cur_layout = tui_current_layout ();
CORE_ADDR addr; CORE_ADDR addr;
@ -96,7 +85,7 @@ Index: gdb-6.5/gdb/tui/tui-layout.c
struct symtab_and_line cursal = get_current_source_symtab_and_line (); struct symtab_and_line cursal = get_current_source_symtab_and_line ();
switch (cur_layout) switch (cur_layout)
@@ -520,8 +521,11 @@ extract_display_start_addr (void) @@ -525,8 +526,11 @@ extract_display_start_addr (void)
case SRC_DATA_COMMAND: case SRC_DATA_COMMAND:
find_line_pc (cursal.symtab, find_line_pc (cursal.symtab,
TUI_SRC_WIN->detail.source_info.start_line_or_addr.u.line_no, TUI_SRC_WIN->detail.source_info.start_line_or_addr.u.line_no,
@ -110,19 +99,11 @@ Index: gdb-6.5/gdb/tui/tui-layout.c
break; break;
case DISASSEM_COMMAND: case DISASSEM_COMMAND:
case SRC_DISASSEM_COMMAND: case SRC_DISASSEM_COMMAND:
Index: gdb-6.5/gdb/tui/tui-win.c Index: gdb-6.7/gdb/tui/tui-win.c
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/tui/tui-win.c 2006-07-11 01:30:43.000000000 -0300 --- gdb-6.7.orig/gdb/tui/tui-win.c 2007-08-23 20:08:50.000000000 +0200
+++ gdb-6.5/gdb/tui/tui-win.c 2006-07-11 02:16:12.000000000 -0300 +++ gdb-6.7/gdb/tui/tui-win.c 2007-10-14 23:26:23.000000000 +0200
@@ -1,6 +1,6 @@ @@ -1359,8 +1359,16 @@ make_visible_with_new_height (struct tui
/* TUI window generic functions.
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
@@ -1342,8 +1342,16 @@ make_visible_with_new_height (struct tui
} }
else else
{ {
@ -140,18 +121,10 @@ Index: gdb-6.5/gdb/tui/tui-win.c
} }
tui_update_source_window (win_info, s, line, TRUE); tui_update_source_window (win_info, s, line, TRUE);
} }
Index: gdb-6.5/gdb/tui/tui-winsource.c Index: gdb-6.7/gdb/tui/tui-winsource.c
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/tui/tui-winsource.c 2006-07-11 01:30:43.000000000 -0300 --- gdb-6.7.orig/gdb/tui/tui-winsource.c 2007-08-23 20:08:50.000000000 +0200
+++ gdb-6.5/gdb/tui/tui-winsource.c 2006-07-11 01:39:20.000000000 -0300 +++ gdb-6.7/gdb/tui/tui-winsource.c 2007-10-14 23:26:23.000000000 +0200
@@ -1,6 +1,6 @@
/* TUI display source/assembly window.
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Contributed by Hewlett-Packard Company.
@@ -173,14 +173,21 @@ tui_update_source_windows_with_addr (COR @@ -173,14 +173,21 @@ tui_update_source_windows_with_addr (COR
void void
tui_update_source_windows_with_line (struct symtab *s, int line) tui_update_source_windows_with_line (struct symtab *s, int line)
@ -190,19 +163,10 @@ Index: gdb-6.5/gdb/tui/tui-winsource.c
tui_show_disassem (pc); tui_show_disassem (pc);
} }
break; break;
Index: gdb-6.5/gdb/symtab.c Index: gdb-6.7/gdb/symtab.c
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/symtab.c 2006-07-11 01:30:43.000000000 -0300 --- gdb-6.7.orig/gdb/symtab.c 2007-10-12 22:35:58.000000000 +0200
+++ gdb-6.5/gdb/symtab.c 2006-07-11 02:16:05.000000000 -0300 +++ gdb-6.7/gdb/symtab.c 2007-10-14 23:26:23.000000000 +0200
@@ -1,7 +1,7 @@
/* Symbol table lookup for the GNU debugger, GDB.
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
- 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GDB.
@@ -73,7 +73,9 @@ static void sources_info (char *, int); @@ -73,7 +73,9 @@ static void sources_info (char *, int);
static void output_source_filename (const char *, int *); static void output_source_filename (const char *, int *);
@ -214,7 +178,7 @@ Index: gdb-6.5/gdb/symtab.c
/* This one is used by linespec.c */ /* This one is used by linespec.c */
@@ -2233,6 +2235,9 @@ find_pc_line (CORE_ADDR pc, int notcurre @@ -2252,6 +2254,9 @@ find_pc_line (CORE_ADDR pc, int notcurre
/* Find line number LINE in any symtab whose name is the same as /* Find line number LINE in any symtab whose name is the same as
SYMTAB. SYMTAB.
@ -224,7 +188,7 @@ Index: gdb-6.5/gdb/symtab.c
If found, return the symtab that contains the linetable in which it was If found, return the symtab that contains the linetable in which it was
found, set *INDEX to the index in the linetable of the best entry found, set *INDEX to the index in the linetable of the best entry
found, and set *EXACT_MATCH nonzero if the value returned is an found, and set *EXACT_MATCH nonzero if the value returned is an
@@ -2249,13 +2254,19 @@ find_line_symtab (struct symtab *symtab, @@ -2268,13 +2273,19 @@ find_line_symtab (struct symtab *symtab,
so far seen. */ so far seen. */
int best_index; int best_index;
@ -245,7 +209,7 @@ Index: gdb-6.5/gdb/symtab.c
if (best_index < 0 || !exact) if (best_index < 0 || !exact)
{ {
/* Didn't find an exact match. So we better keep looking for /* Didn't find an exact match. So we better keep looking for
@@ -2286,7 +2297,7 @@ find_line_symtab (struct symtab *symtab, @@ -2305,7 +2316,7 @@ find_line_symtab (struct symtab *symtab,
if (strcmp (symtab->filename, s->filename) != 0) if (strcmp (symtab->filename, s->filename) != 0)
continue; continue;
l = LINETABLE (s); l = LINETABLE (s);
@ -254,7 +218,7 @@ Index: gdb-6.5/gdb/symtab.c
if (ind >= 0) if (ind >= 0)
{ {
if (exact) if (exact)
@@ -2322,13 +2333,23 @@ done: @@ -2341,13 +2352,23 @@ done:
Returns zero for invalid line number (and sets the PC to 0). Returns zero for invalid line number (and sets the PC to 0).
The source file is specified with a struct symtab. */ The source file is specified with a struct symtab. */
@ -281,7 +245,7 @@ Index: gdb-6.5/gdb/symtab.c
if (symtab == 0) if (symtab == 0)
return 0; return 0;
@@ -2336,7 +2357,73 @@ find_line_pc (struct symtab *symtab, int @@ -2355,7 +2376,73 @@ find_line_pc (struct symtab *symtab, int
if (symtab != NULL) if (symtab != NULL)
{ {
l = LINETABLE (symtab); l = LINETABLE (symtab);
@ -356,7 +320,7 @@ Index: gdb-6.5/gdb/symtab.c
return 1; return 1;
} }
else else
@@ -2354,12 +2418,22 @@ find_line_pc_range (struct symtab_and_li @@ -2373,12 +2460,22 @@ find_line_pc_range (struct symtab_and_li
CORE_ADDR *endptr) CORE_ADDR *endptr)
{ {
CORE_ADDR startaddr; CORE_ADDR startaddr;
@ -380,7 +344,7 @@ Index: gdb-6.5/gdb/symtab.c
/* This whole function is based on address. For example, if line 10 has /* This whole function is based on address. For example, if line 10 has
two parts, one from 0x100 to 0x200 and one from 0x300 to 0x400, then two parts, one from 0x100 to 0x200 and one from 0x300 to 0x400, then
"info line *0x123" should say the line goes from 0x100 to 0x200 "info line *0x123" should say the line goes from 0x100 to 0x200
@@ -2389,7 +2463,7 @@ find_line_pc_range (struct symtab_and_li @@ -2408,7 +2505,7 @@ find_line_pc_range (struct symtab_and_li
Set *EXACT_MATCH nonzero if the value returned is an exact match. */ Set *EXACT_MATCH nonzero if the value returned is an exact match. */
static int static int
@ -389,7 +353,7 @@ Index: gdb-6.5/gdb/symtab.c
int *exact_match) int *exact_match)
{ {
int i; int i;
@@ -2408,7 +2482,7 @@ find_line_common (struct linetable *l, i @@ -2427,7 +2524,7 @@ find_line_common (struct linetable *l, i
return -1; return -1;
len = l->nitems; len = l->nitems;
@ -398,7 +362,7 @@ Index: gdb-6.5/gdb/symtab.c
{ {
struct linetable_entry *item = &(l->item[i]); struct linetable_entry *item = &(l->item[i]);
@@ -2432,6 +2506,52 @@ find_line_common (struct linetable *l, i @@ -2451,6 +2548,52 @@ find_line_common (struct linetable *l, i
return best_index; return best_index;
} }
@ -451,20 +415,11 @@ Index: gdb-6.5/gdb/symtab.c
int int
find_pc_line_pc_range (CORE_ADDR pc, CORE_ADDR *startptr, CORE_ADDR *endptr) find_pc_line_pc_range (CORE_ADDR pc, CORE_ADDR *startptr, CORE_ADDR *endptr)
{ {
Index: gdb-6.5/gdb/symtab.h Index: gdb-6.7/gdb/symtab.h
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/symtab.h 2006-07-11 01:30:43.000000000 -0300 --- gdb-6.7.orig/gdb/symtab.h 2007-08-23 20:08:45.000000000 +0200
+++ gdb-6.5/gdb/symtab.h 2006-07-11 01:39:20.000000000 -0300 +++ gdb-6.7/gdb/symtab.h 2007-10-14 23:26:23.000000000 +0200
@@ -1,7 +1,7 @@ @@ -1271,13 +1271,16 @@ extern struct symtab_and_line find_pc_se
/* Symbol table definitions for GDB.
Copyright (C) 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
- 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+ 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software
Foundation, Inc.
This file is part of GDB.
@@ -1256,13 +1256,16 @@ extern struct symtab_and_line find_pc_se
/* Given a symtab and line number, return the pc there. */ /* Given a symtab and line number, return the pc there. */
@ -482,11 +437,11 @@ Index: gdb-6.5/gdb/symtab.h
/* Given a string, return the line specified by it. For commands like "list" /* Given a string, return the line specified by it. For commands like "list"
and "breakpoint". */ and "breakpoint". */
Index: gdb-6.5/gdb/breakpoint.c Index: gdb-6.7/gdb/breakpoint.c
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/breakpoint.c 2006-07-11 01:30:53.000000000 -0300 --- gdb-6.7.orig/gdb/breakpoint.c 2007-10-13 05:29:58.000000000 +0200
+++ gdb-6.5/gdb/breakpoint.c 2006-07-11 01:39:20.000000000 -0300 +++ gdb-6.7/gdb/breakpoint.c 2007-10-14 23:26:23.000000000 +0200
@@ -5268,12 +5268,70 @@ static void @@ -5325,12 +5325,70 @@ parse_breakpoint_sals (char **address,
static void static void
breakpoint_sals_to_pc (struct symtabs_and_lines *sals, breakpoint_sals_to_pc (struct symtabs_and_lines *sals,
@ -562,7 +517,7 @@ Index: gdb-6.5/gdb/breakpoint.c
/* It's possible for the PC to be nonzero, but still an illegal /* It's possible for the PC to be nonzero, but still an illegal
value on some targets. value on some targets.
@@ -5406,6 +5436,10 @@ break_command_1 (char *arg, int flag, in @@ -5465,6 +5523,10 @@ break_command_1 (char *arg, int flag, in
if (!pending) if (!pending)
{ {
@ -573,7 +528,7 @@ Index: gdb-6.5/gdb/breakpoint.c
/* Make sure that all storage allocated to SALS gets freed. */ /* Make sure that all storage allocated to SALS gets freed. */
make_cleanup (xfree, sals.sals); make_cleanup (xfree, sals.sals);
@@ -5436,11 +5470,6 @@ break_command_1 (char *arg, int flag, in @@ -5495,11 +5557,6 @@ break_command_1 (char *arg, int flag, in
make_cleanup (xfree, addr_string[i]); make_cleanup (xfree, addr_string[i]);
} }
@ -585,7 +540,7 @@ Index: gdb-6.5/gdb/breakpoint.c
/* Verify that condition can be parsed, before setting any /* Verify that condition can be parsed, before setting any
breakpoints. Allocate a separate condition expression for each breakpoints. Allocate a separate condition expression for each
breakpoint. */ breakpoint. */
@@ -5665,7 +5688,7 @@ do_captured_breakpoint (struct ui_out *u @@ -5675,7 +5732,7 @@ do_captured_breakpoint (struct ui_out *u
error (_("Garbage %s following breakpoint address"), address_end); error (_("Garbage %s following breakpoint address"), address_end);
/* Resolve all line numbers to PC's. */ /* Resolve all line numbers to PC's. */
@ -594,7 +549,7 @@ Index: gdb-6.5/gdb/breakpoint.c
/* Verify that conditions can be parsed, before setting any /* Verify that conditions can be parsed, before setting any
breakpoints. */ breakpoints. */
@@ -5670,14 +5699,16 @@ gdb_breakpoint (char *address, char *con @@ -5732,14 +5789,16 @@ gdb_breakpoint (char *address, char *con
void void
resolve_sal_pc (struct symtab_and_line *sal) resolve_sal_pc (struct symtab_and_line *sal)
{ {
@ -614,7 +569,7 @@ Index: gdb-6.5/gdb/breakpoint.c
} }
if (sal->section == 0 && sal->symtab != NULL) if (sal->section == 0 && sal->symtab != NULL)
@@ -5714,6 +5745,54 @@ resolve_sal_pc (struct symtab_and_line * @@ -5776,6 +5835,54 @@ resolve_sal_pc (struct symtab_and_line *
} }
} }
@ -669,7 +624,7 @@ Index: gdb-6.5/gdb/breakpoint.c
void void
break_command (char *arg, int from_tty) break_command (char *arg, int from_tty)
{ {
@@ -7304,6 +7305,8 @@ breakpoint_re_set_one (void *bint) @@ -7320,6 +7427,8 @@ breakpoint_re_set_one (void *bint)
int *not_found_ptr = NULL; int *not_found_ptr = NULL;
struct symtabs_and_lines sals; struct symtabs_and_lines sals;
char *s; char *s;
@ -678,7 +633,7 @@ Index: gdb-6.5/gdb/breakpoint.c
enum enable_state save_enable; enum enable_state save_enable;
switch (b->type) switch (b->type)
@@ -7364,11 +7367,44 @@ breakpoint_re_set_one (void *bint) @@ -7380,11 +7489,44 @@ breakpoint_re_set_one (void *bint)
set_language (b->language); set_language (b->language);
input_radix = b->input_radix; input_radix = b->input_radix;
s = b->addr_string; s = b->addr_string;

View File

@ -4,11 +4,15 @@
destructors as this will be handled in find_methods. destructors as this will be handled in find_methods.
(find_methods): Fix ctor check to also check for dtor. (find_methods): Fix ctor check to also check for dtor.
Index: gdb-6.5/gdb/linespec.c 2007-10-14 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.7.
Index: gdb-6.7/gdb/linespec.c
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/linespec.c 2006-07-07 01:04:56.000000000 -0300 --- gdb-6.7.orig/gdb/linespec.c 2007-10-13 05:26:33.000000000 +0200
+++ gdb-6.5/gdb/linespec.c 2006-07-07 02:05:35.000000000 -0300 +++ gdb-6.7/gdb/linespec.c 2007-10-14 23:31:03.000000000 +0200
@@ -377,12 +377,14 @@ add_matching_methods (int method_counter @@ -398,12 +398,14 @@ add_matching_methods (int method_counter
/* Check for special case of looking for member that /* Check for special case of looking for member that
doesn't have a mangled name provided. This will happen doesn't have a mangled name provided. This will happen
@ -24,9 +28,9 @@ Index: gdb-6.5/gdb/linespec.c
+ || (strlen (phys_name) == strlen (class_name) + 1 + || (strlen (phys_name) == strlen (class_name) + 1
+ && phys_name[0] == '~')) + && phys_name[0] == '~'))
return add_minsym_members (class_name, phys_name, msym_arr); return add_minsym_members (class_name, phys_name, msym_arr);
/* Destructor is handled by caller, don't add it to /* Destructor is handled by caller, don't add it to
@@ -1709,6 +1711,11 @@ collect_methods (char *copy, struct type @@ -1731,6 +1733,11 @@ collect_methods (char *copy, struct type
{ {
int i1 = 0; /* Counter for the symbol array. */ int i1 = 0; /* Counter for the symbol array. */
@ -38,11 +42,11 @@ Index: gdb-6.5/gdb/linespec.c
if (destructor_name_p (copy, t)) if (destructor_name_p (copy, t))
{ {
/* Destructors are a special case. */ /* Destructors are a special case. */
@@ -1727,6 +1734,7 @@ collect_methods (char *copy, struct type @@ -1749,6 +1756,7 @@ collect_methods (char *copy, struct type
} }
} }
else else
+#endif +#endif
i1 = find_methods (t, copy, sym_arr, msym_arr); i1 = find_methods (t, copy, SYMBOL_LANGUAGE (sym_class), sym_arr, msym_arr);
return i1; return i1;

View File

@ -2,7 +2,7 @@ Index: gdb-6.6/gdb/gcore.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/gcore.c --- gdb-6.6.orig/gdb/gcore.c
+++ gdb-6.6/gdb/gcore.c +++ gdb-6.6/gdb/gcore.c
@@ -475,8 +475,13 @@ gcore_copy_callback (bfd *obfd, asection @@ -475,8 +475,14 @@ gcore_copy_callback (bfd *obfd, asection
if (size > total_size) if (size > total_size)
size = total_size; size = total_size;
@ -12,7 +12,8 @@ Index: gdb-6.6/gdb/gcore.c
if (target_read_memory (bfd_section_vma (obfd, osec) + offset, if (target_read_memory (bfd_section_vma (obfd, osec) + offset,
- memhunk, size) != 0) - memhunk, size) != 0)
+ memhunk, size) != 0 + memhunk, size) != 0
+ && (strcmp (TARGET_ARCHITECTURE->arch_name, "ia64") + && (strcmp (gdbarch_bfd_arch_info (current_gdbarch)->arch_name,
+ "ia64")
+ || bfd_section_vma (obfd, osec) != 0)) + || bfd_section_vma (obfd, osec) != 0))
{ {
warning (_("Memory read failed for corefile section, %s bytes at 0x%s."), warning (_("Memory read failed for corefile section, %s bytes at 0x%s."),

View File

@ -17,9 +17,15 @@
(libunwind_frame_prev_register): Support request for (libunwind_frame_prev_register): Support request for
getting the cursor address. getting the cursor address.
--- gdb-6.3/gdb/ia64-tdep.c.fix 2005-07-11 18:13:42.000000000 -0400 2007-10-14 Jan Kratochvil <jan.kratochvil@redhat.com>
+++ gdb-6.3/gdb/ia64-tdep.c 2005-07-11 18:15:52.000000000 -0400
@@ -141,7 +141,7 @@ static int lr_regnum = IA64_VRAP_REGNUM; Port to GDB-6.7.
Index: gdb-6.7/gdb/ia64-tdep.c
===================================================================
--- gdb-6.7.orig/gdb/ia64-tdep.c 2007-10-14 23:57:38.000000000 +0200
+++ gdb-6.7/gdb/ia64-tdep.c 2007-10-15 00:05:20.000000000 +0200
@@ -131,7 +131,7 @@ static int lr_regnum = IA64_VRAP_REGNUM;
they may not be accessible via the ptrace register get/set interfaces. */ they may not be accessible via the ptrace register get/set interfaces. */
enum pseudo_regs { FIRST_PSEUDO_REGNUM = NUM_IA64_RAW_REGS, VBOF_REGNUM = IA64_NAT127_REGNUM + 1, V32_REGNUM, enum pseudo_regs { FIRST_PSEUDO_REGNUM = NUM_IA64_RAW_REGS, VBOF_REGNUM = IA64_NAT127_REGNUM + 1, V32_REGNUM,
V127_REGNUM = V32_REGNUM + 95, V127_REGNUM = V32_REGNUM + 95,
@ -28,7 +34,7 @@
/* Array of register names; There should be ia64_num_regs strings in /* Array of register names; There should be ia64_num_regs strings in
the initializer. */ the initializer. */
@@ -253,6 +253,7 @@ static char *ia64_register_names[] = @@ -243,6 +243,7 @@ static char *ia64_register_names[] =
"p40", "p41", "p42", "p43", "p44", "p45", "p46", "p47", "p40", "p41", "p42", "p43", "p44", "p45", "p46", "p47",
"p48", "p49", "p50", "p51", "p52", "p53", "p54", "p55", "p48", "p49", "p50", "p51", "p52", "p53", "p54", "p55",
"p56", "p57", "p58", "p59", "p60", "p61", "p62", "p63", "p56", "p57", "p58", "p59", "p60", "p61", "p62", "p63",
@ -36,7 +42,7 @@
}; };
struct ia64_frame_cache struct ia64_frame_cache
@@ -1855,6 +1856,12 @@ ia64_frame_prev_register (struct frame_i @@ -1856,6 +1857,12 @@ ia64_frame_prev_register (struct frame_i
read_memory (addr, valuep, register_size (current_gdbarch, regnum)); read_memory (addr, valuep, register_size (current_gdbarch, regnum));
} }
} }
@ -49,7 +55,7 @@
else else
{ {
CORE_ADDR addr = 0; CORE_ADDR addr = 0;
@@ -2177,6 +2184,12 @@ ia64_sigtramp_frame_prev_register (struc @@ -2178,6 +2185,12 @@ ia64_sigtramp_frame_prev_register (struc
*addrp = pr_addr; *addrp = pr_addr;
} }
} }
@ -62,7 +68,7 @@
else else
{ {
/* All other registers not listed above. */ /* All other registers not listed above. */
@@ -2296,6 +2309,8 @@ ia64_gdb2uw_regnum (int regnum) @@ -2299,6 +2312,8 @@ ia64_gdb2uw_regnum (int regnum)
return UNW_IA64_AR + (regnum - IA64_AR0_REGNUM); return UNW_IA64_AR + (regnum - IA64_AR0_REGNUM);
else if ((unsigned) (regnum - IA64_NAT0_REGNUM) < 128) else if ((unsigned) (regnum - IA64_NAT0_REGNUM) < 128)
return UNW_IA64_NAT + (regnum - IA64_NAT0_REGNUM); return UNW_IA64_NAT + (regnum - IA64_NAT0_REGNUM);
@ -71,7 +77,7 @@
else else
return -1; return -1;
} }
@@ -2331,6 +2346,21 @@ ia64_uw2gdb_regnum (int uw_regnum) @@ -2334,6 +2349,21 @@ ia64_uw2gdb_regnum (int uw_regnum)
return -1; return -1;
} }
@ -93,7 +99,7 @@
/* Gdb libunwind-frame callback function to reveal if register is a float /* Gdb libunwind-frame callback function to reveal if register is a float
register or not. */ register or not. */
static int static int
@@ -3111,6 +3141,7 @@ static struct libunwind_descr ia64_libun @@ -3046,6 +3076,7 @@ static struct libunwind_descr ia64_libun
ia64_gdb2uw_regnum, ia64_gdb2uw_regnum,
ia64_uw2gdb_regnum, ia64_uw2gdb_regnum,
ia64_is_fpreg, ia64_is_fpreg,
@ -101,9 +107,11 @@
&ia64_unw_accessors, &ia64_unw_accessors,
&ia64_unw_rse_accessors, &ia64_unw_rse_accessors,
}; };
--- gdb-6.3/gdb/libunwind-frame.c.fix 2005-07-11 18:17:05.000000000 -0400 Index: gdb-6.7/gdb/libunwind-frame.c
+++ gdb-6.3/gdb/libunwind-frame.c 2005-07-11 18:20:31.000000000 -0400 ===================================================================
@@ -122,6 +122,7 @@ libunwind_frame_set_descr (struct gdbarc --- gdb-6.7.orig/gdb/libunwind-frame.c 2007-08-23 20:08:35.000000000 +0200
+++ gdb-6.7/gdb/libunwind-frame.c 2007-10-15 00:07:56.000000000 +0200
@@ -125,6 +125,7 @@ libunwind_frame_set_descr (struct gdbarc
arch_descr->is_fpreg = descr->is_fpreg; arch_descr->is_fpreg = descr->is_fpreg;
arch_descr->accessors = descr->accessors; arch_descr->accessors = descr->accessors;
arch_descr->special_accessors = descr->special_accessors; arch_descr->special_accessors = descr->special_accessors;
@ -111,7 +119,7 @@
} }
static struct libunwind_frame_cache * static struct libunwind_frame_cache *
@@ -129,6 +130,7 @@ libunwind_frame_cache (struct frame_info @@ -132,6 +133,7 @@ libunwind_frame_cache (struct frame_info
{ {
unw_accessors_t *acc; unw_accessors_t *acc;
unw_addr_space_t as; unw_addr_space_t as;
@ -119,7 +127,7 @@
unw_word_t fp; unw_word_t fp;
unw_regnum_t uw_sp_regnum; unw_regnum_t uw_sp_regnum;
struct libunwind_frame_cache *cache; struct libunwind_frame_cache *cache;
@@ -147,22 +149,33 @@ libunwind_frame_cache (struct frame_info @@ -153,23 +155,34 @@ libunwind_frame_cache (struct frame_info
&& get_frame_type (next_frame) != SIGTRAMP_FRAME) && get_frame_type (next_frame) != SIGTRAMP_FRAME)
return NULL; return NULL;
@ -151,7 +159,8 @@
+ { + {
+ acc = descr->accessors; + acc = descr->accessors;
+ as = unw_create_addr_space_p (acc, + as = unw_create_addr_space_p (acc,
TARGET_BYTE_ORDER == BFD_ENDIAN_BIG gdbarch_byte_order (current_gdbarch)
== BFD_ENDIAN_BIG
? __BIG_ENDIAN ? __BIG_ENDIAN
: __LITTLE_ENDIAN); : __LITTLE_ENDIAN);
@ -162,9 +171,9 @@
+ cache->cursor = *cursor_addr; + cache->cursor = *cursor_addr;
+ +
if (unw_step_p (&cache->cursor) < 0) if (unw_step_p (&cache->cursor) < 0)
return NULL; {
unw_destroy_addr_space_p (as);
@@ -285,6 +298,16 @@ libunwind_frame_prev_register (struct fr @@ -316,6 +329,16 @@ libunwind_frame_prev_register (struct fr
if (uw_regnum < 0) if (uw_regnum < 0)
return; return;
@ -181,9 +190,11 @@
/* To get the previous register, we use the libunwind register APIs with /* To get the previous register, we use the libunwind register APIs with
the cursor we have already pushed back to the previous frame. */ the cursor we have already pushed back to the previous frame. */
--- gdb-6.3/gdb/libunwind-frame.h.fix 2005-07-11 18:17:24.000000000 -0400 Index: gdb-6.7/gdb/libunwind-frame.h
+++ gdb-6.3/gdb/libunwind-frame.h 2005-07-11 18:18:46.000000000 -0400 ===================================================================
@@ -37,6 +37,7 @@ struct libunwind_descr --- gdb-6.7.orig/gdb/libunwind-frame.h 2007-08-23 20:08:35.000000000 +0200
+++ gdb-6.7/gdb/libunwind-frame.h 2007-10-15 00:05:20.000000000 +0200
@@ -36,6 +36,7 @@ struct libunwind_descr
int (*gdb2uw) (int); int (*gdb2uw) (int);
int (*uw2gdb) (int); int (*uw2gdb) (int);
int (*is_fpreg) (int); int (*is_fpreg) (int);

View File

@ -11,20 +11,24 @@
* ia64-tdep.c (ia64_libunwind_sigtramp_frame_this_id): Calculate * ia64-tdep.c (ia64_libunwind_sigtramp_frame_this_id): Calculate
the base address using the current stack pointer plus a fixed the base address using the current stack pointer plus a fixed
offset. offset.
Index: gdb-6.5/gdb/libunwind-frame.c 2007-10-14 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.7.
Index: gdb-6.7/gdb/libunwind-frame.c
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/libunwind-frame.c 2006-07-07 03:04:32.000000000 -0300 --- gdb-6.7.orig/gdb/libunwind-frame.c 2007-10-15 00:08:30.000000000 +0200
+++ gdb-6.5/gdb/libunwind-frame.c 2006-07-07 03:07:33.000000000 -0300 +++ gdb-6.7/gdb/libunwind-frame.c 2007-10-15 00:13:29.000000000 +0200
@@ -62,6 +62,7 @@ static unw_word_t (*unw_find_dyn_list_p) @@ -61,6 +61,7 @@ static unw_word_t (*unw_find_dyn_list_p)
struct libunwind_frame_cache struct libunwind_frame_cache
{ {
CORE_ADDR base; CORE_ADDR base;
+ CORE_ADDR sp; + CORE_ADDR sp;
CORE_ADDR func_addr; CORE_ADDR func_addr;
unw_cursor_t cursor; unw_cursor_t cursor;
}; unw_addr_space_t as;
@@ -131,7 +132,7 @@ libunwind_frame_cache (struct frame_info @@ -134,7 +135,7 @@ libunwind_frame_cache (struct frame_info
unw_accessors_t *acc; unw_accessors_t *acc;
unw_addr_space_t as; unw_addr_space_t as;
unw_cursor_t *cursor_addr; unw_cursor_t *cursor_addr;
@ -33,7 +37,7 @@ Index: gdb-6.5/gdb/libunwind-frame.c
unw_regnum_t uw_sp_regnum; unw_regnum_t uw_sp_regnum;
struct libunwind_frame_cache *cache; struct libunwind_frame_cache *cache;
struct libunwind_descr *descr; struct libunwind_descr *descr;
@@ -176,15 +177,28 @@ libunwind_frame_cache (struct frame_info @@ -183,14 +184,29 @@ libunwind_frame_cache (struct frame_info
else /* make copy */ else /* make copy */
cache->cursor = *cursor_addr; cache->cursor = *cursor_addr;
@ -46,25 +50,34 @@ Index: gdb-6.5/gdb/libunwind-frame.c
+ sigaltstack as we want. To handle this, we record the stack + sigaltstack as we want. To handle this, we record the stack
+ address so the caller may calculate a more correct base address + address so the caller may calculate a more correct base address
+ to use. */ + to use. */
+ uw_sp_regnum = descr->gdb2uw (SP_REGNUM); + uw_sp_regnum = descr->gdb2uw (gdbarch_sp_regnum (current_gdbarch));
+ ret = unw_get_reg_p (&cache->cursor, uw_sp_regnum, &sp); + ret = unw_get_reg_p (&cache->cursor, uw_sp_regnum, &sp);
+ if (ret < 0) + if (ret < 0)
+ error ("Can't get libunwind sp register."); + {
+ unw_destroy_addr_space_p (as);
+ error (_("Can't get libunwind sp register."));
+ }
+ +
if (unw_step_p (&cache->cursor) < 0) if (unw_step_p (&cache->cursor) < 0)
return NULL; {
unw_destroy_addr_space_p (as);
return NULL;
}
- /* To get base address, get sp from previous frame. */ - /* To get base address, get sp from previous frame. */
- uw_sp_regnum = descr->gdb2uw (SP_REGNUM); - uw_sp_regnum = descr->gdb2uw (gdbarch_sp_regnum (current_gdbarch));
ret = unw_get_reg_p (&cache->cursor, uw_sp_regnum, &fp); ret = unw_get_reg_p (&cache->cursor, uw_sp_regnum, &fp);
if (ret < 0) if (ret < 0)
error (_("Can't get libunwind sp register.")); {
@@ -198,6 +214,7 @@ libunwind_frame_cache (struct frame_info
error (_("Can't get libunwind sp register."));
}
+ cache->sp = (CORE_ADDR)sp; + cache->sp = (CORE_ADDR)sp;
cache->base = (CORE_ADDR)fp; cache->base = (CORE_ADDR)fp;
cache->as = as;
*this_cache = cache; @@ -402,6 +419,31 @@ libunwind_search_unwind_table (void *as,
@@ -371,6 +385,31 @@ libunwind_search_unwind_table (void *as,
di, pi, need_unwind_info, args); di, pi, need_unwind_info, args);
} }
@ -96,20 +109,20 @@ Index: gdb-6.5/gdb/libunwind-frame.c
/* Verify if we are in a sigtramp frame and we can use libunwind to unwind. */ /* Verify if we are in a sigtramp frame and we can use libunwind to unwind. */
const struct frame_unwind * const struct frame_unwind *
libunwind_sigtramp_frame_sniffer (struct frame_info *next_frame) libunwind_sigtramp_frame_sniffer (struct frame_info *next_frame)
@@ -403,7 +442,7 @@ libunwind_sigtramp_frame_sniffer (struct @@ -439,7 +481,7 @@ libunwind_sigtramp_frame_sniffer (struct
/* Check to see if we are in a signal frame. */
ret = unw_is_signal_frame_p (&cursor); ret = unw_is_signal_frame_p (&cursor);
unw_destroy_addr_space_p (as);
if (ret > 0) if (ret > 0)
- return &libunwind_frame_unwind; - return &libunwind_frame_unwind;
+ return &libunwind_sigtramp_frame_unwind; + return &libunwind_sigtramp_frame_unwind;
return NULL; return NULL;
} }
Index: gdb-6.5/gdb/libunwind-frame.h Index: gdb-6.7/gdb/libunwind-frame.h
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/libunwind-frame.h 2006-07-07 02:51:32.000000000 -0300 --- gdb-6.7.orig/gdb/libunwind-frame.h 2007-10-15 00:05:20.000000000 +0200
+++ gdb-6.5/gdb/libunwind-frame.h 2006-07-07 03:05:49.000000000 -0300 +++ gdb-6.7/gdb/libunwind-frame.h 2007-10-15 00:08:36.000000000 +0200
@@ -49,6 +49,9 @@ void libunwind_frame_set_descr (struct g @@ -48,6 +48,9 @@ void libunwind_frame_set_descr (struct g
void libunwind_frame_this_id (struct frame_info *next_frame, void **this_cache, void libunwind_frame_this_id (struct frame_info *next_frame, void **this_cache,
struct frame_id *this_id); struct frame_id *this_id);
@ -119,11 +132,11 @@ Index: gdb-6.5/gdb/libunwind-frame.h
void libunwind_frame_prev_register (struct frame_info *next_frame, void **this_cache, void libunwind_frame_prev_register (struct frame_info *next_frame, void **this_cache,
int regnum, int *optimizedp, int regnum, int *optimizedp,
enum lval_type *lvalp, CORE_ADDR *addrp, enum lval_type *lvalp, CORE_ADDR *addrp,
Index: gdb-6.5/gdb/ia64-tdep.c Index: gdb-6.7/gdb/ia64-tdep.c
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/ia64-tdep.c 2006-07-07 02:51:32.000000000 -0300 --- gdb-6.7.orig/gdb/ia64-tdep.c 2007-10-15 00:05:20.000000000 +0200
+++ gdb-6.5/gdb/ia64-tdep.c 2006-07-07 03:05:49.000000000 -0300 +++ gdb-6.7/gdb/ia64-tdep.c 2007-10-15 00:08:36.000000000 +0200
@@ -3031,7 +3031,7 @@ ia64_libunwind_sigtramp_frame_this_id (s @@ -2968,7 +2968,7 @@ ia64_libunwind_sigtramp_frame_this_id (s
struct frame_id id; struct frame_id id;
CORE_ADDR prev_ip; CORE_ADDR prev_ip;
@ -132,7 +145,7 @@ Index: gdb-6.5/gdb/ia64-tdep.c
if (frame_id_eq (id, null_frame_id)) if (frame_id_eq (id, null_frame_id))
{ {
(*this_id) = null_frame_id; (*this_id) = null_frame_id;
@@ -3043,8 +3043,14 @@ ia64_libunwind_sigtramp_frame_this_id (s @@ -2980,8 +2980,14 @@ ia64_libunwind_sigtramp_frame_this_id (s
frame_unwind_register (next_frame, IA64_BSP_REGNUM, buf); frame_unwind_register (next_frame, IA64_BSP_REGNUM, buf);
bsp = extract_unsigned_integer (buf, 8); bsp = extract_unsigned_integer (buf, 8);

View File

@ -1,19 +0,0 @@
2005-03-30 Jeff Johnston <jjohnstn@redhat.com>
* bfd/elfcode.h: Change code to allow for idiosyncrasies of
ia64 vsyscall page.
Index: gdb-6.5/bfd/elfcode.h
===================================================================
--- gdb-6.5.orig/bfd/elfcode.h 2006-05-11 05:57:08.000000000 -0300
+++ gdb-6.5/bfd/elfcode.h 2006-07-07 02:36:03.000000000 -0300
@@ -1625,7 +1625,8 @@ NAME(_bfd_elf,bfd_from_remote_memory)
if (segment_end > (bfd_vma) contents_size)
contents_size = segment_end;
- if ((i_phdrs[i].p_offset & -i_phdrs[i].p_align) == 0)
+ if ((i_phdrs[i].p_offset & -i_phdrs[i].p_align) == 0
+ && loadbase == ehdr_vma)
loadbase = ehdr_vma - (i_phdrs[i].p_vaddr & -i_phdrs[i].p_align);
last_phdr = &i_phdrs[i];

View File

@ -21,11 +21,15 @@
* remote.h: Ditto. * remote.h: Ditto.
* dcache.h: Ditto. * dcache.h: Ditto.
Index: gdb-6.6/gdb/symfile-mem.c 2007-10-15 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.7.
Index: gdb-6.7/gdb/symfile-mem.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/symfile-mem.c 2007-01-20 16:09:05.000000000 +0100 --- gdb-6.7.orig/gdb/symfile-mem.c 2007-10-13 05:29:58.000000000 +0200
+++ gdb-6.6/gdb/symfile-mem.c 2007-01-20 16:09:17.000000000 +0100 +++ gdb-6.7/gdb/symfile-mem.c 2007-10-15 21:37:54.000000000 +0200
@@ -58,6 +58,14 @@ @@ -56,6 +56,14 @@
#include "elf/common.h" #include "elf/common.h"
@ -40,7 +44,7 @@ Index: gdb-6.6/gdb/symfile-mem.c
/* Read inferior memory at ADDR to find the header of a loaded object file /* Read inferior memory at ADDR to find the header of a loaded object file
and read its in-core symbols out of inferior memory. TEMPL is a bfd and read its in-core symbols out of inferior memory. TEMPL is a bfd
representing the target's format. NAME is the name to use for this representing the target's format. NAME is the name to use for this
@@ -78,7 +86,7 @@ symbol_file_add_from_memory (struct bfd @@ -76,7 +84,7 @@ symbol_file_add_from_memory (struct bfd
error (_("add-symbol-file-from-memory not supported for this target")); error (_("add-symbol-file-from-memory not supported for this target"));
nbfd = bfd_elf_bfd_from_remote_memory (templ, addr, &loadbase, nbfd = bfd_elf_bfd_from_remote_memory (templ, addr, &loadbase,
@ -49,11 +53,11 @@ Index: gdb-6.6/gdb/symfile-mem.c
if (nbfd == NULL) if (nbfd == NULL)
error (_("Failed to read a valid object file image from memory.")); error (_("Failed to read a valid object file image from memory."));
Index: gdb-6.6/gdb/target.c Index: gdb-6.7/gdb/target.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/target.c 2007-01-20 16:09:12.000000000 +0100 --- gdb-6.7.orig/gdb/target.c 2007-10-14 23:42:39.000000000 +0200
+++ gdb-6.6/gdb/target.c 2007-01-20 16:09:17.000000000 +0100 +++ gdb-6.7/gdb/target.c 2007-10-15 21:37:54.000000000 +0200
@@ -56,7 +56,7 @@ static int nosymbol (char *, CORE_ADDR * @@ -55,7 +55,7 @@ static int nosymbol (char *, CORE_ADDR *
static void tcomplain (void) ATTR_NORETURN; static void tcomplain (void) ATTR_NORETURN;
@ -62,7 +66,7 @@ Index: gdb-6.6/gdb/target.c
static int return_zero (void); static int return_zero (void);
@@ -284,7 +284,7 @@ target_mourn_inferior (void) @@ -283,7 +283,7 @@ target_mourn_inferior (void)
observer_notify_mourn_inferior (&current_target); observer_notify_mourn_inferior (&current_target);
} }
@ -71,8 +75,8 @@ Index: gdb-6.6/gdb/target.c
nomemory (CORE_ADDR memaddr, char *myaddr, int len, int write, nomemory (CORE_ADDR memaddr, char *myaddr, int len, int write,
struct target_ops *t) struct target_ops *t)
{ {
@@ -517,7 +517,7 @@ update_current_target (void) @@ -518,7 +518,7 @@ update_current_target (void)
(void (*) (void)) (void (*) (struct regcache *))
noprocess); noprocess);
de_fault (deprecated_xfer_memory, de_fault (deprecated_xfer_memory,
- (int (*) (CORE_ADDR, gdb_byte *, int, int, struct mem_attrib *, struct target_ops *)) - (int (*) (CORE_ADDR, gdb_byte *, int, int, struct mem_attrib *, struct target_ops *))
@ -80,7 +84,7 @@ Index: gdb-6.6/gdb/target.c
nomemory); nomemory);
de_fault (to_files_info, de_fault (to_files_info,
(void (*) (struct target_ops *)) (void (*) (struct target_ops *))
@@ -1178,7 +1178,7 @@ target_xfer_partial (struct target_ops * @@ -1195,7 +1195,7 @@ target_xfer_partial (struct target_ops *
it makes no progress, and then return how much was transferred). */ it makes no progress, and then return how much was transferred). */
int int
@ -89,7 +93,7 @@ Index: gdb-6.6/gdb/target.c
{ {
if (target_read (&current_target, TARGET_OBJECT_MEMORY, NULL, if (target_read (&current_target, TARGET_OBJECT_MEMORY, NULL,
myaddr, memaddr, len) == len) myaddr, memaddr, len) == len)
@@ -1188,7 +1188,7 @@ target_read_memory (CORE_ADDR memaddr, g @@ -1205,7 +1205,7 @@ target_read_memory (CORE_ADDR memaddr, g
} }
int int
@ -98,7 +102,7 @@ Index: gdb-6.6/gdb/target.c
{ {
if (target_write (&current_target, TARGET_OBJECT_MEMORY, NULL, if (target_write (&current_target, TARGET_OBJECT_MEMORY, NULL,
myaddr, memaddr, len) == len) myaddr, memaddr, len) == len)
@@ -2186,8 +2186,8 @@ debug_to_prepare_to_store (void) @@ -2228,8 +2228,8 @@ debug_to_prepare_to_store (struct regcac
fprintf_unfiltered (gdb_stdlog, "target_prepare_to_store ()\n"); fprintf_unfiltered (gdb_stdlog, "target_prepare_to_store ()\n");
} }
@ -109,7 +113,7 @@ Index: gdb-6.6/gdb/target.c
int write, struct mem_attrib *attrib, int write, struct mem_attrib *attrib,
struct target_ops *target) struct target_ops *target)
{ {
@@ -2197,9 +2197,9 @@ deprecated_debug_xfer_memory (CORE_ADDR @@ -2239,9 +2239,9 @@ deprecated_debug_xfer_memory (CORE_ADDR
attrib, target); attrib, target);
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,
@ -121,11 +125,11 @@ Index: gdb-6.6/gdb/target.c
if (retval > 0) if (retval > 0)
{ {
Index: gdb-6.6/gdb/target.h Index: gdb-6.7/gdb/target.h
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/target.h 2007-01-20 16:09:10.000000000 +0100 --- gdb-6.7.orig/gdb/target.h 2007-10-14 23:24:52.000000000 +0200
+++ gdb-6.6/gdb/target.h 2007-01-20 16:09:17.000000000 +0100 +++ gdb-6.7/gdb/target.h 2007-10-15 21:39:20.000000000 +0200
@@ -347,10 +347,10 @@ struct target_ops @@ -351,10 +351,10 @@ struct target_ops
NOTE: cagney/2004-10-01: This has been entirely superseeded by NOTE: cagney/2004-10-01: This has been entirely superseeded by
to_xfer_partial and inferior inheritance. */ to_xfer_partial and inferior inheritance. */
@ -140,7 +144,7 @@ Index: gdb-6.6/gdb/target.h
void (*to_files_info) (struct target_ops *); void (*to_files_info) (struct target_ops *);
int (*to_insert_breakpoint) (struct bp_target_info *); int (*to_insert_breakpoint) (struct bp_target_info *);
@@ -605,16 +605,17 @@ extern DCACHE *target_dcache; @@ -615,13 +615,14 @@ extern DCACHE *target_dcache;
extern int target_read_string (CORE_ADDR, char **, int, int *); extern int target_read_string (CORE_ADDR, char **, int, int *);
@ -157,46 +161,13 @@ Index: gdb-6.6/gdb/target.h
+extern LONGEST xfer_memory (CORE_ADDR, gdb_byte *, LONGEST, int, +extern LONGEST xfer_memory (CORE_ADDR, gdb_byte *, LONGEST, int,
+ struct mem_attrib *, struct target_ops *); + struct mem_attrib *, struct target_ops *);
-extern int child_xfer_memory (CORE_ADDR, gdb_byte *, int, int,
- struct mem_attrib *, struct target_ops *);
+extern LONGEST child_xfer_memory (CORE_ADDR, gdb_byte *, LONGEST, int,
+ struct mem_attrib *, struct target_ops *);
/* Fetches the target's memory map. If one is found it is sorted /* Fetches the target's memory map. If one is found it is sorted
and returned, after some consistency checking. Otherwise, NULL and returned, after some consistency checking. Otherwise, NULL
Index: gdb-6.6/gdb/infptrace.c Index: gdb-6.7/gdb/dcache.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/infptrace.c 2005-12-17 23:34:01.000000000 +0100 --- gdb-6.7.orig/gdb/dcache.c 2007-08-23 20:08:28.000000000 +0200
+++ gdb-6.6/gdb/infptrace.c 2007-01-20 16:09:17.000000000 +0100 +++ gdb-6.7/gdb/dcache.c 2007-10-15 21:37:54.000000000 +0200
@@ -331,17 +331,17 @@ store_inferior_registers (int regnum) @@ -517,9 +517,9 @@ dcache_free (DCACHE *dcache)
deprecated_child_ops doesn't allow memory operations to cross below
us in the target stack anyway. */
-int
-child_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write,
+LONGEST
+child_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len, int write,
struct mem_attrib *attrib, struct target_ops *target)
{
- int i;
+ LONGEST i;
/* Round starting address down to longword boundary. */
CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_TYPE_RET);
/* Round ending address up; get number of longwords that makes. */
- int count = ((((memaddr + len) - addr) + sizeof (PTRACE_TYPE_RET) - 1)
- / sizeof (PTRACE_TYPE_RET));
- int alloc = count * sizeof (PTRACE_TYPE_RET);
+ LONGEST count = ((((memaddr + len) - addr) + sizeof (PTRACE_TYPE_RET) - 1)
+ / sizeof (PTRACE_TYPE_RET));
+ LONGEST alloc = count * sizeof (PTRACE_TYPE_RET);
PTRACE_TYPE_RET *buffer;
struct cleanup *old_chain = NULL;
Index: gdb-6.6/gdb/dcache.c
===================================================================
--- gdb-6.6.orig/gdb/dcache.c 2006-08-15 20:46:24.000000000 +0200
+++ gdb-6.6/gdb/dcache.c 2007-01-20 16:09:17.000000000 +0100
@@ -519,9 +519,9 @@ dcache_free (DCACHE *dcache)
This routine is indended to be called by remote_xfer_ functions. */ This routine is indended to be called by remote_xfer_ functions. */
@ -208,11 +179,11 @@ Index: gdb-6.6/gdb/dcache.c
{ {
int i; int i;
int (*xfunc) (DCACHE *dcache, CORE_ADDR addr, gdb_byte *ptr); int (*xfunc) (DCACHE *dcache, CORE_ADDR addr, gdb_byte *ptr);
Index: gdb-6.6/gdb/dcache.h Index: gdb-6.7/gdb/dcache.h
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/dcache.h 2005-12-17 23:33:59.000000000 +0100 --- gdb-6.7.orig/gdb/dcache.h 2007-08-23 20:08:28.000000000 +0200
+++ gdb-6.6/gdb/dcache.h 2007-01-20 16:09:17.000000000 +0100 +++ gdb-6.7/gdb/dcache.h 2007-10-15 21:37:54.000000000 +0200
@@ -37,7 +37,7 @@ void dcache_free (DCACHE *); @@ -35,7 +35,7 @@ void dcache_free (DCACHE *);
/* Simple to call from <remote>_xfer_memory */ /* Simple to call from <remote>_xfer_memory */
@ -222,11 +193,11 @@ Index: gdb-6.6/gdb/dcache.h
+ LONGEST len, int should_write); + LONGEST len, int should_write);
#endif /* DCACHE_H */ #endif /* DCACHE_H */
Index: gdb-6.6/gdb/exec.c Index: gdb-6.7/gdb/exec.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/exec.c 2006-11-10 20:20:35.000000000 +0100 --- gdb-6.7.orig/gdb/exec.c 2007-08-23 20:08:28.000000000 +0200
+++ gdb-6.6/gdb/exec.c 2007-01-20 16:09:17.000000000 +0100 +++ gdb-6.7/gdb/exec.c 2007-10-15 21:37:54.000000000 +0200
@@ -452,8 +452,8 @@ map_vmap (bfd *abfd, bfd *arch) @@ -453,8 +453,8 @@ map_vmap (bfd *abfd, bfd *arch)
The same routine is used to handle both core and exec files; The same routine is used to handle both core and exec files;
we just tail-call it with more arguments to select between them. */ we just tail-call it with more arguments to select between them. */
@ -237,11 +208,11 @@ Index: gdb-6.6/gdb/exec.c
struct mem_attrib *attrib, struct target_ops *target) struct mem_attrib *attrib, struct target_ops *target)
{ {
int res; int res;
Index: gdb-6.6/gdb/linux-nat.c Index: gdb-6.7/gdb/linux-nat.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/linux-nat.c 2007-01-20 16:09:14.000000000 +0100 --- gdb-6.7.orig/gdb/linux-nat.c 2007-10-15 00:13:52.000000000 +0200
+++ gdb-6.6/gdb/linux-nat.c 2007-01-20 16:09:17.000000000 +0100 +++ gdb-6.7/gdb/linux-nat.c 2007-10-15 21:37:54.000000000 +0200
@@ -3266,7 +3266,7 @@ linux_xfer_partial (struct target_ops *o @@ -3248,7 +3248,7 @@ linux_xfer_partial (struct target_ops *o
Revert when Bugzilla 147436 is fixed. */ Revert when Bugzilla 147436 is fixed. */
if (iterate_over_lwps (ia64_linux_check_stack_region, &range) != NULL) if (iterate_over_lwps (ia64_linux_check_stack_region, &range) != NULL)
{ /* This region contains ia64 rse registers, we have to re-read. */ { /* This region contains ia64 rse registers, we have to re-read. */
@ -250,11 +221,11 @@ Index: gdb-6.6/gdb/linux-nat.c
/* Re-read register stack area. */ /* Re-read register stack area. */
xxfer = super_xfer_partial (ops, object, annex, xxfer = super_xfer_partial (ops, object, annex,
Index: gdb-6.6/gdb/remote.c Index: gdb-6.7/gdb/remote.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/remote.c 2007-01-20 16:09:12.000000000 +0100 --- gdb-6.7.orig/gdb/remote.c 2007-10-14 23:42:39.000000000 +0200
+++ gdb-6.6/gdb/remote.c 2007-01-20 16:09:17.000000000 +0100 +++ gdb-6.7/gdb/remote.c 2007-10-15 21:37:54.000000000 +0200
@@ -27,6 +27,7 @@ @@ -25,6 +25,7 @@
#include "gdb_string.h" #include "gdb_string.h"
#include <ctype.h> #include <ctype.h>
#include <fcntl.h> #include <fcntl.h>
@ -262,7 +233,7 @@ Index: gdb-6.6/gdb/remote.c
#include "inferior.h" #include "inferior.h"
#include "bfd.h" #include "bfd.h"
#include "symfile.h" #include "symfile.h"
@@ -4185,19 +4186,27 @@ remote_read_bytes (CORE_ADDR memaddr, gd @@ -4484,19 +4485,27 @@ remote_read_bytes (CORE_ADDR memaddr, gd
if SHOULD_WRITE is nonzero. Returns length of data written or if SHOULD_WRITE is nonzero. Returns length of data written or
read; 0 for error. TARGET is unused. */ read; 0 for error. TARGET is unused. */
@ -293,11 +264,11 @@ Index: gdb-6.6/gdb/remote.c
} }
/* Sends a packet with content determined by the printf format string /* Sends a packet with content determined by the printf format string
Index: gdb-6.6/gdb/remote-sim.c Index: gdb-6.7/gdb/remote-sim.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/remote-sim.c 2006-11-10 20:20:36.000000000 +0100 --- gdb-6.7.orig/gdb/remote-sim.c 2007-08-23 20:08:36.000000000 +0200
+++ gdb-6.6/gdb/remote-sim.c 2007-01-20 16:10:10.000000000 +0100 +++ gdb-6.7/gdb/remote-sim.c 2007-10-15 21:41:33.000000000 +0200
@@ -745,11 +745,14 @@ gdbsim_prepare_to_store (void) @@ -747,11 +747,14 @@ gdbsim_prepare_to_store (struct regcache
Returns the number of bytes transferred. */ Returns the number of bytes transferred. */
@ -314,13 +285,13 @@ Index: gdb-6.6/gdb/remote-sim.c
/* If no program is running yet, then ignore the simulator for /* If no program is running yet, then ignore the simulator for
memory. Pass the request down to the next target, hopefully memory. Pass the request down to the next target, hopefully
an exec file. */ an exec file. */
@@ -765,22 +768,22 @@ gdbsim_xfer_inferior_memory (CORE_ADDR m @@ -767,22 +770,22 @@ gdbsim_xfer_inferior_memory (CORE_ADDR m
printf_filtered ("gdbsim_xfer_inferior_memory: myaddr 0x"); printf_filtered ("gdbsim_xfer_inferior_memory: myaddr 0x");
gdb_print_host_address (myaddr, gdb_stdout); gdb_print_host_address (myaddr, gdb_stdout);
printf_filtered (", memaddr 0x%s, len %d, write %d\n", printf_filtered (", memaddr 0x%s, len %d, write %d\n",
- paddr_nz (memaddr), len, write); - paddr_nz (memaddr), len, write);
+ paddr_nz (memaddr), xfer_len, write); + paddr_nz (memaddr), xfer_len, write);
if (sr_get_debug () && write) if (remote_debug && write)
- dump_mem (myaddr, len); - dump_mem (myaddr, len);
+ dump_mem (myaddr, xfer_len); + dump_mem (myaddr, xfer_len);
} }
@ -333,10 +304,10 @@ Index: gdb-6.6/gdb/remote-sim.c
else else
{ {
- len = sim_read (gdbsim_desc, memaddr, myaddr, len); - len = sim_read (gdbsim_desc, memaddr, myaddr, len);
- if (sr_get_debug () && len > 0) - if (remote_debug && len > 0)
- dump_mem (myaddr, len); - dump_mem (myaddr, len);
+ xfer_len = sim_read (gdbsim_desc, memaddr, myaddr, xfer_len); + xfer_len = sim_read (gdbsim_desc, memaddr, myaddr, xfer_len);
+ if (sr_get_debug () && xfer_len > 0) + if (remote_debug && xfer_len > 0)
+ dump_mem (myaddr, xfer_len); + dump_mem (myaddr, xfer_len);
} }
- return len; - return len;

View File

@ -15,44 +15,49 @@
(decode_variable_not_found): ... a new function here. (decode_variable_not_found): ... a new function here.
(decode_variable): New function. (decode_variable): New function.
Index: gdb-6.5/gdb/linespec.c 2007-10-31 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.7.
Index: gdb-6.7/gdb/linespec.c
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/linespec.c 2006-01-10 20:14:43.000000000 -0200 --- gdb-6.7.orig/gdb/linespec.c 2007-08-23 20:08:35.000000000 +0200
+++ gdb-6.5/gdb/linespec.c 2006-07-07 01:04:56.000000000 -0300 +++ gdb-6.7/gdb/linespec.c 2007-10-13 05:26:33.000000000 +0200
@@ -37,6 +37,7 @@ @@ -36,6 +36,7 @@
#include "objc-lang.h"
#include "linespec.h" #include "linespec.h"
#include "exceptions.h" #include "exceptions.h"
#include "language.h"
+#include "gdb_assert.h" +#include "gdb_assert.h"
/* We share this one with symtab.c, but it is not exported widely. */ /* We share this one with symtab.c, but it is not exported widely. */
@@ -75,7 +75,8 @@ static struct symtabs_and_lines find_met @@ -75,7 +76,8 @@ static struct symtabs_and_lines find_met
struct symbol *sym_class);
static int collect_methods (char *copy, struct type *t, static int collect_methods (char *copy, struct type *t,
struct symbol *sym_class,
- struct symbol **sym_arr); - struct symbol **sym_arr);
+ struct symbol **sym_arr, + struct symbol **sym_arr,
+ struct minimal_symbol **msym_arr); + struct minimal_symbol **msym_arr);
static NORETURN void cplusplus_error (const char *name, static NORETURN void cplusplus_error (const char *name,
const char *fmt, ...) const char *fmt, ...)
@@ -83,10 +84,12 @@ static NORETURN void cplusplus_error (co @@ -84,11 +86,13 @@ static NORETURN void cplusplus_error (co
static int total_number_of_methods (struct type *type); static int total_number_of_methods (struct type *type);
-static int find_methods (struct type *, char *, struct symbol **); static int find_methods (struct type *, char *,
+static int find_methods (struct type *, char *, struct symbol **, - enum language, struct symbol **);
+ enum language, struct symbol **,
+ struct minimal_symbol **); + struct minimal_symbol **);
static int add_matching_methods (int method_counter, struct type *t, static int add_matching_methods (int method_counter, struct type *t,
enum language language,
- struct symbol **sym_arr); - struct symbol **sym_arr);
+ struct symbol **sym_arr, + struct symbol **sym_arr,
+ struct minimal_symbol **msym_arr); + struct minimal_symbol **msym_arr);
static int add_constructors (int method_counter, struct type *t, static int add_constructors (int method_counter, struct type *t,
struct symbol **sym_arr); enum language language,
@@ -101,6 +104,9 @@ static int is_objc_method_format (const @@ -104,6 +108,9 @@ static int is_objc_method_format (const
static struct symtabs_and_lines decode_line_2 (struct symbol *[], static struct symtabs_and_lines decode_line_2 (struct symbol *[],
int, int, char ***); int, int, char ***);
@ -62,7 +67,7 @@ Index: gdb-6.5/gdb/linespec.c
static struct symtab *symtab_from_filename (char **argptr, static struct symtab *symtab_from_filename (char **argptr,
char *p, int is_quote_enclosed, char *p, int is_quote_enclosed,
int *not_found_ptr); int *not_found_ptr);
@@ -191,12 +197,18 @@ total_number_of_methods (struct type *ty @@ -194,13 +201,18 @@ total_number_of_methods (struct type *ty
/* Recursive helper function for decode_line_1. /* Recursive helper function for decode_line_1.
Look for methods named NAME in type T. Look for methods named NAME in type T.
Return number of matches. Return number of matches.
@ -77,29 +82,27 @@ Index: gdb-6.5/gdb/linespec.c
Note that this function is g++ specific. */ Note that this function is g++ specific. */
static int static int
-find_methods (struct type *t, char *name, struct symbol **sym_arr) find_methods (struct type *t, char *name, enum language language,
+find_methods (struct type *t, char *name, struct symbol **sym_arr, - struct symbol **sym_arr)
+ struct minimal_symbol **msym_arr) + struct symbol **sym_arr, struct minimal_symbol **msym_arr)
{ {
int i1 = 0; int i1 = 0;
int ibase; int ibase;
@@ -239,7 +251,8 @@ find_methods (struct type *t, char *name @@ -243,7 +255,7 @@ find_methods (struct type *t, char *name
if (strcmp_iw (name, method_name) == 0) if (strcmp_iw (name, method_name) == 0)
/* Find all the overloaded methods with that name. */ /* Find all the overloaded methods with that name. */
i1 += add_matching_methods (method_counter, t, i1 += add_matching_methods (method_counter, t, language,
- sym_arr + i1); - sym_arr + i1);
+ sym_arr + i1, + sym_arr + i1, msym_arr);
+ msym_arr);
else if (strncmp (class_name, name, name_len) == 0 else if (strncmp (class_name, name, name_len) == 0
&& (class_name[name_len] == '\0' && (class_name[name_len] == '\0'
|| class_name[name_len] == '<')) || class_name[name_len] == '<'))
@@ -261,21 +274,101 @@ find_methods (struct type *t, char *name @@ -266,21 +278,100 @@ find_methods (struct type *t, char *name
if (i1 == 0) if (i1 == 0)
for (ibase = 0; ibase < TYPE_N_BASECLASSES (t); ibase++) for (ibase = 0; ibase < TYPE_N_BASECLASSES (t); ibase++)
- i1 += find_methods (TYPE_BASECLASS (t, ibase), name, sym_arr + i1); i1 += find_methods (TYPE_BASECLASS (t, ibase), name,
+ i1 += find_methods (TYPE_BASECLASS (t, ibase), name, sym_arr + i1, - language, sym_arr + i1);
+ msym_arr); + language, sym_arr + i1, msym_arr);
return i1; return i1;
} }
@ -185,8 +188,8 @@ Index: gdb-6.5/gdb/linespec.c
static int static int
add_matching_methods (int method_counter, struct type *t, add_matching_methods (int method_counter, struct type *t,
- struct symbol **sym_arr) - enum language language, struct symbol **sym_arr)
+ struct symbol **sym_arr, + enum language language, struct symbol **sym_arr,
+ struct minimal_symbol **msym_arr) + struct minimal_symbol **msym_arr)
{ {
int field_counter; int field_counter;
@ -197,11 +200,10 @@ Index: gdb-6.5/gdb/linespec.c
for (field_counter = TYPE_FN_FIELDLIST_LENGTH (t, method_counter) - 1; for (field_counter = TYPE_FN_FIELDLIST_LENGTH (t, method_counter) - 1;
field_counter >= 0; field_counter >= 0;
@@ -299,6 +374,16 @@ add_matching_methods (int method_counter @@ -305,6 +396,16 @@ add_matching_methods (int method_counter
}
else else
phys_name = TYPE_FN_FIELD_PHYSNAME (f, field_counter); phys_name = TYPE_FN_FIELD_PHYSNAME (f, field_counter);
+
+ /* Check for special case of looking for member that + /* Check for special case of looking for member that
+ doesn't have a mangled name provided. This will happen + doesn't have a mangled name provided. This will happen
+ when we have in-charge and not-in-charge constructors. + when we have in-charge and not-in-charge constructors.
@ -211,10 +213,11 @@ Index: gdb-6.5/gdb/linespec.c
+ table which has the full member name information we need. */ + table which has the full member name information we need. */
+ if (strlen (phys_name) <= strlen (class_name)) + if (strlen (phys_name) <= strlen (class_name))
+ return add_minsym_members (class_name, phys_name, msym_arr); + return add_minsym_members (class_name, phys_name, msym_arr);
+
/* Destructor is handled by caller, don't add it to /* Destructor is handled by caller, don't add it to
the list. */ the list. */
@@ -324,6 +409,9 @@ add_matching_methods (int method_counter if (is_destructor_name (phys_name) != 0)
@@ -330,6 +431,9 @@ add_matching_methods (int method_counter
} }
} }
@ -224,7 +227,7 @@ Index: gdb-6.5/gdb/linespec.c
return i1; return i1;
} }
@@ -603,6 +691,146 @@ decode_line_2 (struct symbol *sym_arr[], @@ -610,6 +714,146 @@ decode_line_2 (struct symbol *sym_arr[],
discard_cleanups (old_chain); discard_cleanups (old_chain);
return return_values; return return_values;
} }
@ -371,20 +374,20 @@ Index: gdb-6.5/gdb/linespec.c
/* The parser of linespec itself. */ /* The parser of linespec itself. */
@@ -1406,36 +1634,46 @@ find_method (int funfirstline, char ***c @@ -1414,35 +1658,46 @@ find_method (int funfirstline, char ***c
int i1; /* Counter for the symbol array. */
struct symbol **sym_arr = alloca (total_number_of_methods (t) struct symbol **sym_arr = alloca (total_number_of_methods (t)
* sizeof (struct symbol *)); * sizeof (struct symbol *));
+ struct minimal_symbol **msym_arr = alloca (total_number_of_methods (t) + struct minimal_symbol **msym_arr = alloca (total_number_of_methods (t)
+ * sizeof (struct minimal_symbol *)); + * sizeof (struct minimal_symbol *));
+ +
+ msym_arr[0] = NULL; + msym_arr[0] = NULL;
+
/* Find all methods with a matching name, and put them in /* Find all methods with a matching name, and put them in
sym_arr. */ sym_arr. */
- i1 = collect_methods (copy, t, sym_arr); - i1 = collect_methods (copy, t, sym_class, sym_arr);
+ i1 = collect_methods (copy, t, sym_arr, msym_arr); + i1 = collect_methods (copy, t, sym_class, sym_arr, msym_arr);
if (i1 == 1) if (i1 == 1)
{ {
@ -428,11 +431,11 @@ Index: gdb-6.5/gdb/linespec.c
/* There is more than one field with that name /* There is more than one field with that name
(overloaded). Ask the user which one to use. */ (overloaded). Ask the user which one to use. */
+ if (msym_arr[0] != NULL) + if (msym_arr[0] != NULL)
+ return decode_line_3 (msym_arr, i1, funfirstline, canonical); + return decode_line_3 (msym_arr, i1, funfirstline, canonical);
return decode_line_2 (sym_arr, i1, funfirstline, canonical); return decode_line_2 (sym_arr, i1, funfirstline, canonical);
} }
else else
@@ -1462,11 +1700,12 @@ find_method (int funfirstline, char ***c @@ -1469,11 +1722,12 @@ find_method (int funfirstline, char ***c
} }
/* Find all methods named COPY in the class whose type is T, and put /* Find all methods named COPY in the class whose type is T, and put
@ -441,22 +444,22 @@ Index: gdb-6.5/gdb/linespec.c
static int static int
collect_methods (char *copy, struct type *t, collect_methods (char *copy, struct type *t,
- struct symbol **sym_arr) - struct symbol *sym_class, struct symbol **sym_arr)
+ struct symbol **sym_arr, + struct symbol *sym_class, struct symbol **sym_arr,
+ struct minimal_symbol **msym_arr) + struct minimal_symbol **msym_arr)
{ {
int i1 = 0; /* Counter for the symbol array. */ int i1 = 0; /* Counter for the symbol array. */
@@ -1488,7 +1727,7 @@ collect_methods (char *copy, struct type @@ -1495,7 +1749,7 @@ collect_methods (char *copy, struct type
} }
} }
else else
- i1 = find_methods (t, copy, sym_arr); - i1 = find_methods (t, copy, SYMBOL_LANGUAGE (sym_class), sym_arr);
+ i1 = find_methods (t, copy, sym_arr, msym_arr); + i1 = find_methods (t, copy, SYMBOL_LANGUAGE (sym_class), sym_arr, msym_arr);
return i1; return i1;
} }
@@ -1976,12 +2021,13 @@ decode_dollar (char *copy, int funfirstl @@ -1717,12 +1971,13 @@ decode_dollar (char *copy, int funfirstl
and do not issue an error message. */ and do not issue an error message. */
static struct symtabs_and_lines static struct symtabs_and_lines
@ -472,7 +475,7 @@ Index: gdb-6.5/gdb/linespec.c
struct minimal_symbol *msymbol; struct minimal_symbol *msymbol;
@@ -2001,8 +2047,25 @@ decode_variable (char *copy, int funfirs @@ -1740,8 +1995,25 @@ decode_variable (char *copy, int funfirs
msymbol = lookup_minimal_symbol (copy, NULL, NULL); msymbol = lookup_minimal_symbol (copy, NULL, NULL);
if (msymbol != NULL) if (msymbol != NULL)
@ -484,10 +487,10 @@ Index: gdb-6.5/gdb/linespec.c
+ if (file_symtab == 0) + if (file_symtab == 0)
+ build_canonical_line_spec (retval.sals, SYMBOL_LINKAGE_NAME (msymbol), + build_canonical_line_spec (retval.sals, SYMBOL_LINKAGE_NAME (msymbol),
+ canonical); + canonical);
+
+ return retval; + return retval;
+ } + }
+
+ retval.nelts = 0; + retval.nelts = 0;
+ retval.sals = NULL; + retval.sals = NULL;
+ return retval; + return retval;
@ -499,7 +502,7 @@ Index: gdb-6.5/gdb/linespec.c
if (!have_full_symbols () && if (!have_full_symbols () &&
!have_partial_symbols () && !have_minimal_symbols ()) !have_partial_symbols () && !have_minimal_symbols ())
error (_("No symbol table is loaded. Use the \"file\" command.")); error (_("No symbol table is loaded. Use the \"file\" command."));
@@ -2010,6 +2064,132 @@ decode_variable (char *copy, int funfirs @@ -1751,6 +2023,132 @@ decode_variable (char *copy, int funfirs
throw_error (NOT_FOUND_ERROR, _("Function \"%s\" not defined."), copy); throw_error (NOT_FOUND_ERROR, _("Function \"%s\" not defined."), copy);
} }
@ -632,15 +635,17 @@ Index: gdb-6.5/gdb/linespec.c
diff -u -rup gdb-6.6-orig/gdb/Makefile.in gdb-6.6/gdb/Makefile.in Index: gdb-6.7/gdb/Makefile.in
--- gdb-6.6-orig/gdb/Makefile.in 2007-10-05 15:22:37.000000000 +0200 ===================================================================
+++ gdb-6.6/gdb/Makefile.in 2007-10-05 16:29:10.000000000 +0200 --- gdb-6.7.orig/gdb/Makefile.in 2007-10-13 05:09:50.000000000 +0200
@@ -2266,7 +2266,7 @@ libunwind-frame.o: libunwind-frame.c $(d +++ gdb-6.7/gdb/Makefile.in 2007-10-13 05:15:13.000000000 +0200
@@ -2233,7 +2233,8 @@ libunwind-frame.o: libunwind-frame.c $(d
linespec.o: linespec.c $(defs_h) $(symtab_h) $(frame_h) $(command_h) \ linespec.o: linespec.c $(defs_h) $(symtab_h) $(frame_h) $(command_h) \
$(symfile_h) $(objfiles_h) $(source_h) $(demangle_h) $(value_h) \ $(symfile_h) $(objfiles_h) $(source_h) $(demangle_h) $(value_h) \
$(completer_h) $(cp_abi_h) $(parser_defs_h) $(block_h) \ $(completer_h) $(cp_abi_h) $(parser_defs_h) $(block_h) \
- $(objc_lang_h) $(linespec_h) $(exceptions_h) - $(objc_lang_h) $(linespec_h) $(exceptions_h) $(language_h)
+ $(objc_lang_h) $(linespec_h) $(exceptions_h) $(gdb_assert_h) + $(objc_lang_h) $(linespec_h) $(exceptions_h) $(language_h) \
+ $(gdb_assert_h)
linux-fork.o: linux-fork.c $(defs_h) $(inferior_h) $(regcache_h) $(gdbcmd_h) \ linux-fork.o: linux-fork.c $(defs_h) $(inferior_h) $(regcache_h) $(gdbcmd_h) \
$(infcall_h) $(gdb_assert_h) $(gdb_string_h) $(linux_fork_h) \ $(infcall_h) $(gdb_assert_h) $(gdb_string_h) $(linux_fork_h) \
$(linux_nat_h) $(linux_nat_h)

View File

@ -9,10 +9,14 @@
* gdb.base/follow-child.exp, gdb.base/follow-child.c: New files. * gdb.base/follow-child.exp, gdb.base/follow-child.c: New files.
Index: gdb-6.6/gdb/doc/observer.texi 2007-10-16 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.7.
Index: gdb-6.7/gdb/doc/observer.texi
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/doc/observer.texi --- gdb-6.7.orig/gdb/doc/observer.texi 2007-10-13 05:09:50.000000000 +0200
+++ gdb-6.6/gdb/doc/observer.texi +++ gdb-6.7/gdb/doc/observer.texi 2007-10-14 23:24:52.000000000 +0200
@@ -119,6 +119,10 @@ when @value{GDBN} calls this observer, t @@ -119,6 +119,10 @@ when @value{GDBN} calls this observer, t
haven't been loaded yet. haven't been loaded yet.
@end deftypefun @end deftypefun
@ -24,11 +28,11 @@ Index: gdb-6.6/gdb/doc/observer.texi
@deftypefun void solib_unloaded (struct so_list *@var{solib}) @deftypefun void solib_unloaded (struct so_list *@var{solib})
The shared library specified by @var{solib} has been unloaded. The shared library specified by @var{solib} has been unloaded.
@end deftypefun @end deftypefun
Index: gdb-6.6/gdb/linux-nat.c Index: gdb-6.7/gdb/linux-nat.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/linux-nat.c --- gdb-6.7.orig/gdb/linux-nat.c 2007-10-13 05:09:50.000000000 +0200
+++ gdb-6.6/gdb/linux-nat.c +++ gdb-6.7/gdb/linux-nat.c 2007-10-14 23:24:52.000000000 +0200
@@ -803,11 +803,26 @@ iterate_over_lwps (int (*callback) (stru @@ -742,11 +742,26 @@ iterate_over_lwps (int (*callback) (stru
{ {
struct lwp_info *lp, *lpnext; struct lwp_info *lp, *lpnext;
@ -58,7 +62,7 @@ Index: gdb-6.6/gdb/linux-nat.c
} }
return NULL; return NULL;
@@ -3262,6 +3274,18 @@ linux_nat_add_target (struct target_ops @@ -3272,6 +3284,18 @@ linux_nat_add_target (struct target_ops
thread_db_init (t); thread_db_init (t);
} }
@ -77,7 +81,7 @@ Index: gdb-6.6/gdb/linux-nat.c
void void
_initialize_linux_nat (void) _initialize_linux_nat (void)
{ {
@@ -3276,6 +3300,8 @@ Specify any of the following keywords fo @@ -3286,6 +3310,8 @@ Specify any of the following keywords fo
status -- list a different bunch of random process info.\n\ status -- list a different bunch of random process info.\n\
all -- list all available /proc info.")); all -- list all available /proc info."));
@ -86,19 +90,19 @@ Index: gdb-6.6/gdb/linux-nat.c
/* Save the original signal mask. */ /* Save the original signal mask. */
sigprocmask (SIG_SETMASK, NULL, &normal_mask); sigprocmask (SIG_SETMASK, NULL, &normal_mask);
Index: gdb-6.6/gdb/target.c Index: gdb-6.7/gdb/target.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/target.c --- gdb-6.7.orig/gdb/target.c 2007-08-23 20:08:45.000000000 +0200
+++ gdb-6.6/gdb/target.c +++ gdb-6.7/gdb/target.c 2007-10-14 23:25:13.000000000 +0200
@@ -40,6 +40,7 @@ @@ -39,6 +39,7 @@
#include "gdb_assert.h"
#include "gdbcore.h" #include "gdbcore.h"
#include "exceptions.h" #include "exceptions.h"
#include "target-descriptions.h"
+#include "observer.h" +#include "observer.h"
static void target_info (char *, int); static void target_info (char *, int);
@@ -276,6 +277,13 @@ target_load (char *arg, int from_tty) @@ -275,6 +276,13 @@ target_load (char *arg, int from_tty)
(*current_target.to_load) (arg, from_tty); (*current_target.to_load) (arg, from_tty);
} }
@ -112,11 +116,11 @@ Index: gdb-6.6/gdb/target.c
static int static int
nomemory (CORE_ADDR memaddr, char *myaddr, int len, int write, nomemory (CORE_ADDR memaddr, char *myaddr, int len, int write,
struct target_ops *t) struct target_ops *t)
Index: gdb-6.6/gdb/target.h Index: gdb-6.7/gdb/target.h
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/target.h --- gdb-6.7.orig/gdb/target.h 2007-08-23 20:08:46.000000000 +0200
+++ gdb-6.6/gdb/target.h +++ gdb-6.7/gdb/target.h 2007-10-14 23:24:52.000000000 +0200
@@ -891,8 +891,7 @@ int target_follow_fork (int follow_child @@ -864,8 +864,7 @@ int target_follow_fork (int follow_child
/* The inferior process has died. Do what is right. */ /* The inferior process has died. Do what is right. */

View File

@ -1,8 +1,8 @@
Index: gdb-6.6/gdb/dwarf2read.c Index: gdb-6.7/gdb/dwarf2read.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/dwarf2read.c --- gdb-6.7.orig/gdb/dwarf2read.c 2007-10-13 05:27:15.000000000 +0200
+++ gdb-6.6/gdb/dwarf2read.c +++ gdb-6.7/gdb/dwarf2read.c 2007-10-13 05:29:58.000000000 +0200
@@ -1219,7 +1219,7 @@ dwarf2_build_psymtabs (struct objfile *o @@ -1226,7 +1226,7 @@ dwarf2_build_psymtabs (struct objfile *o
else else
dwarf2_per_objfile->loc_buffer = NULL; dwarf2_per_objfile->loc_buffer = NULL;
@ -11,11 +11,11 @@ Index: gdb-6.6/gdb/dwarf2read.c
|| (objfile->global_psymbols.size == 0 || (objfile->global_psymbols.size == 0
&& objfile->static_psymbols.size == 0)) && objfile->static_psymbols.size == 0))
{ {
Index: gdb-6.6/gdb/auxv.c Index: gdb-6.7/gdb/auxv.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/auxv.c --- gdb-6.7.orig/gdb/auxv.c 2007-08-23 20:08:26.000000000 +0200
+++ gdb-6.6/gdb/auxv.c +++ gdb-6.7/gdb/auxv.c 2007-10-13 05:29:58.000000000 +0200
@@ -82,7 +82,7 @@ procfs_xfer_auxv (struct target_ops *ops @@ -80,7 +80,7 @@ procfs_xfer_auxv (struct target_ops *ops
Return 1 if an entry was read into *TYPEP and *VALP. */ Return 1 if an entry was read into *TYPEP and *VALP. */
int int
target_auxv_parse (struct target_ops *ops, gdb_byte **readptr, target_auxv_parse (struct target_ops *ops, gdb_byte **readptr,
@ -24,7 +24,7 @@ Index: gdb-6.6/gdb/auxv.c
{ {
const int sizeof_auxv_field = TYPE_LENGTH (builtin_type_void_data_ptr); const int sizeof_auxv_field = TYPE_LENGTH (builtin_type_void_data_ptr);
gdb_byte *ptr = *readptr; gdb_byte *ptr = *readptr;
@@ -107,9 +107,10 @@ target_auxv_parse (struct target_ops *op @@ -105,9 +105,10 @@ target_auxv_parse (struct target_ops *op
an error getting the information. On success, return 1 after an error getting the information. On success, return 1 after
storing the entry's value field in *VALP. */ storing the entry's value field in *VALP. */
int int
@ -37,7 +37,7 @@ Index: gdb-6.6/gdb/auxv.c
gdb_byte *data; gdb_byte *data;
LONGEST n = target_read_alloc (ops, TARGET_OBJECT_AUXV, NULL, &data); LONGEST n = target_read_alloc (ops, TARGET_OBJECT_AUXV, NULL, &data);
gdb_byte *ptr = data; gdb_byte *ptr = data;
@@ -119,10 +120,10 @@ target_auxv_search (struct target_ops *o @@ -117,10 +118,10 @@ target_auxv_search (struct target_ops *o
return n; return n;
while (1) while (1)
@ -50,7 +50,7 @@ Index: gdb-6.6/gdb/auxv.c
{ {
xfree (data); xfree (data);
*valp = val; *valp = val;
@@ -145,7 +146,8 @@ target_auxv_search (struct target_ops *o @@ -143,7 +144,8 @@ target_auxv_search (struct target_ops *o
int int
fprint_target_auxv (struct ui_file *file, struct target_ops *ops) fprint_target_auxv (struct ui_file *file, struct target_ops *ops)
{ {
@ -60,7 +60,7 @@ Index: gdb-6.6/gdb/auxv.c
gdb_byte *data; gdb_byte *data;
LONGEST len = target_read_alloc (ops, TARGET_OBJECT_AUXV, NULL, LONGEST len = target_read_alloc (ops, TARGET_OBJECT_AUXV, NULL,
&data); &data);
@@ -155,14 +157,14 @@ fprint_target_auxv (struct ui_file *file @@ -153,14 +155,14 @@ fprint_target_auxv (struct ui_file *file
if (len <= 0) if (len <= 0)
return len; return len;
@ -77,7 +77,7 @@ Index: gdb-6.6/gdb/auxv.c
{ {
#define TAG(tag, text, kind) \ #define TAG(tag, text, kind) \
case tag: name = #tag; description = text; flavor = kind; break case tag: name = #tag; description = text; flavor = kind; break
@@ -213,7 +215,7 @@ fprint_target_auxv (struct ui_file *file @@ -211,7 +213,7 @@ fprint_target_auxv (struct ui_file *file
} }
fprintf_filtered (file, "%-4s %-20s %-30s ", fprintf_filtered (file, "%-4s %-20s %-30s ",
@ -86,11 +86,11 @@ Index: gdb-6.6/gdb/auxv.c
switch (flavor) switch (flavor)
{ {
case dec: case dec:
Index: gdb-6.6/gdb/auxv.h Index: gdb-6.7/gdb/auxv.h
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/auxv.h --- gdb-6.7.orig/gdb/auxv.h 2007-08-23 20:08:26.000000000 +0200
+++ gdb-6.6/gdb/auxv.h +++ gdb-6.7/gdb/auxv.h 2007-10-13 05:29:58.000000000 +0200
@@ -37,14 +37,14 @@ struct target_ops; /* Forward declarati @@ -35,14 +35,14 @@ struct target_ops; /* Forward declarati
Return 1 if an entry was read into *TYPEP and *VALP. */ Return 1 if an entry was read into *TYPEP and *VALP. */
extern int target_auxv_parse (struct target_ops *ops, extern int target_auxv_parse (struct target_ops *ops,
gdb_byte **readptr, gdb_byte *endptr, gdb_byte **readptr, gdb_byte *endptr,
@ -107,11 +107,11 @@ Index: gdb-6.6/gdb/auxv.h
/* Print the contents of the target's AUXV on the specified file. */ /* Print the contents of the target's AUXV on the specified file. */
extern int fprint_target_auxv (struct ui_file *file, struct target_ops *ops); extern int fprint_target_auxv (struct ui_file *file, struct target_ops *ops);
Index: gdb-6.6/gdb/breakpoint.h Index: gdb-6.7/gdb/breakpoint.h
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/breakpoint.h --- gdb-6.7.orig/gdb/breakpoint.h 2007-10-13 05:09:50.000000000 +0200
+++ gdb-6.6/gdb/breakpoint.h +++ gdb-6.7/gdb/breakpoint.h 2007-10-13 05:29:58.000000000 +0200
@@ -159,6 +159,7 @@ enum enable_state @@ -153,6 +153,7 @@ enum enable_state
automatically enabled and reset when the call automatically enabled and reset when the call
"lands" (either completes, or stops at another "lands" (either completes, or stops at another
eventpoint). */ eventpoint). */
@ -121,7 +121,7 @@ Index: gdb-6.6/gdb/breakpoint.h
breakpoint instruction on top of it, or restore breakpoint instruction on top of it, or restore
@@ -807,8 +808,12 @@ extern void remove_thread_event_breakpoi @@ -807,8 +808,12 @@ extern void remove_thread_event_breakpoi
extern void disable_breakpoints_in_shlibs (int silent); extern void disable_breakpoints_in_shlibs (void);
+extern void disable_breakpoints_at_startup (int silent); +extern void disable_breakpoints_at_startup (int silent);
+ +
@ -132,11 +132,11 @@ Index: gdb-6.6/gdb/breakpoint.h
extern void create_solib_load_event_breakpoint (char *, int, char *, char *); extern void create_solib_load_event_breakpoint (char *, int, char *, char *);
extern void create_solib_unload_event_breakpoint (char *, int, extern void create_solib_unload_event_breakpoint (char *, int,
Index: gdb-6.6/gdb/symfile-mem.c Index: gdb-6.7/gdb/symfile-mem.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/symfile-mem.c --- gdb-6.7.orig/gdb/symfile-mem.c 2007-08-23 20:08:39.000000000 +0200
+++ gdb-6.6/gdb/symfile-mem.c +++ gdb-6.7/gdb/symfile-mem.c 2007-10-13 05:29:58.000000000 +0200
@@ -110,7 +110,7 @@ symbol_file_add_from_memory (struct bfd @@ -108,7 +108,7 @@ symbol_file_add_from_memory (struct bfd
} }
objf = symbol_file_add_from_bfd (nbfd, from_tty, objf = symbol_file_add_from_bfd (nbfd, from_tty,
@ -145,11 +145,11 @@ Index: gdb-6.6/gdb/symfile-mem.c
/* This might change our ideas about frames already looked at. */ /* This might change our ideas about frames already looked at. */
reinit_frame_cache (); reinit_frame_cache ();
Index: gdb-6.6/gdb/infrun.c Index: gdb-6.7/gdb/infrun.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/infrun.c --- gdb-6.7.orig/gdb/infrun.c 2007-10-13 05:09:50.000000000 +0200
+++ gdb-6.6/gdb/infrun.c +++ gdb-6.7/gdb/infrun.c 2007-10-13 05:29:58.000000000 +0200
@@ -2249,6 +2249,11 @@ process_event_stop_test: @@ -2305,6 +2305,11 @@ process_event_stop_test:
code segments in shared libraries might be mapped in now. */ code segments in shared libraries might be mapped in now. */
re_enable_breakpoints_in_shlibs (); re_enable_breakpoints_in_shlibs ();
@ -161,11 +161,11 @@ Index: gdb-6.6/gdb/infrun.c
/* If requested, stop when the dynamic linker notifies /* If requested, stop when the dynamic linker notifies
gdb of events. This allows the user to get control gdb of events. This allows the user to get control
and place breakpoints in initializer routines for and place breakpoints in initializer routines for
Index: gdb-6.6/gdb/objfiles.c Index: gdb-6.7/gdb/objfiles.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/objfiles.c --- gdb-6.7.orig/gdb/objfiles.c 2007-08-23 20:08:36.000000000 +0200
+++ gdb-6.6/gdb/objfiles.c +++ gdb-6.7/gdb/objfiles.c 2007-10-13 05:29:58.000000000 +0200
@@ -50,6 +50,9 @@ @@ -48,6 +48,9 @@
#include "dictionary.h" #include "dictionary.h"
#include "source.h" #include "source.h"
@ -175,7 +175,7 @@ Index: gdb-6.6/gdb/objfiles.c
/* Prototypes for local functions */ /* Prototypes for local functions */
static void objfile_alloc_data (struct objfile *objfile); static void objfile_alloc_data (struct objfile *objfile);
@@ -261,7 +264,19 @@ init_entry_point_info (struct objfile *o @@ -259,7 +262,19 @@ init_entry_point_info (struct objfile *o
CORE_ADDR CORE_ADDR
entry_point_address (void) entry_point_address (void)
{ {
@ -196,11 +196,11 @@ Index: gdb-6.6/gdb/objfiles.c
} }
/* Create the terminating entry of OBJFILE's minimal symbol table. /* Create the terminating entry of OBJFILE's minimal symbol table.
Index: gdb-6.6/gdb/solib-svr4.c Index: gdb-6.7/gdb/solib-svr4.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/solib-svr4.c --- gdb-6.7.orig/gdb/solib-svr4.c 2007-10-12 22:34:03.000000000 +0200
+++ gdb-6.6/gdb/solib-svr4.c +++ gdb-6.7/gdb/solib-svr4.c 2007-10-14 23:04:45.000000000 +0200
@@ -34,6 +34,8 @@ @@ -31,6 +31,8 @@
#include "gdbcore.h" #include "gdbcore.h"
#include "target.h" #include "target.h"
#include "inferior.h" #include "inferior.h"
@ -209,7 +209,7 @@ Index: gdb-6.6/gdb/solib-svr4.c
#include "gdb_assert.h" #include "gdb_assert.h"
@@ -267,7 +269,9 @@ static char *debug_loader_name; @@ -249,7 +251,9 @@ static char *debug_loader_name;
/* Local function prototypes */ /* Local function prototypes */
@ -217,44 +217,57 @@ Index: gdb-6.6/gdb/solib-svr4.c
static int match_main (char *); static int match_main (char *);
+#endif +#endif
static CORE_ADDR bfd_lookup_symbol (bfd *, char *, flagword); static CORE_ADDR bfd_lookup_symbol (bfd *, char *);
@@ -389,22 +393,79 @@ elf_locate_base (void) @@ -352,10 +356,12 @@ scan_dyntag (int dyntag, bfd *abfd, CORE
{ int arch_size, step, sect_size;
struct bfd_section *dyninfo_sect; long dyn_tag;
int dyninfo_sect_size; CORE_ADDR dyn_ptr, dyn_addr;
- CORE_ADDR dyninfo_addr; + CORE_ADDR entry_addr;
+ CORE_ADDR dyninfo_addr, relocated_dyninfo_addr, entry_addr; gdb_byte *bufend, *bufstart, *buf;
gdb_byte *buf; Elf32_External_Dyn *x_dynp_32;
gdb_byte *bufend; Elf64_External_Dyn *x_dynp_64;
int arch_size; struct bfd_section *sect;
+ int ret; + int ret;
+
+ /* Find the address of the entry point of the program from the
+ auxv vector. */
+ ret = target_auxv_search (&current_target, AT_ENTRY, &entry_addr);
+
+ if (ret == 0 || ret == -1)
+ {
+ /* No auxv info, maybe an older kernel. Fake our way through. */
+ entry_addr = bfd_get_start_address (exec_bfd);
+
+ if (debug_solib)
+ fprintf_unfiltered (gdb_stdlog,
+ "elf_locate_base: program entry address not found. Using bfd's 0x%s for %s\n",
+ paddr_nz (entry_addr), exec_bfd->filename);
+ }
+ else
+ {
+ if (debug_solib)
+ fprintf_unfiltered (gdb_stdlog,
+ "elf_locate_base: found program entry address 0x%s for %s\n",
+ paddr_nz (entry_addr), exec_bfd->filename);
+ }
if (abfd == NULL)
return 0;
@@ -363,19 +369,74 @@ scan_dyntag (int dyntag, bfd *abfd, CORE
if (arch_size == -1)
return 0;
+ /* The auxv vector based relocatable files reading is limited to the main
+ executable. */
+ gdb_assert (abfd == exec_bfd || ptr == NULL);
+
+ if (ptr != NULL)
+ {
+ /* Find the address of the entry point of the program from the
+ auxv vector. */
+ ret = target_auxv_search (&current_target, AT_ENTRY, &entry_addr);
+
+ if (ret == 0 || ret == -1)
+ {
+ /* No auxv info, maybe an older kernel. Fake our way through. */
+ entry_addr = bfd_get_start_address (exec_bfd);
+
+ if (debug_solib)
+ fprintf_unfiltered (gdb_stdlog,
+ "elf_locate_base: program entry address not found. Using bfd's 0x%s for %s\n",
+ paddr_nz (entry_addr), exec_bfd->filename);
+ }
+ else
+ {
+ if (debug_solib)
+ fprintf_unfiltered (gdb_stdlog,
+ "elf_locate_base: found program entry address 0x%s for %s\n",
+ paddr_nz (entry_addr), exec_bfd->filename);
+ }
+ }
+
/* Find the start address of the .dynamic section. */ /* Find the start address of the .dynamic section. */
dyninfo_sect = bfd_get_section_by_name (exec_bfd, ".dynamic"); sect = bfd_get_section_by_name (abfd, ".dynamic");
if (dyninfo_sect == NULL) if (sect == NULL)
- return 0; - return 0;
+ { + {
+ if (debug_solib) + if (debug_solib)
@ -271,50 +284,78 @@ Index: gdb-6.6/gdb/solib-svr4.c
+ exec_bfd->filename); + exec_bfd->filename);
+ } + }
+ +
dyninfo_addr = bfd_section_vma (exec_bfd, dyninfo_sect); dyn_addr = bfd_section_vma (abfd, sect);
+ if (debug_solib) + if (debug_solib)
+ fprintf_unfiltered (gdb_stdlog, + fprintf_unfiltered (gdb_stdlog,
+ "elf_locate_base: unrelocated .dynamic addr 0x%s\n", + "elf_locate_base: .dynamic addr 0x%s\n",
+ paddr_nz (dyninfo_addr)); + paddr_nz (dyn_addr));
+
+ relocated_dyninfo_addr = dyninfo_addr
+ + entry_addr - bfd_get_start_address(exec_bfd);
+ if (debug_solib)
+ fprintf_unfiltered (gdb_stdlog,
+ "elf_locate_base: relocated .dyn addr 0x%s for %s\n",
+ paddr_nz(relocated_dyninfo_addr), exec_bfd->filename);
/* Read in .dynamic section, silently ignore errors. */ /* Read in .dynamic from the BFD. We will get the actual value
dyninfo_sect_size = bfd_section_size (exec_bfd, dyninfo_sect); from memory later. */
buf = alloca (dyninfo_sect_size); sect_size = bfd_section_size (abfd, sect);
- if (target_read_memory (dyninfo_addr, buf, dyninfo_sect_size)) buf = bufstart = alloca (sect_size);
- return 0;
+ if (debug_solib) + if (debug_solib)
+ fprintf_unfiltered (gdb_stdlog, + fprintf_unfiltered (gdb_stdlog,
+ "elf_locate_base: read in .dynamic section\n"); + "elf_locate_base: read in .dynamic section\n");
+ if (target_read_memory (relocated_dyninfo_addr, buf, dyninfo_sect_size)) if (!bfd_get_section_contents (abfd, sect,
buf, 0, sect_size))
- return 0;
+ { + {
+ if (debug_solib) + if (debug_solib)
+ fprintf_unfiltered (gdb_stdlog, + fprintf_unfiltered (gdb_stdlog,
+ "elf_locate_base: couldn't read .dynamic section at 0x%s -- return now\n", + "elf_locate_base: couldn't read .dynamic section -- return now\n");
+ paddr_nz (relocated_dyninfo_addr));
+ return 0; + return 0;
+ } + }
/* Find the DT_DEBUG entry in the the .dynamic section. /* Iterate over BUF and scan for DYNTAG. If found, set PTR and return. */
For mips elf we look for DT_MIPS_RLD_MAP, mips elf apparently has step = (arch_size == 32) ? sizeof (Elf32_External_Dyn)
@@ -431,6 +492,10 @@ elf_locate_base (void) @@ -408,9 +469,43 @@ scan_dyntag (int dyntag, bfd *abfd, CORE
{ CORE_ADDR ptr_addr;
dyn_ptr = bfd_h_get_32 (exec_bfd,
(bfd_byte *) x_dynp->d_un.d_ptr); ptr_addr = dyn_addr + (buf - bufstart) + arch_size / 8;
+ if (debug_solib) + if (ptr != NULL)
+ fprintf_unfiltered (gdb_stdlog, + {
+ "elf_locate_base: DT_DEBUG entry has value 0x%s -- return now\n", + if (debug_solib)
+ paddr_nz (dyn_ptr)); + fprintf_unfiltered (gdb_stdlog,
return dyn_ptr; + "elf_locate_base: unrelocated ptr addr 0x%s\n",
} + paddr_nz (ptr_addr));
else if (dyn_tag == DT_MIPS_RLD_MAP) + ptr_addr += entry_addr - bfd_get_start_address (exec_bfd);
@@ -556,6 +621,10 @@ solib_svr4_r_map (void) + if (debug_solib)
+ fprintf_unfiltered (gdb_stdlog,
+ "elf_locate_base: relocated ptr addr 0x%s"
+ " (auxv entry 0x%s, bfd start address 0x%s)"
+ " for %s\n",
+ paddr_nz (ptr_addr), paddr_nz (entry_addr),
+ paddr_nz (bfd_get_start_address (exec_bfd)),
+ exec_bfd->filename);
+ }
if (target_read_memory (ptr_addr, ptr_buf, arch_size / 8) == 0)
- dyn_ptr = extract_typed_address (ptr_buf,
- builtin_type_void_data_ptr);
+ {
+ dyn_ptr = extract_typed_address (ptr_buf,
+ builtin_type_void_data_ptr);
+ if (ptr != NULL)
+ {
+ if (debug_solib)
+ fprintf_unfiltered (gdb_stdlog,
+ "elf_locate_base: Tag entry has value 0x%s -- return now\n",
+ paddr_nz (dyn_ptr));
+ }
+ }
+ else
+ {
+ if (ptr != NULL)
+ {
+ if (debug_solib)
+ fprintf_unfiltered (gdb_stdlog,
+ "elf_locate_base: Couldn't read tag entry value -- return now\n");
+ }
+ }
*ptr = dyn_ptr;
}
return 1;
@@ -547,6 +638,10 @@ solib_svr4_r_map (void)
{ {
struct link_map_offsets *lmo = svr4_fetch_link_map_offsets (); struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
@ -325,7 +366,7 @@ Index: gdb-6.6/gdb/solib-svr4.c
return read_memory_typed_address (debug_base + lmo->r_map_offset, return read_memory_typed_address (debug_base + lmo->r_map_offset,
builtin_type_void_data_ptr); builtin_type_void_data_ptr);
} }
@@ -713,6 +782,11 @@ svr4_current_sos (void) @@ -704,6 +799,11 @@ svr4_current_sos (void)
struct so_list **link_ptr = &head; struct so_list **link_ptr = &head;
CORE_ADDR ldsomap = 0; CORE_ADDR ldsomap = 0;
@ -337,7 +378,7 @@ Index: gdb-6.6/gdb/solib-svr4.c
/* Make sure we've looked up the inferior's dynamic linker's base /* Make sure we've looked up the inferior's dynamic linker's base
structure. */ structure. */
if (! debug_base) if (! debug_base)
@@ -722,11 +796,21 @@ svr4_current_sos (void) @@ -713,11 +813,21 @@ svr4_current_sos (void)
/* If we can't find the dynamic linker's base structure, this /* If we can't find the dynamic linker's base structure, this
must not be a dynamically linked executable. Hmm. */ must not be a dynamically linked executable. Hmm. */
if (! debug_base) if (! debug_base)
@ -360,7 +401,7 @@ Index: gdb-6.6/gdb/solib-svr4.c
lm = solib_svr4_r_map (); lm = solib_svr4_r_map ();
while (lm) while (lm)
@@ -742,23 +826,103 @@ svr4_current_sos (void) @@ -733,23 +843,103 @@ svr4_current_sos (void)
new->lm_info->lm = xzalloc (lmo->link_map_size); new->lm_info->lm = xzalloc (lmo->link_map_size);
make_cleanup (xfree, new->lm_info->lm); make_cleanup (xfree, new->lm_info->lm);
@ -465,15 +506,15 @@ Index: gdb-6.6/gdb/solib-svr4.c
target_read_string (LM_NAME (new), &buffer, target_read_string (LM_NAME (new), &buffer,
SO_NAME_MAX_PATH_SIZE - 1, &errcode); SO_NAME_MAX_PATH_SIZE - 1, &errcode);
if (errcode != 0) if (errcode != 0)
@@ -766,22 +930,37 @@ svr4_current_sos (void) @@ -757,23 +947,35 @@ svr4_current_sos (void)
safe_strerror (errcode)); safe_strerror (errcode));
else else
{ {
- strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1); - strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
- new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; - new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
- xfree (buffer);
- strcpy (new->so_original_name, new->so_name); - strcpy (new->so_original_name, new->so_name);
- } - }
- xfree (buffer);
- -
- /* If this entry has no name, or its name matches the name - /* If this entry has no name, or its name matches the name
- for the main executable, don't include it in the list. */ - for the main executable, don't include it in the list. */
@ -485,22 +526,18 @@ Index: gdb-6.6/gdb/solib-svr4.c
- new->next = 0; - new->next = 0;
- *link_ptr = new; - *link_ptr = new;
- link_ptr = &new->next; - link_ptr = &new->next;
+ if (debug_solib) + if (debug_solib)
+ fprintf_unfiltered (gdb_stdlog, + fprintf_unfiltered (gdb_stdlog,
+ "svr4_current_sos: LM_NAME is <%s>\n", + "svr4_current_sos: LM_NAME is <%s>\n",
+ buffer); + buffer);
+ /* The name could be empty, in which case it is the + /* The name could be empty, in which case it is the
+ system supplied DSO. */ + system supplied DSO. */
+ if (strcmp (buffer, "") == 0) + if (strcmp (buffer, "") == 0)
+ free_so (new);
+ else
+ { + {
+ xfree (buffer);
+ free_so (new);
+ }
+ else
+ {
+ strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1); + strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
+ new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; + new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+ xfree (buffer);
+ strcpy (new->so_original_name, new->so_name); + strcpy (new->so_original_name, new->so_name);
+ if (debug_solib) + if (debug_solib)
+ { + {
@ -517,9 +554,11 @@ Index: gdb-6.6/gdb/solib-svr4.c
+ link_ptr = &new->next; + link_ptr = &new->next;
+ } + }
} }
+ xfree (buffer);
} }
@@ -798,6 +977,11 @@ svr4_current_sos (void) /* On Solaris, the dynamic linker is not in the normal list of
@@ -789,6 +991,11 @@ svr4_current_sos (void)
if (head == NULL) if (head == NULL)
return svr4_default_sos (); return svr4_default_sos ();
@ -531,7 +570,7 @@ Index: gdb-6.6/gdb/solib-svr4.c
return head; return head;
} }
@@ -874,7 +1058,7 @@ svr4_fetch_objfile_link_map (struct objf @@ -868,7 +1075,7 @@ svr4_fetch_objfile_link_map (struct objf
/* On some systems, the only way to recognize the link map entry for /* On some systems, the only way to recognize the link map entry for
the main executable file is by looking at its name. Return the main executable file is by looking at its name. Return
non-zero iff SONAME matches one of the known main executable names. */ non-zero iff SONAME matches one of the known main executable names. */
@ -540,7 +579,7 @@ Index: gdb-6.6/gdb/solib-svr4.c
static int static int
match_main (char *soname) match_main (char *soname)
{ {
@@ -888,6 +1072,7 @@ match_main (char *soname) @@ -882,6 +1089,7 @@ match_main (char *soname)
return (0); return (0);
} }
@ -548,7 +587,7 @@ Index: gdb-6.6/gdb/solib-svr4.c
/* Return 1 if PC lies in the dynamic symbol resolution code of the /* Return 1 if PC lies in the dynamic symbol resolution code of the
SVR4 run time loader. */ SVR4 run time loader. */
@@ -987,6 +1172,11 @@ enable_break (void) @@ -979,6 +1187,11 @@ enable_break (void)
/* Find the .interp section; if not found, warn the user and drop /* Find the .interp section; if not found, warn the user and drop
into the old breakpoint at symbol code. */ into the old breakpoint at symbol code. */
interp_sect = bfd_get_section_by_name (exec_bfd, ".interp"); interp_sect = bfd_get_section_by_name (exec_bfd, ".interp");
@ -560,7 +599,7 @@ Index: gdb-6.6/gdb/solib-svr4.c
if (interp_sect) if (interp_sect)
{ {
unsigned int interp_sect_size; unsigned int interp_sect_size;
@@ -1025,6 +1215,9 @@ enable_break (void) @@ -1018,6 +1231,9 @@ enable_break (void)
if (tmp_fd >= 0) if (tmp_fd >= 0)
tmp_bfd = bfd_fopen (tmp_pathname, gnutarget, FOPEN_RB, tmp_fd); tmp_bfd = bfd_fopen (tmp_pathname, gnutarget, FOPEN_RB, tmp_fd);
@ -570,7 +609,7 @@ Index: gdb-6.6/gdb/solib-svr4.c
if (tmp_bfd == NULL) if (tmp_bfd == NULL)
goto bkpt_at_symbol; goto bkpt_at_symbol;
@@ -1111,6 +1304,9 @@ enable_break (void) @@ -1115,6 +1331,9 @@ enable_break (void)
if (sym_addr != 0) if (sym_addr != 0)
{ {
create_solib_event_breakpoint (load_addr + sym_addr); create_solib_event_breakpoint (load_addr + sym_addr);
@ -580,7 +619,7 @@ Index: gdb-6.6/gdb/solib-svr4.c
return 1; return 1;
} }
@@ -1372,6 +1568,8 @@ svr4_solib_create_inferior_hook (void) @@ -1375,6 +1594,8 @@ svr4_solib_create_inferior_hook (void)
while (stop_signal != TARGET_SIGNAL_TRAP); while (stop_signal != TARGET_SIGNAL_TRAP);
stop_soon = NO_STOP_QUIETLY; stop_soon = NO_STOP_QUIETLY;
#endif /* defined(_SCO_DS) */ #endif /* defined(_SCO_DS) */
@ -589,7 +628,7 @@ Index: gdb-6.6/gdb/solib-svr4.c
} }
static void static void
@@ -1558,6 +1756,75 @@ svr4_lp64_fetch_link_map_offsets (void) @@ -1551,6 +1772,75 @@ svr4_lp64_fetch_link_map_offsets (void)
return lmp; return lmp;
} }
@ -664,8 +703,8 @@ Index: gdb-6.6/gdb/solib-svr4.c
+ +
static struct target_so_ops svr4_so_ops; struct target_so_ops svr4_so_ops;
@@ -1580,4 +1847,8 @@ _initialize_svr4_solib (void) @@ -1592,4 +1882,8 @@ _initialize_svr4_solib (void)
/* FIXME: Don't do this here. *_gdbarch_init() should set so_ops. */ /* FIXME: Don't do this here. *_gdbarch_init() should set so_ops. */
current_target_so_ops = &svr4_so_ops; current_target_so_ops = &svr4_so_ops;
@ -674,12 +713,12 @@ Index: gdb-6.6/gdb/solib-svr4.c
+ "Display the inferior's linkmap."); + "Display the inferior's linkmap.");
+ +
} }
Index: gdb-6.6/gdb/varobj.c Index: gdb-6.7/gdb/varobj.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/varobj.c --- gdb-6.7.orig/gdb/varobj.c 2007-08-31 21:01:17.000000000 +0200
+++ gdb-6.6/gdb/varobj.c +++ gdb-6.7/gdb/varobj.c 2007-10-13 05:29:58.000000000 +0200
@@ -870,6 +870,62 @@ varobj_list (struct varobj ***varlist) @@ -1116,6 +1116,62 @@ install_new_value (struct varobj *var, s
return rootcount; return changed;
} }
+void +void
@ -741,11 +780,11 @@ Index: gdb-6.6/gdb/varobj.c
/* Update the values for a variable and its children. This is a /* Update the values for a variable and its children. This is a
two-pronged attack. First, re-parse the value for the root's two-pronged attack. First, re-parse the value for the root's
expression to see if it's changed. Then go all the way expression to see if it's changed. Then go all the way
Index: gdb-6.6/gdb/solist.h Index: gdb-6.7/gdb/solist.h
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/solist.h --- gdb-6.7.orig/gdb/solist.h 2007-08-23 20:08:38.000000000 +0200
+++ gdb-6.6/gdb/solist.h +++ gdb-6.7/gdb/solist.h 2007-10-13 05:29:58.000000000 +0200
@@ -62,6 +62,8 @@ struct so_list @@ -61,6 +61,8 @@ struct so_list
bfd *abfd; bfd *abfd;
char symbols_loaded; /* flag: symbols read in yet? */ char symbols_loaded; /* flag: symbols read in yet? */
char from_tty; /* flag: print msgs? */ char from_tty; /* flag: print msgs? */
@ -754,7 +793,7 @@ Index: gdb-6.6/gdb/solist.h
struct objfile *objfile; /* objfile for loaded lib */ struct objfile *objfile; /* objfile for loaded lib */
struct section_table *sections; struct section_table *sections;
struct section_table *sections_end; struct section_table *sections_end;
@@ -113,9 +115,15 @@ void free_so (struct so_list *so); @@ -123,9 +125,15 @@ void free_so (struct so_list *so);
/* Return address of first so_list entry in master shared object list. */ /* Return address of first so_list entry in master shared object list. */
struct so_list *master_so_list (void); struct so_list *master_so_list (void);
@ -770,29 +809,29 @@ Index: gdb-6.6/gdb/solist.h
/* FIXME: gdbarch needs to control this variable */ /* FIXME: gdbarch needs to control this variable */
extern struct target_so_ops *current_target_so_ops; extern struct target_so_ops *current_target_so_ops;
@@ -126,4 +134,6 @@ extern struct target_so_ops *current_tar @@ -143,4 +151,6 @@ struct symbol *solib_global_lookup (cons
#define TARGET_SO_IN_DYNSYM_RESOLVE_CODE \ const domain_enum domain,
(current_target_so_ops->in_dynsym_resolve_code) struct symtab **symtab);
+/* Controls the printing of debugging output. */ +/* Controls the printing of debugging output. */
+extern int debug_solib; +extern int debug_solib;
#endif #endif
Index: gdb-6.6/gdb/varobj.h Index: gdb-6.7/gdb/varobj.h
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/varobj.h --- gdb-6.7.orig/gdb/varobj.h 2007-08-31 20:52:05.000000000 +0200
+++ gdb-6.6/gdb/varobj.h +++ gdb-6.7/gdb/varobj.h 2007-10-13 05:29:58.000000000 +0200
@@ -99,4 +99,6 @@ extern int varobj_list (struct varobj ** @@ -114,4 +114,6 @@ extern int varobj_update (struct varobj
extern int varobj_update (struct varobj **varp, struct varobj ***changelist); extern void varobj_invalidate (void);
+extern void varobj_refresh(void); +extern void varobj_refresh(void);
+ +
#endif /* VAROBJ_H */ #endif /* VAROBJ_H */
Index: gdb-6.6/gdb/symfile.c Index: gdb-6.7/gdb/symfile.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/symfile.c --- gdb-6.7.orig/gdb/symfile.c 2007-09-24 23:48:05.000000000 +0200
+++ gdb-6.6/gdb/symfile.c +++ gdb-6.7/gdb/symfile.c 2007-10-13 05:32:14.000000000 +0200
@@ -49,6 +49,7 @@ @@ -47,6 +47,7 @@
#include "readline/readline.h" #include "readline/readline.h"
#include "gdb_assert.h" #include "gdb_assert.h"
#include "block.h" #include "block.h"
@ -800,7 +839,7 @@ Index: gdb-6.6/gdb/symfile.c
#include "observer.h" #include "observer.h"
#include "exec.h" #include "exec.h"
#include "parser-defs.h" #include "parser-defs.h"
@@ -659,7 +660,7 @@ syms_from_objfile (struct objfile *objfi @@ -779,7 +780,7 @@ syms_from_objfile (struct objfile *objfi
/* Now either addrs or offsets is non-zero. */ /* Now either addrs or offsets is non-zero. */
@ -809,7 +848,7 @@ Index: gdb-6.6/gdb/symfile.c
{ {
/* We will modify the main symbol table, make sure that all its users /* We will modify the main symbol table, make sure that all its users
will be cleaned up if an error occurs during symbol reading. */ will be cleaned up if an error occurs during symbol reading. */
@@ -687,7 +688,7 @@ syms_from_objfile (struct objfile *objfi @@ -807,7 +808,7 @@ syms_from_objfile (struct objfile *objfi
We no longer warn if the lowest section is not a text segment (as We no longer warn if the lowest section is not a text segment (as
happens for the PA64 port. */ happens for the PA64 port. */
@ -818,7 +857,7 @@ Index: gdb-6.6/gdb/symfile.c
{ {
asection *lower_sect; asection *lower_sect;
asection *sect; asection *sect;
@@ -856,17 +857,21 @@ new_symfile_objfile (struct objfile *obj @@ -976,17 +977,21 @@ new_symfile_objfile (struct objfile *obj
/* If this is the main symbol file we have to clean up all users of the /* If this is the main symbol file we have to clean up all users of the
old main symbol file. Otherwise it is sufficient to fixup all the old main symbol file. Otherwise it is sufficient to fixup all the
breakpoints that may have been redefined by this symbol file. */ breakpoints that may have been redefined by this symbol file. */
@ -842,7 +881,7 @@ Index: gdb-6.6/gdb/symfile.c
/* We're done reading the symbol file; finish off complaints. */ /* We're done reading the symbol file; finish off complaints. */
clear_complaints (&symfile_complaints, 0, verbo); clear_complaints (&symfile_complaints, 0, verbo);
@@ -909,7 +914,7 @@ symbol_file_add_with_addrs_or_offsets (b @@ -1029,7 +1034,7 @@ symbol_file_add_with_addrs_or_offsets (b
interactively wiping out any existing symbols. */ interactively wiping out any existing symbols. */
if ((have_full_symbols () || have_partial_symbols ()) if ((have_full_symbols () || have_partial_symbols ())
@ -851,7 +890,7 @@ Index: gdb-6.6/gdb/symfile.c
&& from_tty && from_tty
&& !query ("Load new symbol table from \"%s\"? ", name)) && !query ("Load new symbol table from \"%s\"? ", name))
error (_("Not confirmed.")); error (_("Not confirmed."));
@@ -1090,6 +1095,10 @@ symbol_file_clear (int from_tty) @@ -1213,6 +1218,10 @@ symbol_file_clear (int from_tty)
symfile_objfile->name) symfile_objfile->name)
: !query (_("Discard symbol table? ")))) : !query (_("Discard symbol table? "))))
error (_("Not confirmed.")); error (_("Not confirmed."));
@ -862,7 +901,7 @@ Index: gdb-6.6/gdb/symfile.c
free_all_objfiles (); free_all_objfiles ();
/* solib descriptors may have handles to objfiles. Since their /* solib descriptors may have handles to objfiles. Since their
@@ -2204,6 +2213,8 @@ reread_symbols (void) @@ -2470,6 +2479,8 @@ reread_symbols (void)
/* Discard cleanups as symbol reading was successful. */ /* Discard cleanups as symbol reading was successful. */
discard_cleanups (old_cleanups); discard_cleanups (old_cleanups);
@ -871,19 +910,19 @@ Index: gdb-6.6/gdb/symfile.c
/* If the mtime has changed between the time we set new_modtime /* If the mtime has changed between the time we set new_modtime
and now, we *want* this to be out of date, so don't call stat and now, we *want* this to be out of date, so don't call stat
again now. */ again now. */
@@ -2579,6 +2590,7 @@ clear_symtab_users (void) @@ -2837,6 +2848,7 @@ clear_symtab_users (void)
breakpoint_re_set ();
set_default_breakpoint (0, 0, 0, 0);
clear_pc_function_cache (); clear_pc_function_cache ();
if (deprecated_target_new_objfile_hook)
deprecated_target_new_objfile_hook (NULL);
+ varobj_refresh (); + varobj_refresh ();
observer_notify_new_objfile (NULL);
/* Clear globals which might have pointed into a removed objfile. /* Clear globals which might have pointed into a removed objfile.
FIXME: It's not clear which of these are supposed to persist Index: gdb-6.7/gdb/breakpoint.c
Index: gdb-6.6/gdb/breakpoint.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/breakpoint.c --- gdb-6.7.orig/gdb/breakpoint.c 2007-10-13 05:27:15.000000000 +0200
+++ gdb-6.6/gdb/breakpoint.c +++ gdb-6.7/gdb/breakpoint.c 2007-10-13 05:29:58.000000000 +0200
@@ -781,15 +781,15 @@ insert_watchpoints_for_new_thread (ptid_ @@ -840,15 +840,15 @@ insert_watchpoints_for_new_thread (ptid_
struct value *v = b->owner->val_chain; struct value *v = b->owner->val_chain;
/* Look at each value on the value chain. */ /* Look at each value on the value chain. */
@ -902,7 +941,7 @@ Index: gdb-6.6/gdb/breakpoint.c
/* We only watch structs and arrays if user asked /* We only watch structs and arrays if user asked
for it explicitly, never if they just happen to for it explicitly, never if they just happen to
@@ -801,8 +801,8 @@ insert_watchpoints_for_new_thread (ptid_ @@ -860,8 +860,8 @@ insert_watchpoints_for_new_thread (ptid_
CORE_ADDR addr; CORE_ADDR addr;
int len, type; int len, type;
@ -913,7 +952,7 @@ Index: gdb-6.6/gdb/breakpoint.c
type = hw_write; type = hw_write;
if (b->owner->type == bp_read_watchpoint) if (b->owner->type == bp_read_watchpoint)
type = hw_read; type = hw_read;
@@ -2682,12 +2682,12 @@ mark_triggered_watchpoints (CORE_ADDR st @@ -2749,12 +2749,12 @@ mark_triggered_watchpoints (CORE_ADDR st
|| b->type == bp_read_watchpoint || b->type == bp_read_watchpoint
|| b->type == bp_access_watchpoint) || b->type == bp_access_watchpoint)
{ {
@ -929,7 +968,7 @@ Index: gdb-6.6/gdb/breakpoint.c
if (v == b->val_chain if (v == b->val_chain
|| (TYPE_CODE (vtype) != TYPE_CODE_STRUCT || (TYPE_CODE (vtype) != TYPE_CODE_STRUCT
@@ -2695,11 +2695,11 @@ mark_triggered_watchpoints (CORE_ADDR st @@ -2762,11 +2762,11 @@ mark_triggered_watchpoints (CORE_ADDR st
{ {
CORE_ADDR vaddr; CORE_ADDR vaddr;
@ -943,7 +982,7 @@ Index: gdb-6.6/gdb/breakpoint.c
b->watchpoint_triggered = 1; b->watchpoint_triggered = 1;
} }
} }
@@ -2869,12 +2869,12 @@ bpstat_stop_status (CORE_ADDR bp_addr, p @@ -2936,12 +2936,12 @@ bpstat_stop_status (CORE_ADDR bp_addr, p
bs->stop = 0; bs->stop = 0;
continue; continue;
} }
@ -959,7 +998,7 @@ Index: gdb-6.6/gdb/breakpoint.c
if (v == b->val_chain if (v == b->val_chain
|| (TYPE_CODE (vtype) != TYPE_CODE_STRUCT || (TYPE_CODE (vtype) != TYPE_CODE_STRUCT
@@ -2882,11 +2882,11 @@ bpstat_stop_status (CORE_ADDR bp_addr, p @@ -2949,11 +2949,11 @@ bpstat_stop_status (CORE_ADDR bp_addr, p
{ {
CORE_ADDR vaddr; CORE_ADDR vaddr;
@ -973,7 +1012,7 @@ Index: gdb-6.6/gdb/breakpoint.c
must_check_value = 1; must_check_value = 1;
} }
} }
@@ -3937,6 +3937,7 @@ describe_other_breakpoints (CORE_ADDR pc @@ -3996,6 +3996,7 @@ describe_other_breakpoints (CORE_ADDR pc
printf_filtered ("%s%s ", printf_filtered ("%s%s ",
((b->enable_state == bp_disabled || ((b->enable_state == bp_disabled ||
b->enable_state == bp_shlib_disabled || b->enable_state == bp_shlib_disabled ||
@ -981,7 +1020,7 @@ Index: gdb-6.6/gdb/breakpoint.c
b->enable_state == bp_call_disabled) b->enable_state == bp_call_disabled)
? " (disabled)" ? " (disabled)"
: b->enable_state == bp_permanent : b->enable_state == bp_permanent
@@ -4615,6 +4616,62 @@ re_enable_breakpoints_in_shlibs (void) @@ -4669,6 +4670,62 @@ re_enable_breakpoints_in_shlibs (void)
} }
} }
@ -1044,7 +1083,7 @@ Index: gdb-6.6/gdb/breakpoint.c
static void static void
solib_load_unload_1 (char *hookname, int tempflag, char *dll_pathname, solib_load_unload_1 (char *hookname, int tempflag, char *dll_pathname,
char *cond_string, enum bptype bp_kind) char *cond_string, enum bptype bp_kind)
@@ -6961,6 +7018,7 @@ delete_breakpoint (struct breakpoint *bp @@ -7084,6 +7141,7 @@ delete_breakpoint (struct breakpoint *bp
&& !b->loc->duplicate && !b->loc->duplicate
&& b->enable_state != bp_disabled && b->enable_state != bp_disabled
&& b->enable_state != bp_shlib_disabled && b->enable_state != bp_shlib_disabled
@ -1052,7 +1091,7 @@ Index: gdb-6.6/gdb/breakpoint.c
&& !b->pending && !b->pending
&& b->enable_state != bp_call_disabled) && b->enable_state != bp_call_disabled)
{ {
@@ -7176,7 +7234,8 @@ breakpoint_re_set_one (void *bint) @@ -7308,7 +7366,8 @@ breakpoint_re_set_one (void *bint)
break; break;
save_enable = b->enable_state; save_enable = b->enable_state;
@ -1062,20 +1101,20 @@ Index: gdb-6.6/gdb/breakpoint.c
b->enable_state = bp_disabled; b->enable_state = bp_disabled;
else else
/* If resetting a shlib-disabled breakpoint, we don't want to /* If resetting a shlib-disabled breakpoint, we don't want to
Index: gdb-6.6/gdb/solib.c Index: gdb-6.7/gdb/solib.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/solib.c --- gdb-6.7.orig/gdb/solib.c 2007-08-23 20:08:38.000000000 +0200
+++ gdb-6.6/gdb/solib.c +++ gdb-6.7/gdb/solib.c 2007-10-13 05:32:46.000000000 +0200
@@ -72,6 +72,8 @@ solib_ops (struct gdbarch *gdbarch) @@ -78,6 +78,8 @@ set_solib_ops (struct gdbarch *gdbarch,
/* external data declarations */ /* external data declarations */
+int debug_solib; +int debug_solib;
+ +
/* FIXME: gdbarch needs to control this variable */ /* FIXME: gdbarch needs to control this variable, or else every
configuration needs to call set_solib_ops. */
struct target_so_ops *current_target_so_ops; struct target_so_ops *current_target_so_ops;
@@ -105,6 +107,8 @@ The search path for loading non-absolute
@@ -102,6 +104,8 @@ The search path for loading non-absolute
value); value);
} }
@ -1084,7 +1123,7 @@ Index: gdb-6.6/gdb/solib.c
/* /*
GLOBAL FUNCTION GLOBAL FUNCTION
@@ -376,7 +380,6 @@ free_so (struct so_list *so) @@ -394,7 +398,6 @@ free_so (struct so_list *so)
xfree (so); xfree (so);
} }
@ -1092,7 +1131,7 @@ Index: gdb-6.6/gdb/solib.c
/* Return address of first so_list entry in master shared object list. */ /* Return address of first so_list entry in master shared object list. */
struct so_list * struct so_list *
master_so_list (void) master_so_list (void)
@@ -384,7 +387,6 @@ master_so_list (void) @@ -402,7 +405,6 @@ master_so_list (void)
return so_list_head; return so_list_head;
} }
@ -1100,7 +1139,7 @@ Index: gdb-6.6/gdb/solib.c
/* A small stub to get us past the arg-passing pinhole of catch_errors. */ /* A small stub to get us past the arg-passing pinhole of catch_errors. */
static int static int
@@ -396,15 +398,40 @@ symbol_add_stub (void *arg) @@ -414,15 +416,40 @@ symbol_add_stub (void *arg)
/* Have we already loaded this shared object? */ /* Have we already loaded this shared object? */
ALL_OBJFILES (so->objfile) ALL_OBJFILES (so->objfile)
{ {
@ -1144,7 +1183,7 @@ Index: gdb-6.6/gdb/solib.c
free_section_addr_info (sap); free_section_addr_info (sap);
return (1); return (1);
@@ -532,6 +559,10 @@ update_solib_list (int from_tty, struct @@ -550,6 +577,10 @@ update_solib_list (int from_tty, struct
the inferior's current list. */ the inferior's current list. */
while (i) while (i)
{ {
@ -1155,7 +1194,7 @@ Index: gdb-6.6/gdb/solib.c
if (! strcmp (gdb->so_original_name, i->so_original_name)) if (! strcmp (gdb->so_original_name, i->so_original_name))
break; break;
@@ -585,28 +616,7 @@ update_solib_list (int from_tty, struct @@ -603,28 +634,7 @@ update_solib_list (int from_tty, struct
/* Fill in the rest of each of the `struct so_list' nodes. */ /* Fill in the rest of each of the `struct so_list' nodes. */
for (i = inferior; i; i = i->next) for (i = inferior; i; i = i->next)
{ {
@ -1185,7 +1224,7 @@ Index: gdb-6.6/gdb/solib.c
/* Notify any observer that the shared object has been /* Notify any observer that the shared object has been
loaded now that we've added it to GDB's tables. */ loaded now that we've added it to GDB's tables. */
@@ -702,6 +712,41 @@ solib_add (char *pattern, int from_tty, @@ -720,6 +730,41 @@ solib_add (char *pattern, int from_tty,
} }
} }
@ -1227,7 +1266,7 @@ Index: gdb-6.6/gdb/solib.c
/* /*
@@ -1006,4 +1051,12 @@ This takes precedence over the environme @@ -1045,4 +1090,12 @@ This takes precedence over the environme
reload_shared_libraries, reload_shared_libraries,
show_solib_search_path, show_solib_search_path,
&setlist, &showlist); &setlist, &showlist);
@ -1240,11 +1279,11 @@ Index: gdb-6.6/gdb/solib.c
+ NULL, NULL, + NULL, NULL,
+ &setdebuglist, &showdebuglist); + &setdebuglist, &showdebuglist);
} }
Index: gdb-6.6/gdb/elfread.c Index: gdb-6.7/gdb/elfread.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/elfread.c --- gdb-6.7.orig/gdb/elfread.c 2007-08-23 20:08:28.000000000 +0200
+++ gdb-6.6/gdb/elfread.c +++ gdb-6.7/gdb/elfread.c 2007-10-13 05:29:58.000000000 +0200
@@ -556,7 +556,7 @@ elf_symfile_read (struct objfile *objfil @@ -611,7 +611,7 @@ elf_symfile_read (struct objfile *objfil
/* If we are reinitializing, or if we have never loaded syms yet, /* If we are reinitializing, or if we have never loaded syms yet,
set table to empty. MAINLINE is cleared so that *_read_psymtab set table to empty. MAINLINE is cleared so that *_read_psymtab
functions do not all also re-initialize the psymbol table. */ functions do not all also re-initialize the psymbol table. */
@ -1253,3 +1292,125 @@ Index: gdb-6.6/gdb/elfread.c
{ {
init_psymbol_list (objfile, 0); init_psymbol_list (objfile, 0);
mainline = 0; mainline = 0;
2007-10-31 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.7 - workaround too early breakpoint address analysis.
diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7-orig/gdb/Makefile.in gdb-6.7-patched/gdb/Makefile.in
--- gdb-6.7-orig/gdb/Makefile.in 2007-10-31 12:50:10.000000000 +0100
+++ gdb-6.7-patched/gdb/Makefile.in 2007-10-31 00:38:11.000000000 +0100
@@ -1824,7 +1824,7 @@ amd64-tdep.o: amd64-tdep.c $(defs_h) $(a
$(dummy_frame_h) $(frame_h) $(frame_base_h) $(frame_unwind_h) \
$(inferior_h) $(gdbcmd_h) $(gdbcore_h) $(objfiles_h) $(regcache_h) \
$(regset_h) $(symfile_h) $(gdb_assert_h) $(amd64_tdep_h) \
- $(i387_tdep_h)
+ $(i387_tdep_h) $(exceptions_h)
annotate.o: annotate.c $(defs_h) $(annotate_h) $(value_h) $(target_h) \
$(gdbtypes_h) $(breakpoint_h)
arch-utils.o: arch-utils.c $(defs_h) $(arch_utils_h) $(buildsym_h) \
diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.7-orig/gdb/amd64-tdep.c gdb-6.7-patched/gdb/amd64-tdep.c
--- gdb-6.7-orig/gdb/amd64-tdep.c 2007-10-31 12:50:09.000000000 +0100
+++ gdb-6.7-patched/gdb/amd64-tdep.c 2007-10-31 00:46:13.000000000 +0100
@@ -36,6 +36,7 @@
#include "symfile.h"
#include "dwarf2-frame.h"
#include "gdb_assert.h"
+#include "exceptions.h"
#include "amd64-tdep.h"
#include "i387-tdep.h"
@@ -734,16 +735,28 @@ amd64_alloc_frame_cache (void)
Any function that doesn't start with this sequence will be assumed
to have no prologue and thus no valid frame pointer in %rbp. */
-static CORE_ADDR
-amd64_analyze_prologue (CORE_ADDR pc, CORE_ADDR current_pc,
- struct amd64_frame_cache *cache)
+struct amd64_analyze_prologue_data
+ {
+ CORE_ADDR pc, current_pc;
+ struct amd64_frame_cache *cache;
+ CORE_ADDR retval;
+ };
+
+static int
+amd64_analyze_prologue_1 (void *data_pointer)
{
+ struct amd64_analyze_prologue_data *data = data_pointer;
+ CORE_ADDR pc = data->pc, current_pc = data->current_pc;
+ struct amd64_frame_cache *cache = data->cache;
static gdb_byte proto[3] = { 0x48, 0x89, 0xe5 }; /* movq %rsp, %rbp */
gdb_byte buf[3];
gdb_byte op;
if (current_pc <= pc)
- return current_pc;
+ {
+ data->retval = current_pc;
+ return 1;
+ }
op = read_memory_unsigned_integer (pc, 1);
@@ -756,18 +769,57 @@ amd64_analyze_prologue (CORE_ADDR pc, CO
/* If that's all, return now. */
if (current_pc <= pc + 1)
- return current_pc;
+ {
+ data->retval = current_pc;
+ return 1;
+ }
/* Check for `movq %rsp, %rbp'. */
read_memory (pc + 1, buf, 3);
if (memcmp (buf, proto, 3) != 0)
- return pc + 1;
+ {
+ data->retval = pc + 1;
+ return 1;
+ }
/* OK, we actually have a frame. */
cache->frameless_p = 0;
- return pc + 4;
+ data->retval = pc + 4;
+ return 1;
}
+ data->retval = pc;
+ return 1;
+}
+
+/* Catch memory read errors and return just PC in such case.
+ It occurs very early on enable_break->new_symfile_objfile->
+ ->breakpoint_re_set->decode_line_1->decode_variable_1->
+ ->find_function_start_sal */
+
+static CORE_ADDR
+amd64_analyze_prologue (CORE_ADDR pc, CORE_ADDR current_pc,
+ struct amd64_frame_cache *cache)
+{
+ int status;
+ struct amd64_analyze_prologue_data data;
+ struct ui_file *saved_gdb_stderr;
+
+ /* Suppress error messages. */
+ saved_gdb_stderr = gdb_stderr;
+ gdb_stderr = ui_file_new ();
+
+ data.pc = pc;
+ data.current_pc = current_pc;
+ data.cache = cache;
+ status = catch_errors (amd64_analyze_prologue_1, &data, "", RETURN_MASK_ALL);
+
+ /* Stop suppressing error messages. */
+ ui_file_delete (gdb_stderr);
+ gdb_stderr = saved_gdb_stderr;
+
+ if (status)
+ return data.retval;
return pc;
}

View File

@ -3,64 +3,29 @@
* solib-svr4.c (enable_break): Convert a symbol descriptor into * solib-svr4.c (enable_break): Convert a symbol descriptor into
the corresponding function entry point. the corresponding function entry point.
(solib_break_names): Delete "._dl_debug_state", no longer needed. (solib_break_names): Delete "._dl_debug_state", no longer needed.
2007-10-12 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.7.
*** ./gdb/solib-svr4.c.dist Fri Oct 22 11:50:31 2004 Index: gdb-6.7/gdb/solib-svr4.c
--- ./gdb/solib-svr4.c Fri Oct 22 11:53:19 2004 ===================================================================
*************** --- gdb-6.7.orig/gdb/solib-svr4.c 2007-10-09 20:03:30.000000000 +0200
*** 86,102 **** +++ gdb-6.7/gdb/solib-svr4.c 2007-10-12 22:34:03.000000000 +0200
"_dl_debug_state", @@ -1089,7 +1089,15 @@ enable_break (void)
"rtld_db_dlactivity", {
"_rtld_debug_state", sym_addr = bfd_lookup_symbol (tmp_bfd, *bkpt_namep);
- if (sym_addr != 0)
- /* On the 64-bit PowerPC, the linker symbol with the same name as - break;
- the C function points to a function descriptor, not to the entry + {
- point. The linker symbol whose name is the C function name + /* The symbol might be a descriptor, convert to into the
- prefixed with a '.' points to the function's entry point. So + corresponding code address. */
- when we look through this table, we ignore symbols that point + sym_addr = gdbarch_convert_from_func_ptr_addr (current_gdbarch,
- into the data section (thus skipping the descriptor's symbol), + sym_addr,
- and eventually try this one, giving us the real entry point + tmp_bfd_target);
- address. */ + if (sym_addr != 0)
- "._dl_debug_state", + break;
- + }
NULL }
};
if (sym_addr != 0)
--- 86,91 ----
***************
*** 1284,1301 ****
/* Now try to set a breakpoint in the dynamic linker. */
for (bkpt_namep = solib_break_names; *bkpt_namep != NULL; bkpt_namep++)
{
! /* On ABI's that use function descriptors, there are usually
! two linker symbols associated with each C function: one
! pointing at the actual entry point of the machine code,
! and one pointing at the function's descriptor. The
! latter symbol has the same name as the C function.
!
! What we're looking for here is the machine code entry
! point, so we are only interested in symbols in code
! sections. */
! sym_addr = bfd_lookup_symbol (tmp_bfd, *bkpt_namep, SEC_CODE);
if (sym_addr != 0)
! break;
}
/* We're done with both the temporary bfd and target. Remember,
--- 1273,1289 ----
/* Now try to set a breakpoint in the dynamic linker. */
for (bkpt_namep = solib_break_names; *bkpt_namep != NULL; bkpt_namep++)
{
! sym_addr = bfd_lookup_symbol (tmp_bfd, *bkpt_namep, 0);
if (sym_addr != 0)
! {
! /* The symbol might be a descriptor, convert to into the
! corresponding code address. */
! sym_addr = gdbarch_convert_from_func_ptr_addr (current_gdbarch,
! sym_addr,
! tmp_bfd_target);
! if (sym_addr != 0)
! break;
! }
}
/* We're done with both the temporary bfd and target. Remember,

View File

@ -83,3 +83,12 @@
{ {
xfree (basename); xfree (basename);
xfree (dir); xfree (dir);
@@ -1952,7 +1952,7 @@ find_separate_debug_file (struct objfile
strcat (debugfile, "/");
strcat (debugfile, basename);
- if (separate_debug_file_exists (debugfile, crc32))
+ if (separate_debug_file_exists (debugfile, crc32, objfile->name))
{
xfree (build_id_filename);
xfree (canon_name);

View File

@ -3,13 +3,17 @@
* top.c (gdb_readline_wrapper): Ensure terminal is gdb's before calling * top.c (gdb_readline_wrapper): Ensure terminal is gdb's before calling
readline. readline.
Index: gdb-6.5/gdb/top.c 2007-10-14 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.7.
Index: gdb-6.7/gdb/top.c
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/top.c 2006-03-29 19:53:33.000000000 -0300 --- gdb-6.7.orig/gdb/top.c 2007-09-02 23:13:56.000000000 +0200
+++ gdb-6.5/gdb/top.c 2006-07-07 02:29:42.000000000 -0300 +++ gdb-6.7/gdb/top.c 2007-10-14 23:38:27.000000000 +0200
@@ -728,6 +728,14 @@ gdb_readline_wrapper (char *prompt) @@ -795,6 +795,14 @@ gdb_readline_wrapper (char *prompt)
after_char_processing_hook = NULL;
} back_to = make_cleanup (gdb_readline_wrapper_cleanup, cleanup);
+ /* Before calling readline, ensure we have the terminal. If we don't + /* Before calling readline, ensure we have the terminal. If we don't
+ have the terminal and call readline, we risk the possibility of + have the terminal and call readline, we risk the possibility of
@ -19,6 +23,6 @@ Index: gdb-6.5/gdb/top.c
+ a page break prompt. */ + a page break prompt. */
+ terminal_ours (); + terminal_ours ();
+ +
return readline (prompt); /* Display our prompt and prevent double prompt display. */
} display_gdb_prompt (prompt);
rl_already_prompted = 1;

View File

@ -1,29 +1,13 @@
Index: gdb/testsuite/ChangeLog [base]
2005-01-21 Jeff Johnston <jjohnstn@redhat.com>
* gdb.cp/constructortest.exp: New test. 2007-10-14 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.cp/constructortest.cc: Ditto.
* gdb.cp/templates.exp: Change break of dtor to be fully quoted.
2007-09-22 Jan Kratochvil <jan.kratochvil@redhat.com> Port to GDB-6.7.
* gdb.cp/constructortest.exp, gdb.cp/constructortest.cc: Test also the Index: gdb-6.7/gdb/testsuite/gdb.cp/constructortest.cc
`$delete' destructor variant. ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
2007-09-25 Jan Kratochvil <jan.kratochvil@redhat.com> +++ gdb-6.7/gdb/testsuite/gdb.cp/constructortest.cc 2007-10-14 23:29:48.000000000 +0200
* gdb.cp/constructortest.exp: Delete the FIXME workaround of restarting
the whole GDB.
2007-10-05 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.cp/constructortest.exp: Test BREAKPOINT_RE_SET for multiple PCs
by PIE.
* gdb.cp/constructortest.exp: Handle the change of settings breakpoints
always at all the ctor/dtor variants.
--- gdb-6.3/gdb/testsuite/gdb.cp/constructortest.cc.fix Fri Jan 21 17:06:56 2005
+++ gdb-6.3/gdb/testsuite/gdb.cp/constructortest.cc Fri Jan 21 17:05:18 2005
@@ -0,0 +1,99 @@ @@ -0,0 +1,99 @@
+/* This testcase is part of GDB, the GNU debugger. +/* This testcase is part of GDB, the GNU debugger.
+ +
@ -124,8 +108,10 @@ Index: gdb/testsuite/ChangeLog
+{ +{
+ y = 2; /* First line D */ + y = 2; /* First line D */
+} +}
--- gdb-6.3/gdb/testsuite/gdb.cp/constructortest.exp.fix Fri Jan 21 17:07:02 2005 Index: gdb-6.7/gdb/testsuite/gdb.cp/constructortest.exp
+++ gdb-6.3/gdb/testsuite/gdb.cp/constructortest.exp Fri Jan 21 17:05:29 2005 ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.7/gdb/testsuite/gdb.cp/constructortest.exp 2007-10-14 23:29:48.000000000 +0200
@@ -0,0 +1,148 @@ @@ -0,0 +1,148 @@
+# This testcase is part of GDB, the GNU debugger. +# This testcase is part of GDB, the GNU debugger.
+ +
@ -275,14 +261,10 @@ Index: gdb/testsuite/ChangeLog
+} +}
+ +
+gdb_continue_to_breakpoint "First line ~C" +gdb_continue_to_breakpoint "First line ~C"
--- gdb-6.3/gdb/testsuite/gdb.cp/templates.exp.fix Fri Jan 21 17:07:10 2005 Index: gdb-6.7/gdb/testsuite/gdb.cp/templates.exp
+++ gdb-6.3/gdb/testsuite/gdb.cp/templates.exp Fri Jan 21 17:09:09 2005 ===================================================================
@@ -1,4 +1,4 @@ --- gdb-6.7.orig/gdb/testsuite/gdb.cp/templates.exp 2007-08-23 20:14:17.000000000 +0200
-# Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2002, 2003, 2004 +++ gdb-6.7/gdb/testsuite/gdb.cp/templates.exp 2007-10-14 23:29:48.000000000 +0200
+# Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -142,7 +142,7 @@ proc test_template_breakpoints {} { @@ -142,7 +142,7 @@ proc test_template_breakpoints {} {
# See CLLbs14792 # See CLLbs14792
if {$hp_aCC_compiler} {setup_xfail hppa*-*-* CLLbs14792} if {$hp_aCC_compiler} {setup_xfail hppa*-*-* CLLbs14792}

View File

@ -1,38 +1,43 @@
Index: gdb-6.5/gdb/testsuite/configure.ac 2007-10-13 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.7.
Index: gdb-6.7/gdb/testsuite/configure.ac
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/testsuite/configure.ac 2006-07-07 01:12:31.000000000 -0300 --- gdb-6.7.orig/gdb/testsuite/configure.ac 2007-08-23 19:58:44.000000000 +0200
+++ gdb-6.5/gdb/testsuite/configure.ac 2006-07-07 01:13:23.000000000 -0300 +++ gdb-6.7/gdb/testsuite/configure.ac 2007-10-13 05:28:28.000000000 +0200
@@ -114,4 +114,4 @@ AC_OUTPUT([Makefile \ @@ -114,5 +114,5 @@ AC_OUTPUT([Makefile \
gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \ gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \
gdb.fortran/Makefile gdb.server/Makefile \ gdb.fortran/Makefile gdb.server/Makefile \
gdb.java/Makefile gdb.mi/Makefile \ gdb.java/Makefile gdb.mi/Makefile \
- gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile]) - gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile \
+ gdb.objc/Makefile gdb.pie/Makefile gdb.threads/Makefile gdb.trace/Makefile]) + gdb.objc/Makefile gdb.pie/Makefile gdb.threads/Makefile gdb.trace/Makefile \
Index: gdb-6.5/gdb/testsuite/configure gdb.xml/Makefile])
Index: gdb-6.7/gdb/testsuite/configure
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/testsuite/configure 2006-07-07 01:12:31.000000000 -0300 --- gdb-6.7.orig/gdb/testsuite/configure 2007-01-23 18:11:54.000000000 +0100
+++ gdb-6.5/gdb/testsuite/configure 2006-07-07 01:13:23.000000000 -0300 +++ gdb-6.7/gdb/testsuite/configure 2007-10-13 05:29:11.000000000 +0200
@@ -3075,7 +3075,7 @@ done @@ -3102,7 +3102,7 @@ done
- ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile" - ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
+ ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.objc/Makefile gdb.pie/Makefile gdb.threads/Makefile gdb.trace/Makefile" + ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.objc/Makefile gdb.pie/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
cat >confcache <<\_ACEOF cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure # This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure # tests run on this system so they can be shared between configure
@@ -3639,6 +3639,7 @@ do @@ -3666,6 +3666,7 @@ do
"gdb.java/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.java/Makefile" ;; "gdb.java/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.java/Makefile" ;;
"gdb.mi/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.mi/Makefile" ;; "gdb.mi/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.mi/Makefile" ;;
"gdb.objc/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.objc/Makefile" ;; "gdb.objc/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.objc/Makefile" ;;
+ "gdb.pie/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.pie/Makefile" ;; + "gdb.pie/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.pie/Makefile" ;;
"gdb.threads/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.threads/Makefile" ;; "gdb.threads/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.threads/Makefile" ;;
"gdb.trace/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.trace/Makefile" ;; "gdb.trace/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.trace/Makefile" ;;
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 "gdb.xml/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.xml/Makefile" ;;
Index: gdb-6.5/gdb/testsuite/gdb.pie/attach.c Index: gdb-6.7/gdb/testsuite/gdb.pie/attach.c
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.5/gdb/testsuite/gdb.pie/attach.c 2006-07-07 01:13:23.000000000 -0300 +++ gdb-6.7/gdb/testsuite/gdb.pie/attach.c 2007-10-13 05:27:45.000000000 +0200
@@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
+/* This program is intended to be started outside of gdb, and then +/* This program is intended to be started outside of gdb, and then
+ attached to by gdb. Thus, it simply spins in a loop. The loop + attached to by gdb. Thus, it simply spins in a loop. The loop
@ -54,10 +59,10 @@ Index: gdb-6.5/gdb/testsuite/gdb.pie/attach.c
+ } + }
+ return 0; + return 0;
+} +}
Index: gdb-6.5/gdb/testsuite/gdb.pie/attach2.c Index: gdb-6.7/gdb/testsuite/gdb.pie/attach2.c
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.5/gdb/testsuite/gdb.pie/attach2.c 2006-07-07 01:13:23.000000000 -0300 +++ gdb-6.7/gdb/testsuite/gdb.pie/attach2.c 2007-10-13 05:27:45.000000000 +0200
@@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
+/* This program is intended to be started outside of gdb, and then +/* This program is intended to be started outside of gdb, and then
+ attached to by gdb. Thus, it simply spins in a loop. The loop + attached to by gdb. Thus, it simply spins in a loop. The loop
@ -83,10 +88,10 @@ Index: gdb-6.5/gdb/testsuite/gdb.pie/attach2.c
+ } + }
+ return (0); + return (0);
+} +}
Index: gdb-6.5/gdb/testsuite/gdb.pie/break.c Index: gdb-6.7/gdb/testsuite/gdb.pie/break.c
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.5/gdb/testsuite/gdb.pie/break.c 2006-07-07 01:13:23.000000000 -0300 +++ gdb-6.7/gdb/testsuite/gdb.pie/break.c 2007-10-13 05:27:45.000000000 +0200
@@ -0,0 +1,146 @@ @@ -0,0 +1,146 @@
+/* This testcase is part of GDB, the GNU debugger. +/* This testcase is part of GDB, the GNU debugger.
+ +
@ -234,10 +239,10 @@ Index: gdb-6.5/gdb/testsuite/gdb.pie/break.c
+ } + }
+ return 0; + return 0;
+} +}
Index: gdb-6.5/gdb/testsuite/gdb.pie/break1.c Index: gdb-6.7/gdb/testsuite/gdb.pie/break1.c
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.5/gdb/testsuite/gdb.pie/break1.c 2006-07-07 01:13:23.000000000 -0300 +++ gdb-6.7/gdb/testsuite/gdb.pie/break1.c 2007-10-13 05:27:45.000000000 +0200
@@ -0,0 +1,44 @@ @@ -0,0 +1,44 @@
+/* This testcase is part of GDB, the GNU debugger. +/* This testcase is part of GDB, the GNU debugger.
+ +
@ -283,10 +288,10 @@ Index: gdb-6.5/gdb/testsuite/gdb.pie/break1.c
+void marker3 (a, b) char *a, *b; {} /* set breakpoint 18 here */ +void marker3 (a, b) char *a, *b; {} /* set breakpoint 18 here */
+void marker4 (d) long d; {} /* set breakpoint 13 here */ +void marker4 (d) long d; {} /* set breakpoint 13 here */
+#endif +#endif
Index: gdb-6.5/gdb/testsuite/gdb.pie/coremaker.c Index: gdb-6.7/gdb/testsuite/gdb.pie/coremaker.c
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.5/gdb/testsuite/gdb.pie/coremaker.c 2006-07-07 01:13:23.000000000 -0300 +++ gdb-6.7/gdb/testsuite/gdb.pie/coremaker.c 2007-10-13 05:27:45.000000000 +0200
@@ -0,0 +1,142 @@ @@ -0,0 +1,142 @@
+/* Copyright 1992, 1993, 1994, 1995, 1996, 1999 +/* Copyright 1992, 1993, 1994, 1995, 1996, 1999
+ Free Software Foundation, Inc. + Free Software Foundation, Inc.
@ -430,10 +435,10 @@ Index: gdb-6.5/gdb/testsuite/gdb.pie/coremaker.c
+ return 0; + return 0;
+} +}
+ +
Index: gdb-6.5/gdb/testsuite/gdb.pie/attach.exp Index: gdb-6.7/gdb/testsuite/gdb.pie/attach.exp
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.5/gdb/testsuite/gdb.pie/attach.exp 2006-07-07 01:13:23.000000000 -0300 +++ gdb-6.7/gdb/testsuite/gdb.pie/attach.exp 2007-10-13 05:27:45.000000000 +0200
@@ -0,0 +1,432 @@ @@ -0,0 +1,432 @@
+# Copyright 1997, 1999, 2002 Free Software Foundation, Inc. +# Copyright 1997, 1999, 2002 Free Software Foundation, Inc.
+ +
@ -867,10 +872,10 @@ Index: gdb-6.5/gdb/testsuite/gdb.pie/attach.exp
+do_call_attach_tests +do_call_attach_tests
+ +
+return 0 +return 0
Index: gdb-6.5/gdb/testsuite/gdb.pie/break.exp Index: gdb-6.7/gdb/testsuite/gdb.pie/break.exp
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.5/gdb/testsuite/gdb.pie/break.exp 2006-07-07 01:13:23.000000000 -0300 +++ gdb-6.7/gdb/testsuite/gdb.pie/break.exp 2007-10-13 05:27:45.000000000 +0200
@@ -0,0 +1,973 @@ @@ -0,0 +1,973 @@
+# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, +# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2002, 2003, 2004 +# 2000, 2002, 2003, 2004
@ -1845,10 +1850,10 @@ Index: gdb-6.5/gdb/testsuite/gdb.pie/break.exp
+ send_gdb "set args main\n" + send_gdb "set args main\n"
+ gdb_expect -re ".*$gdb_prompt $" {} + gdb_expect -re ".*$gdb_prompt $" {}
+} +}
Index: gdb-6.5/gdb/testsuite/gdb.pie/corefile.exp Index: gdb-6.7/gdb/testsuite/gdb.pie/corefile.exp
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.5/gdb/testsuite/gdb.pie/corefile.exp 2006-07-07 01:13:23.000000000 -0300 +++ gdb-6.7/gdb/testsuite/gdb.pie/corefile.exp 2007-10-13 05:27:45.000000000 +0200
@@ -0,0 +1,243 @@ @@ -0,0 +1,243 @@
+# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Free Software Foundation, Inc. +# Free Software Foundation, Inc.
@ -2093,10 +2098,10 @@ Index: gdb-6.5/gdb/testsuite/gdb.pie/corefile.exp
+gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(\\).*" "up in corefile.exp (reinit)" +gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(\\).*" "up in corefile.exp (reinit)"
+ +
+gdb_test "core" "No core file now." +gdb_test "core" "No core file now."
Index: gdb-6.5/gdb/testsuite/gdb.pie/Makefile.in Index: gdb-6.7/gdb/testsuite/gdb.pie/Makefile.in
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.5/gdb/testsuite/gdb.pie/Makefile.in 2006-07-07 01:13:23.000000000 -0300 +++ gdb-6.7/gdb/testsuite/gdb.pie/Makefile.in 2007-10-13 05:27:45.000000000 +0200
@@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
+VPATH = @srcdir@ +VPATH = @srcdir@
+srcdir = @srcdir@ +srcdir = @srcdir@

View File

@ -28,15 +28,18 @@
* doc/observer.texi: Add two new observers for linux_new_thread * doc/observer.texi: Add two new observers for linux_new_thread
and sigtrap. and sigtrap.
Index: gdb-6.5/gdb/doc/observer.texi 2007-10-13 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.7.
Index: gdb-6.7/gdb/doc/observer.texi
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/doc/observer.texi 2006-07-11 12:30:23.000000000 -0300 --- gdb-6.7.orig/gdb/doc/observer.texi 2007-05-11 21:55:20.000000000 +0200
+++ gdb-6.5/gdb/doc/observer.texi 2006-07-11 15:00:15.000000000 -0300 +++ gdb-6.7/gdb/doc/observer.texi 2007-10-13 04:51:21.000000000 +0200
@@ -122,3 +122,13 @@ haven't been loaded yet. @@ -129,3 +129,12 @@ Called with @var{objfile} equal to @code
@deftypefun void solib_unloaded (struct so_list *@var{solib}) previously loaded symbol table data has now been invalidated.
The shared library specified by @var{solib} has been unloaded.
@end deftypefun @end deftypefun
+
+@deftypefun void linux_new_thread (ptid_t @var{ptid}) +@deftypefun void linux_new_thread (ptid_t @var{ptid})
+A new linux thread described by @var{ptid} has been officially attached +A new linux thread described by @var{ptid} has been officially attached
+to by gdb. +to by gdb.
@ -46,11 +49,11 @@ Index: gdb-6.5/gdb/doc/observer.texi
+A low-level SIGTRAP has been discovered. This notification can be used to save +A low-level SIGTRAP has been discovered. This notification can be used to save
+additional state necessary if the trap is deferred for later handling. +additional state necessary if the trap is deferred for later handling.
+@end deftypefun +@end deftypefun
Index: gdb-6.5/gdb/infrun.c Index: gdb-6.7/gdb/infrun.c
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/infrun.c 2006-07-11 12:30:23.000000000 -0300 --- gdb-6.7.orig/gdb/infrun.c 2007-10-12 22:35:58.000000000 +0200
+++ gdb-6.5/gdb/infrun.c 2006-07-11 15:00:17.000000000 -0300 +++ gdb-6.7/gdb/infrun.c 2007-10-13 04:50:11.000000000 +0200
@@ -1703,9 +1703,19 @@ handle_inferior_event (struct execution_ @@ -1784,9 +1784,19 @@ handle_inferior_event (struct execution_
single step over a watchpoint without disabling the watchpoint. */ single step over a watchpoint without disabling the watchpoint. */
if (HAVE_STEPPABLE_WATCHPOINT && STOPPED_BY_WATCHPOINT (ecs->ws)) if (HAVE_STEPPABLE_WATCHPOINT && STOPPED_BY_WATCHPOINT (ecs->ws))
{ {
@ -71,16 +74,16 @@ Index: gdb-6.5/gdb/infrun.c
prepare_to_wait (ecs); prepare_to_wait (ecs);
return; return;
} }
@@ -1715,6 +1725,8 @@ handle_inferior_event (struct execution_ @@ -1797,6 +1807,8 @@ handle_inferior_event (struct execution_
register or page protection watchpoint scheme need here? */ if (gdbarch_have_nonsteppable_watchpoint (current_gdbarch)
if (HAVE_NONSTEPPABLE_WATCHPOINT && STOPPED_BY_WATCHPOINT (ecs->ws)) && STOPPED_BY_WATCHPOINT (ecs->ws))
{ {
+ CORE_ADDR addr = 0; + CORE_ADDR addr = 0;
+ +
/* At this point, we are stopped at an instruction which has /* At this point, we are stopped at an instruction which has
attempted to write to a piece of memory under control of attempted to write to a piece of memory under control of
a watchpoint. The instruction hasn't actually executed a watchpoint. The instruction hasn't actually executed
@@ -1722,15 +1734,12 @@ handle_inferior_event (struct execution_ @@ -1804,15 +1816,12 @@ handle_inferior_event (struct execution_
now, we would get the old value, and therefore no change now, we would get the old value, and therefore no change
would seem to have occurred. would seem to have occurred.
@ -102,7 +105,7 @@ Index: gdb-6.5/gdb/infrun.c
if (debug_infrun) if (debug_infrun)
fprintf_unfiltered (gdb_stdlog, "infrun: STOPPED_BY_WATCHPOINT\n"); fprintf_unfiltered (gdb_stdlog, "infrun: STOPPED_BY_WATCHPOINT\n");
@@ -1801,6 +1810,41 @@ handle_inferior_event (struct execution_ @@ -1883,6 +1892,41 @@ handle_inferior_event (struct execution_
} }
} }
@ -144,7 +147,7 @@ Index: gdb-6.5/gdb/infrun.c
/* Look at the cause of the stop, and decide what to do. /* Look at the cause of the stop, and decide what to do.
The alternatives are: The alternatives are:
1) break; to really stop and return to the debugger, 1) break; to really stop and return to the debugger,
@@ -1852,6 +1896,8 @@ handle_inferior_event (struct execution_ @@ -1935,6 +1979,8 @@ handle_inferior_event (struct execution_
See more comments in inferior.h. */ See more comments in inferior.h. */
if (stop_soon == STOP_QUIETLY_NO_SIGSTOP) if (stop_soon == STOP_QUIETLY_NO_SIGSTOP)
{ {
@ -153,11 +156,11 @@ Index: gdb-6.5/gdb/infrun.c
stop_stepping (ecs); stop_stepping (ecs);
if (stop_signal == TARGET_SIGNAL_STOP) if (stop_signal == TARGET_SIGNAL_STOP)
stop_signal = TARGET_SIGNAL_0; stop_signal = TARGET_SIGNAL_0;
Index: gdb-6.5/gdb/breakpoint.c Index: gdb-6.7/gdb/breakpoint.c
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/breakpoint.c 2006-07-11 12:30:23.000000000 -0300 --- gdb-6.7.orig/gdb/breakpoint.c 2007-08-30 00:07:47.000000000 +0200
+++ gdb-6.5/gdb/breakpoint.c 2006-07-11 15:00:19.000000000 -0300 +++ gdb-6.7/gdb/breakpoint.c 2007-10-13 04:50:11.000000000 +0200
@@ -748,6 +748,90 @@ insert_catchpoint (struct ui_out *uo, vo @@ -806,6 +806,90 @@ insert_catchpoint (struct ui_out *uo, vo
} }
} }
@ -247,8 +250,8 @@ Index: gdb-6.5/gdb/breakpoint.c
+ +
/* Helper routine: free the value chain for a breakpoint (watchpoint). */ /* Helper routine: free the value chain for a breakpoint (watchpoint). */
static void free_valchain (struct bp_location *b) static void
@@ -1190,6 +1274,7 @@ remove_breakpoints (void) @@ -1294,6 +1378,7 @@ remove_breakpoints (void)
{ {
struct bp_location *b; struct bp_location *b;
int val; int val;
@ -256,7 +259,7 @@ Index: gdb-6.5/gdb/breakpoint.c
ALL_BP_LOCATIONS (b) ALL_BP_LOCATIONS (b)
{ {
@@ -1197,10 +1282,10 @@ remove_breakpoints (void) @@ -1301,10 +1386,10 @@ remove_breakpoints (void)
{ {
val = remove_breakpoint (b, mark_uninserted); val = remove_breakpoint (b, mark_uninserted);
if (val != 0) if (val != 0)
@ -269,7 +272,7 @@ Index: gdb-6.5/gdb/breakpoint.c
} }
int int
@@ -2126,8 +2211,13 @@ print_it_typical (bpstat bs) @@ -2187,8 +2272,13 @@ print_it_typical (bpstat bs)
break; break;
case bp_thread_event: case bp_thread_event:
@ -285,7 +288,7 @@ Index: gdb-6.5/gdb/breakpoint.c
printf_filtered (_("Thread Event Breakpoint: gdb should not stop!\n")); printf_filtered (_("Thread Event Breakpoint: gdb should not stop!\n"));
return PRINT_NOTHING; return PRINT_NOTHING;
break; break;
@@ -2567,6 +2657,54 @@ which its expression is valid.\n"); @@ -2636,6 +2726,54 @@ which its expression is valid.\n");
} }
} }
@ -340,7 +343,7 @@ Index: gdb-6.5/gdb/breakpoint.c
/* Get a bpstat associated with having just stopped at address /* Get a bpstat associated with having just stopped at address
BP_ADDR in thread PTID. STOPPED_BY_WATCHPOINT is 1 if the BP_ADDR in thread PTID. STOPPED_BY_WATCHPOINT is 1 if the
target thinks we stopped due to a hardware watchpoint, 0 if we target thinks we stopped due to a hardware watchpoint, 0 if we
@@ -2697,82 +2835,61 @@ bpstat_stop_status (CORE_ADDR bp_addr, p @@ -2766,82 +2904,61 @@ bpstat_stop_status (CORE_ADDR bp_addr, p
bs->stop = 1; bs->stop = 1;
bs->print = 1; bs->print = 1;
@ -468,7 +471,7 @@ Index: gdb-6.5/gdb/breakpoint.c
{ {
char *message = xstrprintf ("Error evaluating expression for watchpoint %d\n", char *message = xstrprintf ("Error evaluating expression for watchpoint %d\n",
b->number); b->number);
@@ -2801,6 +2918,15 @@ bpstat_stop_status (CORE_ADDR bp_addr, p @@ -2870,6 +2987,15 @@ bpstat_stop_status (CORE_ADDR bp_addr, p
break; break;
case WP_VALUE_NOT_CHANGED: case WP_VALUE_NOT_CHANGED:
/* Stop. */ /* Stop. */
@ -484,7 +487,7 @@ Index: gdb-6.5/gdb/breakpoint.c
++(b->hit_count); ++(b->hit_count);
break; break;
default: default:
@@ -2816,7 +2942,7 @@ bpstat_stop_status (CORE_ADDR bp_addr, p @@ -2885,7 +3011,7 @@ bpstat_stop_status (CORE_ADDR bp_addr, p
break; break;
} }
} }
@ -493,7 +496,7 @@ Index: gdb-6.5/gdb/breakpoint.c
{ {
/* This is a case where some watchpoint(s) triggered, /* This is a case where some watchpoint(s) triggered,
but not at the address of this watchpoint (FOUND but not at the address of this watchpoint (FOUND
@@ -4112,6 +4238,7 @@ set_raw_breakpoint (struct symtab_and_li @@ -4186,6 +4312,7 @@ set_raw_breakpoint (struct symtab_and_li
b->exec_pathname = NULL; b->exec_pathname = NULL;
b->ops = NULL; b->ops = NULL;
b->pending = 0; b->pending = 0;
@ -501,11 +504,11 @@ Index: gdb-6.5/gdb/breakpoint.c
/* Add this breakpoint to the end of the chain /* Add this breakpoint to the end of the chain
so that a list of breakpoints will come out in order so that a list of breakpoints will come out in order
Index: gdb-6.5/gdb/breakpoint.h Index: gdb-6.7/gdb/breakpoint.h
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/breakpoint.h 2006-07-11 12:30:23.000000000 -0300 --- gdb-6.7.orig/gdb/breakpoint.h 2007-08-23 20:08:26.000000000 +0200
+++ gdb-6.5/gdb/breakpoint.h 2006-07-11 15:00:17.000000000 -0300 +++ gdb-6.7/gdb/breakpoint.h 2007-10-13 04:50:11.000000000 +0200
@@ -426,6 +426,11 @@ struct breakpoint @@ -420,6 +420,11 @@ struct breakpoint
/* Is breakpoint pending on shlib loads? */ /* Is breakpoint pending on shlib loads? */
int pending; int pending;
@ -517,7 +520,7 @@ Index: gdb-6.5/gdb/breakpoint.h
}; };
/* The following stuff is an abstract data type "bpstat" ("breakpoint /* The following stuff is an abstract data type "bpstat" ("breakpoint
@@ -692,6 +697,14 @@ extern void tbreak_command (char *, int) @@ -688,6 +693,14 @@ extern void tbreak_command (char *, int)
extern int insert_breakpoints (void); extern int insert_breakpoints (void);
@ -532,11 +535,11 @@ Index: gdb-6.5/gdb/breakpoint.h
extern int remove_breakpoints (void); extern int remove_breakpoints (void);
/* This function can be used to physically insert eventpoints from the /* This function can be used to physically insert eventpoints from the
Index: gdb-6.5/gdb/linux-nat.c Index: gdb-6.7/gdb/linux-nat.c
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/linux-nat.c 2006-07-11 12:32:29.000000000 -0300 --- gdb-6.7.orig/gdb/linux-nat.c 2007-10-12 22:35:58.000000000 +0200
+++ gdb-6.5/gdb/linux-nat.c 2006-07-11 15:00:15.000000000 -0300 +++ gdb-6.7/gdb/linux-nat.c 2007-10-13 04:50:11.000000000 +0200
@@ -36,6 +36,7 @@ @@ -34,6 +34,7 @@
#include "gdbthread.h" #include "gdbthread.h"
#include "gdbcmd.h" #include "gdbcmd.h"
#include "regcache.h" #include "regcache.h"
@ -544,7 +547,7 @@ Index: gdb-6.5/gdb/linux-nat.c
#include "regset.h" #include "regset.h"
#include "inf-ptrace.h" #include "inf-ptrace.h"
#include "auxv.h" #include "auxv.h"
@@ -764,6 +765,9 @@ delete_lwp (ptid_t ptid) @@ -704,6 +705,9 @@ delete_lwp (ptid_t ptid)
else else
lwp_list = lp->next; lwp_list = lp->next;
@ -554,7 +557,7 @@ Index: gdb-6.5/gdb/linux-nat.c
xfree (lp); xfree (lp);
} }
@@ -1478,6 +1482,13 @@ stop_wait_callback (struct lwp_info *lp, @@ -1501,6 +1505,13 @@ stop_wait_callback (struct lwp_info *lp,
user will delete or disable the breakpoint, but the user will delete or disable the breakpoint, but the
thread will have already tripped on it. */ thread will have already tripped on it. */
@ -568,7 +571,7 @@ Index: gdb-6.5/gdb/linux-nat.c
/* Now resume this LWP and get the SIGSTOP event. */ /* Now resume this LWP and get the SIGSTOP event. */
errno = 0; errno = 0;
ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0); ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0);
@@ -2054,6 +2065,14 @@ retry: @@ -2061,6 +2072,14 @@ retry:
target_pid_to_str (lp->ptid)); target_pid_to_str (lp->ptid));
} }
@ -583,11 +586,11 @@ Index: gdb-6.5/gdb/linux-nat.c
/* Handle GNU/Linux's extended waitstatus for trace events. */ /* Handle GNU/Linux's extended waitstatus for trace events. */
if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP && status >> 16 != 0) if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP && status >> 16 != 0)
{ {
Index: gdb-6.5/gdb/linux-nat.h Index: gdb-6.7/gdb/linux-nat.h
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/linux-nat.h 2006-07-11 12:30:23.000000000 -0300 --- gdb-6.7.orig/gdb/linux-nat.h 2007-10-12 22:35:58.000000000 +0200
+++ gdb-6.5/gdb/linux-nat.h 2006-07-11 12:32:29.000000000 -0300 +++ gdb-6.7/gdb/linux-nat.h 2007-10-13 04:50:11.000000000 +0200
@@ -63,6 +63,18 @@ struct lwp_info @@ -61,6 +61,18 @@ struct lwp_info
/* Next LWP in list. */ /* Next LWP in list. */
struct lwp_info *next; struct lwp_info *next;
@ -606,41 +609,41 @@ Index: gdb-6.5/gdb/linux-nat.h
}; };
/* Attempt to initialize libthread_db. */ /* Attempt to initialize libthread_db. */
Index: gdb-6.5/gdb/Makefile.in Index: gdb-6.7/gdb/Makefile.in
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/Makefile.in 2006-07-11 12:30:23.000000000 -0300 --- gdb-6.7.orig/gdb/Makefile.in 2007-09-05 02:14:02.000000000 +0200
+++ gdb-6.5/gdb/Makefile.in 2006-07-11 15:00:19.000000000 -0300 +++ gdb-6.7/gdb/Makefile.in 2007-10-13 04:50:53.000000000 +0200
@@ -2113,7 +2113,7 @@ i387-tdep.o: i387-tdep.c $(defs_h) $(dou @@ -2160,7 +2160,7 @@ i387-tdep.o: i387-tdep.c $(defs_h) $(dou
$(gdb_assert_h) $(gdb_string_h) $(i386_tdep_h) $(i387_tdep_h) $(gdb_assert_h) $(gdb_string_h) $(i386_tdep_h) $(i387_tdep_h)
ia64-linux-nat.o: ia64-linux-nat.c $(defs_h) $(gdb_string_h) $(inferior_h) \ ia64-linux-nat.o: ia64-linux-nat.c $(defs_h) $(gdb_string_h) $(inferior_h) \
$(target_h) $(gdbcore_h) $(regcache_h) $(ia64_tdep_h) $(gdb_wait_h) \ $(target_h) $(gdbcore_h) $(regcache_h) $(ia64_tdep_h) $(gdb_wait_h) \
- $(gregset_h) $(linux_nat_h) - $(gregset_h) $(linux_nat_h)
+ $(gregset_h) $(observer_h) $(linux_nat_h) + $(gregset_h) $(observer_h) $(linux_nat_h)
ia64-linux-tdep.o: ia64-linux-tdep.c $(defs_h) $(ia64_tdep_h) \ ia64-linux-tdep.o: ia64-linux-tdep.c $(defs_h) $(ia64_tdep_h) \
$(arch_utils_h) $(gdbcore_h) $(regcache_h) $(osabi_h) $(solib_svr4_h) $(arch_utils_h) $(gdbcore_h) $(regcache_h) $(osabi_h) $(solib_svr4_h) \
ia64-tdep.o: ia64-tdep.c $(defs_h) $(inferior_h) $(gdbcore_h) \ $(symtab_h)
@@ -2518,7 +2518,7 @@ rs6000-tdep.o: rs6000-tdep.c $(defs_h) $ @@ -2541,7 +2541,7 @@ rs6000-tdep.o: rs6000-tdep.c $(defs_h) $
$(frame_unwind_h) $(frame_base_h) $(rs6000_tdep_h) rs6000-aix-tdep.o: rs6000-aix-tdep.c $(defs_h) $(gdb_string_h) $(osabi_h) \
rs6000-aix-tdep.o: rs6000-aix-tdep.c $(defs_h) $(osabi_h) $(rs6000_tdep_h) $(regcache_h) $(regset_h) $(rs6000_tdep_h) $(ppc_tdep_h)
s390-nat.o: s390-nat.c $(defs_h) $(tm_h) $(regcache_h) $(inferior_h) \ s390-nat.o: s390-nat.c $(defs_h) $(regcache_h) $(inferior_h) \
- $(s390_tdep_h) $(target_h) $(linux_nat_h) - $(s390_tdep_h) $(target_h) $(linux_nat_h)
+ $(s390_tdep_h) $(target_h) $(observer_h) $(linux_nat_h) + $(s390_tdep_h) $(target_h) $(linux_nat_h) $(observer_h)
s390-tdep.o: s390-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) $(inferior_h) \ s390-tdep.o: s390-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) $(inferior_h) \
$(symtab_h) $(target_h) $(gdbcore_h) $(gdbcmd_h) $(objfiles_h) \ $(symtab_h) $(target_h) $(gdbcore_h) $(gdbcmd_h) $(objfiles_h) \
$(floatformat_h) $(regcache_h) $(trad_frame_h) $(frame_base_h) \ $(floatformat_h) $(regcache_h) $(trad_frame_h) $(frame_base_h) \
Index: gdb-6.5/gdb/linux-thread-db.c Index: gdb-6.7/gdb/linux-thread-db.c
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/linux-thread-db.c 2006-07-11 12:30:23.000000000 -0300 --- gdb-6.7.orig/gdb/linux-thread-db.c 2007-08-23 20:08:35.000000000 +0200
+++ gdb-6.5/gdb/linux-thread-db.c 2006-07-11 15:00:18.000000000 -0300 +++ gdb-6.7/gdb/linux-thread-db.c 2007-10-13 04:53:59.000000000 +0200
@@ -36,6 +36,7 @@ @@ -34,6 +34,7 @@
#include "target.h" #include "target.h"
#include "regcache.h" #include "regcache.h"
#include "solib-svr4.h" #include "solib-svr4.h"
+#include "observer.h" +#include "observer.h"
#include "gdbcore.h" #include "gdbcore.h"
#include "observer.h"
#include "linux-nat.h" #include "linux-nat.h"
@@ -673,6 +674,7 @@ attach_thread (ptid_t ptid, const td_thr
@@ -718,6 +719,7 @@ attach_thread (ptid_t ptid, const td_thr
{ {
struct thread_info *tp; struct thread_info *tp;
td_err_e err; td_err_e err;
@ -648,17 +651,21 @@ Index: gdb-6.5/gdb/linux-thread-db.c
/* If we're being called after a TD_CREATE event, we may already /* If we're being called after a TD_CREATE event, we may already
know about this thread. There are two ways this can happen. We know about this thread. There are two ways this can happen. We
@@ -753,11 +755,18 @@ attach_thread (ptid_t ptid, const td_thr @@ -700,8 +702,10 @@ attach_thread (ptid_t ptid, const td_thr
if (ti_p->ti_state == TD_THR_UNKNOWN || ti_p->ti_state == TD_THR_ZOMBIE) if (ti_p->ti_state == TD_THR_UNKNOWN || ti_p->ti_state == TD_THR_ZOMBIE)
return; /* A zombie thread -- do not attach. */ return; /* A zombie thread -- do not attach. */
+ new_ptid = BUILD_LWP (ti_p->ti_lid, GET_PID (ptid)); + new_ptid = BUILD_LWP (ti_p->ti_lid, GET_PID (ptid));
+ +
/* Under GNU/Linux, we have to attach to each and every thread. */ /* Under GNU/Linux, we have to attach to each and every thread. */
#ifdef ATTACH_LWP - if (lin_lwp_attach_lwp (BUILD_LWP (ti_p->ti_lid, GET_PID (ptid)), 0) < 0)
- ATTACH_LWP (BUILD_LWP (ti_p->ti_lid, GET_PID (ptid)), 0); + if (lin_lwp_attach_lwp (new_ptid, 0) < 0)
+ ATTACH_LWP (new_ptid, 0); return;
#endif
/* Add the thread to GDB's thread list. */
@@ -712,6 +716,11 @@ attach_thread (ptid_t ptid, const td_thr
if (verbose)
printf_unfiltered (_("[New %s]\n"), target_pid_to_str (ptid));
+ /* Notify any observers of a new linux thread. This + /* Notify any observers of a new linux thread. This
+ would include any linux platforms that have to insert hardware + would include any linux platforms that have to insert hardware
@ -668,8 +675,8 @@ Index: gdb-6.5/gdb/linux-thread-db.c
/* Enable thread event reporting for this thread. */ /* Enable thread event reporting for this thread. */
err = td_thr_event_enable_p (th_p, 1); err = td_thr_event_enable_p (th_p, 1);
if (err != TD_OK) if (err != TD_OK)
@@ -946,7 +955,8 @@ thread_db_wait (ptid_t ptid, struct targ @@ -891,7 +900,8 @@ thread_db_wait (ptid_t ptid, struct targ
return pid_to_ptid (-1); thread_db_find_new_threads ();
if (ourstatus->kind == TARGET_WAITKIND_STOPPED if (ourstatus->kind == TARGET_WAITKIND_STOPPED
- && ourstatus->value.sig == TARGET_SIGNAL_TRAP) - && ourstatus->value.sig == TARGET_SIGNAL_TRAP)
@ -678,11 +685,11 @@ Index: gdb-6.5/gdb/linux-thread-db.c
/* Check for a thread event. */ /* Check for a thread event. */
check_event (ptid); check_event (ptid);
Index: gdb-6.5/gdb/i386-linux-nat.c Index: gdb-6.7/gdb/i386-linux-nat.c
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/i386-linux-nat.c 2006-07-11 12:30:23.000000000 -0300 --- gdb-6.7.orig/gdb/i386-linux-nat.c 2007-08-23 20:08:34.000000000 +0200
+++ gdb-6.5/gdb/i386-linux-nat.c 2006-07-11 15:00:09.000000000 -0300 +++ gdb-6.7/gdb/i386-linux-nat.c 2007-10-13 04:50:11.000000000 +0200
@@ -619,10 +619,9 @@ i386_linux_dr_get (int regnum) @@ -585,10 +585,9 @@ i386_linux_dr_get (int regnum)
int tid; int tid;
unsigned long value; unsigned long value;
@ -696,7 +703,7 @@ Index: gdb-6.5/gdb/i386-linux-nat.c
/* FIXME: kettenis/2001-03-27: Calling perror_with_name if the /* FIXME: kettenis/2001-03-27: Calling perror_with_name if the
ptrace call fails breaks debugging remote targets. The correct ptrace call fails breaks debugging remote targets. The correct
@@ -647,10 +646,9 @@ i386_linux_dr_set (int regnum, unsigned @@ -613,10 +612,9 @@ i386_linux_dr_set (int regnum, unsigned
{ {
int tid; int tid;
@ -710,11 +717,11 @@ Index: gdb-6.5/gdb/i386-linux-nat.c
errno = 0; errno = 0;
ptrace (PTRACE_POKEUSER, tid, ptrace (PTRACE_POKEUSER, tid,
Index: gdb-6.5/gdb/ia64-linux-nat.c Index: gdb-6.7/gdb/ia64-linux-nat.c
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/ia64-linux-nat.c 2006-07-11 12:30:23.000000000 -0300 --- gdb-6.7.orig/gdb/ia64-linux-nat.c 2007-08-23 20:08:35.000000000 +0200
+++ gdb-6.5/gdb/ia64-linux-nat.c 2006-07-11 15:00:00.000000000 -0300 +++ gdb-6.7/gdb/ia64-linux-nat.c 2007-10-13 05:07:58.000000000 +0200
@@ -29,6 +29,7 @@ @@ -27,6 +27,7 @@
#include "regcache.h" #include "regcache.h"
#include "ia64-tdep.h" #include "ia64-tdep.h"
#include "linux-nat.h" #include "linux-nat.h"
@ -722,25 +729,27 @@ Index: gdb-6.5/gdb/ia64-linux-nat.c
#include <signal.h> #include <signal.h>
#include <sys/ptrace.h> #include <sys/ptrace.h>
@@ -561,8 +562,9 @@ is_power_of_2 (int val) @@ -550,10 +551,10 @@ is_power_of_2 (int val)
return onecount <= 1; return onecount <= 1;
} }
-int
-ia64_linux_insert_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rw)
+/* Internal routine to insert one watchpoint for a specified thread. */ +/* Internal routine to insert one watchpoint for a specified thread. */
+static int static int
-ia64_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw)
+ia64_linux_insert_one_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rw) +ia64_linux_insert_one_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rw)
{ {
- ptid_t ptid = inferior_ptid;
int idx; int idx;
long dbr_addr, dbr_mask; long dbr_addr, dbr_mask;
@@ -608,8 +610,38 @@ ia64_linux_insert_watchpoint (ptid_t pti int max_watchpoints = 4;
@@ -598,10 +599,39 @@ ia64_linux_insert_watchpoint (CORE_ADDR
return 0; return 0;
} }
+/* Internal callback routine which can be used via iterate_over_lwps +/* Internal callback routine which can be used via iterate_over_lwps
+ to insert a specific watchpoint from all active threads. */ + to insert a specific watchpoint from all active threads. */
+static int static int
-ia64_linux_remove_watchpoint (CORE_ADDR addr, int len, int type)
+ia64_linux_insert_watchpoint_callback (struct lwp_info *lwp, void *data) +ia64_linux_insert_watchpoint_callback (struct lwp_info *lwp, void *data)
+{ +{
+ struct linux_watchpoint *args = (struct linux_watchpoint *)data; + struct linux_watchpoint *args = (struct linux_watchpoint *)data;
@ -750,9 +759,8 @@ Index: gdb-6.5/gdb/ia64-linux-nat.c
+} +}
+ +
+/* Insert a watchpoint for all threads. */ +/* Insert a watchpoint for all threads. */
int +static int
-ia64_linux_remove_watchpoint (ptid_t ptid, CORE_ADDR addr, int len) +ia64_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw)
+ia64_linux_insert_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rw)
+{ +{
+ struct linux_watchpoint args; + struct linux_watchpoint args;
+ +
@ -770,11 +778,13 @@ Index: gdb-6.5/gdb/ia64-linux-nat.c
+ +
+/* Internal routine to remove one watchpoint for a specified thread. */ +/* Internal routine to remove one watchpoint for a specified thread. */
+static int +static int
+ia64_linux_remove_one_watchpoint (ptid_t ptid, CORE_ADDR addr, int len) +ia64_linux_remove_one_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int type)
{ {
- ptid_t ptid = inferior_ptid;
int idx; int idx;
long dbr_addr, dbr_mask; long dbr_addr, dbr_mask;
@@ -632,23 +664,74 @@ ia64_linux_remove_watchpoint (ptid_t pti int max_watchpoints = 4;
@@ -623,13 +653,55 @@ ia64_linux_remove_watchpoint (CORE_ADDR
return -1; return -1;
} }
@ -790,8 +800,8 @@ Index: gdb-6.5/gdb/ia64-linux-nat.c
+} +}
+ +
+/* Remove a watchpoint for all threads. */ +/* Remove a watchpoint for all threads. */
+int +static int
+ia64_linux_remove_watchpoint (ptid_t ptid, CORE_ADDR addr, int len) +ia64_linux_remove_watchpoint (CORE_ADDR addr, int len)
+{ +{
+ struct linux_watchpoint args; + struct linux_watchpoint args;
+ +
@ -818,8 +828,8 @@ Index: gdb-6.5/gdb/ia64-linux-nat.c
+ return 0; + return 0;
+} +}
+ +
int static int
ia64_linux_stopped_data_address (CORE_ADDR *addr_p) ia64_linux_stopped_data_address (struct target_ops *ops, CORE_ADDR *addr_p)
{ {
CORE_ADDR psr; CORE_ADDR psr;
int tid; int tid;
@ -827,9 +837,10 @@ Index: gdb-6.5/gdb/ia64-linux-nat.c
+ struct siginfo *siginfo_p; + struct siginfo *siginfo_p;
ptid_t ptid = inferior_ptid; ptid_t ptid = inferior_ptid;
+ struct lwp_info *lp; + struct lwp_info *lp;
struct regcache *regcache = get_current_regcache ();
tid = TIDGET(ptid); tid = TIDGET(ptid);
if (tid == 0) @@ -637,10 +709,19 @@ ia64_linux_stopped_data_address (struct
tid = PIDGET (ptid); tid = PIDGET (ptid);
errno = 0; errno = 0;
@ -851,17 +862,17 @@ Index: gdb-6.5/gdb/ia64-linux-nat.c
+ (siginfo_p->si_code & 0xffff) != 0x0004 /* TRAP_HWBKPT */) + (siginfo_p->si_code & 0xffff) != 0x0004 /* TRAP_HWBKPT */)
return 0; return 0;
psr = read_register_pid (IA64_PSR_REGNUM, ptid); regcache_cooked_read_unsigned (regcache, IA64_PSR_REGNUM, &psr);
@@ -656,7 +739,7 @@ ia64_linux_stopped_data_address (CORE_AD @@ -648,7 +729,7 @@ ia64_linux_stopped_data_address (struct
for the next instruction */ for the next instruction */
write_register_pid (IA64_PSR_REGNUM, psr, ptid); regcache_cooked_write_unsigned (regcache, IA64_PSR_REGNUM, psr);
- *addr_p = (CORE_ADDR)siginfo.si_addr; - *addr_p = (CORE_ADDR)siginfo.si_addr;
+ *addr_p = (CORE_ADDR)siginfo_p->si_addr; + *addr_p = (CORE_ADDR)siginfo_p->si_addr;
return 1; return 1;
} }
@@ -685,6 +768,31 @@ ia64_linux_xfer_partial (struct target_o @@ -796,6 +877,31 @@ ia64_linux_xfer_partial (struct target_o
offset, len); offset, len);
} }
@ -893,7 +904,7 @@ Index: gdb-6.5/gdb/ia64-linux-nat.c
void _initialize_ia64_linux_nat (void); void _initialize_ia64_linux_nat (void);
void void
@@ -701,4 +809,7 @@ _initialize_ia64_linux_nat (void) @@ -834,4 +940,7 @@ _initialize_ia64_linux_nat (void)
/* Register the target. */ /* Register the target. */
linux_nat_add_target (t); linux_nat_add_target (t);
@ -901,11 +912,11 @@ Index: gdb-6.5/gdb/ia64-linux-nat.c
+ observer_attach_linux_new_thread (ia64_linux_new_thread); + observer_attach_linux_new_thread (ia64_linux_new_thread);
+ observer_attach_sigtrap (ia64_linux_save_sigtrap_info); + observer_attach_sigtrap (ia64_linux_save_sigtrap_info);
} }
Index: gdb-6.5/gdb/amd64-linux-nat.c Index: gdb-6.7/gdb/amd64-linux-nat.c
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/amd64-linux-nat.c 2006-07-11 12:30:23.000000000 -0300 --- gdb-6.7.orig/gdb/amd64-linux-nat.c 2007-08-23 20:08:26.000000000 +0200
+++ gdb-6.5/gdb/amd64-linux-nat.c 2006-07-11 15:00:09.000000000 -0300 +++ gdb-6.7/gdb/amd64-linux-nat.c 2007-10-13 04:50:11.000000000 +0200
@@ -234,10 +234,9 @@ amd64_linux_dr_get (int regnum) @@ -240,10 +240,9 @@ amd64_linux_dr_get (int regnum)
int tid; int tid;
unsigned long value; unsigned long value;
@ -919,7 +930,7 @@ Index: gdb-6.5/gdb/amd64-linux-nat.c
/* FIXME: kettenis/2001-03-27: Calling perror_with_name if the /* FIXME: kettenis/2001-03-27: Calling perror_with_name if the
ptrace call fails breaks debugging remote targets. The correct ptrace call fails breaks debugging remote targets. The correct
@@ -262,10 +261,9 @@ amd64_linux_dr_set (int regnum, unsigned @@ -268,10 +267,9 @@ amd64_linux_dr_set (int regnum, unsigned
{ {
int tid; int tid;
@ -933,11 +944,11 @@ Index: gdb-6.5/gdb/amd64-linux-nat.c
errno = 0; errno = 0;
ptrace (PT_WRITE_U, tid, offsetof (struct user, u_debugreg[regnum]), value); ptrace (PT_WRITE_U, tid, offsetof (struct user, u_debugreg[regnum]), value);
Index: gdb-6.5/gdb/s390-nat.c Index: gdb-6.7/gdb/s390-nat.c
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/s390-nat.c 2006-07-11 12:30:23.000000000 -0300 --- gdb-6.7.orig/gdb/s390-nat.c 2007-08-23 20:08:37.000000000 +0200
+++ gdb-6.5/gdb/s390-nat.c 2006-07-11 15:00:26.000000000 -0300 +++ gdb-6.7/gdb/s390-nat.c 2007-10-13 04:50:11.000000000 +0200
@@ -30,6 +30,7 @@ @@ -27,6 +27,7 @@
#include "linux-nat.h" #include "linux-nat.h"
#include "s390-tdep.h" #include "s390-tdep.h"
@ -945,8 +956,8 @@ Index: gdb-6.5/gdb/s390-nat.c
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include <sys/ptrace.h> #include <sys/ptrace.h>
@@ -114,14 +115,14 @@ fill_fpregset (fpregset_t *regp, int reg @@ -111,14 +112,14 @@ fill_fpregset (const struct regcache *re
((char *)regp) + regmap_fpregset[i]); (char *)regp + regmap_fpregset[i]);
} }
-/* Find the TID for the current inferior thread to use with ptrace. */ -/* Find the TID for the current inferior thread to use with ptrace. */
@ -964,25 +975,25 @@ Index: gdb-6.5/gdb/s390-nat.c
return tid; return tid;
} }
@@ -205,7 +206,7 @@ store_fpregs (int tid, int regnum) @@ -202,7 +203,7 @@ store_fpregs (const struct regcache *reg
static void static void
s390_linux_fetch_inferior_registers (int regnum) s390_linux_fetch_inferior_registers (struct regcache *regcache, int regnum)
{ {
- int tid = s390_inferior_tid (); - int tid = s390_inferior_tid ();
+ int tid = s390_tid (inferior_ptid); + int tid = s390_tid (inferior_ptid);
if (regnum == -1 if (regnum == -1
|| (regnum < S390_NUM_REGS && regmap_gregset[regnum] != -1)) || (regnum < S390_NUM_REGS && regmap_gregset[regnum] != -1))
@@ -221,7 +222,7 @@ s390_linux_fetch_inferior_registers (int @@ -218,7 +219,7 @@ s390_linux_fetch_inferior_registers (str
static void static void
s390_linux_store_inferior_registers (int regnum) s390_linux_store_inferior_registers (struct regcache *regcache, int regnum)
{ {
- int tid = s390_inferior_tid (); - int tid = s390_inferior_tid ();
+ int tid = s390_tid (inferior_ptid); + int tid = s390_tid (inferior_ptid);
if (regnum == -1 if (regnum == -1
|| (regnum < S390_NUM_REGS && regmap_gregset[regnum] != -1)) || (regnum < S390_NUM_REGS && regmap_gregset[regnum] != -1))
@@ -263,7 +264,7 @@ s390_stopped_by_watchpoint (void) @@ -260,7 +261,7 @@ s390_stopped_by_watchpoint (void)
parea.len = sizeof (per_lowcore); parea.len = sizeof (per_lowcore);
parea.process_addr = (addr_t) & per_lowcore; parea.process_addr = (addr_t) & per_lowcore;
parea.kernel_addr = offsetof (struct user_regs_struct, per_info.lowcore); parea.kernel_addr = offsetof (struct user_regs_struct, per_info.lowcore);
@ -991,7 +1002,7 @@ Index: gdb-6.5/gdb/s390-nat.c
perror_with_name (_("Couldn't retrieve watchpoint status")); perror_with_name (_("Couldn't retrieve watchpoint status"));
return per_lowcore.perc_storage_alteration == 1 return per_lowcore.perc_storage_alteration == 1
@@ -271,9 +272,9 @@ s390_stopped_by_watchpoint (void) @@ -268,9 +269,9 @@ s390_stopped_by_watchpoint (void)
} }
static void static void
@ -1003,7 +1014,7 @@ Index: gdb-6.5/gdb/s390-nat.c
per_struct per_info; per_struct per_info;
ptrace_area parea; ptrace_area parea;
@@ -310,6 +311,16 @@ s390_fix_watch_points (void) @@ -307,6 +308,16 @@ s390_fix_watch_points (void)
perror_with_name (_("Couldn't modify watchpoint status")); perror_with_name (_("Couldn't modify watchpoint status"));
} }
@ -1020,7 +1031,7 @@ Index: gdb-6.5/gdb/s390-nat.c
static int static int
s390_insert_watchpoint (CORE_ADDR addr, int len, int type) s390_insert_watchpoint (CORE_ADDR addr, int len, int type)
{ {
@@ -323,10 +334,24 @@ s390_insert_watchpoint (CORE_ADDR addr, @@ -320,10 +331,24 @@ s390_insert_watchpoint (CORE_ADDR addr,
area->next = watch_base; area->next = watch_base;
watch_base = area; watch_base = area;
@ -1046,7 +1057,7 @@ Index: gdb-6.5/gdb/s390-nat.c
static int static int
s390_remove_watchpoint (CORE_ADDR addr, int len, int type) s390_remove_watchpoint (CORE_ADDR addr, int len, int type)
{ {
@@ -348,7 +373,11 @@ s390_remove_watchpoint (CORE_ADDR addr, @@ -345,7 +370,11 @@ s390_remove_watchpoint (CORE_ADDR addr,
*parea = area->next; *parea = area->next;
xfree (area); xfree (area);
@ -1059,7 +1070,7 @@ Index: gdb-6.5/gdb/s390-nat.c
return 0; return 0;
} }
@@ -364,6 +393,15 @@ s390_region_ok_for_hw_watchpoint (CORE_A @@ -361,6 +390,15 @@ s390_region_ok_for_hw_watchpoint (CORE_A
return 1; return 1;
} }
@ -1075,7 +1086,7 @@ Index: gdb-6.5/gdb/s390-nat.c
void _initialize_s390_nat (void); void _initialize_s390_nat (void);
@@ -389,4 +427,6 @@ _initialize_s390_nat (void) @@ -386,4 +424,6 @@ _initialize_s390_nat (void)
/* Register the target. */ /* Register the target. */
linux_nat_add_target (t); linux_nat_add_target (t);

View File

@ -35,11 +35,15 @@
* testsuite/gdb.threads/watchthreads2.c: New test case. * testsuite/gdb.threads/watchthreads2.c: New test case.
* testsuite/gdb.threads/watchthreads2.exp: Ditto. * testsuite/gdb.threads/watchthreads2.exp: Ditto.
Index: gdb-6.5/gdb/config/i386/nm-linux64.h 2007-10-14 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.7.
Index: gdb-6.7/gdb/config/i386/nm-linux64.h
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/config/i386/nm-linux64.h 2006-07-12 01:54:10.000000000 -0300 --- gdb-6.7.orig/gdb/config/i386/nm-linux64.h 2007-08-23 20:08:48.000000000 +0200
+++ gdb-6.5/gdb/config/i386/nm-linux64.h 2006-07-12 01:54:29.000000000 -0300 +++ gdb-6.7/gdb/config/i386/nm-linux64.h 2007-10-14 23:41:50.000000000 +0200
@@ -35,22 +35,59 @@ @@ -33,20 +33,58 @@
/* Provide access to the i386 hardware debugging registers. */ /* Provide access to the i386 hardware debugging registers. */
@ -66,7 +70,7 @@ Index: gdb-6.5/gdb/config/i386/nm-linux64.h
#define I386_DR_LOW_GET_STATUS() \ #define I386_DR_LOW_GET_STATUS() \
- amd64_linux_dr_get_status () - amd64_linux_dr_get_status ()
+ amd64_linux_dr_get_status (inferior_ptid) + amd64_linux_dr_get_status (inferior_ptid)
+
+/* Watchpoints and hardware breakpoints. */ +/* Watchpoints and hardware breakpoints. */
+ +
+/* Insert a watchpoint to watch a memory region which starts at +/* Insert a watchpoint to watch a memory region which starts at
@ -105,14 +109,13 @@ Index: gdb-6.5/gdb/config/i386/nm-linux64.h
+#define target_remove_hw_breakpoint(bp_tgt) \ +#define target_remove_hw_breakpoint(bp_tgt) \
+ amd64_linux_remove_hw_breakpoint (bp_tgt) + amd64_linux_remove_hw_breakpoint (bp_tgt)
/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */ #endif /* nm-linux64.h */
#define FETCH_INFERIOR_REGISTERS Index: gdb-6.7/gdb/config/i386/nm-linux.h
Index: gdb-6.5/gdb/config/i386/nm-linux.h
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/config/i386/nm-linux.h 2006-07-12 01:54:10.000000000 -0300 --- gdb-6.7.orig/gdb/config/i386/nm-linux.h 2007-08-23 20:08:48.000000000 +0200
+++ gdb-6.5/gdb/config/i386/nm-linux.h 2006-07-12 01:54:29.000000000 -0300 +++ gdb-6.7/gdb/config/i386/nm-linux.h 2007-10-14 23:40:55.000000000 +0200
@@ -46,23 +46,61 @@ extern CORE_ADDR register_u_addr (CORE_A @@ -29,21 +29,60 @@
/* Provide access to the i386 hardware debugging registers. */ /* Provide access to the i386 hardware debugging registers. */
-extern void i386_linux_dr_set_control (unsigned long control); -extern void i386_linux_dr_set_control (unsigned long control);
@ -138,8 +141,7 @@ Index: gdb-6.5/gdb/config/i386/nm-linux.h
#define I386_DR_LOW_GET_STATUS() \ #define I386_DR_LOW_GET_STATUS() \
- i386_linux_dr_get_status () - i386_linux_dr_get_status ()
+ i386_linux_dr_get_status (inferior_ptid) + i386_linux_dr_get_status (inferior_ptid)
+
+/* Watchpoints and hardware breakpoints. */ +/* Watchpoints and hardware breakpoints. */
+ +
+/* Insert a watchpoint to watch a memory region which starts at +/* Insert a watchpoint to watch a memory region which starts at
@ -178,14 +180,14 @@ Index: gdb-6.5/gdb/config/i386/nm-linux.h
+#define target_remove_hw_breakpoint(bp_tgt) \ +#define target_remove_hw_breakpoint(bp_tgt) \
+ i386_linux_remove_hw_breakpoint (bp_tgt) + i386_linux_remove_hw_breakpoint (bp_tgt)
+ +
/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */
#define FETCH_INFERIOR_REGISTERS
Index: gdb-6.5/gdb/i386-nat.c #ifdef HAVE_PTRACE_GETFPXREGS
Index: gdb-6.7/gdb/i386-nat.c
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/i386-nat.c 2006-07-12 01:54:10.000000000 -0300 --- gdb-6.7.orig/gdb/i386-nat.c 2007-08-23 20:08:34.000000000 +0200
+++ gdb-6.5/gdb/i386-nat.c 2006-07-12 01:54:29.000000000 -0300 +++ gdb-6.7/gdb/i386-nat.c 2007-10-14 23:39:04.000000000 +0200
@@ -21,6 +21,7 @@ @@ -19,6 +19,7 @@
#include "defs.h" #include "defs.h"
#include "breakpoint.h" #include "breakpoint.h"
@ -193,10 +195,10 @@ Index: gdb-6.5/gdb/i386-nat.c
#include "command.h" #include "command.h"
#include "gdbcmd.h" #include "gdbcmd.h"
Index: gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.c Index: gdb-6.7/gdb/testsuite/gdb.threads/watchthreads2.c
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.c 2006-07-12 01:54:29.000000000 -0300 +++ gdb-6.7/gdb/testsuite/gdb.threads/watchthreads2.c 2007-10-14 23:39:04.000000000 +0200
@@ -0,0 +1,66 @@ @@ -0,0 +1,66 @@
+/* This testcase is part of GDB, the GNU debugger. +/* This testcase is part of GDB, the GNU debugger.
+ +
@ -264,10 +266,10 @@ Index: gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.c
+ pthread_exit(NULL); + pthread_exit(NULL);
+} +}
+ +
Index: gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.exp Index: gdb-6.7/gdb/testsuite/gdb.threads/watchthreads2.exp
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.exp 2006-07-12 01:54:29.000000000 -0300 +++ gdb-6.7/gdb/testsuite/gdb.threads/watchthreads2.exp 2007-10-14 23:39:04.000000000 +0200
@@ -0,0 +1,133 @@ @@ -0,0 +1,133 @@
+# This testcase is part of GDB, the GNU debugger. +# This testcase is part of GDB, the GNU debugger.
+ +
@ -402,11 +404,11 @@ Index: gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.exp
+} else { +} else {
+ fail $message + fail $message
+} +}
Index: gdb-6.5/gdb/i386-linux-nat.c Index: gdb-6.7/gdb/i386-linux-nat.c
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/i386-linux-nat.c 2006-07-12 01:54:28.000000000 -0300 --- gdb-6.7.orig/gdb/i386-linux-nat.c 2007-10-13 05:09:50.000000000 +0200
+++ gdb-6.5/gdb/i386-linux-nat.c 2006-07-12 01:57:19.000000000 -0300 +++ gdb-6.7/gdb/i386-linux-nat.c 2007-10-14 23:39:04.000000000 +0200
@@ -24,6 +24,7 @@ @@ -22,6 +22,7 @@
#include "inferior.h" #include "inferior.h"
#include "gdbcore.h" #include "gdbcore.h"
#include "regcache.h" #include "regcache.h"
@ -414,7 +416,7 @@ Index: gdb-6.5/gdb/i386-linux-nat.c
#include "target.h" #include "target.h"
#include "linux-nat.h" #include "linux-nat.h"
@@ -614,14 +615,14 @@ i386_linux_store_inferior_registers (int @@ -580,14 +581,14 @@ i386_linux_store_inferior_registers (str
/* Support for debug registers. */ /* Support for debug registers. */
static unsigned long static unsigned long
@ -432,7 +434,7 @@ Index: gdb-6.5/gdb/i386-linux-nat.c
/* FIXME: kettenis/2001-03-27: Calling perror_with_name if the /* FIXME: kettenis/2001-03-27: Calling perror_with_name if the
ptrace call fails breaks debugging remote targets. The correct ptrace call fails breaks debugging remote targets. The correct
@@ -642,13 +643,13 @@ i386_linux_dr_get (int regnum) @@ -608,13 +609,13 @@ i386_linux_dr_get (int regnum)
} }
static void static void
@ -449,7 +451,7 @@ Index: gdb-6.5/gdb/i386-linux-nat.c
errno = 0; errno = 0;
ptrace (PTRACE_POKEUSER, tid, ptrace (PTRACE_POKEUSER, tid,
@@ -658,34 +659,158 @@ i386_linux_dr_set (int regnum, unsigned @@ -624,34 +625,158 @@ i386_linux_dr_set (int regnum, unsigned
} }
void void
@ -616,26 +618,26 @@ Index: gdb-6.5/gdb/i386-linux-nat.c
/* Called by libthread_db. Returns a pointer to the thread local /* Called by libthread_db. Returns a pointer to the thread local
storage (or its descriptor). */ storage (or its descriptor). */
@@ -843,4 +968,6 @@ _initialize_i386_linux_nat (void) @@ -816,4 +941,6 @@ _initialize_i386_linux_nat (void)
/* Register the target. */ /* Register the target. */
linux_nat_add_target (t); linux_nat_add_target (t);
+ +
+ observer_attach_linux_new_thread (i386_linux_new_thread); + observer_attach_linux_new_thread (i386_linux_new_thread);
} }
Index: gdb-6.5/gdb/amd64-linux-nat.c Index: gdb-6.7/gdb/amd64-linux-nat.c
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/amd64-linux-nat.c 2006-07-12 01:54:28.000000000 -0300 --- gdb-6.7.orig/gdb/amd64-linux-nat.c 2007-10-13 05:09:50.000000000 +0200
+++ gdb-6.5/gdb/amd64-linux-nat.c 2006-07-12 01:54:29.000000000 -0300 +++ gdb-6.7/gdb/amd64-linux-nat.c 2007-10-14 23:39:04.000000000 +0200
@@ -25,6 +25,7 @@ @@ -23,6 +23,7 @@
#include "inferior.h" #include "inferior.h"
#include "gdbcore.h" #include "gdbcore.h"
#include "regcache.h" #include "regcache.h"
+#include "observer.h" +#include "observer.h"
#include "linux-nat.h" #include "linux-nat.h"
#include "amd64-linux-tdep.h"
#include "gdb_assert.h" @@ -235,14 +236,14 @@ amd64_linux_store_inferior_registers (st
@@ -229,14 +230,14 @@ amd64_linux_store_inferior_registers (in
static unsigned long static unsigned long
@ -653,7 +655,7 @@ Index: gdb-6.5/gdb/amd64-linux-nat.c
/* FIXME: kettenis/2001-03-27: Calling perror_with_name if the /* FIXME: kettenis/2001-03-27: Calling perror_with_name if the
ptrace call fails breaks debugging remote targets. The correct ptrace call fails breaks debugging remote targets. The correct
@@ -257,13 +258,13 @@ amd64_linux_dr_get (int regnum) @@ -263,13 +264,13 @@ amd64_linux_dr_get (int regnum)
} }
static void static void
@ -670,7 +672,7 @@ Index: gdb-6.5/gdb/amd64-linux-nat.c
errno = 0; errno = 0;
ptrace (PT_WRITE_U, tid, offsetof (struct user, u_debugreg[regnum]), value); ptrace (PT_WRITE_U, tid, offsetof (struct user, u_debugreg[regnum]), value);
@@ -272,34 +273,158 @@ amd64_linux_dr_set (int regnum, unsigned @@ -278,34 +279,158 @@ amd64_linux_dr_set (int regnum, unsigned
} }
void void
@ -837,18 +839,18 @@ Index: gdb-6.5/gdb/amd64-linux-nat.c
/* This function is called by libthread_db as part of its handling of /* This function is called by libthread_db as part of its handling of
a request for a thread's local storage address. */ a request for a thread's local storage address. */
@@ -399,4 +524,6 @@ _initialize_amd64_linux_nat (void) @@ -406,4 +531,6 @@ _initialize_amd64_linux_nat (void)
/* Register the target. */ /* Register the target. */
linux_nat_add_target (t); linux_nat_add_target (t);
+ +
+ observer_attach_linux_new_thread (amd64_linux_new_thread); + observer_attach_linux_new_thread (amd64_linux_new_thread);
} }
Index: gdb-6.5/gdb/testsuite/gdb.threads/watchthreads.c Index: gdb-6.7/gdb/testsuite/gdb.threads/watchthreads.c
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/testsuite/gdb.threads/watchthreads.c 2006-07-12 01:55:19.000000000 -0300 --- gdb-6.7.orig/gdb/testsuite/gdb.threads/watchthreads.c 2007-08-23 20:08:50.000000000 +0200
+++ gdb-6.5/gdb/testsuite/gdb.threads/watchthreads.c 2006-07-12 01:56:51.000000000 -0300 +++ gdb-6.7/gdb/testsuite/gdb.threads/watchthreads.c 2007-10-14 23:39:04.000000000 +0200
@@ -58,7 +58,7 @@ void *thread_function(void *arg) { @@ -56,7 +56,7 @@ void *thread_function(void *arg) {
/* Don't run forever. Run just short of it :) */ /* Don't run forever. Run just short of it :) */
while (*myp > 0) while (*myp > 0)
{ {

View File

@ -1,194 +1,38 @@
Index: gdb-6.6/gdb/mi/mi-cmd-env.c [base]
2007-10-14 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.7.
Index: gdb-6.7/gdb/mi/mi-cmd-env.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/mi/mi-cmd-env.c --- gdb-6.7.orig/gdb/mi/mi-cmd-env.c 2007-10-14 23:42:39.000000000 +0200
+++ gdb-6.6/gdb/mi/mi-cmd-env.c +++ gdb-6.7/gdb/mi/mi-cmd-env.c 2007-10-14 23:42:39.000000000 +0200
@@ -126,7 +126,7 @@ mi_cmd_env_path (char *command, char **a @@ -78,7 +78,8 @@ mi_cmd_env_pwd (char *command, char **ar
static struct mi_opt opts[] =
{ /* Otherwise the mi level is 2 or higher. */
{"r", RESET_OPT, 0},
- 0
+ {0}
};
dont_repeat (); - getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
@@ -198,7 +198,7 @@ mi_cmd_env_dir (char *command, char **ar + /* Unused result. */
static struct mi_opt opts[] = + 1 && getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
{ ui_out_field_string (uiout, "cwd", gdb_dirbuf);
{"r", RESET_OPT, 0},
- 0
+ {0}
};
dont_repeat (); return MI_CMD_DONE;
Index: gdb-6.6/gdb/mi/mi-getopt.c Index: gdb-6.7/gdb/testsuite/gdb.base/move-dir.h
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/mi/mi-getopt.c --- gdb-6.7.orig/gdb/testsuite/gdb.base/move-dir.h 2007-10-14 23:31:22.000000000 +0200
+++ gdb-6.6/gdb/mi/mi-getopt.c +++ gdb-6.7/gdb/testsuite/gdb.base/move-dir.h 2007-10-14 23:42:39.000000000 +0200
@@ -82,7 +82,7 @@ mi_valid_noargs (const char *prefix, int
char *optarg;
static struct mi_opt opts[] =
{
- 0
+ {0}
};
if (mi_getopt (prefix, argc, argv, opts, &optind, &optarg) == -1)
Index: gdb-6.6/gdb/mi/mi-cmd-break.c
===================================================================
--- gdb-6.6.orig/gdb/mi/mi-cmd-break.c
+++ gdb-6.6/gdb/mi/mi-cmd-break.c
@@ -90,7 +90,7 @@ mi_cmd_break_insert (char *command, char
{"c", CONDITION_OPT, 1},
{"i", IGNORE_COUNT_OPT, 1},
{"p", THREAD_OPT, 1},
- 0
+ {0}
};
/* Parse arguments. It could be -r or -h or -t, <location> or ``--''
@@ -196,7 +196,7 @@ mi_cmd_break_watch (char *command, char
{
{"r", READ_OPT, 0},
{"a", ACCESS_OPT, 0},
- 0
+ {0}
};
/* Parse arguments. */
Index: gdb-6.6/gdb/mi/mi-cmd-disas.c
===================================================================
--- gdb-6.6.orig/gdb/mi/mi-cmd-disas.c
+++ gdb-6.6/gdb/mi/mi-cmd-disas.c
@@ -84,7 +84,7 @@ mi_cmd_disassemble (char *command, char
{"n", NUM_OPT, 1},
{"s", START_OPT, 1},
{"e", END_OPT, 1},
- 0
+ {0}
};
/* Get the options with their arguments. Keep track of what we
Index: gdb-6.6/gdb/mi/mi-main.c
===================================================================
--- gdb-6.6.orig/gdb/mi/mi-main.c
+++ gdb-6.6/gdb/mi/mi-main.c
@@ -773,7 +773,7 @@ mi_cmd_data_read_memory (char *command,
static struct mi_opt opts[] =
{
{"o", OFFSET_OPT, 1},
- 0
+ {0}
};
while (1)
@@ -973,7 +973,7 @@ mi_cmd_data_write_memory (char *command,
static struct mi_opt opts[] =
{
{"o", OFFSET_OPT, 1},
- 0
+ {0}
};
while (1)
Index: gdb-6.6/gdb/p-valprint.c
===================================================================
--- gdb-6.6.orig/gdb/p-valprint.c
+++ gdb-6.6/gdb/p-valprint.c
@@ -753,7 +753,7 @@ pascal_object_print_value_fields (struct
int dont_print_statmem)
{
int i, len, n_baseclasses;
- struct obstack tmp_obstack;
+ struct obstack tmp_obstack = {0};
char *last_dont_print = obstack_next_free (&dont_print_statmem_obstack);
CHECK_TYPEDEF (type);
@@ -922,7 +922,7 @@ pascal_object_print_value (struct type *
enum val_prettyprint pretty,
struct type **dont_print_vb)
{
- struct obstack tmp_obstack;
+ struct obstack tmp_obstack = {0};
struct type **last_dont_print
= (struct type **) obstack_next_free (&dont_print_vb_obstack);
int i, n_baseclasses = TYPE_N_BASECLASSES (type);
Index: gdb-6.6/gdb/cp-valprint.c
===================================================================
--- gdb-6.6.orig/gdb/cp-valprint.c
+++ gdb-6.6/gdb/cp-valprint.c
@@ -265,7 +265,7 @@ cp_print_value_fields (struct type *type
struct type **dont_print_vb,int dont_print_statmem)
{
int i, len, n_baseclasses;
- struct obstack tmp_obstack;
+ struct obstack tmp_obstack = {0};
char *last_dont_print = obstack_next_free (&dont_print_statmem_obstack);
int fields_seen = 0;
@@ -524,7 +524,7 @@ cp_print_value (struct type *type, struc
struct ui_file *stream, int format, int recurse,
enum val_prettyprint pretty, struct type **dont_print_vb)
{
- struct obstack tmp_obstack;
+ struct obstack tmp_obstack = {0};
struct type **last_dont_print
= (struct type **) obstack_next_free (&dont_print_vb_obstack);
int i, n_baseclasses = TYPE_N_BASECLASSES (type);
Index: gdb-6.6/gdb/tui/tui-layout.c
===================================================================
--- gdb-6.6.orig/gdb/tui/tui-layout.c
+++ gdb-6.6/gdb/tui/tui-layout.c
@@ -755,7 +755,7 @@ show_source_disasm_command (void)
if (TUI_DISASM_WIN == NULL)
{
make_disasm_window (&TUI_DISASM_WIN, asm_height, src_height - 1);
- init_and_make_win ((void **) & locator,
+ init_and_make_win ((void **)(char *) & locator,
LOCATOR_WIN,
2 /* 1 */ ,
tui_term_width (),
@@ -848,7 +848,7 @@ show_data (enum tui_layout_type new_layo
make_source_window (&tui_win_list[win_type], src_height, data_height - 1);
else
make_disasm_window (&tui_win_list[win_type], src_height, data_height - 1);
- init_and_make_win ((void **) & locator,
+ init_and_make_win ((void **)(char *) & locator,
LOCATOR_WIN,
2 /* 1 */ ,
tui_term_width (),
@@ -963,7 +963,7 @@ make_source_or_disasm_window (struct tui
execution_info = tui_source_exec_info_win_ptr ();
else
execution_info = tui_disassem_exec_info_win_ptr ();
- init_and_make_win ((void **) & execution_info,
+ init_and_make_win ((void **)(char *) & execution_info,
EXEC_INFO_WIN,
height,
3,
@@ -1013,7 +1013,7 @@ show_source_or_disasm_and_command (enum
make_source_window (win_info_ptr, src_height - 1, 0);
else
make_disasm_window (win_info_ptr, src_height - 1, 0);
- init_and_make_win ((void **) & locator,
+ init_and_make_win ((void **)(char *) & locator,
LOCATOR_WIN,
2 /* 1 */ ,
tui_term_width (),
Index: gdb-6.6/gdb/testsuite/gdb.base/move-dir.h
===================================================================
--- gdb-6.6.orig/gdb/testsuite/gdb.base/move-dir.h
+++ gdb-6.6/gdb/testsuite/gdb.base/move-dir.h
@@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
-#include <stdlib.h> -#include <stdlib.h>
+#include <stdio.h> +#include <stdio.h>
void other() { void other() {
const char* ostring = "other"; const char* ostring = "other";
Index: gdb-6.6/gdb/testsuite/gdb.base/sigrepeat.c Index: gdb-6.7/gdb/testsuite/gdb.base/sigrepeat.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/testsuite/gdb.base/sigrepeat.c --- gdb-6.7.orig/gdb/testsuite/gdb.base/sigrepeat.c 2007-08-23 20:08:49.000000000 +0200
+++ gdb-6.6/gdb/testsuite/gdb.base/sigrepeat.c +++ gdb-6.7/gdb/testsuite/gdb.base/sigrepeat.c 2007-10-14 23:42:39.000000000 +0200
@@ -22,6 +22,7 @@ @@ -21,6 +21,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <signal.h> #include <signal.h>
@ -196,11 +40,11 @@ Index: gdb-6.6/gdb/testsuite/gdb.base/sigrepeat.c
#include <sys/time.h> #include <sys/time.h>
static volatile int done[2]; static volatile int done[2];
Index: gdb-6.6/gdb/s390-tdep.c Index: gdb-6.7/gdb/s390-tdep.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/s390-tdep.c --- gdb-6.7.orig/gdb/s390-tdep.c 2007-10-02 21:26:42.000000000 +0200
+++ gdb-6.6/gdb/s390-tdep.c +++ gdb-6.7/gdb/s390-tdep.c 2007-10-14 23:42:39.000000000 +0200
@@ -2277,6 +2277,9 @@ s390_return_value (struct gdbarch *gdbar @@ -2214,6 +2214,9 @@ s390_return_value (struct gdbarch *gdbar
case RETURN_VALUE_STRUCT_CONVENTION: case RETURN_VALUE_STRUCT_CONVENTION:
error (_("Cannot set function return value.")); error (_("Cannot set function return value."));
break; break;
@ -210,7 +54,7 @@ Index: gdb-6.6/gdb/s390-tdep.c
} }
} }
else if (out) else if (out)
@@ -2309,6 +2312,9 @@ s390_return_value (struct gdbarch *gdbar @@ -2246,6 +2249,9 @@ s390_return_value (struct gdbarch *gdbar
case RETURN_VALUE_STRUCT_CONVENTION: case RETURN_VALUE_STRUCT_CONVENTION:
error (_("Function return value unknown.")); error (_("Function return value unknown."));
break; break;
@ -220,27 +64,10 @@ Index: gdb-6.6/gdb/s390-tdep.c
} }
} }
Index: gdb-6.6/gdb/remote.c Index: gdb-6.7/gdb/f-exp.y
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/remote.c --- gdb-6.7.orig/gdb/f-exp.y 2007-06-12 17:33:03.000000000 +0200
+++ gdb-6.6/gdb/remote.c +++ gdb-6.7/gdb/f-exp.y 2007-10-14 23:42:39.000000000 +0200
@@ -2843,10 +2843,10 @@ cleanup_sigint_signal_handler (void *dum
{
signal (SIGINT, handle_sigint);
if (sigint_remote_twice_token)
- delete_async_signal_handler ((struct async_signal_handler **)
+ delete_async_signal_handler ((struct async_signal_handler **) (char *)
&sigint_remote_twice_token);
if (sigint_remote_token)
- delete_async_signal_handler ((struct async_signal_handler **)
+ delete_async_signal_handler ((struct async_signal_handler **) (char *)
&sigint_remote_token);
}
Index: gdb-6.6/gdb/f-exp.y
===================================================================
--- gdb-6.6.orig/gdb/f-exp.y
+++ gdb-6.6/gdb/f-exp.y
@@ -567,6 +567,8 @@ ptype : typebase @@ -567,6 +567,8 @@ ptype : typebase
case tp_function: case tp_function:
follow_type = lookup_function_type (follow_type); follow_type = lookup_function_type (follow_type);
@ -250,48 +77,11 @@ Index: gdb-6.6/gdb/f-exp.y
} }
$$ = follow_type; $$ = follow_type;
} }
Index: gdb-6.6/gdb/remote-fileio.c Index: gdb-6.7/gdb/source.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/remote-fileio.c --- gdb-6.7.orig/gdb/source.c 2007-08-23 20:08:38.000000000 +0200
+++ gdb-6.6/gdb/remote-fileio.c +++ gdb-6.7/gdb/source.c 2007-10-14 23:42:39.000000000 +0200
@@ -1332,19 +1332,19 @@ static struct { @@ -170,7 +170,7 @@ get_current_source_symtab_and_line (void
char *name;
void (*func)(char *);
} remote_fio_func_map[] = {
- "open", remote_fileio_func_open,
- "close", remote_fileio_func_close,
- "read", remote_fileio_func_read,
- "write", remote_fileio_func_write,
- "lseek", remote_fileio_func_lseek,
- "rename", remote_fileio_func_rename,
- "unlink", remote_fileio_func_unlink,
- "stat", remote_fileio_func_stat,
- "fstat", remote_fileio_func_fstat,
- "gettimeofday", remote_fileio_func_gettimeofday,
- "isatty", remote_fileio_func_isatty,
- "system", remote_fileio_func_system,
- NULL, NULL
+ {"open", remote_fileio_func_open},
+ {"close", remote_fileio_func_close},
+ {"read", remote_fileio_func_read},
+ {"write", remote_fileio_func_write},
+ {"lseek", remote_fileio_func_lseek},
+ {"rename", remote_fileio_func_rename},
+ {"unlink", remote_fileio_func_unlink},
+ {"stat", remote_fileio_func_stat},
+ {"fstat", remote_fileio_func_fstat},
+ {"gettimeofday", remote_fileio_func_gettimeofday},
+ {"isatty", remote_fileio_func_isatty},
+ {"system", remote_fileio_func_system},
+ {NULL, NULL}
};
static int
Index: gdb-6.6/gdb/source.c
===================================================================
--- gdb-6.6.orig/gdb/source.c
+++ gdb-6.6/gdb/source.c
@@ -172,7 +172,7 @@ get_current_source_symtab_and_line (void
void void
set_default_source_symtab_and_line (void) set_default_source_symtab_and_line (void)
{ {
@ -300,7 +90,7 @@ Index: gdb-6.6/gdb/source.c
if (!have_full_symbols () && !have_partial_symbols ()) if (!have_full_symbols () && !have_partial_symbols ())
error (_("No symbol table is loaded. Use the \"file\" command.")); error (_("No symbol table is loaded. Use the \"file\" command."));
@@ -1428,7 +1428,7 @@ static void @@ -1439,7 +1439,7 @@ static void
line_info (char *arg, int from_tty) line_info (char *arg, int from_tty)
{ {
struct symtabs_and_lines sals; struct symtabs_and_lines sals;
@ -309,92 +99,24 @@ Index: gdb-6.6/gdb/source.c
CORE_ADDR start_pc, end_pc; CORE_ADDR start_pc, end_pc;
int i; int i;
Index: gdb-6.6/gdb/symfile.c Index: gdb-6.7/gdb/linespec.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/symfile.c --- gdb-6.7.orig/gdb/linespec.c 2007-10-14 23:31:03.000000000 +0200
+++ gdb-6.6/gdb/symfile.c +++ gdb-6.7/gdb/linespec.c 2007-10-14 23:53:57.000000000 +0200
@@ -2933,6 +2933,8 @@ add_psymbol_with_dem_name_to_list (char @@ -1654,7 +1654,7 @@ static struct symtabs_and_lines
deprecated_bcache (buf, dem_namelength + 1, objfile->psymbol_cache);
break;
/* FIXME What should be done for the default case? Ignoring for now. */
+ default:
+ break;
}
/* val and coreaddr are mutually exclusive, one of them *will* be zero */
Index: gdb-6.6/gdb/linespec.c
===================================================================
--- gdb-6.6.orig/gdb/linespec.c
+++ gdb-6.6/gdb/linespec.c
@@ -1631,7 +1631,7 @@ static struct symtabs_and_lines
find_method (int funfirstline, char ***canonical, char *saved_arg, find_method (int funfirstline, char ***canonical, char *saved_arg,
char *copy, struct type *t, struct symbol *sym_class) char *copy, struct type *t, struct symbol *sym_class)
{ {
- struct symtabs_and_lines values; - struct symtabs_and_lines values;
+ struct symtabs_and_lines values = {0}; + struct symtabs_and_lines values = { NULL };
struct symbol *sym = 0; struct symbol *sym = NULL;
int i1; /* Counter for the symbol array. */ int i1; /* Counter for the symbol array. */
struct symbol **sym_arr = alloca (total_number_of_methods (t) struct symbol **sym_arr = alloca (total_number_of_methods (t)
Index: gdb-6.6/gdb/macroscope.c Index: gdb-6.7/gdb/gdb-events.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/macroscope.c --- gdb-6.7.orig/gdb/gdb-events.c 2007-08-23 20:08:31.000000000 +0200
+++ gdb-6.6/gdb/macroscope.c +++ gdb-6.7/gdb/gdb-events.c 2007-10-14 23:42:39.000000000 +0200
@@ -33,7 +33,7 @@ @@ -319,6 +319,8 @@ gdb_events_deliver (struct gdb_events *v
struct macro_scope *
sal_macro_scope (struct symtab_and_line sal)
{
- struct macro_source_file *main, *inclusion;
+ struct macro_source_file *main_sf, *inclusion;
struct macro_scope *ms;
if (! sal.symtab
@@ -42,8 +42,8 @@ sal_macro_scope (struct symtab_and_line
ms = (struct macro_scope *) xmalloc (sizeof (*ms));
- main = macro_main (sal.symtab->macro_table);
- inclusion = macro_lookup_inclusion (main, sal.symtab->filename);
+ main_sf = macro_main (sal.symtab->macro_table);
+ inclusion = macro_lookup_inclusion (main_sf, sal.symtab->filename);
if (inclusion)
{
@@ -66,7 +66,7 @@ sal_macro_scope (struct symtab_and_line
For the time being, though, we'll just treat these as
occurring at the end of the main source file. */
- ms->file = main;
+ ms->file = main_sf;
ms->line = -1;
complaint (&symfile_complaints,
@@ -83,7 +83,6 @@ struct macro_scope *
default_macro_scope (void)
{
struct symtab_and_line sal;
- struct macro_source_file *main;
struct macro_scope *ms;
/* If there's a selected frame, use its PC. */
Index: gdb-6.6/gdb/target.c
===================================================================
--- gdb-6.6.orig/gdb/target.c
+++ gdb-6.6/gdb/target.c
@@ -1045,6 +1045,9 @@ memory_xfer_partial (struct target_ops *
if (writebuf != NULL)
error (_("Writing to flash memory forbidden in this context"));
break;
+
+ default:
+ break;
}
if (region->attrib.cache)
Index: gdb-6.6/gdb/gdb-events.c
===================================================================
--- gdb-6.6.orig/gdb/gdb-events.c
+++ gdb-6.6/gdb/gdb-events.c
@@ -321,6 +321,8 @@ gdb_events_deliver (struct gdb_events *v
case architecture_changed: case architecture_changed:
vector->architecture_changed (); vector->architecture_changed ();
break; break;
@ -403,11 +125,11 @@ Index: gdb-6.6/gdb/gdb-events.c
} }
delivering_events = event->next; delivering_events = event->next;
xfree (event); xfree (event);
Index: gdb-6.6/gdb/dwarf2read.c Index: gdb-6.7/gdb/dwarf2read.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/dwarf2read.c --- gdb-6.7.orig/gdb/dwarf2read.c 2007-10-14 23:31:22.000000000 +0200
+++ gdb-6.6/gdb/dwarf2read.c +++ gdb-6.7/gdb/dwarf2read.c 2007-10-14 23:42:39.000000000 +0200
@@ -9307,6 +9307,7 @@ dwarf_decode_macros (struct line_header @@ -9585,6 +9585,7 @@ dwarf_decode_macros (struct line_header
for (;;) for (;;)
{ {
enum dwarf_macinfo_record_type macinfo_type; enum dwarf_macinfo_record_type macinfo_type;
@ -415,7 +137,7 @@ Index: gdb-6.6/gdb/dwarf2read.c
/* Do we at least have room for a macinfo type byte? */ /* Do we at least have room for a macinfo type byte? */
if (mac_ptr >= mac_end) if (mac_ptr >= mac_end)
@@ -9318,13 +9319,16 @@ dwarf_decode_macros (struct line_header @@ -9596,13 +9597,16 @@ dwarf_decode_macros (struct line_header
macinfo_type = read_1_byte (abfd, mac_ptr); macinfo_type = read_1_byte (abfd, mac_ptr);
mac_ptr++; mac_ptr++;
@ -437,11 +159,11 @@ Index: gdb-6.6/gdb/dwarf2read.c
case DW_MACINFO_define: case DW_MACINFO_define:
case DW_MACINFO_undef: case DW_MACINFO_undef:
{ {
Index: gdb-6.6/gdb/stabsread.c Index: gdb-6.7/gdb/stabsread.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/stabsread.c --- gdb-6.7.orig/gdb/stabsread.c 2007-10-09 00:44:32.000000000 +0200
+++ gdb-6.6/gdb/stabsread.c +++ gdb-6.7/gdb/stabsread.c 2007-10-14 23:42:39.000000000 +0200
@@ -1794,7 +1794,8 @@ again: @@ -1842,7 +1842,8 @@ again:
struct type *domain = read_type (pp, objfile); struct type *domain = read_type (pp, objfile);
struct type *return_type; struct type *return_type;
struct field *args; struct field *args;
@ -451,11 +173,11 @@ Index: gdb-6.6/gdb/stabsread.c
if (**pp != ',') if (**pp != ',')
/* Invalid member type data format. */ /* Invalid member type data format. */
Index: gdb-6.6/gdb/dwarf2expr.c Index: gdb-6.7/gdb/dwarf2expr.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/dwarf2expr.c --- gdb-6.7.orig/gdb/dwarf2expr.c 2007-08-23 20:08:28.000000000 +0200
+++ gdb-6.6/gdb/dwarf2expr.c +++ gdb-6.7/gdb/dwarf2expr.c 2007-10-14 23:42:39.000000000 +0200
@@ -559,6 +559,8 @@ execute_stack_op (struct dwarf_expr_cont @@ -594,6 +594,8 @@ execute_stack_op (struct dwarf_expr_cont
op_ptr = read_uleb128 (op_ptr, op_end, &reg); op_ptr = read_uleb128 (op_ptr, op_end, &reg);
result += reg; result += reg;
break; break;
@ -464,24 +186,11 @@ Index: gdb-6.6/gdb/dwarf2expr.c
} }
break; break;
Index: gdb-6.6/gdb/varobj.c Index: gdb-6.7/gdb/varobj.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/varobj.c --- gdb-6.7.orig/gdb/varobj.c 2007-10-13 05:29:58.000000000 +0200
+++ gdb-6.6/gdb/varobj.c +++ gdb-6.7/gdb/varobj.c 2007-10-14 23:42:39.000000000 +0200
@@ -325,10 +325,9 @@ struct language_specific @@ -347,8 +347,7 @@ static struct language_specific language
/* Array of known source language routines. */
static struct language_specific
- languages[vlang_end][sizeof (struct language_specific)] = {
+ languages[vlang_end] = {
/* Unknown (try treating as C */
- {
- vlang_unknown,
+ {vlang_unknown,
c_number_of_children,
c_name_of_variable,
c_name_of_child,
@@ -339,8 +338,7 @@ static struct language_specific
c_value_of_variable} c_value_of_variable}
, ,
/* C */ /* C */
@ -491,7 +200,7 @@ Index: gdb-6.6/gdb/varobj.c
c_number_of_children, c_number_of_children,
c_name_of_variable, c_name_of_variable,
c_name_of_child, c_name_of_child,
@@ -351,8 +349,7 @@ static struct language_specific @@ -360,8 +359,7 @@ static struct language_specific language
c_value_of_variable} c_value_of_variable}
, ,
/* C++ */ /* C++ */
@ -501,7 +210,7 @@ Index: gdb-6.6/gdb/varobj.c
cplus_number_of_children, cplus_number_of_children,
cplus_name_of_variable, cplus_name_of_variable,
cplus_name_of_child, cplus_name_of_child,
@@ -363,8 +360,7 @@ static struct language_specific @@ -373,8 +371,7 @@ static struct language_specific language
cplus_value_of_variable} cplus_value_of_variable}
, ,
/* Java */ /* Java */
@ -511,20 +220,11 @@ Index: gdb-6.6/gdb/varobj.c
java_number_of_children, java_number_of_children,
java_name_of_variable, java_name_of_variable,
java_name_of_child, java_name_of_child,
@@ -519,7 +515,7 @@ varobj_create (char *objname, Index: gdb-6.7/gdb/doublest.c
/* Set language info */
lang = variable_language (var);
- var->root->lang = languages[lang];
+ var->root->lang = &languages[lang];
/* Set ourselves as our root */
var->root->rootvar = var;
Index: gdb-6.6/gdb/doublest.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/doublest.c --- gdb-6.7.orig/gdb/doublest.c 2007-08-23 20:08:28.000000000 +0200
+++ gdb-6.6/gdb/doublest.c +++ gdb-6.7/gdb/doublest.c 2007-10-14 23:42:39.000000000 +0200
@@ -94,15 +94,10 @@ get_field (const bfd_byte *data, enum fl @@ -92,15 +92,10 @@ get_field (const bfd_byte *data, enum fl
{ {
result |= (unsigned long)*(data + cur_byte) << cur_bitshift; result |= (unsigned long)*(data + cur_byte) << cur_bitshift;
cur_bitshift += FLOATFORMAT_CHAR_BIT; cur_bitshift += FLOATFORMAT_CHAR_BIT;
@ -544,10 +244,11 @@ Index: gdb-6.6/gdb/doublest.c
} }
if (len < sizeof(result) * FLOATFORMAT_CHAR_BIT) if (len < sizeof(result) * FLOATFORMAT_CHAR_BIT)
/* Mask out bits which are not part of the field */ /* Mask out bits which are not part of the field */
diff -u -rup gdb-6.6-orig/gdb/cli/cli-cmds.c gdb-6.6/gdb/cli/cli-cmds.c Index: gdb-6.7/gdb/cli/cli-cmds.c
--- gdb-6.6-orig/gdb/cli/cli-cmds.c 2007-04-08 20:49:09.000000000 +0200 ===================================================================
+++ gdb-6.6/gdb/cli/cli-cmds.c 2007-04-08 20:54:49.000000000 +0200 --- gdb-6.7.orig/gdb/cli/cli-cmds.c 2007-08-23 20:08:47.000000000 +0200
@@ -323,7 +323,8 @@ pwd_command (char *args, int from_tty) +++ gdb-6.7/gdb/cli/cli-cmds.c 2007-10-14 23:42:39.000000000 +0200
@@ -320,7 +320,8 @@ pwd_command (char *args, int from_tty)
{ {
if (args) if (args)
error (_("The \"pwd\" command does not take an argument: %s"), args); error (_("The \"pwd\" command does not take an argument: %s"), args);
@ -557,10 +258,11 @@ diff -u -rup gdb-6.6-orig/gdb/cli/cli-cmds.c gdb-6.6/gdb/cli/cli-cmds.c
if (strcmp (gdb_dirbuf, current_directory) != 0) if (strcmp (gdb_dirbuf, current_directory) != 0)
printf_unfiltered (_("Working directory %s\n (canonically %s).\n"), printf_unfiltered (_("Working directory %s\n (canonically %s).\n"),
diff -u -rup gdb-6.6-orig/gdb/inflow.c gdb-6.6/gdb/inflow.c Index: gdb-6.7/gdb/inflow.c
--- gdb-6.6-orig/gdb/inflow.c 2006-02-10 23:01:43.000000000 +0100 ===================================================================
+++ gdb-6.6/gdb/inflow.c 2007-04-08 20:56:48.000000000 +0200 --- gdb-6.7.orig/gdb/inflow.c 2007-08-23 20:08:35.000000000 +0200
@@ -549,17 +549,20 @@ new_tty (void) +++ gdb-6.7/gdb/inflow.c 2007-10-14 23:42:39.000000000 +0200
@@ -547,17 +547,20 @@ new_tty (void)
if (tty != 0) if (tty != 0)
{ {
close (0); close (0);
@ -584,12 +286,13 @@ diff -u -rup gdb-6.6-orig/gdb/inflow.c gdb-6.6/gdb/inflow.c
} }
if (tty > 2) if (tty > 2)
close (tty); close (tty);
diff -u -rup gdb-6.6-orig/gdb/linux-nat.c gdb-6.6/gdb/linux-nat.c Index: gdb-6.7/gdb/linux-nat.c
--- gdb-6.6-orig/gdb/linux-nat.c 2007-04-08 20:49:11.000000000 +0200 ===================================================================
+++ gdb-6.6/gdb/linux-nat.c 2007-04-08 20:54:08.000000000 +0200 --- gdb-6.7.orig/gdb/linux-nat.c 2007-10-14 23:31:22.000000000 +0200
@@ -2972,7 +2972,8 @@ linux_nat_info_proc_cmd (char *args, int +++ gdb-6.7/gdb/linux-nat.c 2007-10-14 23:42:39.000000000 +0200
@@ -2895,7 +2895,8 @@ linux_nat_info_proc_cmd (char *args, int
sprintf (fname1, "/proc/%lld/cmdline", pid); sprintf (fname1, "/proc/%lld/cmdline", pid);
if ((procfile = fopen (fname1, "r")) > 0) if ((procfile = fopen (fname1, "r")) != NULL)
{ {
- fgets (buffer, sizeof (buffer), procfile); - fgets (buffer, sizeof (buffer), procfile);
+ /* Unused result. */ + /* Unused result. */
@ -597,10 +300,11 @@ diff -u -rup gdb-6.6-orig/gdb/linux-nat.c gdb-6.6/gdb/linux-nat.c
printf_filtered ("cmdline = '%s'\n", buffer); printf_filtered ("cmdline = '%s'\n", buffer);
fclose (procfile); fclose (procfile);
} }
diff -u -rup gdb-6.6-orig/gdb/main.c gdb-6.6/gdb/main.c Index: gdb-6.7/gdb/main.c
--- gdb-6.6-orig/gdb/main.c 2007-04-08 20:49:09.000000000 +0200 ===================================================================
+++ gdb-6.6/gdb/main.c 2007-04-08 20:55:30.000000000 +0200 --- gdb-6.7.orig/gdb/main.c 2007-08-23 20:08:36.000000000 +0200
@@ -195,7 +195,8 @@ captured_main (void *data) +++ gdb-6.7/gdb/main.c 2007-10-14 23:42:39.000000000 +0200
@@ -193,7 +193,8 @@ captured_main (void *data)
line[0] = '\0'; /* Terminate saved (now empty) cmd line */ line[0] = '\0'; /* Terminate saved (now empty) cmd line */
instream = stdin; instream = stdin;
@ -610,23 +314,11 @@ diff -u -rup gdb-6.6-orig/gdb/main.c gdb-6.6/gdb/main.c
current_directory = gdb_dirbuf; current_directory = gdb_dirbuf;
gdb_stdout = stdio_fileopen (stdout); gdb_stdout = stdio_fileopen (stdout);
diff -u -rup gdb-6.6-orig/gdb/mi/mi-cmd-env.c gdb-6.6/gdb/mi/mi-cmd-env.c Index: gdb-6.7/gdb/top.c
--- gdb-6.6-orig/gdb/mi/mi-cmd-env.c 2007-04-08 20:49:09.000000000 +0200 ===================================================================
+++ gdb-6.6/gdb/mi/mi-cmd-env.c 2007-04-08 20:55:11.000000000 +0200 --- gdb-6.7.orig/gdb/top.c 2007-10-14 23:38:27.000000000 +0200
@@ -80,7 +80,8 @@ mi_cmd_env_pwd (char *command, char **ar +++ gdb-6.7/gdb/top.c 2007-10-14 23:42:39.000000000 +0200
@@ -1636,7 +1636,8 @@ gdb_init (char *argv0)
/* Otherwise the mi level is 2 or higher. */
- getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
+ /* Unused result. */
+ 1 && getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
ui_out_field_string (uiout, "cwd", gdb_dirbuf);
return MI_CMD_DONE;
diff -u -rup gdb-6.6-orig/gdb/top.c gdb-6.6/gdb/top.c
--- gdb-6.6-orig/gdb/top.c 2007-04-08 20:49:10.000000000 +0200
+++ gdb-6.6/gdb/top.c 2007-04-08 20:55:46.000000000 +0200
@@ -1643,7 +1643,8 @@ gdb_init (char *argv0)
/* Run the init function of each source file */ /* Run the init function of each source file */
@ -636,10 +328,11 @@ diff -u -rup gdb-6.6-orig/gdb/top.c gdb-6.6/gdb/top.c
current_directory = gdb_dirbuf; current_directory = gdb_dirbuf;
#ifdef __MSDOS__ #ifdef __MSDOS__
diff -u -rup gdb-6.6-orig/gdb/ui-file.c gdb-6.6/gdb/ui-file.c Index: gdb-6.7/gdb/ui-file.c
--- gdb-6.6-orig/gdb/ui-file.c 2005-12-17 23:34:03.000000000 +0100 ===================================================================
+++ gdb-6.6/gdb/ui-file.c 2007-04-08 20:56:21.000000000 +0200 --- gdb-6.7.orig/gdb/ui-file.c 2007-08-23 20:08:46.000000000 +0200
@@ -482,7 +482,8 @@ stdio_file_write (struct ui_file *file, +++ gdb-6.7/gdb/ui-file.c 2007-10-14 23:42:39.000000000 +0200
@@ -480,7 +480,8 @@ stdio_file_write (struct ui_file *file,
if (stdio->magic != &stdio_file_magic) if (stdio->magic != &stdio_file_magic)
internal_error (__FILE__, __LINE__, internal_error (__FILE__, __LINE__,
_("stdio_file_write: bad magic number")); _("stdio_file_write: bad magic number"));
@ -649,10 +342,11 @@ diff -u -rup gdb-6.6-orig/gdb/ui-file.c gdb-6.6/gdb/ui-file.c
} }
static void static void
diff -u -rup gdb-6.6-orig/gdb/utils.c gdb-6.6/gdb/utils.c Index: gdb-6.7/gdb/utils.c
--- gdb-6.6-orig/gdb/utils.c 2007-04-08 20:49:09.000000000 +0200 ===================================================================
+++ gdb-6.6/gdb/utils.c 2007-04-08 20:56:01.000000000 +0200 --- gdb-6.7.orig/gdb/utils.c 2007-08-23 20:08:46.000000000 +0200
@@ -718,7 +718,8 @@ internal_vproblem (struct internal_probl +++ gdb-6.7/gdb/utils.c 2007-10-14 23:42:39.000000000 +0200
@@ -716,7 +716,8 @@ internal_vproblem (struct internal_probl
abort (); /* NOTE: GDB has only three calls to abort(). */ abort (); /* NOTE: GDB has only three calls to abort(). */
default: default:
dejavu = 3; dejavu = 3;
@ -662,9 +356,11 @@ diff -u -rup gdb-6.6-orig/gdb/utils.c gdb-6.6/gdb/utils.c
exit (1); exit (1);
} }
} }
--- ./gdb/gdbserver/gdbreplay.c 29 Mar 2007 01:06:47 -0000 1.14 Index: gdb-6.7/gdb/gdbserver/gdbreplay.c
+++ ./gdb/gdbserver/gdbreplay.c 8 Aug 2007 20:32:12 -0000 ===================================================================
@@ -358,7 +358,12 @@ expect (FILE *fp) --- gdb-6.7.orig/gdb/gdbserver/gdbreplay.c 2007-08-23 20:08:48.000000000 +0200
+++ gdb-6.7/gdb/gdbserver/gdbreplay.c 2007-10-14 23:42:39.000000000 +0200
@@ -356,7 +356,12 @@ expect (FILE *fp)
{ {
break; break;
} }
@ -678,7 +374,7 @@ diff -u -rup gdb-6.6-orig/gdb/utils.c gdb-6.6/gdb/utils.c
} }
while (fromlog == fromgdb); while (fromlog == fromgdb);
if (fromlog != EOL) if (fromlog != EOL)
@@ -385,7 +390,11 @@ play (FILE *fp) @@ -383,7 +388,11 @@ play (FILE *fp)
while ((fromlog = logchar (fp)) != EOL) while ((fromlog = logchar (fp)) != EOL)
{ {
ch = fromlog; ch = fromlog;

View File

@ -1,351 +0,0 @@
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=109921
2007-01-09 Jan Kratochvil <jan.kratochvil@redhat.com>
* buildsym.c (start_subfile_index): Renamed `start_subfile' now
supporting the FILE_INDEX parameter.
(start_subfile): Backward compatible stub for `start_subfile_index'.
(end_symtab): Resolve new SYMBOL.FILE.SYMTAB from SYMBOL.FILE.INDEX.
Substitute possibly missing DIRNAME from the CU's main file DIRNAME.
Clear `subfiles' variable as its data have been deallocated.
* buildsym.h (struct subfile): New field `file_index'.
(start_subfile_index): New prototype.
* dwarf2read.c (add_file_name): Ensure subfile has been founded.
(dwarf_decode_lines): Specify the new FILE_INDEX parameter.
(dwarf2_start_subfile): New FILE_INDEX parameter.
(new_symbol): Extract `DW_AT_decl_file' DWARF 2 information entry.
* symtab.c (lookup_symbol): Override by the new SYMBOL.FILE.SYMTAB.
(search_symbols): Likewise.
* symtab.h (struct symbol): New fields FILE.INDEX and FILE.SYMTAB.
(SYMBOL_FILE_INDEX, SYMBOL_FILE_SYMTAB): New macros.
Index: gdb-6.6/gdb/buildsym.c
===================================================================
--- gdb-6.6.orig/gdb/buildsym.c 2006-08-25 18:32:32.000000000 +0200
+++ gdb-6.6/gdb/buildsym.c 2007-01-20 13:59:48.000000000 +0100
@@ -540,7 +540,7 @@ make_blockvector (struct objfile *objfil
the directory in which it resides (or NULL if not known). */
void
-start_subfile (char *name, char *dirname)
+start_subfile_index (char *name, char *dirname, unsigned file_index)
{
struct subfile *subfile;
@@ -552,6 +552,17 @@ start_subfile (char *name, char *dirname
if (FILENAME_CMP (subfile->name, name) == 0)
{
current_subfile = subfile;
+
+ if (subfile->file_index != 0 && file_index != 0
+ && subfile->file_index != file_index)
+ complaint (&symfile_complaints, _("Filenames indexing conflict: "
+ "name \"%s\" dir \"%s\" index %u vs. "
+ "name \"%s\" dir \"%s\" index %u"),
+ subfile->name, subfile->dirname, subfile->file_index,
+ name, dirname, file_index);
+ if (subfile->file_index == 0)
+ subfile->file_index = file_index;
+
return;
}
}
@@ -567,6 +578,7 @@ start_subfile (char *name, char *dirname
current_subfile = subfile;
/* Save its name and compilation directory name */
+ subfile->file_index = file_index;
subfile->name = (name == NULL) ? NULL : savestring (name, strlen (name));
subfile->dirname =
(dirname == NULL) ? NULL : savestring (dirname, strlen (dirname));
@@ -622,6 +634,13 @@ start_subfile (char *name, char *dirname
}
}
+/* Backward compatibility. */
+void
+start_subfile (char *name, char *dirname)
+{
+ start_subfile_index (name, dirname, 0);
+}
+
/* For stabs readers, the first N_SO symbol is assumed to be the
source file name, and the subfile struct is initialized using that
assumption. If another N_SO symbol is later seen, immediately
@@ -821,9 +840,12 @@ end_symtab (CORE_ADDR end_addr, struct o
{
struct symtab *symtab = NULL;
struct blockvector *blockvector;
- struct subfile *subfile;
+ struct subfile *subfile, *subfile_main;
struct context_stack *cstk;
struct subfile *nextsub;
+ int subfiles_count;
+ struct symtab **file_index_to_symtab;
+ size_t file_index_to_symtab_size;
/* Finish the lexical context of the last function in the file; pop
the context stack. */
@@ -921,6 +943,18 @@ end_symtab (CORE_ADDR end_addr, struct o
#endif
PROCESS_LINENUMBER_HOOK (); /* Needed for xcoff. */
+ /* Get the last subfile s SUBFILE_MAIN which is the main file of CU.
+ Count SUBFILES_COUNT.
+ Start with 1 as we do not iterate past the last item. */
+ subfiles_count = 1;
+ for (subfile_main = subfiles; subfile_main && subfile_main->next;
+ subfile_main = subfile_main->next)
+ subfiles_count++;
+
+ file_index_to_symtab_size = sizeof (*file_index_to_symtab) * subfiles_count;
+ file_index_to_symtab = xmalloc (file_index_to_symtab_size);
+ memset ((char *) file_index_to_symtab, 0, file_index_to_symtab_size);
+
/* Now create the symtab objects proper, one for each subfile. */
/* (The main file is the last one on the chain.) */
@@ -981,6 +1015,16 @@ end_symtab (CORE_ADDR end_addr, struct o
strlen (subfile->dirname) + 1);
strcpy (symtab->dirname, subfile->dirname);
}
+ /* Non-primary subfiles may miss COMP_DIR resulting in NULL
+ DIRNAME and so default it from the CU file - SUBFILE_MAIN. */
+ else if (subfile_main->dirname)
+ {
+ /* Reallocate the dirname on the symbol obstack */
+ symtab->dirname = (char *)
+ obstack_alloc (&objfile->objfile_obstack,
+ strlen (subfile_main->dirname) + 1);
+ strcpy (symtab->dirname, subfile_main->dirname);
+ }
else
{
symtab->dirname = NULL;
@@ -1009,6 +1053,13 @@ end_symtab (CORE_ADDR end_addr, struct o
but the main file. */
symtab->primary = 0;
+
+ /* It may be zero for files unlisted in File Table. */
+ if (subfile->file_index)
+ {
+ gdb_assert (subfile->file_index <= subfiles_count);
+ file_index_to_symtab[subfile->file_index - 1] = symtab;
+ }
}
if (subfile->name != NULL)
{
@@ -1037,9 +1088,40 @@ end_symtab (CORE_ADDR end_addr, struct o
symtab->primary = 1;
}
+ /* Resolve `struct symbol.file.index' into `struct symbol.file.symtab'. */
+ if (blockvector)
+ {
+ int block_i;
+
+ for (block_i = 0; block_i < BLOCKVECTOR_NBLOCKS (blockvector); block_i++)
+ {
+ struct symbol *sym;
+ struct dict_iterator iter;
+
+ for (sym = dict_iterator_first (BLOCK_DICT
+ (BLOCKVECTOR_BLOCK (blockvector, block_i)), &iter);
+ sym != NULL;
+ sym = dict_iterator_next (&iter))
+ {
+ /* Beware the ordering as `sym->file' is a union. */
+ if (SYMBOL_FILE_INDEX (sym)
+ && file_index_to_symtab[SYMBOL_FILE_INDEX (sym) - 1])
+ SYMBOL_FILE_SYMTAB (sym) = file_index_to_symtab
+ [SYMBOL_FILE_INDEX (sym) - 1];
+ else
+ {
+ /* Default to the primary symbol table, never use NULL. */
+ SYMBOL_FILE_SYMTAB (sym) = symtab;
+ }
+ }
+ }
+ }
+
+ xfree (file_index_to_symtab);
last_source_file = NULL;
current_subfile = NULL;
pending_macros = NULL;
+ subfiles = NULL;
return symtab;
}
Index: gdb-6.6/gdb/buildsym.h
===================================================================
--- gdb-6.6.orig/gdb/buildsym.h 2005-12-17 23:33:59.000000000 +0100
+++ gdb-6.6/gdb/buildsym.h 2007-01-20 13:59:48.000000000 +0100
@@ -63,6 +63,7 @@ EXTERN CORE_ADDR last_source_start_addr;
struct subfile
{
struct subfile *next;
+ unsigned file_index;
char *name;
char *dirname;
struct linetable *line_vector;
@@ -240,6 +241,9 @@ extern void finish_block (struct symbol
extern void really_free_pendings (void *dummy);
+extern void start_subfile_index (char *name, char *dirname,
+ unsigned file_index);
+
extern void start_subfile (char *name, char *dirname);
extern void patch_subfile_names (struct subfile *subfile, char *name);
Index: gdb-6.6/gdb/dwarf2read.c
===================================================================
--- gdb-6.6.orig/gdb/dwarf2read.c 2007-01-20 06:43:04.000000000 +0100
+++ gdb-6.6/gdb/dwarf2read.c 2007-01-20 14:00:12.000000000 +0100
@@ -853,7 +853,7 @@ static struct line_header *(dwarf_decode
static void dwarf_decode_lines (struct line_header *, char *, bfd *,
struct dwarf2_cu *, struct partial_symtab *);
-static void dwarf2_start_subfile (char *, char *, char *);
+static void dwarf2_start_subfile (char *, char *, char *, unsigned);
static struct symbol *new_symbol (struct die_info *, struct type *,
struct dwarf2_cu *);
@@ -6428,6 +6428,7 @@ add_file_name (struct line_header *lh,
unsigned int length)
{
struct file_entry *fe;
+ char *dir = NULL;
/* Grow the array if necessary. */
if (lh->file_names_size == 0)
@@ -6450,6 +6451,10 @@ add_file_name (struct line_header *lh,
fe->mod_time = mod_time;
fe->length = length;
fe->included_p = 0;
+
+ if (dir_index)
+ dir = lh->include_dirs[dir_index - 1];
+ dwarf2_start_subfile (name, dir, NULL, lh->num_file_names);
}
@@ -6668,7 +6673,7 @@ dwarf_decode_lines (struct line_header *
if (fe->dir_index)
dir = lh->include_dirs[fe->dir_index - 1];
- dwarf2_start_subfile (fe->name, dir, comp_dir);
+ dwarf2_start_subfile (fe->name, dir, comp_dir, file);
}
/* Decode the table. */
@@ -6785,7 +6790,7 @@ dwarf_decode_lines (struct line_header *
if (!decode_for_pst_p)
{
last_subfile = current_subfile;
- dwarf2_start_subfile (fe->name, dir, comp_dir);
+ dwarf2_start_subfile (fe->name, dir, comp_dir, file);
}
}
break;
@@ -6889,7 +6894,8 @@ dwarf_decode_lines (struct line_header *
subfile's name. */
static void
-dwarf2_start_subfile (char *filename, char *dirname, char *comp_dir)
+dwarf2_start_subfile (char *filename, char *dirname, char *comp_dir,
+ unsigned file_index)
{
char *fullname;
@@ -6908,7 +6914,7 @@ dwarf2_start_subfile (char *filename, ch
else
fullname = filename;
- start_subfile (fullname, comp_dir);
+ start_subfile_index (fullname, comp_dir, file_index);
if (fullname != filename)
xfree (fullname);
@@ -7017,6 +7023,13 @@ new_symbol (struct die_info *die, struct
{
SYMBOL_LINE (sym) = DW_UNSND (attr);
}
+ attr = dwarf2_attr (die, DW_AT_decl_file, cu);
+ if (attr)
+ {
+ /* Do not yet search `objfile->symtabs' here as they still do not
+ have filled in their FILE.INDEX fields. */
+ SYMBOL_FILE_INDEX (sym) = DW_UNSND (attr);
+ }
switch (die->tag)
{
case DW_TAG_label:
Index: gdb-6.6/gdb/symtab.c
===================================================================
--- gdb-6.6.orig/gdb/symtab.c 2007-01-20 13:59:25.000000000 +0100
+++ gdb-6.6/gdb/symtab.c 2007-01-20 13:59:48.000000000 +0100
@@ -1129,6 +1129,10 @@ lookup_symbol (const char *name, const s
if (needtofreename)
xfree (demangled_name);
+ /* Override the returned symtab with optional symbol's specific one. */
+ if (returnval != NULL && symtab != NULL)
+ *symtab = SYMBOL_FILE_SYMTAB (returnval);
+
return returnval;
}
@@ -3235,7 +3239,7 @@ search_symbols (char *regexp, domain_enu
ALL_BLOCK_SYMBOLS (b, iter, sym)
{
QUIT;
- if (file_matches (s->filename, files, nfiles)
+ if (file_matches (SYMBOL_FILE_SYMTAB (sym)->filename, files, nfiles)
&& ((regexp == NULL
|| re_exec (SYMBOL_NATURAL_NAME (sym)) != 0)
&& ((kind == VARIABLES_DOMAIN && SYMBOL_CLASS (sym) != LOC_TYPEDEF
@@ -3248,7 +3252,7 @@ search_symbols (char *regexp, domain_enu
/* match */
psr = (struct symbol_search *) xmalloc (sizeof (struct symbol_search));
psr->block = i;
- psr->symtab = s;
+ psr->symtab = SYMBOL_FILE_SYMTAB (sym);
psr->symbol = sym;
psr->msymbol = NULL;
psr->next = NULL;
Index: gdb-6.6/gdb/symtab.h
===================================================================
--- gdb-6.6.orig/gdb/symtab.h 2007-01-20 06:43:00.000000000 +0100
+++ gdb-6.6/gdb/symtab.h 2007-01-20 13:59:48.000000000 +0100
@@ -623,6 +623,18 @@ struct symbol
ENUM_BITFIELD(address_class) aclass : 6;
+ /* File name it comes from. Use with `line' below.
+ FILE.INDEX is zero if the symbol's specific file is not known and in such
+ case we later default to the main file of the compilation unit.
+ FILE.SYMTAB gets resolved during end_symtab() and it is never NULL. */
+
+ union
+ {
+ unsigned index;
+ struct symtab *symtab;
+ }
+ file;
+
/* Line number of definition. FIXME: Should we really make the assumption
that nobody will try to debug files longer than 64K lines? What about
machine generated programs? */
@@ -663,6 +675,8 @@ struct symbol
#define SYMBOL_DOMAIN(symbol) (symbol)->domain
#define SYMBOL_CLASS(symbol) (symbol)->aclass
#define SYMBOL_TYPE(symbol) (symbol)->type
+#define SYMBOL_FILE_INDEX(symbol) (symbol)->file.index
+#define SYMBOL_FILE_SYMTAB(symbol) (symbol)->file.symtab
#define SYMBOL_LINE(symbol) (symbol)->line
#define SYMBOL_BASEREG(symbol) (symbol)->aux_value.basereg
#define SYMBOL_OBJFILE(symbol) (symbol)->aux_value.objfile

View File

@ -1,30 +0,0 @@
2006-12-30 Andrew Cagney <cagney@redhat.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf2-frame.c (execute_cfa_program): New support of
`DW_CFA_GNU_negative_offset_extended'.
Index: ./gdb/dwarf2-frame.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2-frame.c,v
retrieving revision 1.64
diff -u -p -r1.64 dwarf2-frame.c
--- ./gdb/dwarf2-frame.c 28 Nov 2006 17:28:29 -0000 1.64
+++ ./gdb/dwarf2-frame.c 30 Dec 2006 18:24:58 -0000
@@ -555,6 +555,15 @@ bad CFI data; mismatched DW_CFA_restore_
insn_ptr = read_uleb128 (insn_ptr, insn_end, &utmp);
break;
+ case DW_CFA_GNU_negative_offset_extended:
+ insn_ptr = read_uleb128 (insn_ptr, insn_end, &reg);
+ insn_ptr = read_uleb128 (insn_ptr, insn_end, &offset);
+ offset *= fs->data_align;
+ dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
+ fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAVED_OFFSET;
+ fs->regs.reg[reg].loc.offset = -offset;
+ break;
+
default:
internal_error (__FILE__, __LINE__, _("Unknown CFI encountered."));
}

View File

@ -1,509 +0,0 @@
2006-12-30 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.arch/i386-gnu-cfi.exp, gdb.arch/i386-gnu-cfi.c,
gdb.arch/i386-gnu-cfi-asm.S: New files.
Index: ./gdb/testsuite/gdb.arch/i386-gnu-cfi-asm.S
===================================================================
RCS file: ./gdb/testsuite/gdb.arch/i386-gnu-cfi-asm.S
diff -N ./gdb/testsuite/gdb.arch/i386-gnu-cfi-asm.S
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ./gdb/testsuite/gdb.arch/i386-gnu-cfi-asm.S 30 Dec 2006 18:25:02 -0000
@@ -0,0 +1,357 @@
+/* Copyright 2006 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Please email any bugs, comments, and/or additions to this file to:
+ * bug-gdb@gnu.org
+ *
+ * This file is part of the gdb testsuite.
+ *
+ * It was generated using
+ * "gcc -g -O9 -S -o gate.s gate.c -fasynchronous-unwind-tables",
+ * using the following source file:
+ *
+ *
+ * void *gate (void *(*gate) (void *data), void *data)
+ * {
+ * return 1 + (*gate) (data);
+ * }
+ *
+ * Changes are marked as `CHANGE' below.
+ */
+
+ .file "gate.c"
+ .section .debug_abbrev,"",@progbits
+.Ldebug_abbrev0:
+ .section .debug_info,"",@progbits
+.Ldebug_info0:
+ .section .debug_line,"",@progbits
+.Ldebug_line0:
+ .text
+.Ltext0:
+ .p2align 4,,15
+.globl gate
+ .type gate, @function
+gate:
+.LFB2:
+ .file 1 "gate.c"
+ .loc 1 2 0
+.LVL0:
+ pushl %ebp
+.LCFI0:
+ movl %esp, %ebp
+.LCFI1:
+ subl $8, %esp
+.LCFI2:
+ .loc 1 3 0
+ movl 12(%ebp), %eax
+ movl %eax, (%esp)
+ call *8(%ebp)
+ .loc 1 4 0
+ leave
+ .loc 1 3 0
+ addl $1, %eax
+ .loc 1 4 0
+ ret
+.LFE2:
+ .size gate, .-gate
+ .section .debug_frame,"",@progbits
+.Lframe0:
+ .long .LECIE0-.LSCIE0
+.LSCIE0:
+ .long 0xffffffff
+ .byte 0x1
+ .string ""
+ .uleb128 0x1
+ .sleb128 -4
+ .byte 0x8
+ .byte 0xc
+ .uleb128 0x4
+ .uleb128 0x4
+ .byte 0x88
+ .uleb128 0x1
+ .align 4
+.LECIE0:
+.LSFDE0:
+ .long .LEFDE0-.LASFDE0
+.LASFDE0:
+ .long .Lframe0
+ .long .LFB2
+ .long .LFE2-.LFB2
+ .byte 0x4
+ .long .LCFI0-.LFB2
+ .byte 0xe
+ .uleb128 0x8
+ .byte 0x85
+ .uleb128 0x2
+
+ /* CHANGE */
+ .byte 0x2f
+ .uleb128 0x1
+ .uleb128 0x0
+ /* CHANGE */
+
+ .byte 0x4
+ .long .LCFI1-.LCFI0
+ .byte 0xd
+ .uleb128 0x5
+ .align 4
+.LEFDE0:
+ .section .eh_frame,"a",@progbits
+.Lframe1:
+ .long .LECIE1-.LSCIE1
+.LSCIE1:
+ .long 0x0
+ .byte 0x1
+ .string ""
+ .uleb128 0x1
+ .sleb128 -4
+ .byte 0x8
+ .byte 0xc
+ .uleb128 0x4
+ .uleb128 0x4
+ .byte 0x88
+ .uleb128 0x1
+ .align 4
+.LECIE1:
+.LSFDE1:
+ .long .LEFDE1-.LASFDE1
+.LASFDE1:
+ .long .LASFDE1-.Lframe1
+ .long .LFB2
+ .long .LFE2-.LFB2
+ .byte 0x4
+ .long .LCFI0-.LFB2
+ .byte 0xe
+ .uleb128 0x8
+ .byte 0x85
+ .uleb128 0x2
+
+ /* CHANGE */
+ .byte 0x2f
+ .uleb128 0x1
+ .uleb128 0x0
+ /* CHANGE */
+
+ .byte 0x4
+ .long .LCFI1-.LCFI0
+ .byte 0xd
+ .uleb128 0x5
+ .align 4
+.LEFDE1:
+ .text
+.Letext0:
+ .section .debug_loc,"",@progbits
+.Ldebug_loc0:
+.LLST0:
+ .long .LFB2-.Ltext0
+ .long .LCFI0-.Ltext0
+ .value 0x2
+ .byte 0x74
+ .sleb128 4
+ .long .LCFI0-.Ltext0
+ .long .LCFI1-.Ltext0
+ .value 0x2
+ .byte 0x74
+ .sleb128 8
+ .long .LCFI1-.Ltext0
+ .long .LFE2-.Ltext0
+ .value 0x2
+ .byte 0x75
+ .sleb128 8
+ .long 0x0
+ .long 0x0
+ .section .debug_info
+ .long 0x74
+ .value 0x2
+ .long .Ldebug_abbrev0
+ .byte 0x4
+ .uleb128 0x1
+ .long .Ldebug_line0
+ .long .Letext0
+ .long .Ltext0
+ .long .LASF2
+ .byte 0x1
+ .long .LASF3
+ .long .LASF4
+ .uleb128 0x2
+ .long 0x5f
+ .byte 0x1
+ .long .LASF0
+ .byte 0x1
+ .byte 0x2
+ .byte 0x1
+ .long 0x5f
+ .long .LFB2
+ .long .LFE2
+ .long .LLST0
+ .uleb128 0x3
+ .long .LASF0
+ .byte 0x1
+ .byte 0x1
+ .long 0x71
+ .byte 0x2
+ .byte 0x91
+ .sleb128 0
+ .uleb128 0x3
+ .long .LASF1
+ .byte 0x1
+ .byte 0x1
+ .long 0x5f
+ .byte 0x2
+ .byte 0x91
+ .sleb128 4
+ .byte 0x0
+ .uleb128 0x4
+ .byte 0x4
+ .uleb128 0x5
+ .long 0x71
+ .byte 0x1
+ .long 0x5f
+ .uleb128 0x6
+ .long 0x5f
+ .byte 0x0
+ .uleb128 0x7
+ .byte 0x4
+ .long 0x61
+ .byte 0x0
+ .section .debug_abbrev
+ .uleb128 0x1
+ .uleb128 0x11
+ .byte 0x1
+ .uleb128 0x10
+ .uleb128 0x6
+ .uleb128 0x12
+ .uleb128 0x1
+ .uleb128 0x11
+ .uleb128 0x1
+ .uleb128 0x25
+ .uleb128 0xe
+ .uleb128 0x13
+ .uleb128 0xb
+ .uleb128 0x3
+ .uleb128 0xe
+ .uleb128 0x1b
+ .uleb128 0xe
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x2
+ .uleb128 0x2e
+ .byte 0x1
+ .uleb128 0x1
+ .uleb128 0x13
+ .uleb128 0x3f
+ .uleb128 0xc
+ .uleb128 0x3
+ .uleb128 0xe
+ .uleb128 0x3a
+ .uleb128 0xb
+ .uleb128 0x3b
+ .uleb128 0xb
+ .uleb128 0x27
+ .uleb128 0xc
+ .uleb128 0x49
+ .uleb128 0x13
+ .uleb128 0x11
+ .uleb128 0x1
+ .uleb128 0x12
+ .uleb128 0x1
+ .uleb128 0x40
+ .uleb128 0x6
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x3
+ .uleb128 0x5
+ .byte 0x0
+ .uleb128 0x3
+ .uleb128 0xe
+ .uleb128 0x3a
+ .uleb128 0xb
+ .uleb128 0x3b
+ .uleb128 0xb
+ .uleb128 0x49
+ .uleb128 0x13
+ .uleb128 0x2
+ .uleb128 0xa
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x4
+ .uleb128 0xf
+ .byte 0x0
+ .uleb128 0xb
+ .uleb128 0xb
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x5
+ .uleb128 0x15
+ .byte 0x1
+ .uleb128 0x1
+ .uleb128 0x13
+ .uleb128 0x27
+ .uleb128 0xc
+ .uleb128 0x49
+ .uleb128 0x13
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x6
+ .uleb128 0x5
+ .byte 0x0
+ .uleb128 0x49
+ .uleb128 0x13
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x7
+ .uleb128 0xf
+ .byte 0x0
+ .uleb128 0xb
+ .uleb128 0xb
+ .uleb128 0x49
+ .uleb128 0x13
+ .byte 0x0
+ .byte 0x0
+ .byte 0x0
+ .section .debug_pubnames,"",@progbits
+ .long 0x17
+ .value 0x2
+ .long .Ldebug_info0
+ .long 0x78
+ .long 0x25
+ .string "gate"
+ .long 0x0
+ .section .debug_aranges,"",@progbits
+ .long 0x1c
+ .value 0x2
+ .long .Ldebug_info0
+ .byte 0x4
+ .byte 0x0
+ .value 0x0
+ .value 0x0
+ .long .Ltext0
+ .long .Letext0-.Ltext0
+ .long 0x0
+ .long 0x0
+ .section .debug_str,"MS",@progbits,1
+.LASF1:
+ .string "data"
+.LASF0:
+ .string "gate"
+.LASF3:
+ .string "gate.c"
+.LASF4:
+ .string "/home/jkratoch/redhat/bz165025"
+.LASF2:
+ .string "GNU C 4.1.1 20061213 (Red Hat 4.1.1-46)"
+ .ident "GCC: (GNU) 4.1.1 20061213 (Red Hat 4.1.1-46)"
+ .section .note.GNU-stack,"",@progbits
Index: ./gdb/testsuite/gdb.arch/i386-gnu-cfi.c
===================================================================
RCS file: ./gdb/testsuite/gdb.arch/i386-gnu-cfi.c
diff -N ./gdb/testsuite/gdb.arch/i386-gnu-cfi.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ./gdb/testsuite/gdb.arch/i386-gnu-cfi.c 30 Dec 2006 18:25:02 -0000
@@ -0,0 +1,31 @@
+/* Unwinding of DW_CFA_GNU_negative_offset_extended test program.
+
+ Copyright 2006, Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <stdlib.h>
+
+/* i386-gnu-cfi-asm.S: */
+extern void *gate (void *(*gate) (void *data), void *data);
+
+int main (void)
+{
+ gate ((void *(*) (void *data)) abort, NULL);
+ return 0;
+}
Index: ./gdb/testsuite/gdb.arch/i386-gnu-cfi.exp
===================================================================
RCS file: ./gdb/testsuite/gdb.arch/i386-gnu-cfi.exp
diff -N ./gdb/testsuite/gdb.arch/i386-gnu-cfi.exp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ./gdb/testsuite/gdb.arch/i386-gnu-cfi.exp 30 Dec 2006 18:25:02 -0000
@@ -0,0 +1,94 @@
+# Copyright 2006 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@gnu.org
+
+# This file is part of the gdb testsuite.
+
+# Unwinding of DW_CFA_GNU_negative_offset_extended test program.
+
+if $tracelevel {
+ strace $tracelevel
+}
+
+# Test i386 unwinder.
+
+set prms_id 0
+set bug_id 0
+
+if ![istarget "i?86-*-*"] then {
+ verbose "Skipping i386 unwinder tests."
+ return
+}
+
+set testfile "i386-gnu-cfi"
+set srcfilec ${testfile}.c
+set srcfileasm ${testfile}-asm.S
+set binfile ${objdir}/${subdir}/${testfile}
+
+# some targets have leading underscores on assembly symbols.
+# TODO: detect this automatically
+set additional_flags ""
+if [istarget "i?86-*-cygwin*"] then {
+ set additional_flags "additional_flags=-DSYMBOL_PREFIX=\"_\""
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfilec} ${srcdir}/${subdir}/${srcfileasm}" "${binfile}" executable [list debug $additional_flags]] != "" } {
+ untested i386-gnu-cfi.exp
+ return -1
+}
+
+# Get things started.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# We should stop in abort(3).
+
+gdb_test "run" \
+ "Program received signal SIGABRT,.*" \
+ "run"
+
+# Backtrace would crash before.
+
+gdb_test "bt" \
+ "main \\(\\) at .*${testfile}.c.*" \
+ "backtrace"
+
+# Check we see the inserted `DW_CFA_GNU_negative_offset_extended' CFI.
+# We see there the original CFI-stored filename `gate.c'.
+
+gdb_test "up 3" \
+ "gate \\(\[^()\]*\\) at .*gate.c.*" \
+ "shift up to the modified frame"
+
+send_gdb "info frame\n";
+gdb_expect {
+ -re "Stack level 3, frame at (0x\[0-9a-f\]+):.*Saved registers:.* ecx at (0x\[0-9a-f\]+),.*" {
+ pass "Value of the CFI inserted register"
+ if { [string compare $expect_out(1,string) $expect_out(2,string)] } then {
+ fail "Value of the CFI inserted register"
+ } else {
+ pass "Value of the CFI inserted register"
+ }
+ }
+ default {
+ fail "Existence of the CFI inserted register"
+ }
+}

View File

@ -64,7 +64,7 @@ diff -u -p -r1.36 value.c
{ {
/* Assume a CORE_ADDR can fit in a LONGEST (for now). Not sure /* Assume a CORE_ADDR can fit in a LONGEST (for now). Not sure
whether we want this to be true eventually. */ whether we want this to be true eventually. */
@@ -1054,6 +1053,33 @@ value_as_address (struct value *val) @@ -1054,6 +1053,34 @@ value_as_address (struct value *val)
return unpack_long (value_type (val), value_contents (val)); return unpack_long (value_type (val), value_contents (val));
#endif #endif
} }
@ -76,6 +76,7 @@ diff -u -p -r1.36 value.c
+value_as_address (struct value *val) +value_as_address (struct value *val)
+{ +{
+ CORE_ADDR addr; + CORE_ADDR addr;
+ int addr_bit;
+ +
+ addr = value_as_address_core (val); + addr = value_as_address_core (val);
+ +
@ -88,7 +89,7 @@ diff -u -p -r1.36 value.c
+ either zero or sign extended. Should ADDRESS_TO_POINTER() or + either zero or sign extended. Should ADDRESS_TO_POINTER() or
+ some ADDRESS_TO_PRINTABLE() be used to do the conversion? */ + some ADDRESS_TO_PRINTABLE() be used to do the conversion? */
+ +
+ int addr_bit = TARGET_ADDR_BIT; + addr_bit = gdbarch_addr_bit (current_gdbarch);
+ +
+ if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT)) + if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
+ addr &= ((CORE_ADDR) 1 << addr_bit) - 1; + addr &= ((CORE_ADDR) 1 << addr_bit) - 1;

View File

@ -1,54 +0,0 @@
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=205551
2006-09-10 Jan Kratochvil <jan.kratochvil@redhat.com>
* printcmd.c (printf_command): Handle forgotten "%p".
2006-09-10 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/display.exp: New test of `printf' "%p" formatting.
diff -u -r sources-clean/gdb/printcmd.c sources-custom/gdb/printcmd.c
--- sources-clean/gdb/printcmd.c 2006-07-29 20:29:26.000000000 +0200
+++ sources-custom/gdb/printcmd.c 2006-09-12 16:18:55.000000000 +0200
@@ -43,6 +43,9 @@
#include "gdb_assert.h"
#include "block.h"
#include "disasm.h"
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
#ifdef TUI
#include "tui/tui.h" /* For tui_active et.al. */
@@ -2065,6 +2068,16 @@
#else
error (_("long long not supported in printf"));
#endif
+ case ptr_arg:
+#ifdef HAVE_UINTPTR_T
+ {
+ void *val = (void *) (uintptr_t) value_as_address (val_args[i]);
+ printf_filtered (current_substring, val);
+ break;
+ }
+#else
+ error (_("pointer not supported in printf"));
+#endif
case int_arg:
{
int val = value_as_long (val_args[i]);
diff -u -r sources-clean/gdb/testsuite/gdb.base/display.exp sources-custom/gdb/testsuite/gdb.base/display.exp
--- sources-clean/gdb/testsuite/gdb.base/display.exp 2006-08-13 02:53:36.000000000 +0200
+++ sources-custom/gdb/testsuite/gdb.base/display.exp 2006-09-12 16:17:24.000000000 +0200
@@ -179,6 +179,8 @@
gdb_test "printf \"\"" ".*" "re-set term"
gdb_test "printf \"\\w\"" ".*Unrecognized escape character.*"
gdb_test "printf \"%d\" j" ".*Invalid argument syntax.*"
+# 0 or hex vs. dec printing may be platform dependent:
+gdb_test "printf \"<%p>\\n\", (void *)7" ".*7>.*"
# play with "print", too
#

View File

@ -1,52 +0,0 @@
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=215816
2007-01-03 Jan Kratochvil <jan.kratochvil@redhat.com>
Daniel Jacobowitz <dan@codesourcery.com>
* gdb.base/readline.exp: Set $TERM. Test arrow keys in
secondary prompts.
--- ./gdb/testsuite/gdb.base/readline.exp 8 Jun 2003 13:14:05 -0000 1.2
+++ ./gdb/testsuite/gdb.base/readline.exp 3 Jan 2007 21:22:47 -0000
@@ -1,4 +1,4 @@
-# Copyright 2002 Free Software Foundation, Inc.
+# Copyright 2002, 2003, 2007 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -159,6 +159,14 @@ if [info exists env(INPUTRC)] {
}
set env(INPUTRC) "/dev/null"
+# The arrow key test relies on the standard VT100 bindings, so make
+# sure that an appropriate terminal is selected. The same bug
+# doesn't show up if we use ^P / ^N instead.
+if [info exists env(TERM)] {
+ set old_term $env(TERM)
+}
+set env(TERM) "vt100"
+
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
@@ -178,6 +186,18 @@ operate_and_get_next "operate-and-get-ne
"p 5" "" \
"end" ".* = 5"
+# Verify that arrow keys work in secondary prompts. The control
+# sequence is a hard-coded VT100 up arrow.
+gdb_test "print 42" "\\\$\[0-9\]* = 42"
+set msg "arrow keys with secondary prompt"
+gdb_test_multiple "if 1 > 0\n\033\[A\033\[A\nend" $msg {
+ -re ".*\\\$\[0-9\]* = 42\r\n$gdb_prompt $" {
+ pass $msg
+ }
+ -re ".*Undefined command:.*$gdb_prompt $" {
+ fail $msg
+ }
+}
# Now repeat the first test with a history file that fills the entire
# history list.

View File

@ -1,165 +0,0 @@
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=215816
2007-01-03 Jan Kratochvil <jan.kratochvil@redhat.com>
Daniel Jacobowitz <dan@codesourcery.com>
* Makefile.in (top.o): Update.
* top.c (gdb_readline_wrapper_done, gdb_readline_wrapper_result)
(saved_after_char_processing_hook, gdb_readline_wrapper_line)
(struct gdb_readline_wrapper_cleanup, gdb_readline_wrapper_cleanup):
New.
(gdb_readline_wrapper): Rewrite to use asynchronous readline.
--- ./gdb/Makefile.in 3 Jan 2007 18:05:43 -0000 1.864
+++ ./gdb/Makefile.in 3 Jan 2007 21:22:46 -0000
@@ -2782,7 +2782,7 @@ top.o: top.c $(defs_h) $(gdbcmd_h) $(cal
$(annotate_h) $(completer_h) $(top_h) $(version_h) $(serial_h) \
$(doublest_h) $(gdb_assert_h) $(readline_h) $(readline_history_h) \
$(event_top_h) $(gdb_string_h) $(gdb_stat_h) $(ui_out_h) \
- $(cli_out_h) $(main_h)
+ $(cli_out_h) $(main_h) $(event_loop_h)
tracepoint.o: tracepoint.c $(defs_h) $(symtab_h) $(frame_h) $(gdbtypes_h) \
$(expression_h) $(gdbcmd_h) $(value_h) $(target_h) $(language_h) \
$(gdb_string_h) $(inferior_h) $(tracepoint_h) $(remote_h) \
--- ./gdb/top.c 1 Jan 2007 05:57:49 -0000 1.116
+++ ./gdb/top.c 3 Jan 2007 21:22:47 -0000
@@ -47,6 +47,7 @@
#include "doublest.h"
#include "gdb_assert.h"
#include "main.h"
+#include "event-loop.h"
/* readline include files */
#include "readline/readline.h"
@@ -710,24 +710,84 @@
}
/* This is like readline(), but it has some gdb-specific behavior.
- gdb can use readline in both the synchronous and async modes during
+ gdb may want readline in both the synchronous and async modes during
a single gdb invocation. At the ordinary top-level prompt we might
be using the async readline. That means we can't use
rl_pre_input_hook, since it doesn't work properly in async mode.
However, for a secondary prompt (" >", such as occurs during a
- `define'), gdb just calls readline() directly, running it in
- synchronous mode. So for operate-and-get-next to work in this
- situation, we have to switch the hooks around. That is what
- gdb_readline_wrapper is for. */
+ `define'), gdb wants a synchronous response.
+
+ We used to call readline() directly, running it in synchronous
+ mode. But mixing modes this way is not supported, and as of
+ readline 5.x it no longer works; the arrow keys come unbound during
+ the synchronous call. So we make a nested call into the event
+ loop. That's what gdb_readline_wrapper is for. */
+
+/* A flag set as soon as gdb_readline_wrapper_line is called; we can't
+ rely on gdb_readline_wrapper_result, which might still be NULL if
+ the user types Control-D for EOF. */
+static int gdb_readline_wrapper_done;
+
+/* The result of the current call to gdb_readline_wrapper, once a newline
+ is seen. */
+static char *gdb_readline_wrapper_result;
+
+/* Any intercepted hook. Operate-and-get-next sets this, expecting it
+ to be called after the newline is processed (which will redisplay
+ the prompt). But in gdb_readline_wrapper we will not get a new
+ prompt until the next call, or until we return to the event loop.
+ So we disable this hook around the newline and restore it before we
+ return. */
+static void (*saved_after_char_processing_hook) (void);
+
+/* This function is called when readline has seen a complete line of
+ text. */
+
+static void
+gdb_readline_wrapper_line (char *line)
+{
+ gdb_assert (!gdb_readline_wrapper_done);
+ gdb_readline_wrapper_result = line;
+ gdb_readline_wrapper_done = 1;
+
+ /* Prevent operate-and-get-next from acting too early. */
+ saved_after_char_processing_hook = after_char_processing_hook;
+ after_char_processing_hook = NULL;
+}
+
+struct gdb_readline_wrapper_cleanup
+ {
+ void (*handler_orig) (char *);
+ char *prompt_orig;
+ int already_prompted_orig;
+ };
+
+static void
+gdb_readline_wrapper_cleanup (void *arg)
+{
+ struct gdb_readline_wrapper_cleanup *cleanup = arg;
+
+ gdb_assert (rl_already_prompted == 1);
+ rl_already_prompted = cleanup->already_prompted_orig;
+ PROMPT (0) = cleanup->prompt_orig;
+
+ gdb_assert (input_handler == gdb_readline_wrapper_line);
+ input_handler = cleanup->handler_orig;
+ gdb_readline_wrapper_result = NULL;
+ gdb_readline_wrapper_done = 0;
+
+ after_char_processing_hook = saved_after_char_processing_hook;
+ saved_after_char_processing_hook = NULL;
+
+ xfree (cleanup);
+}
+
char *
gdb_readline_wrapper (char *prompt)
{
- /* Set the hook that works in this case. */
- if (after_char_processing_hook)
- {
- rl_pre_input_hook = (Function *) after_char_processing_hook;
- after_char_processing_hook = NULL;
- }
+ struct cleanup *back_to;
+ struct gdb_readline_wrapper_cleanup *cleanup;
+ char *retval;
/* Before calling readline, ensure we have the terminal. If we don't
have the terminal and call readline, we risk the possibility of
@@ -737,7 +797,32 @@
a page break prompt. */
terminal_ours ();
- return readline (prompt);
+ cleanup = xmalloc (sizeof (*cleanup));
+ cleanup->handler_orig = input_handler;
+ input_handler = gdb_readline_wrapper_line;
+
+ cleanup->prompt_orig = get_prompt ();
+ PROMPT (0) = prompt;
+ cleanup->already_prompted_orig = rl_already_prompted;
+
+ back_to = make_cleanup (gdb_readline_wrapper_cleanup, cleanup);
+
+ /* Display our prompt and prevent double prompt display. */
+ display_gdb_prompt (NULL);
+ rl_already_prompted = 1;
+
+ if (after_char_processing_hook)
+ (*after_char_processing_hook) ();
+ gdb_assert (after_char_processing_hook == NULL);
+
+ /* gdb_do_one_event argument is unused. */
+ while (gdb_do_one_event (NULL) >= 0)
+ if (gdb_readline_wrapper_done)
+ break;
+
+ retval = gdb_readline_wrapper_result;
+ do_cleanups (back_to);
+ return retval;
}

View File

@ -16,10 +16,15 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=216711
* gdb.threads/bt-clone-stop.exp, gdb.threads/bt-clone-stop.c: * gdb.threads/bt-clone-stop.exp, gdb.threads/bt-clone-stop.c:
New file. New file.
2007-10-16 Jan Kratochvil <jan.kratochvil@redhat.com>
--- ./gdb/amd64-linux-tdep.c 19 Aug 2006 15:15:18 -0000 1.12 Port to GDB-6.7.
+++ ./gdb/amd64-linux-tdep.c 17 Dec 2006 17:59:05 -0000
@@ -235,6 +235,80 @@ amd64_linux_register_reggroup_p (struct Index: gdb-6.7/gdb/amd64-linux-tdep.c
===================================================================
--- gdb-6.7.orig/gdb/amd64-linux-tdep.c 2007-08-23 20:08:26.000000000 +0200
+++ gdb-6.7/gdb/amd64-linux-tdep.c 2007-10-16 15:57:03.000000000 +0200
@@ -234,6 +234,80 @@ amd64_linux_register_reggroup_p (struct
/* Set the program counter for process PTID to PC. */ /* Set the program counter for process PTID to PC. */
@ -98,9 +103,9 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=216711
+} +}
+ +
static void static void
amd64_linux_write_pc (CORE_ADDR pc, ptid_t ptid) amd64_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
{ {
@@ -273,6 +342,8 @@ amd64_linux_init_abi (struct gdbarch_inf @@ -272,6 +346,8 @@ amd64_linux_init_abi (struct gdbarch_inf
tdep->sc_reg_offset = amd64_linux_sc_reg_offset; tdep->sc_reg_offset = amd64_linux_sc_reg_offset;
tdep->sc_num_regs = ARRAY_SIZE (amd64_linux_sc_reg_offset); tdep->sc_num_regs = ARRAY_SIZE (amd64_linux_sc_reg_offset);
@ -109,9 +114,11 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=216711
/* GNU/Linux uses SVR4-style shared libraries. */ /* GNU/Linux uses SVR4-style shared libraries. */
set_solib_svr4_fetch_link_map_offsets set_solib_svr4_fetch_link_map_offsets
(gdbarch, svr4_lp64_fetch_link_map_offsets); (gdbarch, svr4_lp64_fetch_link_map_offsets);
--- ./gdb/amd64-tdep.c 19 Aug 2006 15:15:18 -0000 1.32 Index: gdb-6.7/gdb/amd64-tdep.c
+++ ./gdb/amd64-tdep.c 17 Dec 2006 17:59:05 -0000 ===================================================================
@@ -879,11 +879,16 @@ amd64_frame_this_id (struct frame_info * --- gdb-6.7.orig/gdb/amd64-tdep.c 2007-10-12 17:48:39.000000000 +0200
+++ gdb-6.7/gdb/amd64-tdep.c 2007-10-16 15:57:03.000000000 +0200
@@ -849,11 +849,16 @@ amd64_frame_this_id (struct frame_info *
{ {
struct amd64_frame_cache *cache = struct amd64_frame_cache *cache =
amd64_frame_cache (next_frame, this_cache); amd64_frame_cache (next_frame, this_cache);
@ -128,9 +135,11 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=216711
(*this_id) = frame_id_build (cache->base + 16, cache->pc); (*this_id) = frame_id_build (cache->base + 16, cache->pc);
} }
--- ./gdb/i386-tdep.c 8 Aug 2006 21:36:46 -0000 1.225 Index: gdb-6.7/gdb/i386-tdep.c
+++ ./gdb/i386-tdep.c 17 Dec 2006 17:59:10 -0000 ===================================================================
@@ -2313,6 +2313,9 @@ i386_gdbarch_init (struct gdbarch_info i --- gdb-6.7.orig/gdb/i386-tdep.c 2007-10-12 17:48:39.000000000 +0200
+++ gdb-6.7/gdb/i386-tdep.c 2007-10-16 15:57:03.000000000 +0200
@@ -2355,6 +2355,9 @@ i386_gdbarch_init (struct gdbarch_info i
tdep->sc_pc_offset = -1; tdep->sc_pc_offset = -1;
tdep->sc_sp_offset = -1; tdep->sc_sp_offset = -1;
@ -140,20 +149,24 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=216711
/* The format used for `long double' on almost all i386 targets is /* The format used for `long double' on almost all i386 targets is
the i387 extended floating-point format. In fact, of all targets the i387 extended floating-point format. In fact, of all targets
in the GCC 2.95 tree, only OSF/1 does it different, and insists in the GCC 2.95 tree, only OSF/1 does it different, and insists
--- ./gdb/i386-tdep.h 21 Jan 2006 20:59:50 -0000 1.46 Index: gdb-6.7/gdb/i386-tdep.h
+++ ./gdb/i386-tdep.h 17 Dec 2006 17:59:10 -0000 ===================================================================
@@ -104,6 +104,9 @@ struct gdbarch_tdep --- gdb-6.7.orig/gdb/i386-tdep.h 2007-08-23 20:08:34.000000000 +0200
is deprecated, please use `sc_reg_offset' instead. */ +++ gdb-6.7/gdb/i386-tdep.h 2007-10-16 15:57:32.000000000 +0200
int sc_pc_offset; @@ -106,6 +106,9 @@ struct gdbarch_tdep
int sc_sp_offset; /* ISA-specific data types. */
struct type *i386_mmx_type;
struct type *i386_sse_type;
+ +
+ /* Detect OS dependent outermost frames; such as `clone'. */ + /* Detect OS dependent outermost frames; such as `clone'. */
+ int (*outermost_frame_p) (struct frame_info *next_frame); + int (*outermost_frame_p) (struct frame_info *next_frame);
}; };
/* Floating-point registers. */ /* Floating-point registers. */
--- /dev/null 1 Jan 1970 00:00:00 -0000 Index: gdb-6.7/gdb/testsuite/gdb.threads/bt-clone-stop.c
+++ ./gdb/testsuite/gdb.threads/bt-clone-stop.c 17 Dec 2006 17:59:19 -0000 ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.7/gdb/testsuite/gdb.threads/bt-clone-stop.c 2007-10-16 15:57:03.000000000 +0200
@@ -0,0 +1,39 @@ @@ -0,0 +1,39 @@
+/* This testcase is part of GDB, the GNU debugger. +/* This testcase is part of GDB, the GNU debugger.
+ +
@ -194,8 +207,10 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=216711
+ for (;;) + for (;;)
+ pause(); + pause();
+} +}
--- /dev/null 1 Jan 1970 00:00:00 -0000 Index: gdb-6.7/gdb/testsuite/gdb.threads/bt-clone-stop.exp
+++ ./gdb/testsuite/gdb.threads/bt-clone-stop.exp 17 Dec 2006 17:59:19 -0000 ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.7/gdb/testsuite/gdb.threads/bt-clone-stop.exp 2007-10-16 15:57:03.000000000 +0200
@@ -0,0 +1,61 @@ @@ -0,0 +1,61 @@
+# Copyright 2006 Free Software Foundation, Inc. +# Copyright 2006 Free Software Foundation, Inc.
+ +

View File

@ -122,3 +122,56 @@ Index: ./gdb/ppc-linux-tdep.c
if (tdep->wordsize == 4) if (tdep->wordsize == 4)
{ {
2007-10-17 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.7.
diff -u -u -X /home/jkratoch/.diffi.list -rup gdb-6.7-patched/gdb/gdbtypes.c gdb-6.7/gdb/gdbtypes.c
--- gdb-6.7-patched/gdb/gdbtypes.c 2007-09-05 02:51:48.000000000 +0200
+++ gdb-6.7/gdb/gdbtypes.c 2007-10-17 12:09:00.000000000 +0200
@@ -95,6 +95,10 @@ const struct floatformat *floatformats_v
&floatformat_vax_d,
&floatformat_vax_d
};
+const struct floatformat *floatformat_ppc64_long_double[BFD_ENDIAN_UNKNOWN] = {
+ &floatformat_ppc64_long_double_big,
+ &floatformat_ppc64_long_double_little
+};
struct type *builtin_type_ieee_single;
struct type *builtin_type_ieee_double;
diff -u -u -X /home/jkratoch/.diffi.list -rup gdb-6.7-patched/gdb/gdbtypes.h gdb-6.7/gdb/gdbtypes.h
--- gdb-6.7-patched/gdb/gdbtypes.h 2007-09-05 02:51:48.000000000 +0200
+++ gdb-6.7/gdb/gdbtypes.h 2007-10-17 12:08:30.000000000 +0200
@@ -1121,6 +1121,7 @@ extern const struct floatformat *floatfo
extern const struct floatformat *floatformats_ia64_quad[BFD_ENDIAN_UNKNOWN];
extern const struct floatformat *floatformats_vax_f[BFD_ENDIAN_UNKNOWN];
extern const struct floatformat *floatformats_vax_d[BFD_ENDIAN_UNKNOWN];
+extern const struct floatformat *floatformat_ppc64_long_double[BFD_ENDIAN_UNKNOWN];
extern struct type *builtin_type_ieee_single;
extern struct type *builtin_type_ieee_double;
diff -u -u -X /home/jkratoch/.diffi.list -rup gdb-6.7-patched/gdb/rs6000-tdep.c gdb-6.7/gdb/rs6000-tdep.c
--- gdb-6.7-patched/gdb/rs6000-tdep.c 2007-10-16 20:52:45.000000000 +0200
+++ gdb-6.7/gdb/rs6000-tdep.c 2007-10-17 12:07:54.000000000 +0200
@@ -3755,16 +3755,7 @@ rs6000_gdbarch_init (struct gdbarch_info
set_gdbarch_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
if (sysv_abi)
{
- int byte_order = gdbarch_byte_order (gdbarch);
-
- if (byte_order == BFD_ENDIAN_BIG)
- set_gdbarch_long_double_format (gdbarch, &floatformat_ppc64_long_double_big);
- else if (byte_order == BFD_ENDIAN_LITTLE)
- set_gdbarch_long_double_format (gdbarch, &floatformat_ppc64_long_double_little);
- else
- internal_error (__FILE__, __LINE__,
- _("rs6000_gdbarch_init: "
- "bad byte order"));
+ set_gdbarch_long_double_format (gdbarch, floatformat_ppc64_long_double);
set_gdbarch_long_double_bit (gdbarch, 16 * TARGET_CHAR_BIT);
}
else

View File

@ -6,11 +6,15 @@ for gdb/ChangeLog:
boundaries. boundaries.
* dwarfread.c (locval): Likewise. * dwarfread.c (locval): Likewise.
Index: gdb-6.5/gdb/dwarf2read.c 2007-10-15 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.7.
Index: gdb-6.7/gdb/dwarf2read.c
=================================================================== ===================================================================
--- gdb-6.5.orig/gdb/dwarf2read.c 2006-09-04 02:02:23.000000000 -0300 --- gdb-6.7.orig/gdb/dwarf2read.c 2007-10-15 00:08:30.000000000 +0200
+++ gdb-6.5/gdb/dwarf2read.c 2006-09-04 02:02:23.000000000 -0300 +++ gdb-6.7/gdb/dwarf2read.c 2007-10-15 21:42:43.000000000 +0200
@@ -8667,8 +8667,7 @@ dwarf2_fundamental_type (struct objfile @@ -9070,8 +9070,7 @@ dwarf2_fundamental_type (struct objfile
callers will only want a very basic result and this can become a callers will only want a very basic result and this can become a
complaint. complaint.
@ -20,7 +24,7 @@ Index: gdb-6.5/gdb/dwarf2read.c
static CORE_ADDR static CORE_ADDR
decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu) decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
@@ -8685,7 +8684,7 @@ decode_locdesc (struct dwarf_block *blk, @@ -9088,7 +9087,7 @@ decode_locdesc (struct dwarf_block *blk,
i = 0; i = 0;
stacki = 0; stacki = 0;
@ -29,7 +33,7 @@ Index: gdb-6.5/gdb/dwarf2read.c
while (i < size) while (i < size)
{ {
@@ -8864,6 +8863,16 @@ decode_locdesc (struct dwarf_block *blk, @@ -9270,6 +9269,16 @@ decode_locdesc (struct dwarf_block *blk,
dwarf_stack_op_name (op)); dwarf_stack_op_name (op));
return (stack[stacki]); return (stack[stacki]);
} }
@ -46,44 +50,3 @@ Index: gdb-6.5/gdb/dwarf2read.c
} }
return (stack[stacki]); return (stack[stacki]);
} }
Index: gdb-6.5/gdb/dwarfread.c
===================================================================
--- gdb-6.5.orig/gdb/dwarfread.c 2005-12-17 20:33:59.000000000 -0200
+++ gdb-6.5/gdb/dwarfread.c 2006-09-04 02:02:23.000000000 -0300
@@ -2138,9 +2138,7 @@ decode_line_numbers (char *linetable)
NOTES
- Note that stack[0] is unused except as a default error return.
- Note that stack overflow is not yet handled.
- */
+ Note that stack[0] is unused except as a default error return. */
static int
locval (struct dieinfo *dip)
@@ -2160,7 +2158,7 @@ locval (struct dieinfo *dip)
loc += nbytes;
end = loc + locsize;
stacki = 0;
- stack[stacki] = 0;
+ stack[++stacki] = 0;
dip->isreg = 0;
dip->offreg = 0;
dip->optimized_out = 1;
@@ -2224,6 +2222,16 @@ locval (struct dieinfo *dip)
stacki--;
break;
}
+ /* Enforce maximum stack depth of size-1 to avoid ++stacki writing
+ outside of the allocated space. Also enforce minimum > 0.
+ -- wad@google.com 14 Aug 2006 */
+ if (stacki >= sizeof (stack) / sizeof (*stack) - 1)
+ internal_error (__FILE__, __LINE__,
+ _("location description stack too deep: %d"),
+ stacki);
+ if (stacki <= 0)
+ internal_error (__FILE__, __LINE__,
+ _("location description stack too shallow"));
}
return (stack[stacki]);
}

View File

@ -15,12 +15,15 @@
* linux-nat.h: Likewise. * linux-nat.h: Likewise.
* Makefile.in: Dependencies updated. * Makefile.in: Dependencies updated.
2007-10-16 Jan Kratochvil <jan.kratochvil@redhat.com>
Index: gdb-6.6/gdb/Makefile.in Port to GDB-6.7.
Index: gdb-6.7/gdb/Makefile.in
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/Makefile.in 2007-01-20 06:43:02.000000000 +0100 --- gdb-6.7.orig/gdb/Makefile.in 2007-10-14 23:57:38.000000000 +0200
+++ gdb-6.6/gdb/Makefile.in 2007-01-20 06:57:16.000000000 +0100 +++ gdb-6.7/gdb/Makefile.in 2007-10-16 15:46:48.000000000 +0200
@@ -705,6 +705,7 @@ gdb_expat_h = gdb_expat.h @@ -717,6 +717,7 @@ gdb_expat_h = gdb_expat.h
gdb_locale_h = gdb_locale.h gdb_locale_h = gdb_locale.h
gdb_obstack_h = gdb_obstack.h $(obstack_h) gdb_obstack_h = gdb_obstack.h $(obstack_h)
gdb_proc_service_h = gdb_proc_service.h $(gregset_h) gdb_proc_service_h = gdb_proc_service.h $(gregset_h)
@ -28,7 +31,7 @@ Index: gdb-6.6/gdb/Makefile.in
gdb_ptrace_h = gdb_ptrace.h gdb_ptrace_h = gdb_ptrace.h
gdb_regex_h = gdb_regex.h $(xregex_h) gdb_regex_h = gdb_regex.h $(xregex_h)
gdb_select_h = gdb_select.h gdb_select_h = gdb_select.h
@@ -714,6 +715,7 @@ gdb_string_h = gdb_string.h @@ -726,6 +727,7 @@ gdb_string_h = gdb_string.h
gdb_thread_db_h = gdb_thread_db.h gdb_thread_db_h = gdb_thread_db.h
gdbthread_h = gdbthread.h $(breakpoint_h) $(frame_h) gdbthread_h = gdbthread.h $(breakpoint_h) $(frame_h)
gdbtypes_h = gdbtypes.h $(hashtab_h) gdbtypes_h = gdbtypes.h $(hashtab_h)
@ -36,31 +39,31 @@ Index: gdb-6.6/gdb/Makefile.in
gdb_vfork_h = gdb_vfork.h gdb_vfork_h = gdb_vfork.h
gdb_wait_h = gdb_wait.h gdb_wait_h = gdb_wait.h
glibc_tdep_h = glibc-tdep.h glibc_tdep_h = glibc-tdep.h
@@ -1779,7 +1781,8 @@ amd64fbsd-tdep.o: amd64fbsd-tdep.c $(def @@ -1793,7 +1795,8 @@ amd64fbsd-tdep.o: amd64fbsd-tdep.c $(def
amd64-linux-nat.o: amd64-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \ amd64-linux-nat.o: amd64-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \
$(regcache_h) $(linux_nat_h) $(gdb_assert_h) $(gdb_string_h) \ $(regcache_h) $(linux_nat_h) $(gdb_assert_h) $(gdb_string_h) \
$(gdb_proc_service_h) $(gregset_h) $(amd64_tdep_h) \ $(gdb_proc_service_h) $(gregset_h) $(amd64_tdep_h) \
- $(i386_linux_tdep_h) $(amd64_nat_h) $(target_h) $(amd64_linux_tdep_h) - $(i386_linux_tdep_h) $(amd64_nat_h) $(amd64_linux_tdep_h)
+ $(i386_linux_tdep_h) $(amd64_nat_h) $(target_h) $(amd64_linux_tdep_h) \ + $(i386_linux_tdep_h) $(amd64_nat_h) $(amd64_linux_tdep_h) \
+ $(i387_tdep_h) $(elf_bfd_h) $(gdb_procfs32_h) + $(i387_tdep_h) $(elf_bfd_h) $(gdb_procfs32_h)
amd64-linux-tdep.o: amd64-linux-tdep.c $(defs_h) $(frame_h) $(gdbcore_h) \ amd64-linux-tdep.o: amd64-linux-tdep.c $(defs_h) $(frame_h) $(gdbcore_h) \
$(regcache_h) $(osabi_h) $(symtab_h) $(gdb_string_h) $(amd64_tdep_h) \ $(regcache_h) $(osabi_h) $(symtab_h) $(gdb_string_h) $(amd64_tdep_h) \
$(solib_svr4_h) $(gdbtypes_h) $(reggroups_h) $(amd64_linux_tdep_h) $(solib_svr4_h) $(gdbtypes_h) $(reggroups_h) $(amd64_linux_tdep_h)
Index: gdb-6.6/gdb/amd64-linux-nat.c Index: gdb-6.7/gdb/amd64-linux-nat.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/amd64-linux-nat.c 2007-01-20 06:43:00.000000000 +0100 --- gdb-6.7.orig/gdb/amd64-linux-nat.c 2007-10-14 23:39:04.000000000 +0200
+++ gdb-6.6/gdb/amd64-linux-nat.c 2007-01-20 06:56:21.000000000 +0100 +++ gdb-6.7/gdb/amd64-linux-nat.c 2007-10-16 15:46:18.000000000 +0200
@@ -53,6 +53,9 @@ @@ -51,6 +51,9 @@
#include "amd64-tdep.h" #include "amd64-tdep.h"
#include "i386-linux-tdep.h" #include "i386-linux-tdep.h"
#include "amd64-nat.h" #include "amd64-nat.h"
+#include "i387-tdep.h" +#include "i387-tdep.h"
+#include "bfd/elf-bfd.h" +#include "elf-bfd.h"
+#include "gdb_procfs32.h" +#include "gdb_procfs32.h"
/* Mapping between the general-purpose registers in GNU/Linux x86-64 /* Mapping between the general-purpose registers in GNU/Linux x86-64
`struct user' format and GDB's register cache layout. */ `struct user' format and GDB's register cache layout. */
@@ -87,6 +90,35 @@ static int amd64_linux_gregset64_reg_off @@ -85,6 +88,35 @@ static int amd64_linux_gregset64_reg_off
GNU/Linux i386 registers are all 32-bit, but since we're GNU/Linux i386 registers are all 32-bit, but since we're
little-endian we get away with that. */ little-endian we get away with that. */
@ -96,7 +99,7 @@ Index: gdb-6.6/gdb/amd64-linux-nat.c
/* From <sys/reg.h> on GNU/Linux i386. */ /* From <sys/reg.h> on GNU/Linux i386. */
static int amd64_linux_gregset32_reg_offset[] = static int amd64_linux_gregset32_reg_offset[] =
{ {
@@ -105,6 +137,94 @@ static int amd64_linux_gregset32_reg_off @@ -103,6 +135,96 @@ static int amd64_linux_gregset32_reg_off
}; };
@ -157,12 +160,13 @@ Index: gdb-6.6/gdb/amd64-linux-nat.c
+} +}
+ +
+static char * +static char *
+amd64_elfcore_write_prxfpreg32 (bfd *abfd, char *buf, int *bufsiz) +amd64_elfcore_write_prxfpreg32 (bfd *abfd, char *buf, int *bufsiz,
+ struct regcache *regcache)
+{ +{
+ char *note_name = "LINUX"; + char *note_name = "LINUX";
+ elf_fpxregset32_t fpxregs32; + elf_fpxregset32_t fpxregs32;
+ +
+ i387_fill_fxsave (&fpxregs32, -1); + i387_collect_fxsave (regcache, -1, &fpxregs32);
+ return elfcore_write_note(abfd, buf, bufsiz, + return elfcore_write_note(abfd, buf, bufsiz,
+ note_name, NT_PRXFPREG, &fpxregs32, + note_name, NT_PRXFPREG, &fpxregs32,
+ sizeof(fpxregs32)); + sizeof(fpxregs32));
@ -170,18 +174,19 @@ Index: gdb-6.6/gdb/amd64-linux-nat.c
+ +
+static char * +static char *
+amd64_linux_elfcore_write_prfpreg (bfd *abfd, char *buf, +amd64_linux_elfcore_write_prfpreg (bfd *abfd, char *buf,
+ int *bufsiz, const void *fpregs, int size) + int *bufsiz, const void *fpregs, int size,
+ struct regcache *regcache)
+{ +{
+ if (gdbarch_ptr_bit(current_gdbarch) == 32) + if (gdbarch_ptr_bit(current_gdbarch) == 32)
+ { + {
+ char *note_name = "CORE"; + char *note_name = "CORE";
+ elf_fpregset32_t fpregs32; + elf_fpregset32_t fpregs32;
+ +
+ i387_fill_fsave (&fpregs32, -1); + i387_collect_fsave (regcache, -1, &fpregs32);
+ buf = elfcore_write_note(abfd, buf, bufsiz, note_name, + buf = elfcore_write_note(abfd, buf, bufsiz, note_name,
+ NT_FPREGSET, &fpregs32, sizeof(fpregs32)); + NT_FPREGSET, &fpregs32, sizeof(fpregs32));
+ +
+ return amd64_elfcore_write_prxfpreg32 (abfd, buf, bufsiz); + return amd64_elfcore_write_prxfpreg32 (abfd, buf, bufsiz, regcache);
+ } + }
+ else + else
+ return elfcore_write_prfpreg (abfd, buf, bufsiz, fpregs, size); + return elfcore_write_prfpreg (abfd, buf, bufsiz, fpregs, size);
@ -203,11 +208,11 @@ Index: gdb-6.6/gdb/amd64-linux-nat.c
/* Register the target. */ /* Register the target. */
linux_nat_add_target (t); linux_nat_add_target (t);
Index: gdb-6.6/gdb/config.in Index: gdb-6.7/gdb/config.in
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/config.in 2006-08-08 22:32:15.000000000 +0200 --- gdb-6.7.orig/gdb/config.in 2007-06-18 17:46:37.000000000 +0200
+++ gdb-6.6/gdb/config.in 2007-01-20 06:56:21.000000000 +0100 +++ gdb-6.7/gdb/config.in 2007-10-16 15:46:18.000000000 +0200
@@ -373,6 +373,9 @@ @@ -385,6 +385,9 @@
/* Define to 1 if you have the <sys/poll.h> header file. */ /* Define to 1 if you have the <sys/poll.h> header file. */
#undef HAVE_SYS_POLL_H #undef HAVE_SYS_POLL_H
@ -217,7 +222,7 @@ Index: gdb-6.6/gdb/config.in
/* Define to 1 if you have the <sys/procfs.h> header file. */ /* Define to 1 if you have the <sys/procfs.h> header file. */
#undef HAVE_SYS_PROCFS_H #undef HAVE_SYS_PROCFS_H
@@ -397,6 +400,9 @@ @@ -412,6 +415,9 @@
/* Define to 1 if you have the <sys/types.h> header file. */ /* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H #undef HAVE_SYS_TYPES_H
@ -227,11 +232,11 @@ Index: gdb-6.6/gdb/config.in
/* Define to 1 if you have the <sys/user.h> header file. */ /* Define to 1 if you have the <sys/user.h> header file. */
#undef HAVE_SYS_USER_H #undef HAVE_SYS_USER_H
Index: gdb-6.6/gdb/configure Index: gdb-6.7/gdb/configure
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/configure 2007-01-20 06:43:00.000000000 +0100 --- gdb-6.7.orig/gdb/configure 2007-09-29 22:54:13.000000000 +0200
+++ gdb-6.6/gdb/configure 2007-01-20 06:56:21.000000000 +0100 +++ gdb-6.7/gdb/configure 2007-10-16 15:46:18.000000000 +0200
@@ -9966,6 +9966,157 @@ done @@ -10439,6 +10439,157 @@ done
@ -389,11 +394,11 @@ Index: gdb-6.6/gdb/configure
for ac_header in sys/wait.h wait.h for ac_header in sys/wait.h wait.h
do do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
Index: gdb-6.6/gdb/configure.ac Index: gdb-6.7/gdb/configure.ac
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/configure.ac 2007-01-20 06:43:01.000000000 +0100 --- gdb-6.7.orig/gdb/configure.ac 2007-09-29 22:54:13.000000000 +0200
+++ gdb-6.6/gdb/configure.ac 2007-01-20 06:56:21.000000000 +0100 +++ gdb-6.7/gdb/configure.ac 2007-10-16 15:46:18.000000000 +0200
@@ -371,6 +371,7 @@ AC_CHECK_HEADERS(sys/user.h, [], [], @@ -424,6 +424,7 @@ AC_CHECK_HEADERS(sys/user.h, [], [],
# include <sys/param.h> # include <sys/param.h>
#endif #endif
]) ])
@ -401,11 +406,11 @@ Index: gdb-6.6/gdb/configure.ac
AC_CHECK_HEADERS(sys/wait.h wait.h) AC_CHECK_HEADERS(sys/wait.h wait.h)
AC_CHECK_HEADERS(termios.h termio.h sgtty.h) AC_CHECK_HEADERS(termios.h termio.h sgtty.h)
AC_CHECK_HEADERS(unistd.h) AC_CHECK_HEADERS(unistd.h)
Index: gdb-6.6/gdb/gcore.c Index: gdb-6.7/gdb/gcore.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/gcore.c 2007-01-20 06:43:02.000000000 +0100 --- gdb-6.7.orig/gdb/gcore.c 2007-10-14 23:57:38.000000000 +0200
+++ gdb-6.6/gdb/gcore.c 2007-01-20 06:56:21.000000000 +0100 +++ gdb-6.7/gdb/gcore.c 2007-10-16 15:46:18.000000000 +0200
@@ -320,6 +320,11 @@ gcore_create_callback (CORE_ADDR vaddr, @@ -317,6 +317,11 @@ gcore_create_callback (CORE_ADDR vaddr,
asection *osec; asection *osec;
flagword flags = SEC_ALLOC | SEC_HAS_CONTENTS | SEC_LOAD; flagword flags = SEC_ALLOC | SEC_HAS_CONTENTS | SEC_LOAD;
@ -417,10 +422,10 @@ Index: gdb-6.6/gdb/gcore.c
/* If the memory segment has no permissions set, ignore it, otherwise /* If the memory segment has no permissions set, ignore it, otherwise
when we later try to access it for read/write, we'll get an error when we later try to access it for read/write, we'll get an error
or jam the kernel. */ or jam the kernel. */
Index: gdb-6.6/gdb/gdb_procfs32.h Index: gdb-6.7/gdb/gdb_procfs32.h
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.6/gdb/gdb_procfs32.h 2007-01-20 06:56:21.000000000 +0100 +++ gdb-6.7/gdb/gdb_procfs32.h 2007-10-16 15:46:18.000000000 +0200
@@ -0,0 +1,128 @@ @@ -0,0 +1,128 @@
+#ifdef HAVE_SYS_PROCFS32_H +#ifdef HAVE_SYS_PROCFS32_H
+#include <sys/procfs32.h> +#include <sys/procfs32.h>
@ -550,10 +555,10 @@ Index: gdb-6.6/gdb/gdb_procfs32.h
+#endif /* _SYS_PROCFS32_H */ +#endif /* _SYS_PROCFS32_H */
+ +
+#endif /* HAVE_SYS_PROCFS32_H */ +#endif /* HAVE_SYS_PROCFS32_H */
Index: gdb-6.6/gdb/gdb_user32.h Index: gdb-6.7/gdb/gdb_user32.h
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.6/gdb/gdb_user32.h 2007-01-20 06:56:21.000000000 +0100 +++ gdb-6.7/gdb/gdb_user32.h 2007-10-16 15:46:18.000000000 +0200
@@ -0,0 +1,108 @@ @@ -0,0 +1,108 @@
+#ifdef HAVE_SYS_USER32_H +#ifdef HAVE_SYS_USER32_H
+#include <sys/user32.h> +#include <sys/user32.h>
@ -663,11 +668,11 @@ Index: gdb-6.6/gdb/gdb_user32.h
+#endif /* _SYS_USER32_H */ +#endif /* _SYS_USER32_H */
+ +
+#endif /* HAVE_SYS_USER32_H */ +#endif /* HAVE_SYS_USER32_H */
Index: gdb-6.6/gdb/linux-nat.c Index: gdb-6.7/gdb/linux-nat.c
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/linux-nat.c 2007-01-20 06:43:04.000000000 +0100 --- gdb-6.7.orig/gdb/linux-nat.c 2007-10-15 21:42:26.000000000 +0200
+++ gdb-6.6/gdb/linux-nat.c 2007-01-20 06:56:21.000000000 +0100 +++ gdb-6.7/gdb/linux-nat.c 2007-10-16 15:46:18.000000000 +0200
@@ -100,6 +100,15 @@ static LONGEST (*super_xfer_partial) (st @@ -98,6 +98,21 @@ static LONGEST (*super_xfer_partial) (st
const gdb_byte *, const gdb_byte *,
ULONGEST, LONGEST); ULONGEST, LONGEST);
@ -677,15 +682,21 @@ Index: gdb-6.6/gdb/linux-nat.c
+ (bfd *, char *, int *, const char *, const char *) = elfcore_write_prpsinfo; + (bfd *, char *, int *, const char *, const char *) = elfcore_write_prpsinfo;
+char *(*linux_elfcore_write_prstatus) +char *(*linux_elfcore_write_prstatus)
+ (bfd *, char *, int *, long, int, const void *) = elfcore_write_prstatus; + (bfd *, char *, int *, long, int, const void *) = elfcore_write_prstatus;
+char *(*linux_elfcore_write_prfpreg) +static char *
+ (bfd *, char *, int *, const void *, int) = elfcore_write_prfpreg; +linux_elfcore_write_prfpreg_bfd (bfd *abfd, char *buf, int *bufsiz,
+ const void *fpregs, int size, struct regcache *regcache)
+{
+ return elfcore_write_prfpreg (abfd, buf, bufsiz, fpregs, size);
+}
+char *(*linux_elfcore_write_prfpreg) (bfd *, char *, int *, const void *, int,
+ struct regcache *) = linux_elfcore_write_prfpreg_bfd;
+ +
static int debug_linux_nat; static int debug_linux_nat;
static void static void
show_debug_linux_nat (struct ui_file *file, int from_tty, show_debug_linux_nat (struct ui_file *file, int from_tty,
@@ -2715,11 +2724,11 @@ linux_nat_do_thread_registers (bfd *obfd @@ -2687,11 +2696,11 @@ linux_nat_do_thread_registers (bfd *obfd
else else
fill_gregset (&gregs, -1); fill_gregset (regcache, &gregs, -1);
- note_data = (char *) elfcore_write_prstatus (obfd, - note_data = (char *) elfcore_write_prstatus (obfd,
- note_data, - note_data,
@ -700,9 +711,9 @@ Index: gdb-6.6/gdb/linux-nat.c
if (core_regset_p if (core_regset_p
&& (regset = gdbarch_regset_from_core_section (gdbarch, ".reg2", && (regset = gdbarch_regset_from_core_section (gdbarch, ".reg2",
@@ -2730,10 +2739,10 @@ linux_nat_do_thread_registers (bfd *obfd @@ -2702,10 +2711,11 @@ linux_nat_do_thread_registers (bfd *obfd
else else
fill_fpregset (&fpregs, -1); fill_fpregset (regcache, &fpregs, -1);
- note_data = (char *) elfcore_write_prfpreg (obfd, - note_data = (char *) elfcore_write_prfpreg (obfd,
- note_data, - note_data,
@ -711,13 +722,14 @@ Index: gdb-6.6/gdb/linux-nat.c
+ note_data = (char *) linux_elfcore_write_prfpreg (obfd, + note_data = (char *) linux_elfcore_write_prfpreg (obfd,
+ note_data, + note_data,
+ note_size, + note_size,
+ &fpregs, sizeof (fpregs)); + &fpregs, sizeof (fpregs),
+ regcache);
#ifdef FILL_FPXREGSET #ifdef FILL_FPXREGSET
if (core_regset_p if (core_regset_p
@@ -2828,9 +2837,9 @@ linux_nat_make_corefile_notes (bfd *obfd @@ -2799,9 +2808,9 @@ linux_nat_make_corefile_notes (bfd *obfd
strncat (psargs, get_inferior_args (), psargs_end - string_end);
sizeof (psargs) - strlen (psargs)); }
} }
- note_data = (char *) elfcore_write_prpsinfo (obfd, - note_data = (char *) elfcore_write_prpsinfo (obfd,
- note_data, - note_data,
@ -728,11 +740,11 @@ Index: gdb-6.6/gdb/linux-nat.c
} }
/* Dump information for threads. */ /* Dump information for threads. */
Index: gdb-6.6/gdb/linux-nat.h Index: gdb-6.7/gdb/linux-nat.h
=================================================================== ===================================================================
--- gdb-6.6.orig/gdb/linux-nat.h 2007-01-20 06:42:58.000000000 +0100 --- gdb-6.7.orig/gdb/linux-nat.h 2007-10-13 05:09:50.000000000 +0200
+++ gdb-6.6/gdb/linux-nat.h 2007-01-20 06:56:21.000000000 +0100 +++ gdb-6.7/gdb/linux-nat.h 2007-10-16 15:46:18.000000000 +0200
@@ -108,3 +108,12 @@ void linux_nat_add_target (struct target @@ -110,3 +110,12 @@ void linux_nat_add_target (struct target
/* Update linux-nat internal state when changing from one fork /* Update linux-nat internal state when changing from one fork
to another. */ to another. */
void linux_nat_switch_fork (ptid_t new_ptid); void linux_nat_switch_fork (ptid_t new_ptid);
@ -744,4 +756,4 @@ Index: gdb-6.6/gdb/linux-nat.h
+extern char *(*linux_elfcore_write_prstatus) +extern char *(*linux_elfcore_write_prstatus)
+ (bfd *, char *, int *, long, int, const void *); + (bfd *, char *, int *, long, int, const void *);
+extern char *(*linux_elfcore_write_prfpreg) +extern char *(*linux_elfcore_write_prfpreg)
+ (bfd *, char *, int *, const void *, int); + (bfd *, char *, int *, const void *, int, struct regcache *);

View File

@ -1,143 +0,0 @@
2006-10-29 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb/symtab.c (matching_bfd_sections): Fix VMA matching for objects
loaded at a different address than stored on the disk.
2006-10-29 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/relativedebug.c, gdb.base/relativedebug.exp: New file,
resolving of PC in libc pause(3) (with possibly different on-disk VMA).
Index: ./gdb/symtab.c
===================================================================
--- ./gdb/symtab.c 17 Oct 2006 20:17:44 -0000 1.148
+++ ./gdb/symtab.c 29 Oct 2006 22:29:21 -0000
@@ -739,8 +739,11 @@ matching_bfd_sections (asection *first,
if (bfd_get_section_size (first) != bfd_get_section_size (second))
return 0;
+ /* In-memory addresses may start at a different offset, relativize them. */
if (bfd_get_section_vma (first->owner, first)
- != bfd_get_section_vma (second->owner, second))
+ - bfd_get_start_address (first->owner)
+ != bfd_get_section_vma (second->owner, second)
+ - bfd_get_start_address (second->owner))
return 0;
if (bfd_get_section_name (first->owner, first) == NULL
Index: ./gdb/testsuite/gdb.base/relativedebug.c
===================================================================
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ./gdb/testsuite/gdb.base/relativedebug.c 29 Oct 2006 22:29:21 -0000
@@ -0,0 +1,37 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2006 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <signal.h>
+
+
+static void handler (int signo)
+{
+ abort ();
+}
+
+int main (void)
+{
+ signal (SIGALRM, handler);
+ alarm (1);
+ pause ();
+ pause ();
+ return 0;
+}
Index: ./gdb/testsuite/gdb.base/relativedebug.exp
===================================================================
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ./gdb/testsuite/gdb.base/relativedebug.exp 29 Oct 2006 22:29:21 -0000
@@ -0,0 +1,68 @@
+# Copyright 2006 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set testfile relativedebug
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ untested "Couldn't compile test program"
+ return -1
+}
+
+# Get things started.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# pause () -> SIGALRM -> handler () -> abort ()
+
+gdb_test "run" \
+ ".*Program received signal SIGABRT, Aborted..*" \
+ "run"
+
+# incorrect (#6):
+# (gdb) bt
+# #0 0x00325402 in __kernel_vsyscall ()
+# #1 0x00718f20 in *__GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
+# #2 0x0071a801 in *__GI_abort () at abort.c:88
+# #3 0x0804841f in handler (signo=14) at ./gdb.base/relativedebug.c:27
+# #4 <signal handler called>
+# #5 0x00325402 in __kernel_vsyscall ()
+# #6 0x0077ebc6 in ?? () from /lib/i686/nosegneg/libc.so.6
+# #7 0x08048455 in main () at ./gdb.base/relativedebug.c:34
+# (gdb)
+
+# correct (#6):
+# (gdb) bt
+# #0 0x00b33402 in __kernel_vsyscall ()
+# #1 0x00718f20 in *__GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
+# #2 0x0071a801 in *__GI_abort () at abort.c:88
+# #3 0x0804841f in handler (signo=14) at ./gdb.base/relativedebug.c:27
+# #4 <signal handler called>
+# #5 0x00b33402 in __kernel_vsyscall ()
+# #6 0x0077ebc6 in __pause_nocancel () from /lib/i686/nosegneg/libc.so.6
+# #7 0x08048455 in main () at ./gdb.base/relativedebug.c:34
+# (gdb)
+
+gdb_test "bt" \
+ ".*\[^a-zA-Z\]pause\[^a-zA-Z\].*" \
+ "pause(3) seen there"

View File

@ -12,15 +12,15 @@ The testsuite needs `gdb-6.5-tls-of-separate-debuginfo.patch'.
* solib-svr4.c (svr4_fetch_objfile_link_map): Match even absolute * solib-svr4.c (svr4_fetch_objfile_link_map): Match even absolute
requested pathnames to the internal loaded relative pathnames. requested pathnames to the internal loaded relative pathnames.
2007-10-16 Jan Kratochvil <jan.kratochvil@redhat.com>
Index: gdb-6.5/gdb/solib-svr4.c Port to GDB-6.7.
Index: gdb-6.7/gdb/solib-svr4.c
=================================================================== ===================================================================
RCS file: /cvs/src/src/gdb/solib-svr4.c,v --- gdb-6.7.orig/gdb/solib-svr4.c 2007-10-14 23:04:45.000000000 +0200
retrieving revision 1.58 +++ gdb-6.7/gdb/solib-svr4.c 2007-10-16 15:43:56.000000000 +0200
diff -u -p -r1.58 gdb-6.5/gdb/solib-svr4.c @@ -1009,10 +1009,14 @@ CORE_ADDR
--- gdb-6.5.orig/gdb/solib-svr4.c 18 May 2006 20:38:56 -0000 1.58
+++ gdb-6.5/gdb/solib-svr4.c 1 Sep 2006 18:47:10 -0000
@@ -774,62 +774,81 @@ CORE_ADDR
svr4_fetch_objfile_link_map (struct objfile *objfile) svr4_fetch_objfile_link_map (struct objfile *objfile)
{ {
CORE_ADDR lm; CORE_ADDR lm;
@ -29,136 +29,48 @@ diff -u -p -r1.58 gdb-6.5/gdb/solib-svr4.c
if ((debug_base = locate_base ()) == 0) if ((debug_base = locate_base ()) == 0)
return 0; /* failed somehow... */ return 0; /* failed somehow... */
- /* Position ourselves on the first link map. */ +for (resolve = 0; resolve <= 1; resolve++)
- lm = solib_svr4_r_map (); +{
- while (lm)
+ for (resolve = 0; resolve <= 1; resolve++)
{
- /* Get info on the layout of the r_debug and link_map structures. */
- struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
- int errcode;
- char *buffer;
- struct lm_info objfile_lm_info;
- struct cleanup *old_chain;
- CORE_ADDR name_address;
- gdb_byte *l_name_buf = xmalloc (lmo->l_name_size);
- old_chain = make_cleanup (xfree, l_name_buf);
-
- /* Set up the buffer to contain the portion of the link_map
- structure that gdb cares about. Note that this is not the
- whole link_map structure. */
- objfile_lm_info.lm = xzalloc (lmo->link_map_size);
- make_cleanup (xfree, objfile_lm_info.lm);
-
- /* Read the link map into our internal structure. */
- read_memory (lm, objfile_lm_info.lm, lmo->link_map_size);
-
- /* Read address of name from target memory to GDB. */
- read_memory (lm + lmo->l_name_offset, l_name_buf, lmo->l_name_size);
-
- /* Extract this object's name. Assume that the address is
- unsigned. */
- name_address = extract_unsigned_integer (l_name_buf, lmo->l_name_size);
- target_read_string (name_address, &buffer,
- SO_NAME_MAX_PATH_SIZE - 1, &errcode);
- make_cleanup (xfree, buffer);
- if (errcode != 0)
- warning (_("Can't read pathname for load map: %s."),
- safe_strerror (errcode));
- else
- {
- /* Is this the linkmap for the file we want? */
- /* If the file is not a shared library and has no name,
- we are sure it is the main executable, so we return that. */
- if ((buffer && strcmp (buffer, objfile->name) == 0)
- || (!(objfile->flags & OBJF_SHARED) && (strcmp (buffer, "") == 0)))
- {
- do_cleanups (old_chain);
- return lm;
- }
- }
- /* Not the file we wanted, continue checking. Assume that the
- address is unsigned. */
- lm = extract_unsigned_integer (objfile_lm_info.lm + lmo->l_next_offset,
- lmo->l_next_size);
- do_cleanups (old_chain);
+ /* Position ourselves on the first link map. */
+ lm = solib_svr4_r_map ();
+ while (lm)
+ {
+ /* Get info on the layout of the r_debug and link_map structures. */
+ struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
+ int errcode;
+ char *buffer;
+ struct lm_info objfile_lm_info;
+ struct cleanup *old_chain;
+ CORE_ADDR name_address;
+ gdb_byte *l_name_buf = xmalloc (lmo->l_name_size);
+ old_chain = make_cleanup (xfree, l_name_buf);
+ +
+ /* Set up the buffer to contain the portion of the link_map /* Position ourselves on the first link map. */
+ structure that gdb cares about. Note that this is not the lm = solib_svr4_r_map ();
+ whole link_map structure. */ while (lm)
+ objfile_lm_info.lm = xzalloc (lmo->link_map_size); @@ -1051,6 +1055,21 @@ svr4_fetch_objfile_link_map (struct objf
+ make_cleanup (xfree, objfile_lm_info.lm); safe_strerror (errcode));
+ else
+ /* Read the link map into our internal structure. */ {
+ read_memory (lm, objfile_lm_info.lm, lmo->link_map_size); + /* solib_svr4_r_map() may contain relative pathnames while
+ + `objfile->name' is absolute. */
+ /* Read address of name from target memory to GDB. */ + if (resolve && buffer && buffer[0] != '/')
+ read_memory (lm + lmo->l_name_offset, l_name_buf, lmo->l_name_size);
+
+ /* Extract this object's name. Assume that the address is
+ unsigned. */
+ name_address = extract_unsigned_integer (l_name_buf, lmo->l_name_size);
+ target_read_string (name_address, &buffer,
+ SO_NAME_MAX_PATH_SIZE - 1, &errcode);
+ make_cleanup (xfree, buffer);
+ if (errcode != 0)
+ warning (_("Can't read pathname for load map: %s."),
+ safe_strerror (errcode));
+ else
+ { + {
+ /* solib_svr4_r_map() may contain relative pathnames while + char *absolute;
+ `objfile->name' is absolute. */ + int fd;
+ if (resolve && buffer && buffer[0] != '/')
+ {
+ char *absolute;
+ int fd;
+ +
+ fd = solib_open (buffer, &absolute); + fd = solib_open (buffer, &absolute);
+ if (fd != -1) + if (fd != -1)
+ {
+ make_cleanup (xfree, absolute);
+ buffer = absolute;
+ close (fd);
+ }
+ }
+ /* Is this the linkmap for the file we want? */
+ /* If the file is not a shared library and has no name,
+ we are sure it is the main executable, so we return that. */
+ if ((buffer && strcmp (buffer, objfile->name) == 0)
+ || (!(objfile->flags & OBJF_SHARED) && (strcmp (buffer, "") == 0)))
+ { + {
+ do_cleanups (old_chain); + make_cleanup (xfree, absolute);
+ return lm; + buffer = absolute;
+ close (fd);
+ } + }
+ } + }
+ /* Not the file we wanted, continue checking. Assume that the /* Is this the linkmap for the file we want? */
+ address is unsigned. */ /* If the file is not a shared library and has no name,
+ lm = extract_unsigned_integer (objfile_lm_info.lm + lmo->l_next_offset, we are sure it is the main executable, so we return that. */
+ lmo->l_next_size); @@ -1069,6 +1088,9 @@ svr4_fetch_objfile_link_map (struct objf
+ do_cleanups (old_chain); builtin_type_void_data_ptr);
+ } do_cleanups (old_chain);
} }
+
+} /* resolve */
+
return 0; return 0;
} }
Index: gdb-6.5/gdb/testsuite/gdb.threads/tls-sepdebug-main.c
Index: gdb-6.7/gdb/testsuite/gdb.threads/tls-sepdebug-main.c
=================================================================== ===================================================================
RCS file: gdb-6.5/gdb/testsuite/gdb.threads/tls-sepdebug-main.c --- /dev/null 1970-01-01 00:00:00.000000000 +0000
diff -N gdb-6.5/gdb/testsuite/gdb.threads/tls-sepdebug-main.c +++ gdb-6.7/gdb/testsuite/gdb.threads/tls-sepdebug-main.c 2007-10-16 15:40:01.000000000 +0200
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gdb-6.5/gdb/testsuite/gdb.threads/tls-sepdebug-main.c 1 Sep 2006 18:47:14 -0000
@@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
+/* This testcase is part of GDB, the GNU debugger. +/* This testcase is part of GDB, the GNU debugger.
+ +
@ -185,12 +97,10 @@ diff -N gdb-6.5/gdb/testsuite/gdb.threads/tls-sepdebug-main.c
+{ +{
+ return 0; + return 0;
+} +}
Index: gdb-6.5/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c Index: gdb-6.7/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c
=================================================================== ===================================================================
RCS file: gdb-6.5/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c --- /dev/null 1970-01-01 00:00:00.000000000 +0000
diff -N gdb-6.5/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c +++ gdb-6.7/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c 2007-10-16 15:40:01.000000000 +0200
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gdb-6.5/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c 1 Sep 2006 18:47:14 -0000
@@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
+/* This testcase is part of GDB, the GNU debugger. +/* This testcase is part of GDB, the GNU debugger.
+ +
@ -214,12 +124,10 @@ diff -N gdb-6.5/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c
+ bug-gdb@prep.ai.mit.edu */ + bug-gdb@prep.ai.mit.edu */
+ +
+__thread int var = 42; +__thread int var = 42;
Index: gdb-6.5/gdb/testsuite/gdb.threads/tls-sepdebug.exp Index: gdb-6.7/gdb/testsuite/gdb.threads/tls-sepdebug.exp
=================================================================== ===================================================================
RCS file: gdb-6.5/gdb/testsuite/gdb.threads/tls-sepdebug.exp --- /dev/null 1970-01-01 00:00:00.000000000 +0000
diff -N gdb-6.5/gdb/testsuite/gdb.threads/tls-sepdebug.exp +++ gdb-6.7/gdb/testsuite/gdb.threads/tls-sepdebug.exp 2007-10-16 15:40:01.000000000 +0200
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gdb-6.5/gdb/testsuite/gdb.threads/tls-sepdebug.exp 1 Sep 2006 18:47:14 -0000
@@ -0,0 +1,81 @@ @@ -0,0 +1,81 @@
+# Copyright 2006 Free Software Foundation, Inc. +# Copyright 2006 Free Software Foundation, Inc.
+ +

View File

@ -1,189 +0,0 @@
2006-10-30 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb/minsyms.c (lookup_minimal_symbol_by_pc_section): Handle
overlapping non-zero sized functions (for glibc `__nanosleep').
2006-10-30 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.arch/i386-size-overlap.c, gdb.arch/i386-size-overlap.exp: New
file, provide nested (overlapping) functions for the PC resolving.
Index: ./gdb/minsyms.c
===================================================================
--- ./gdb/minsyms.c 17 Oct 2006 20:17:44 -0000 1.47
+++ ./gdb/minsyms.c 30 Oct 2006 12:41:26 -0000
@@ -511,6 +511,29 @@ lookup_minimal_symbol_by_pc_section (COR
continue;
}
+ /* We are behind the current symbol's size.
+ Try the previous symbol - if it is non-zero sized one it
+ may overlap the current one and reach our PC.
+ It occurs for GNU/Linux glibc `__nanosleep' overlapping
+ later `__nanosleep_nocancel' with PC at 0077ec66:
+ Num: Value Size Type Bind Vis Ndx Name
+ 7247: 0077ec20 124 FUNC WEAK DEFAULT 11 __nanosleep
+ 4651: 0077ec2a 32 FUNC LOCAL DEFAULT 11 __nanosleep_nocancel
+ Test `gdb.arch/i386-size' + `gdb.arch/i386-unwind'.
+ Limit it only for the overlapping cases as we could harm
+ the zero-sized symbols detection logic around.
+ */
+ if (hi > 0
+ && MSYMBOL_SIZE (&msymbol[hi]) != 0
+ && pc >= (SYMBOL_VALUE_ADDRESS (&msymbol[hi])
+ + MSYMBOL_SIZE (&msymbol[hi]))
+ && pc < (SYMBOL_VALUE_ADDRESS (&msymbol[hi - 1])
+ + MSYMBOL_SIZE (&msymbol[hi - 1])))
+ {
+ hi--;
+ continue;
+ }
+
/* Otherwise, this symbol must be as good as we're going
to get. */
break;
Index: ./gdb/testsuite/gdb.arch/i386-size-overlap.c
===================================================================
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ./gdb/testsuite/gdb.arch/i386-size-overlap.c 30 Oct 2006 12:41:35 -0000
@@ -0,0 +1,53 @@
+/* Overlapping symbol sizes test program.
+
+ Copyright 2006 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifdef SYMBOL_PREFIX
+#define SYMBOL(str) SYMBOL_PREFIX #str
+#else
+#define SYMBOL(str) #str
+#endif
+
+void
+trap (void)
+{
+ asm ("int $0x03");
+}
+
+/* Jump from a function with its symbol size set, to a function
+ named by a local label. GDB should report the `main' function
+ even for the rest, after the global `inner' ends. */
+
+asm(".text\n"
+ " .align 8\n"
+ " .globl " SYMBOL (main) "\n"
+ SYMBOL (main) ":\n"
+ " pushl %ebp\n"
+ " mov %esp, %ebp\n"
+ " call .Lfunc\n"
+ " ret\n"
+ SYMBOL (inner) ":\n"
+ " ret\n"
+ " .size " SYMBOL (inner) ", .-" SYMBOL (inner) "\n"
+ ".Lfunc:\n"
+ " pushl %ebp\n"
+ " mov %esp, %ebp\n"
+ " call " SYMBOL (trap) "\n"
+ " .size " SYMBOL (main) ", .-" SYMBOL (main) "\n");
Index: gdb/testsuite/gdb.arch/i386-size-overlap.exp
===================================================================
RCS file: gdb/testsuite/gdb.arch/i386-size-overlap.exp
diff -N ./gdb/testsuite/gdb.arch/i386-size-overlap.exp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ./gdb/testsuite/gdb.arch/i386-size-overlap.exp 30 Oct 2006 12:41:35 -0000
@@ -0,0 +1,79 @@
+# Copyright 2006 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@gnu.org
+
+# This file is part of the gdb testsuite.
+
+if $tracelevel {
+ strace $tracelevel
+}
+
+# Test that GDB can handle overlapping sizes of symbols.
+
+if ![istarget "i?86-*-*"] then {
+ verbose "Skipping i386 unwinder tests."
+ return
+}
+
+set testfile "i386-size-overlap"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+# some targets have leading underscores on assembly symbols.
+# TODO: detect this automatically
+set additional_flags ""
+if [istarget "i?86-*-cygwin*"] then {
+ set additional_flags "additional_flags=-DSYMBOL_PREFIX=\"_\""
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
+ executable [list debug $additional_flags]] != "" } {
+ untested "i386-size"
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# We use gdb_run_cmd so this stands a chance to work for remote
+# targets too.
+gdb_run_cmd
+
+gdb_expect {
+ -re "Program received signal SIGTRAP.*$gdb_prompt $" {
+ pass "run past main"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "run past main"
+ }
+ timeout {
+ fail "run past main (timeout)"
+ }
+}
+
+set message "backtrace shows the outer function"
+gdb_test_multiple "backtrace 10" $message {
+ -re "#1\[ \t]*$hex in inner.*$gdb_prompt $" {
+ fail $message
+ }
+ -re "#1\[ \t]*$hex in main.*$gdb_prompt $" {
+ pass $message
+ }
+}

View File

@ -1,43 +0,0 @@
2007-01-13 Jan Kratochvil <jan.kratochvil@redhat.com>
* lib/gdb.exp (get_compiler_info): Cope with nondefault output logs.
diff -u -rupN gdb-6.5-ppc/gdb/testsuite/lib/gdb.exp gdb-6.5/gdb/testsuite/lib/gdb.exp
--- gdb-6.5-ppc/gdb/testsuite/lib/gdb.exp 2007-01-12 14:33:26.000000000 -0500
+++ gdb-6.5/gdb/testsuite/lib/gdb.exp 2007-01-12 21:15:02.000000000 -0500
@@ -1351,9 +1351,10 @@ proc get_compiler_info {binfile args} {
# Run $ifile through the right preprocessor.
# Toggle gdb.log to keep the compiler output out of the log.
+ set log_old [log_file -info]
log_file
set cppout [ gdb_compile "${ifile}" "" preprocess [list "$args" quiet] ]
- log_file -a "$outdir/$tool.log"
+ eval "log_file $log_old"
# Eval the output.
set unknown 0
2007-01-14 Jan Kratochvil <jan.kratochvil@redhat.com>
* lib/gdb.exp: Abort on missing `site.exp'.
diff -u -rup gdb-6.5-orig/gdb/testsuite/lib/gdb.exp gdb-6.5/gdb/testsuite/lib/gdb.exp
--- gdb-6.5-orig/gdb/testsuite/lib/gdb.exp 2006-12-17 11:59:42.000000000 +0100
+++ gdb-6.5/gdb/testsuite/lib/gdb.exp 2007-01-14 16:27:03.000000000 +0100
@@ -22,6 +22,12 @@
# need to be modified for any target, it can be done with a variable
# or by passing arguments.
+if {$tool == ""} {
+ # Tests would fail, logs on get_compiler_info() would be missing.
+ send_error "`site.exp' not found, run `make site.exp'!\n"
+ exit 2
+}
+
load_lib libgloss.exp
global GDB

View File

@ -1,116 +0,0 @@
Compatibility with: linux-2.6-elf-core-sysctl.patch
fs.binfmt_elf.core_dump_elf_headers=1
2007-08-07 Alan Modra <amodra@bigpond.net.au>
* elf.c: (_bfd_elf_make_section_from_phdr): Properly handle
bss segments.
--- ./bfd/elf.c 6 Aug 2007 18:35:18 -0000 1.405
+++ ./bfd/elf.c 6 Aug 2007 22:53:27 -0000 1.406
@@ -2223,7 +2223,7 @@ _bfd_elf_new_section_hook (bfd *abfd, as
for the single program segment. The first has the length specified by
the file size of the segment, and the second has the length specified
by the difference between the two sizes. In effect, the segment is split
- into it's initialized and uninitialized parts.
+ into its initialized and uninitialized parts.
*/
@@ -2242,40 +2242,46 @@ _bfd_elf_make_section_from_phdr (bfd *ab
split = ((hdr->p_memsz > 0)
&& (hdr->p_filesz > 0)
&& (hdr->p_memsz > hdr->p_filesz));
- sprintf (namebuf, "%s%d%s", typename, index, split ? "a" : "");
- len = strlen (namebuf) + 1;
- name = bfd_alloc (abfd, len);
- if (!name)
- return FALSE;
- memcpy (name, namebuf, len);
- newsect = bfd_make_section (abfd, name);
- if (newsect == NULL)
- return FALSE;
- newsect->vma = hdr->p_vaddr;
- newsect->lma = hdr->p_paddr;
- newsect->size = hdr->p_filesz;
- newsect->filepos = hdr->p_offset;
- newsect->flags |= SEC_HAS_CONTENTS;
- newsect->alignment_power = bfd_log2 (hdr->p_align);
- if (hdr->p_type == PT_LOAD)
+
+ if (hdr->p_filesz > 0)
{
- newsect->flags |= SEC_ALLOC;
- newsect->flags |= SEC_LOAD;
- if (hdr->p_flags & PF_X)
+ sprintf (namebuf, "%s%d%s", typename, index, split ? "a" : "");
+ len = strlen (namebuf) + 1;
+ name = bfd_alloc (abfd, len);
+ if (!name)
+ return FALSE;
+ memcpy (name, namebuf, len);
+ newsect = bfd_make_section (abfd, name);
+ if (newsect == NULL)
+ return FALSE;
+ newsect->vma = hdr->p_vaddr;
+ newsect->lma = hdr->p_paddr;
+ newsect->size = hdr->p_filesz;
+ newsect->filepos = hdr->p_offset;
+ newsect->flags |= SEC_HAS_CONTENTS;
+ newsect->alignment_power = bfd_log2 (hdr->p_align);
+ if (hdr->p_type == PT_LOAD)
{
- /* FIXME: all we known is that it has execute PERMISSION,
- may be data. */
- newsect->flags |= SEC_CODE;
+ newsect->flags |= SEC_ALLOC;
+ newsect->flags |= SEC_LOAD;
+ if (hdr->p_flags & PF_X)
+ {
+ /* FIXME: all we known is that it has execute PERMISSION,
+ may be data. */
+ newsect->flags |= SEC_CODE;
+ }
+ }
+ if (!(hdr->p_flags & PF_W))
+ {
+ newsect->flags |= SEC_READONLY;
}
- }
- if (!(hdr->p_flags & PF_W))
- {
- newsect->flags |= SEC_READONLY;
}
- if (split)
+ if (hdr->p_memsz > hdr->p_filesz)
{
- sprintf (namebuf, "%s%db", typename, index);
+ bfd_vma align;
+
+ sprintf (namebuf, "%s%d%s", typename, index, split ? "b" : "");
len = strlen (namebuf) + 1;
name = bfd_alloc (abfd, len);
if (!name)
@@ -2287,8 +2293,21 @@ _bfd_elf_make_section_from_phdr (bfd *ab
newsect->vma = hdr->p_vaddr + hdr->p_filesz;
newsect->lma = hdr->p_paddr + hdr->p_filesz;
newsect->size = hdr->p_memsz - hdr->p_filesz;
+ newsect->filepos = hdr->p_offset + hdr->p_filesz;
+ align = newsect->vma & -newsect->vma;
+ if (align == 0 || align > hdr->p_align)
+ align = hdr->p_align;
+ newsect->alignment_power = bfd_log2 (align);
if (hdr->p_type == PT_LOAD)
{
+ /* Hack for gdb. Segments that have not been modified do
+ not have their contents written to a core file, on the
+ assumption that a debugger can find the contents in the
+ executable. We flag this case by setting the fake
+ section size to zero. Note that "real" bss sections will
+ always have their contents dumped to the core file. */
+ if (bfd_get_format (abfd) == bfd_core)
+ newsect->size = 0;
newsect->flags |= SEC_ALLOC;
if (hdr->p_flags & PF_X)
newsect->flags |= SEC_CODE;

View File

@ -1,7 +1,14 @@
diff -u -rup gdb-6.6-orig/gdb/Makefile.in gdb-6.6/gdb/Makefile.in [base]
--- gdb-6.6-orig/gdb/Makefile.in 2007-08-28 15:31:19.000000000 +0200
+++ gdb-6.6/gdb/Makefile.in 2007-08-28 15:32:40.000000000 +0200 2007-10-16 Jan Kratochvil <jan.kratochvil@redhat.com>
@@ -1917,7 +1917,8 @@ corelow.o: corelow.c $(defs_h) $(arch_ut
Port to GDB-6.7.
Index: gdb-6.7/gdb/Makefile.in
===================================================================
--- gdb-6.7.orig/gdb/Makefile.in 2007-10-16 16:19:18.000000000 +0200
+++ gdb-6.7/gdb/Makefile.in 2007-10-16 16:42:34.000000000 +0200
@@ -1932,7 +1932,8 @@ corelow.o: corelow.c $(defs_h) $(arch_ut
$(inferior_h) $(symtab_h) $(command_h) $(bfd_h) $(target_h) \ $(inferior_h) $(symtab_h) $(command_h) $(bfd_h) $(target_h) \
$(gdbcore_h) $(gdbthread_h) $(regcache_h) $(regset_h) $(symfile_h) \ $(gdbcore_h) $(gdbthread_h) $(regcache_h) $(regset_h) $(symfile_h) \
$(exec_h) $(readline_h) $(gdb_assert_h) \ $(exec_h) $(readline_h) $(gdb_assert_h) \
@ -9,22 +16,23 @@ diff -u -rup gdb-6.6-orig/gdb/Makefile.in gdb-6.6/gdb/Makefile.in
+ $(exceptions_h) $(solib_h) $(auxv_h) $(elf_common_h) $(objfiles_h) \ + $(exceptions_h) $(solib_h) $(auxv_h) $(elf_common_h) $(objfiles_h) \
+ $(gdbcmd_h) + $(gdbcmd_h)
core-regset.o: core-regset.c $(defs_h) $(command_h) $(gdbcore_h) \ core-regset.o: core-regset.c $(defs_h) $(command_h) $(gdbcore_h) \
$(inferior_h) $(target_h) $(gdb_string_h) $(gregset_h) $(inferior_h) $(target_h) $(regcache_h) $(gdb_string_h) $(gregset_h)
cp-abi.o: cp-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(command_h) $(gdbcmd_h) \ cp-abi.o: cp-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(command_h) $(gdbcmd_h) \
@@ -2785,7 +2786,8 @@ symfile.o: symfile.c $(defs_h) $(bfdlink @@ -2769,7 +2770,8 @@ symfile.o: symfile.c $(defs_h) $(bfdlink
$(gdb_stabs_h) $(gdb_obstack_h) $(completer_h) $(bcache_h) \ $(gdb_stabs_h) $(gdb_obstack_h) $(completer_h) $(bcache_h) \
$(hashtab_h) $(readline_h) $(gdb_assert_h) $(block_h) \ $(hashtab_h) $(readline_h) $(gdb_assert_h) $(block_h) \
$(gdb_string_h) $(gdb_stat_h) $(observer_h) $(exec_h) \ $(gdb_string_h) $(gdb_stat_h) $(observer_h) $(exec_h) \
- $(parser_defs_h) $(elf_bfd_h) - $(parser_defs_h) $(varobj_h) $(elf_bfd_h)
+ $(parser_defs_h) $(elf_bfd_h) $(gdb_stdint_h) $(libbfd_h) $(elf_bfd_h) \ + $(parser_defs_h) $(varobj_h) $(elf_bfd_h) $(gdb_stdint_h) $(libbfd_h) \
+ $(elf_external_h) + $(elf_bfd_h) $(elf_external_h)
symfile-mem.o: symfile-mem.c $(defs_h) $(symtab_h) $(gdbcore_h) \ symfile-mem.o: symfile-mem.c $(defs_h) $(symtab_h) $(gdbcore_h) \
$(objfiles_h) $(exceptions_h) $(gdbcmd_h) $(target_h) $(value_h) \ $(objfiles_h) $(exceptions_h) $(gdbcmd_h) $(target_h) $(value_h) \
$(symfile_h) $(observer_h) $(auxv_h) $(elf_common_h) $(symfile_h) $(observer_h) $(auxv_h) $(elf_common_h)
diff -u -rup gdb-6.6-orig/gdb/corelow.c gdb-6.6/gdb/corelow.c Index: gdb-6.7/gdb/corelow.c
--- gdb-6.6-orig/gdb/corelow.c 2006-04-18 21:20:06.000000000 +0200 ===================================================================
+++ gdb-6.6/gdb/corelow.c 2007-08-28 15:31:56.000000000 +0200 --- gdb-6.7.orig/gdb/corelow.c 2007-09-04 01:06:35.000000000 +0200
@@ -46,6 +46,10 @@ +++ gdb-6.7/gdb/corelow.c 2007-10-16 16:41:50.000000000 +0200
@@ -44,6 +44,10 @@
#include "gdb_assert.h" #include "gdb_assert.h"
#include "exceptions.h" #include "exceptions.h"
#include "solib.h" #include "solib.h"
@ -35,7 +43,7 @@ diff -u -rup gdb-6.6-orig/gdb/corelow.c gdb-6.6/gdb/corelow.c
#ifndef O_LARGEFILE #ifndef O_LARGEFILE
@@ -253,6 +257,66 @@ add_to_thread_list (bfd *abfd, asection @@ -251,6 +255,66 @@ add_to_thread_list (bfd *abfd, asection
inferior_ptid = pid_to_ptid (thread_id); /* Yes, make it current */ inferior_ptid = pid_to_ptid (thread_id); /* Yes, make it current */
} }
@ -102,7 +110,7 @@ diff -u -rup gdb-6.6-orig/gdb/corelow.c gdb-6.6/gdb/corelow.c
/* This routine opens and sets up the core file bfd. */ /* This routine opens and sets up the core file bfd. */
static void static void
@@ -417,6 +420,15 @@ core_open (char *filename, int from_tty) @@ -347,6 +411,15 @@ core_open (char *filename, int from_tty)
ontop = !push_target (&core_ops); ontop = !push_target (&core_ops);
discard_cleanups (old_chain); discard_cleanups (old_chain);
@ -118,7 +126,7 @@ diff -u -rup gdb-6.6-orig/gdb/corelow.c gdb-6.6/gdb/corelow.c
/* This is done first, before anything has a chance to query the /* This is done first, before anything has a chance to query the
inferior for information such as symbols. */ inferior for information such as symbols. */
post_create_inferior (&core_ops, from_tty); post_create_inferior (&core_ops, from_tty);
@@ -662,4 +734,13 @@ _initialize_corelow (void) @@ -678,4 +751,13 @@ _initialize_corelow (void)
if (!coreops_suppress_target) if (!coreops_suppress_target)
add_target (&core_ops); add_target (&core_ops);
@ -132,16 +140,16 @@ diff -u -rup gdb-6.6-orig/gdb/corelow.c gdb-6.6/gdb/corelow.c
+ show_build_id_core_loads, + show_build_id_core_loads,
+ &setlist, &showlist); + &setlist, &showlist);
} }
diff -u -rup gdb-6.6-orig/gdb/solib-svr4.c gdb-6.6/gdb/solib-svr4.c Index: gdb-6.7/gdb/solib-svr4.c
--- gdb-6.6-orig/gdb/solib-svr4.c 2007-08-28 15:31:19.000000000 +0200 ===================================================================
+++ gdb-6.6/gdb/solib-svr4.c 2007-08-28 15:34:02.000000000 +0200 --- gdb-6.7.orig/gdb/solib-svr4.c 2007-10-16 15:43:56.000000000 +0200
@@ -943,10 +943,35 @@ svr4_current_sos (void) +++ gdb-6.7/gdb/solib-svr4.c 2007-10-16 16:44:44.000000000 +0200
} @@ -957,9 +957,35 @@ svr4_current_sos (void)
else free_so (new);
{ else
{
- strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1); - strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
- new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; - new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
- xfree (buffer);
- strcpy (new->so_original_name, new->so_name); - strcpy (new->so_original_name, new->so_name);
+ struct build_id *build_id; + struct build_id *build_id;
+ +
@ -175,12 +183,13 @@ diff -u -rup gdb-6.6-orig/gdb/solib-svr4.c gdb-6.6/gdb/solib-svr4.c
if (debug_solib) if (debug_solib)
{ {
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,
diff -u -rup gdb-6.6-orig/gdb/symfile.c gdb-6.6/gdb/symfile.c Index: gdb-6.7/gdb/symfile.c
--- gdb-6.6-orig/gdb/symfile.c 2007-08-28 15:31:19.000000000 +0200 ===================================================================
+++ gdb-6.6/gdb/symfile.c 2007-08-28 15:36:22.000000000 +0200 --- gdb-6.7.orig/gdb/symfile.c 2007-10-15 21:42:26.000000000 +0200
@@ -54,6 +54,9 @@ +++ gdb-6.7/gdb/symfile.c 2007-10-16 16:46:30.000000000 +0200
#include "exec.h" @@ -53,6 +53,9 @@
#include "parser-defs.h" #include "parser-defs.h"
#include "varobj.h"
#include "elf-bfd.h" #include "elf-bfd.h"
+#include "gdb_stdint.h" +#include "gdb_stdint.h"
+#include "libbfd.h" +#include "libbfd.h"
@ -188,7 +197,7 @@ diff -u -rup gdb-6.6-orig/gdb/symfile.c gdb-6.6/gdb/symfile.c
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>
@@ -62,6 +65,7 @@ @@ -61,6 +64,7 @@
#include <ctype.h> #include <ctype.h>
#include <time.h> #include <time.h>
#include <sys/time.h> #include <sys/time.h>
@ -196,7 +205,7 @@ diff -u -rup gdb-6.6-orig/gdb/symfile.c gdb-6.6/gdb/symfile.c
int (*deprecated_ui_load_progress_hook) (const char *section, unsigned long num); int (*deprecated_ui_load_progress_hook) (const char *section, unsigned long num);
@@ -1120,16 +1124,62 @@ symbol_file_clear (int from_tty) @@ -1238,16 +1242,62 @@ symbol_file_clear (int from_tty)
printf_unfiltered (_("No symbol file now.\n")); printf_unfiltered (_("No symbol file now.\n"));
} }
@ -261,7 +270,7 @@ diff -u -rup gdb-6.6-orig/gdb/symfile.c gdb-6.6/gdb/symfile.c
{ {
struct build_id *retval; struct build_id *retval;
@@ -1145,6 +1195,348 @@ build_id_bfd_get (bfd *abfd) @@ -1263,6 +1313,348 @@ build_id_bfd_get (bfd *abfd)
return retval; return retval;
} }
@ -610,7 +619,7 @@ diff -u -rup gdb-6.6-orig/gdb/symfile.c gdb-6.6/gdb/symfile.c
/* Return if FILENAME has NT_GNU_BUILD_ID matching the CHECK value. */ /* Return if FILENAME has NT_GNU_BUILD_ID matching the CHECK value. */
static int static int
@@ -1159,7 +1551,7 @@ build_id_verify (const char *filename, s @@ -1277,7 +1669,7 @@ build_id_verify (const char *filename, s
if (abfd == NULL) if (abfd == NULL)
return 0; return 0;
@ -619,9 +628,9 @@ diff -u -rup gdb-6.6-orig/gdb/symfile.c gdb-6.6/gdb/symfile.c
if (found == NULL) if (found == NULL)
warning (_("File \"%s\" has no build-id, file skipped"), filename); warning (_("File \"%s\" has no build-id, file skipped"), filename);
@@ -1177,8 +1569,9 @@ build_id_verify (const char *filename, s @@ -1293,8 +1685,9 @@ build_id_verify (const char *filename, s
return retval;
static char *debug_file_directory = NULL; }
-static char * -static char *
-build_id_to_debug_filename (struct build_id *build_id) -build_id_to_debug_filename (struct build_id *build_id)
@ -631,7 +640,7 @@ diff -u -rup gdb-6.6-orig/gdb/symfile.c gdb-6.6/gdb/symfile.c
{ {
char *link, *s, *retval = NULL; char *link, *s, *retval = NULL;
gdb_byte *data = build_id->data; gdb_byte *data = build_id->data;
@@ -1186,7 +1579,9 @@ build_id_to_debug_filename (struct build @@ -1302,7 +1695,9 @@ build_id_to_debug_filename (struct build
/* DEBUG_FILE_DIRECTORY/.build-id/ab/cdef */ /* DEBUG_FILE_DIRECTORY/.build-id/ab/cdef */
link = xmalloc (strlen (debug_file_directory) + (sizeof "/.build-id/" - 1) + 1 link = xmalloc (strlen (debug_file_directory) + (sizeof "/.build-id/" - 1) + 1
@ -642,7 +651,7 @@ diff -u -rup gdb-6.6-orig/gdb/symfile.c gdb-6.6/gdb/symfile.c
s = link + sprintf (link, "%s/.build-id/", debug_file_directory); s = link + sprintf (link, "%s/.build-id/", debug_file_directory);
if (size > 0) if (size > 0)
{ {
@@ -1197,12 +1592,14 @@ build_id_to_debug_filename (struct build @@ -1313,12 +1708,14 @@ build_id_to_debug_filename (struct build
*s++ = '/'; *s++ = '/';
while (size-- > 0) while (size-- > 0)
s += sprintf (s, "%02x", (unsigned) *data++); s += sprintf (s, "%02x", (unsigned) *data++);
@ -659,7 +668,7 @@ diff -u -rup gdb-6.6-orig/gdb/symfile.c gdb-6.6/gdb/symfile.c
if (retval != NULL && !build_id_verify (retval, build_id)) if (retval != NULL && !build_id_verify (retval, build_id))
{ {
@@ -1210,6 +1607,11 @@ build_id_to_debug_filename (struct build @@ -1326,6 +1723,11 @@ build_id_to_debug_filename (struct build
retval = NULL; retval = NULL;
} }
@ -671,7 +680,7 @@ diff -u -rup gdb-6.6-orig/gdb/symfile.c gdb-6.6/gdb/symfile.c
return retval; return retval;
} }
@@ -1305,23 +1707,27 @@ find_separate_debug_file (struct objfile @@ -1423,23 +1825,27 @@ find_separate_debug_file (struct objfile
unsigned long crc32; unsigned long crc32;
int i; int i;
struct build_id *build_id; struct build_id *build_id;
@ -704,7 +713,7 @@ diff -u -rup gdb-6.6-orig/gdb/symfile.c gdb-6.6/gdb/symfile.c
} }
basename = get_debug_link_info (objfile, &crc32); basename = get_debug_link_info (objfile, &crc32);
@@ -1329,7 +1735,10 @@ find_separate_debug_file (struct objfile @@ -1447,7 +1853,10 @@ find_separate_debug_file (struct objfile
if (basename == NULL) if (basename == NULL)
/* There's no separate debug info, hence there's no way we could /* There's no separate debug info, hence there's no way we could
load it => no warning. */ load it => no warning. */
@ -716,7 +725,7 @@ diff -u -rup gdb-6.6-orig/gdb/symfile.c gdb-6.6/gdb/symfile.c
dir = xstrdup (objfile->name); dir = xstrdup (objfile->name);
@@ -1358,6 +1767,7 @@ find_separate_debug_file (struct objfile @@ -1476,6 +1885,7 @@ find_separate_debug_file (struct objfile
if (separate_debug_file_exists (debugfile, crc32, objfile->name)) if (separate_debug_file_exists (debugfile, crc32, objfile->name))
{ {
@ -724,7 +733,7 @@ diff -u -rup gdb-6.6-orig/gdb/symfile.c gdb-6.6/gdb/symfile.c
xfree (basename); xfree (basename);
xfree (dir); xfree (dir);
return xstrdup (debugfile); return xstrdup (debugfile);
@@ -1371,6 +1781,7 @@ find_separate_debug_file (struct objfile @@ -1489,6 +1899,7 @@ find_separate_debug_file (struct objfile
if (separate_debug_file_exists (debugfile, crc32, objfile->name)) if (separate_debug_file_exists (debugfile, crc32, objfile->name))
{ {
@ -732,7 +741,7 @@ diff -u -rup gdb-6.6-orig/gdb/symfile.c gdb-6.6/gdb/symfile.c
xfree (basename); xfree (basename);
xfree (dir); xfree (dir);
return xstrdup (debugfile); return xstrdup (debugfile);
@@ -1384,11 +1795,20 @@ find_separate_debug_file (struct objfile @@ -1502,6 +1913,7 @@ find_separate_debug_file (struct objfile
if (separate_debug_file_exists (debugfile, crc32, objfile->name)) if (separate_debug_file_exists (debugfile, crc32, objfile->name))
{ {
@ -740,8 +749,18 @@ diff -u -rup gdb-6.6-orig/gdb/symfile.c gdb-6.6/gdb/symfile.c
xfree (basename); xfree (basename);
xfree (dir); xfree (dir);
return xstrdup (debugfile); return xstrdup (debugfile);
@@ -1521,6 +1933,7 @@ find_separate_debug_file (struct objfile
if (separate_debug_file_exists (debugfile, crc32, objfile->name))
{
+ xfree (build_id_filename);
xfree (canon_name);
xfree (basename);
xfree (dir);
@@ -1528,6 +1941,14 @@ find_separate_debug_file (struct objfile
}
} }
+ if (build_id_filename != NULL) + if (build_id_filename != NULL)
+ { + {
+ fprintf_unfiltered (gdb_stdlog, + fprintf_unfiltered (gdb_stdlog,
@ -750,10 +769,10 @@ diff -u -rup gdb-6.6-orig/gdb/symfile.c gdb-6.6/gdb/symfile.c
+ xfree (build_id_filename); + xfree (build_id_filename);
+ } + }
+ +
xfree (basename); if (canon_name)
xfree (dir); xfree (canon_name);
return NULL;
@@ -4024,4 +4443,12 @@ the global debug-file directory prepende @@ -4223,4 +4644,12 @@ the global debug-file directory prepende
NULL, NULL,
show_debug_file_directory, show_debug_file_directory,
&setlist, &showlist); &setlist, &showlist);
@ -766,12 +785,13 @@ diff -u -rup gdb-6.6-orig/gdb/symfile.c gdb-6.6/gdb/symfile.c
+ show_build_id_debug, + show_build_id_debug,
+ &setdebuglist, &showdebuglist); + &setdebuglist, &showdebuglist);
} }
diff -u -rup gdb-6.6-orig/gdb/symfile.h gdb-6.6/gdb/symfile.h Index: gdb-6.7/gdb/symfile.h
--- gdb-6.6-orig/gdb/symfile.h 2005-12-17 23:34:03.000000000 +0100 ===================================================================
+++ gdb-6.6/gdb/symfile.h 2007-08-28 15:31:56.000000000 +0200 --- gdb-6.7.orig/gdb/symfile.h 2007-09-24 23:48:05.000000000 +0200
@@ -322,6 +322,12 @@ extern bfd_byte *symfile_relocate_debug_ +++ gdb-6.7/gdb/symfile.h 2007-10-16 16:41:50.000000000 +0200
extern void dwarf_build_psymtabs (struct objfile *, int, file_ptr, @@ -353,6 +353,12 @@ extern int symfile_map_offsets_to_segmen
unsigned int, file_ptr, unsigned int); struct symfile_segment_data *get_symfile_segment_data (bfd *abfd);
void free_symfile_segment_data (struct symfile_segment_data *data);
+/* build-id support. */ +/* build-id support. */
+struct build_id; +struct build_id;

View File

@ -1,715 +0,0 @@
http://sources.redhat.com/ml/gdb-patches/2007-08/msg00478.html
v2
[ Backported for GDB-6.6. ]
2007-08-26 Jan Kratochvil <jan.kratochvil@redhat.com>
* Makefile.in (symfile.o): Update dependencies.
* symfile.c (symbol_file_add_with_addrs_or_offsets): Initialize the
DEBUGFILE variable. FIND_SEPARATE_DEBUG_FILE called only if !PSYMTABS.
(struct build_id): New structure.
(build_id_bfd_get, build_id_verify, build_id_to_debug_filename): New.
(find_separate_debug_file): New variable BUILD_ID.
Call BUILD_ID_BFD_GET with BUILD_ID_TO_DEBUG_FILENAME as the first try.
2007-08-26 Jan Kratochvil <jan.kratochvil@redhat.com>
* lib/gdb.exp (build_id_debug_filename_get): New function.
* gdb.base/sepdebug.exp: Reflect the changes in the heading comment.
Remove the generate DEBUG file for the future testcase runs.
New testcase for the NT_GNU_BUILD_ID retrieval.
Move the final testing step to ...
(test_different_dir): ... a new function.
New parameter XFAIL to XFAIL all the tests performed.
New parameter TEST_DIFFERENT_DIR parametrizing the directory.
New parameter TYPE to PF_PREFIX all the tests performed.
2007-08-26 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.texinfo (Separate Debug Files): Included a BUILD ID description.
Enlisted BUILD ID to the debug file searching example.
Included a BUILD ID `.note.gnu.build-id' section description.
Updated/added the debug files splitting instructions for OBJCOPY.
diff -u -rup gdb-6.6-orig/gdb/Makefile.in gdb-6.6/gdb/Makefile.in
--- gdb-6.6-orig/gdb/Makefile.in 2007-08-28 14:32:18.000000000 +0200
+++ gdb-6.6/gdb/Makefile.in 2007-08-28 14:33:56.000000000 +0200
@@ -2785,7 +2785,7 @@ symfile.o: symfile.c $(defs_h) $(bfdlink
$(gdb_stabs_h) $(gdb_obstack_h) $(completer_h) $(bcache_h) \
$(hashtab_h) $(readline_h) $(gdb_assert_h) $(block_h) \
$(gdb_string_h) $(gdb_stat_h) $(observer_h) $(exec_h) \
- $(parser_defs_h)
+ $(parser_defs_h) $(elf_bfd_h)
symfile-mem.o: symfile-mem.c $(defs_h) $(symtab_h) $(gdbcore_h) \
$(objfiles_h) $(exceptions_h) $(gdbcmd_h) $(target_h) $(value_h) \
$(symfile_h) $(observer_h) $(auxv_h) $(elf_common_h)
diff -u -rup gdb-6.6-orig/gdb/doc/gdb.texinfo gdb-6.6/gdb/doc/gdb.texinfo
--- gdb-6.6-orig/gdb/doc/gdb.texinfo 2007-08-28 14:32:18.000000000 +0200
+++ gdb-6.6/gdb/doc/gdb.texinfo 2007-08-28 14:33:03.000000000 +0200
@@ -11857,18 +11857,32 @@ than the executable code itself --- some
information for their executables in separate files, which users can
install only when they need to debug a problem.
-If an executable's debugging information has been extracted to a
-separate file, the executable should contain a @dfn{debug link} giving
-the name of the debugging information file (with no directory
-components), and a checksum of its contents. (The exact form of a
-debug link is described below.) If the full name of the directory
-containing the executable is @var{execdir}, and the executable has a
-debug link that specifies the name @var{debugfile}, then @value{GDBN}
-will automatically search for the debugging information file in three
-places:
+There are two identificators how the separate debug file may be found:
@itemize @bullet
@item
+@dfn{debug link} is present only in the executable if its debug information has
+been split out. It is not present in the separate debug file. It provides the
+separate debug file filename, usually as @file{executable.debug}.
+@item
+@dfn{build id} is present in all the files (if the operating system supports
+it). The executable file and its separate debug file have the same unique
+@dfn{build id} content.
+@end itemize
+
+If the full name of the directory containing the executable is @var{execdir},
+the executable has a debug link that specifies the name @var{debugfile},
+@var{bu} is the first byte (two hexadecimal characters) of the build id
+content, @var{ild-id} are the remaining bytes / hexadecimal characters and
+@var{globaldebugdir} is the global debug file directory then @value{GDBN} will
+automatically search for the debugging information file in four places:
+
+@itemize @bullet
+@item
+a specific file in the subdirectory of the global debug file directory
+according to the @dfn{build id} content (if present), the file tried is
+@file{@var{globaldebugdir}/.debug-id/@var{bu}/@var{ild-id}.debug}.
+@item
the directory containing the executable file (that is, it will look
for a file named @file{@var{execdir}/@var{debugfile}},
@item
@@ -11883,15 +11897,17 @@ executable's full path, and the name fro
@end itemize
@noindent
@value{GDBN} checks under each of these names for a debugging
-information file whose checksum matches that given in the link, and
-reads the debugging information from the first one it finds.
-
-So, for example, if you ask @value{GDBN} to debug @file{/usr/bin/ls},
-which has a link containing the name @file{ls.debug}, and the global
-debug directory is @file{/usr/lib/debug}, then @value{GDBN} will look
-for debug information in @file{/usr/bin/ls.debug},
-@file{/usr/bin/.debug/ls.debug}, and
-@file{/usr/lib/debug/usr/bin/ls.debug}.
+information file with build id content matching the build id content of the
+executable file - or - whose checksum matches the one given in the link in the
+debug link case. In each case @value{GDBN} reads the debugging information
+from the first debug file it finds.
+
+So, for example, if you ask @value{GDBN} to debug @file{/usr/bin/ls}, which has
+a @dfn{debug link} containing the name @file{ls.debug}, its @dfn{build id}
+value in hexadecimal is @code{abcdef} and the global debug directory is
+@file{/usr/lib/debug}, then @value{GDBN} will look for debug information in
+@file{/usr/lib/debug/.build-id/ab/cdef.debug}, @file{/usr/bin/ls.debug},
+@file{/usr/bin/.debug/ls.debug}, and @file{/usr/lib/debug/usr/bin/ls.debug}.
You can set the global debugging info directory's name, and view the
name @value{GDBN} is currently using.
@@ -11933,6 +11949,16 @@ Any executable file format can carry a d
contain a section named @code{.gnu_debuglink} with the contents
described above.
+@cindex @code{.note.gnu.build-id} sections
+@cindex build id
+Build id is a special section of the executable file named
+@code{.note.gnu.build-id}. The section contains unique identification hash
+derived from the built files - it remains the same across multiple builds of
+the same build tree. The default algorithm SHA1 produces 160 bits (40
+hexadecimal characters) of the content. The same section and value is present
+in the original built binary with symbols, in its stripped variant and in the
+separate debug information file.
+
The debugging information file itself should be an ordinary
executable, containing a full set of linker symbols, sections, and
debugging information. The sections of the debugging information file
@@ -11940,18 +11966,21 @@ should have the same names, addresses an
but they need not contain any data --- much like a @code{.bss} section
in an ordinary executable.
-As of December 2002, there is no standard GNU utility to produce
-separated executable / debugging information file pairs. Ulrich
-Drepper's @file{elfutils} package, starting with version 0.53,
-contains a version of the @code{strip} command such that the command
-@kbd{strip foo -f foo.debug} removes the debugging information from
-the executable file @file{foo}, places it in the file
-@file{foo.debug}, and leaves behind a debug link in @file{foo}.
-
-Since there are many different ways to compute CRC's (different
-polynomials, reversals, byte ordering, etc.), the simplest way to
-describe the CRC used in @code{.gnu_debuglink} sections is to give the
-complete code for a function that computes it:
+@sc{gnu} binary utilities contain the @samp{objcopy} utility able to produce
+the separated executable / debugging information file pairs by commands
+@kbd{objcopy --only-keep-debug foo foo.debug; strip -g foo; objcopy
+--add-gnu-debuglink="foo.debug" "foo"}. These commands remove the debugging
+information from the executable file @file{foo}, place it in the file
+@file{foo.debug}, and leave behind a debug link in @file{foo}. Ulrich
+Drepper's @file{elfutils} package, starting with version 0.53, contains
+a version of the @code{strip} command such that the command @kbd{strip foo -f
+foo.debug} has the same functionality as the three commands above.
+
+Since there are many different ways to compute CRC's for the debug link
+(different polynomials, reversals, byte ordering, etc.). This computation does
+not apply to the build id section. The simplest way to describe the CRC used
+in @code{.gnu_debuglink} sections is to give the complete code for a function
+that computes it:
@kindex gnu_debuglink_crc32
@smallexample
diff -u -rup gdb-6.6-orig/gdb/symfile.c gdb-6.6/gdb/symfile.c
--- gdb-6.6-orig/gdb/symfile.c 2007-08-28 14:32:17.000000000 +0200
+++ gdb-6.6/gdb/symfile.c 2007-08-28 14:34:12.000000000 +0200
@@ -53,6 +53,7 @@
#include "observer.h"
#include "exec.h"
#include "parser-defs.h"
+#include "elf-bfd.h"
#include <sys/types.h>
#include <fcntl.h>
@@ -904,7 +905,7 @@ symbol_file_add_with_addrs_or_offsets (b
{
struct objfile *objfile;
struct partial_symtab *psymtab;
- char *debugfile;
+ char *debugfile = NULL;
struct section_addr_info *orig_addrs = NULL;
struct cleanup *my_cleanups;
const char *name = bfd_get_filename (abfd);
@@ -968,7 +969,11 @@ symbol_file_add_with_addrs_or_offsets (b
}
}
- debugfile = find_separate_debug_file (objfile);
+ /* If the file has its own symbol tables it has no separate debug info.
+ `.dynsym'/`.symtab' go to MSYMBOLS, `.debug_info' goes to SYMTABS/PSYMTABS.
+ `.gnu_debuglink' may no longer be present with `.note.gnu.build-id'. */
+ if (objfile->psymtabs == NULL)
+ debugfile = find_separate_debug_file (objfile);
if (debugfile)
{
if (addrs != NULL)
@@ -1115,6 +1120,99 @@ symbol_file_clear (int from_tty)
printf_unfiltered (_("No symbol file now.\n"));
}
+struct build_id
+ {
+ size_t size;
+ gdb_byte data[1];
+ };
+
+/* Locate NT_GNU_BUILD_ID from ABFD and return its content. */
+
+static struct build_id *
+build_id_bfd_get (bfd *abfd)
+{
+ struct build_id *retval;
+
+ if (!bfd_check_format (abfd, bfd_object)
+ || bfd_get_flavour (abfd) != bfd_target_elf_flavour
+ || elf_tdata (abfd)->build_id == NULL)
+ return NULL;
+
+ retval = xmalloc (sizeof *retval - 1 + elf_tdata (abfd)->build_id_size);
+ retval->size = elf_tdata (abfd)->build_id_size;
+ memcpy (retval->data, elf_tdata (abfd)->build_id, retval->size);
+
+ return retval;
+}
+
+/* Return if FILENAME has NT_GNU_BUILD_ID matching the CHECK value. */
+
+static int
+build_id_verify (const char *filename, struct build_id *check)
+{
+ bfd *abfd;
+ struct build_id *found = NULL;
+ int retval = 0;
+
+ /* We expect to be silent on the non-existing files. */
+ abfd = bfd_openr (filename, gnutarget);
+ if (abfd == NULL)
+ return 0;
+
+ found = build_id_bfd_get (abfd);
+
+ if (found == NULL)
+ warning (_("File \"%s\" has no build-id, file skipped"), filename);
+ else if (found->size != check->size
+ || memcmp (found->data, check->data, found->size) != 0)
+ warning (_("File \"%s\" has a different build-id, file skipped"), filename);
+ else
+ retval = 1;
+
+ if (!bfd_close (abfd))
+ warning (_("cannot close \"%s\": %s"), filename,
+ bfd_errmsg (bfd_get_error ()));
+ return retval;
+}
+
+static char *debug_file_directory = NULL;
+
+static char *
+build_id_to_debug_filename (struct build_id *build_id)
+{
+ char *link, *s, *retval = NULL;
+ gdb_byte *data = build_id->data;
+ size_t size = build_id->size;
+
+ /* DEBUG_FILE_DIRECTORY/.build-id/ab/cdef */
+ link = xmalloc (strlen (debug_file_directory) + (sizeof "/.build-id/" - 1) + 1
+ + 2 * size + (sizeof ".debug" - 1) + 1);
+ s = link + sprintf (link, "%s/.build-id/", debug_file_directory);
+ if (size > 0)
+ {
+ size--;
+ s += sprintf (s, "%02x", (unsigned) *data++);
+ }
+ if (size > 0)
+ *s++ = '/';
+ while (size-- > 0)
+ s += sprintf (s, "%02x", (unsigned) *data++);
+ strcpy (s, ".debug");
+
+ /* lrealpath() is expensive even for the usually non-existent files. */
+ if (access (link, F_OK) == 0)
+ retval = lrealpath (link);
+ xfree (link);
+
+ if (retval != NULL && !build_id_verify (retval, build_id))
+ {
+ xfree (retval);
+ retval = NULL;
+ }
+
+ return retval;
+}
+
static char *
get_debug_link_info (struct objfile *objfile, unsigned long *crc32_out)
{
@@ -1278,7 +1280,6 @@ separate_debug_file_exists (const char *
return 1;
}
-static char *debug_file_directory = NULL;
static void
show_debug_file_directory (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
@@ -1207,6 +1303,25 @@ find_separate_debug_file (struct objfile
bfd_size_type debuglink_size;
unsigned long crc32;
int i;
+ struct build_id *build_id;
+
+ build_id = build_id_bfd_get (objfile->obfd);
+ if (build_id != NULL)
+ {
+ char *build_id_name;
+
+ build_id_name = build_id_to_debug_filename (build_id);
+ free (build_id);
+ /* Prevent looping on a stripped .debug file. */
+ if (build_id_name != NULL && strcmp (build_id_name, objfile->name) == 0)
+ {
+ warning (_("\"%s\": separate debug info file has no debug info"),
+ build_id_name);
+ xfree (build_id_name);
+ }
+ else if (build_id_name != NULL)
+ return build_id_name;
+ }
basename = get_debug_link_info (objfile, &crc32);
diff -u -rup gdb-6.6-orig/gdb/testsuite/gdb.base/sepdebug.exp gdb-6.6/gdb/testsuite/gdb.base/sepdebug.exp
--- gdb-6.6-orig/gdb/testsuite/gdb.base/sepdebug.exp 2007-08-28 14:32:17.000000000 +0200
+++ gdb-6.6/gdb/testsuite/gdb.base/sepdebug.exp 2007-08-28 14:46:38.000000000 +0200
@@ -21,11 +21,14 @@
# Based on break.exp, written by Rob Savoye. (rob@cygnus.com)
# Modified to test gdb's handling of separate debug info files.
+# Modified to test gdb's handling of a debug-id retrieval.
# This file has two parts. The first is testing that gdb behaves
# normally after reading in an executable and its corresponding
# separate debug file. The second moves the .debug file to a different
# location and tests the "set debug-file-directory" command.
+# The third is for testing build-id retrievel by finding the separate
+# ".debug-id/ab/cdef.debug" file.
if $tracelevel then {
@@ -851,110 +854,6 @@ proc test_next_with_recursion {} {
test_next_with_recursion
-#********
-
-# now move the .debug file to a different location so that we can test
-# the "set debug-file-directory" command.
-
-remote_exec build "mv ${objdir}/${subdir}/.debug/${testfile}.debug ${objdir}/${subdir}"
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_test "set debug-file-directory ${objdir}/${subdir}" ".*" "set separate debug location"
-gdb_load ${binfile}
-
-if [target_info exists gdb_stub] {
- gdb_step_for_stub;
-}
-
-#
-# test break at function
-#
-gdb_test "break main" \
- "Breakpoint.*at.* file .*$srcfile, line.*" \
- "breakpoint function, optimized file"
-
-#
-# test break at function
-#
-gdb_test "break marker4" \
- "Breakpoint.*at.* file .*$srcfile, line.*" \
- "breakpoint small function, optimized file"
-
-#
-# run until the breakpoint at main is hit. For non-stubs-using targets.
-#
-if ![target_info exists use_gdb_stub] {
- if [istarget "*-*-vxworks*"] then {
- send_gdb "run vxmain \"2\"\n"
- set timeout 120
- verbose "Timeout is now $timeout seconds" 2
- } else {
- send_gdb "run\n"
- }
- gdb_expect {
- -re "The program .* has been started already.*y or n. $" {
- send_gdb "y\n"
- exp_continue
- }
- -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:$bp_location6.*$bp_location6\[\t \]+if .argc.* \{.*$gdb_prompt $"\
- { pass "run until function breakpoint, optimized file" }
- -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$gdb_prompt $"\
- { pass "run until function breakpoint, optimized file (code motion)" }
- -re ".*$gdb_prompt $" { fail "run until function breakpoint, optimized file" }
- timeout { fail "run until function breakpoint, optimized file (timeout)" }
- }
-} else {
- if ![target_info exists gdb_stub] {
- gdb_test continue ".*Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:$bp_location6.*$bp_location6\[\t \]+if .argc.*\{.*" "stub continue, optimized file"
- }
-}
-
-#
-# run until the breakpoint at a small function
-#
-
-#
-# Add a second pass pattern. The behavior differs here between stabs
-# and dwarf for one-line functions. Stabs preserves two line symbols
-# (one before the prologue and one after) with the same line number,
-# but dwarf regards these as duplicates and discards one of them.
-# Therefore the address after the prologue (where the breakpoint is)
-# has no exactly matching line symbol, and GDB reports the breakpoint
-# as if it were in the middle of a line rather than at the beginning.
-
-set bp_location13 [gdb_get_line_number "set breakpoint 13 here"]
-set bp_location14 [gdb_get_line_number "set breakpoint 14 here"]
-send_gdb "continue\n"
-gdb_expect {
- -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:$bp_location13\[\r\n\]+$bp_location13\[\t \]+void marker4.*" {
- pass "run until breakpoint set at small function, optimized file"
- }
- -re "Breakpoint $decimal, $hex in marker4 \\(d=177601976\\) at .*$srcfile:$bp_location13\[\r\n\]+$bp_location13\[\t \]+void marker4.*" {
- pass "run until breakpoint set at small function, optimized file"
- }
- -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:$bp_location14\[\r\n\]+$bp_location14\[\t \]+void marker4.*" {
- # marker4() is defined at line 46 when compiled with -DPROTOTYPES
- pass "run until breakpoint set at small function, optimized file (line bp_location14)"
- }
- -re ".*$gdb_prompt " {
- fail "run until breakpoint set at small function, optimized file"
- }
- timeout {
- fail "run until breakpoint set at small function, optimized file (timeout)"
- }
-}
-
-
-# Reset the default arguments for VxWorks
-if [istarget "*-*-vxworks*"] {
- set timeout 10
- verbose "Timeout is now $timeout seconds" 2
- send_gdb "set args main\n"
- gdb_expect -re ".*$gdb_prompt $" {}
-}
-
-
# Compile up a second, different, object file. Copy its debug info
# over the top of the new debug info. Note that somewhere in the
# above the "set debug-file-directory" variable is set to
@@ -973,6 +872,7 @@ if [gdb_gnu_strip_debug $binfile] {
unsupported "cannot produce separate debug info files"
return -1
}
+remote_exec build "cp ${existing_binfile}.debug ${existing_binfile}.debug-backup"
remote_exec build "cp $corrupt_debug_file ${existing_binfile}.debug"
gdb_exit
@@ -990,3 +890,188 @@ gdb_test_multiple "file $existing_binfil
exp_continue
}
}
+
+remote_exec build "cp ${existing_binfile}.debug-backup ${existing_binfile}.debug"
+
+#********
+
+proc test_different_dir {type test_different_dir xfail} {
+ global srcdir subdir objdir binfile srcfile timeout gdb_prompt
+ global pf_prefix
+ global bp_location6 decimal hex
+
+ set pf_prefix "$type:"
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_test "set debug-file-directory ${test_different_dir}" ".*" "set separate debug location"
+ gdb_load ${binfile}
+
+ if [target_info exists gdb_stub] {
+ gdb_step_for_stub;
+ }
+
+ #
+ # test break at function
+ #
+ if {$xfail} {
+ setup_xfail "*-*-*"
+ }
+ gdb_test "break main" \
+ "Breakpoint.*at.* file .*$srcfile, line.*" \
+ "breakpoint function, optimized file"
+
+ #
+ # test break at function
+ #
+ if {$xfail} {
+ setup_xfail "*-*-*"
+ }
+ gdb_test "break marker4" \
+ "Breakpoint.*at.* file .*$srcfile, line.*" \
+ "breakpoint small function, optimized file"
+
+ #
+ # run until the breakpoint at main is hit. For non-stubs-using targets.
+ #
+ gdb_run_cmd
+ if {$xfail} {
+ setup_xfail "*-*-*"
+ }
+ gdb_expect {
+ -re "Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:$bp_location6.*$bp_location6\[\t \]+if .argc.* \{.*$gdb_prompt $" {
+ pass "run until function breakpoint, optimized file"
+ }
+ -re "Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$gdb_prompt $" {
+ pass "run until function breakpoint, optimized file (code motion)"
+ }
+ -re "$gdb_prompt $" {
+ fail "run until function breakpoint, optimized file"
+ }
+ timeout {
+ fail "run until function breakpoint, optimized file (timeout)"
+ }
+ }
+
+ if ![target_info exists use_gdb_stub] {
+ if [istarget "*-*-vxworks*"] then {
+ send_gdb "run vxmain \"2\"\n"
+ set timeout 120
+ verbose "Timeout is now $timeout seconds" 2
+ } else {
+ send_gdb "run\n"
+ }
+ if {$xfail} {
+ setup_xfail "*-*-*"
+ }
+ gdb_expect {
+ -re "The program .* has been started already.*y or n. $" {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:$bp_location6.*$bp_location6\[\t \]+if .argc.* \{.*$gdb_prompt $"\
+ { pass "run until function breakpoint, optimized file" }
+ -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$gdb_prompt $"\
+ { pass "run until function breakpoint, optimized file (code motion)" }
+ -re ".*$gdb_prompt $" { fail "run until function breakpoint, optimized file" }
+ timeout { fail "run until function breakpoint, optimized file (timeout)" }
+ }
+ } else {
+ if ![target_info exists gdb_stub] {
+ gdb_test continue ".*Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:$bp_location6.*$bp_location6\[\t \]+if .argc.*\{.*" "stub continue, optimized file"
+ }
+ }
+
+
+
+ #
+ # run until the breakpoint at a small function
+ #
+
+ #
+ # Add a second pass pattern. The behavior differs here between stabs
+ # and dwarf for one-line functions. Stabs preserves two line symbols
+ # (one before the prologue and one after) with the same line number,
+ # but dwarf regards these as duplicates and discards one of them.
+ # Therefore the address after the prologue (where the breakpoint is)
+ # has no exactly matching line symbol, and GDB reports the breakpoint
+ # as if it were in the middle of a line rather than at the beginning.
+
+ set bp_location13 [gdb_get_line_number "set breakpoint 13 here"]
+ set bp_location14 [gdb_get_line_number "set breakpoint 14 here"]
+ send_gdb "continue\n"
+ if {$xfail} {
+ setup_xfail "*-*-*"
+ }
+ gdb_expect {
+ -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:$bp_location13\[\r\n\]+$bp_location13\[\t \]+void marker4.*" {
+ pass "run until breakpoint set at small function, optimized file"
+ }
+ -re "Breakpoint $decimal, $hex in marker4 \\(d=177601976\\) at .*$srcfile:$bp_location13\[\r\n\]+$bp_location13\[\t \]+void marker4.*" {
+ pass "run until breakpoint set at small function, optimized file"
+ }
+ -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:$bp_location14\[\r\n\]+$bp_location14\[\t \]+void marker4.*" {
+ # marker4() is defined at line 46 when compiled with -DPROTOTYPES
+ pass "run until breakpoint set at small function, optimized file (line bp_location14)"
+ }
+ -re ".*$gdb_prompt " {
+ fail "run until breakpoint set at small function, optimized file"
+ }
+ timeout {
+ fail "run until breakpoint set at small function, optimized file (timeout)"
+ }
+ }
+
+
+ # Reset the default arguments for VxWorks
+ if [istarget "*-*-vxworks*"] {
+ set timeout 10
+ verbose "Timeout is now $timeout seconds" 2
+ send_gdb "set args main\n"
+ gdb_expect -re ".*$gdb_prompt $" {}
+ }
+
+ unset pf_prefix
+# proc test_different_dir
+}
+
+
+# now move the .debug file to a different location so that we can test
+# the "set debug-file-directory" command.
+
+remote_exec build "mv ${objdir}/${subdir}/.debug/${testfile}.debug ${objdir}/${subdir}"
+set debugfile "${objdir}/${subdir}/${testfile}.debug"
+
+test_different_dir debuglink "${objdir}/${subdir}" 0
+
+
+# NT_GNU_BUILD_ID / .note.gnu.build-id test:
+
+set build_id_debug_filename [build_id_debug_filename_get $binfile]
+if {$build_id_debug_filename eq ""} {
+ unsupported "build-id is not supported by the compiler"
+
+ # Spare debug files may confuse testsuite runs in the future.
+ remote_exec build "rm -f $debugfile"
+} else {
+ set build_id_debugself_filename [build_id_debug_filename_get $debugfile]
+ set test "build-id support by binutils"
+ set xfail 0
+ if {$build_id_debugself_filename eq ""} {
+ unsupported $test
+ set xfail 1
+ } elseif {$build_id_debugself_filename ne $build_id_debug_filename} {
+ fail $test
+ } else {
+ pass $test
+ }
+
+ file mkdir [file dirname ${objdir}/${subdir}/${build_id_debug_filename}]
+ remote_exec build "mv $debugfile ${objdir}/${subdir}/${build_id_debug_filename}"
+
+ test_different_dir build-id "${objdir}/${subdir}" $xfail
+
+ # Spare debug files may confuse testsuite runs in the future.
+ remote_exec build "rm -f ${objdir}/${subdir}/${build_id_debug_filename}"
+}
diff -u -rup gdb-6.6-orig/gdb/testsuite/lib/gdb.exp gdb-6.6/gdb/testsuite/lib/gdb.exp
--- gdb-6.6-orig/gdb/testsuite/lib/gdb.exp 2007-08-28 14:32:18.000000000 +0200
+++ gdb-6.6/gdb/testsuite/lib/gdb.exp 2007-08-28 14:33:03.000000000 +0200
@@ -2323,6 +2323,27 @@ proc separate_debug_filename { exec } {
return $debug_file
}
+# Return the build-id hex string (usually 160 bits as 40 hex characters)
+# converted to the form: .build-id/ab/cdef1234...89.debug
+# Return "" if no build-id found.
+proc build_id_debug_filename_get { exec } {
+ set tmp "${exec}-tmp"
+ exec objcopy -j .note.gnu.build-id -O binary $exec $tmp
+ set fi [open $tmp]
+ # Skip the NOTE header.
+ read $fi 16
+ set data [read $fi]
+ close $fi
+ file delete $tmp
+ if {$data eq ""} {
+ return ""
+ }
+ # Convert it to hex.
+ binary scan $data H* data
+ set data [regsub {^..} $data {\0/}]
+ return ".build-id/${data}.debug";
+}
+
# Create stripped files for DEST, replacing it. If ARGS is passed, it is a
# list of optional flags. The only currently supported flag is no-main,
# which removes the symbol entry for main from the separate debug file.
--- gdb-6.6/gdb/testsuite/gdb.base/sepdebug.exp 2007-08-28 15:27:36.000000000 +0200
+++ gdb-6.6/gdb/testsuite/gdb.base/sepdebug.exp 2007-08-28 15:25:23.000000000 +0200
@@ -860,14 +860,14 @@ test_next_with_recursion
# ${objdir}/${subdir} so need to move things there.
set existing_binfile $binfile
-set testfile "sepdebug2"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-set corrupt_debug_file [separate_debug_filename $binfile]
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+set testfile2 "sepdebug2"
+set srcfile2 ${testfile2}.c
+set binfile2 ${objdir}/${subdir}/${testfile2}
+set corrupt_debug_file [separate_debug_filename $binfile2]
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {debug additional_flags=-w}] != "" } {
return -1
}
-if [gdb_gnu_strip_debug $binfile] {
+if [gdb_gnu_strip_debug $binfile2] {
# check that you have a recent version of strip and objcopy installed
unsupported "cannot produce separate debug info files"
return -1

View File

@ -1,9 +1,14 @@
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=225783 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=225783
2007-10-16 Jan Kratochvil <jan.kratochvil@redhat.com>
--- gdb-6.6/gdb/testsuite/gdb.base/prelink.exp.orig 2006-03-08 19:22:09.000000000 -0500 Port to GDB-6.7.
+++ gdb-6.6/gdb/testsuite/gdb.base/prelink.exp 2007-04-08 13:22:45.000000000 -0400
@@ -48,7 +48,7 @@ Index: gdb-6.7/gdb/testsuite/gdb.base/prelink.exp
===================================================================
--- gdb-6.7.orig/gdb/testsuite/gdb.base/prelink.exp 2007-08-23 20:14:17.000000000 +0200
+++ gdb-6.7/gdb/testsuite/gdb.base/prelink.exp 2007-10-16 16:16:51.000000000 +0200
@@ -47,7 +47,7 @@ if { [gdb_compile "${srcdir}/${subdir}/$
return -1 return -1
} }
@ -12,13 +17,13 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=225783
# Maybe we don't have prelink. # Maybe we don't have prelink.
return -1 return -1
} }
@@ -89,11 +89,11 @@ @@ -88,11 +88,11 @@ if { $found == 0 } {
return 0 return 0
} }
-if {[catch "system \"prelink -uN ${libfile}\""] != 0} { -if {[catch "system \"prelink -uN ${libfile}\""] != 0} {
+if {[catch "system \"/usr/sbin/prelink -uN ${libfile}\""] != 0} { +if {[catch "system \"/usr/sbin/prelink -uN ${libfile}\""] != 0} {
untested "${libfile} was not prelinked, maybe system libraries are not prelinked?" untested "${testfile}.so was not prelinked, maybe system libraries are not prelinked?"
return 0 return 0
} }
-catch "system \"prelink -qNR ${libfile}\"" -catch "system \"prelink -qNR ${libfile}\""

View File

@ -1,201 +0,0 @@
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=232014
Based on `gdb-6.5-gcore-i386-on-amd64.patch'.
diff -u -rup gdb-6.6-orig/gdb/Makefile.in gdb-6.6/gdb/Makefile.in
--- gdb-6.6-orig/gdb/Makefile.in 2007-03-12 17:59:56.000000000 -0400
+++ gdb-6.6/gdb/Makefile.in 2007-04-23 13:05:05.000000000 -0400
@@ -2481,7 +2481,7 @@ ppcbug-rom.o: ppcbug-rom.c $(defs_h) $(g
ppc-linux-nat.o: ppc-linux-nat.c $(defs_h) $(gdb_string_h) $(frame_h) \
$(inferior_h) $(gdbcore_h) $(regcache_h) $(gdb_assert_h) \
$(gdb_wait_h) $(gregset_h) $(ppc_tdep_h) $(target_h) \
- $(linux_nat_h)
+ $(linux_nat_h) $(elf_bfd_h) $(gdb_procfs32_h)
ppc-linux-tdep.o: ppc-linux-tdep.c $(defs_h) $(frame_h) $(inferior_h) \
$(symtab_h) $(target_h) $(gdbcore_h) $(gdbcmd_h) $(symfile_h) \
$(objfiles_h) $(regcache_h) $(value_h) $(osabi_h) $(regset_h) \
diff -u -rup gdb-6.6-orig/gdb/gdb_procfs32.h gdb-6.6/gdb/gdb_procfs32.h
--- gdb-6.6-orig/gdb/gdb_procfs32.h 2007-03-12 17:59:55.000000000 -0400
+++ gdb-6.6/gdb/gdb_procfs32.h 2007-04-23 13:07:03.000000000 -0400
@@ -23,6 +23,8 @@
#ifndef _SYS_PROCFS32_H
#define _SYS_PROCFS32_H 1
+#if defined(__x86_64__) || defined(__ppc64__) || defined(__powerpc64__)
+
/* This is somewhat modelled after the file of the same name on SVR4
systems. It provides a definition of the core file format for ELF
used on Linux. It doesn't have anything to do with the /proc file
@@ -49,17 +51,27 @@ typedef unsigned int elf_greg32_t;
user_regs_struct' directly in the typedef, but tradition says that
the register set is an array, which does have some peculiar
semantics, so leave it that way. */
+#if defined(__x86_64__)
#define ELF_NGREG32 (sizeof (struct user_regs32_struct) / sizeof(elf_greg32_t))
+#elif defined(__ppc64__) || defined(__powerpc64__)
+#define ELF_NGREG32 48
+#else
+#error "Unsupported platform"
+#endif
typedef elf_greg32_t elf_gregset32_t[ELF_NGREG32];
/* Register set for the floating-point registers. */
-typedef struct user_fpregs32_struct elf_fpregset32_t;
-
/* Register set for the extended floating-point registers. Includes
the Pentium III SSE registers in addition to the classic
floating-point stuff. */
+#if defined(__x86_64__)
+typedef struct user_fpregs32_struct elf_fpregset32_t;
typedef struct user_fpxregs32_struct elf_fpxregset32_t;
-
+#elif defined(__ppc64__) || defined(__powerpc64__)
+typedef elf_fpregset_t elf_fpregset32_t;
+#else
+#error "Unsupported platform"
+#endif
/* Definitions to generate Intel SVR4-like core files. These mostly
have the same names as the SVR4 types with "elf_" tacked on the
@@ -100,8 +112,15 @@
char pr_zomb; /* Zombie. */
char pr_nice; /* Nice val. */
unsigned int pr_flag; /* Flags. */
+#if defined(__x86_64__)
unsigned short int pr_uid;
unsigned short int pr_gid;
+#elif defined(__ppc64__) || defined(__powerpc64__)
+ unsigned int pr_uid;
+ unsigned int pr_gid;
+#else
+#error "Unsupported platform"
+#endif
int pr_pid, pr_ppid, pr_pgrp, pr_sid;
/* Lots missing */
char pr_fname[16]; /* Filename of executable. */
@@ -123,6 +135,8 @@ typedef struct elf_prpsinfo32 prpsinfo32
__END_DECLS
+#endif /* defined(__x86_64__) || defined(__ppc64__) || defined(__powerpc64__) */
+
#endif /* _SYS_PROCFS32_H */
#endif /* HAVE_SYS_PROCFS32_H */
diff -u -rup gdb-6.6-orig/gdb/gdb_user32.h gdb-6.6/gdb/gdb_user32.h
--- gdb-6.6-orig/gdb/gdb_user32.h 2007-03-12 17:59:55.000000000 -0400
+++ gdb-6.6/gdb/gdb_user32.h 2007-04-23 13:05:05.000000000 -0400
@@ -32,6 +32,8 @@ typedef unsigned int gdb_uint32_t;
#ifndef _SYS_USER32_H
#define _SYS_USER32_H 1
+#ifdef __x86_64__
+
/* These are the 32-bit x86 structures. */
struct user_fpregs32_struct
@@ -103,6 +105,8 @@ struct user32
int u_debugreg [8];
};
+#endif /* __x86_64__ */
+
#endif /* _SYS_USER32_H */
#endif /* HAVE_SYS_USER32_H */
diff -u -rup gdb-6.6-orig/gdb/ppc-linux-nat.c gdb-6.6/gdb/ppc-linux-nat.c
--- gdb-6.6-orig/gdb/ppc-linux-nat.c 2006-05-05 16:45:03.000000000 -0400
+++ gdb-6.6/gdb/ppc-linux-nat.c 2007-04-23 13:16:09.000000000 -0400
@@ -29,6 +29,8 @@
#include "gdb_assert.h"
#include "target.h"
#include "linux-nat.h"
+#include "bfd/elf-bfd.h"
+#include "gdb_procfs32.h"
#include <stdint.h>
#include <sys/types.h>
@@ -1002,6 +1004,68 @@ fill_fpregset (gdb_fpregset_t *fpregsetp
}
}
+#if defined(__ppc64__) || defined(__powerpc64__)
+
+/* This functions make ELF32 32-bit elfcore note sections
+ on ppc64 environment. */
+
+static char *
+ppc_linux_elfcore_write_prpsinfo (bfd *abfd, char *buf, int *bufsiz,
+ const char *fname, const char *psargs)
+{
+ if (gdbarch_ptr_bit(current_gdbarch) == 32)
+ {
+ int note_type;
+ char *note_name = "CORE";
+ struct elf_prpsinfo32 data;
+ note_type = NT_PRPSINFO;
+
+ memset (&data, 0, sizeof (data));
+ strncpy (data.pr_fname, fname, sizeof (data.pr_fname));
+ strncpy (data.pr_psargs, psargs, sizeof (data.pr_psargs));
+ return elfcore_write_note (abfd, buf, bufsiz,
+ note_name, note_type, &data, sizeof (data));
+ }
+ else
+ return elfcore_write_prpsinfo (abfd, buf, bufsiz, fname, psargs);
+}
+
+static void
+ppc_linux_set_registers (const gdb_byte *gregs, gdb_byte *buf)
+{
+ int i;
+ const int elf_ngreg = 48;
+
+ /* Copy the ppc registers in the ppc64 layout into ppc layout. */
+ for (i = 0; i < elf_ngreg; i++)
+ memcpy (buf + 4 * i, gregs + 8 * i + 4, 4);
+ /* CR and XER are an exception as they are shifted left there,
+ see fill_gregset(). */
+ memcpy (buf + 4 * PT_CCR, gregs + 8 * PT_CCR + 0, 4);
+ memcpy (buf + 4 * PT_XER, gregs + 8 * PT_XER + 0, 4);
+}
+
+static char *
+ppc_linux_elfcore_write_prstatus (bfd *abfd, char *buf, int *bufsiz,
+ long pid, int cursig, const void *gregs)
+{
+ if (gdbarch_ptr_bit(current_gdbarch) == 32)
+ {
+ char *note_name = "CORE";
+ struct elf_prstatus32 prstat;
+ memset (&prstat, 0, sizeof (prstat));
+ prstat.pr_pid = pid;
+ prstat.pr_cursig = cursig;
+ ppc_linux_set_registers (gregs, (gdb_byte *) &prstat.pr_reg);
+ return elfcore_write_note (abfd, buf, bufsiz, note_name,
+ NT_PRSTATUS, &prstat, sizeof (prstat));
+ }
+ else
+ return elfcore_write_prstatus (abfd, buf, bufsiz, pid, cursig, gregs);
+}
+
+#endif /* defined(__ppc64__) || defined(__powerpc64__) */
+
void _initialize_ppc_linux_nat (void);
void
@@ -1024,6 +1084,12 @@ _initialize_ppc_linux_nat (void)
t->to_stopped_by_watchpoint = ppc_linux_stopped_by_watchpoint;
t->to_stopped_data_address = ppc_linux_stopped_data_address;
+#if defined(__ppc64__) || defined(__powerpc64__)
+ /* This functions make elfcore note sections. */
+ linux_elfcore_write_prpsinfo = ppc_linux_elfcore_write_prpsinfo;
+ linux_elfcore_write_prstatus = ppc_linux_elfcore_write_prstatus;
+#endif /* defined(__ppc64__) || defined(__powerpc64__) */
+
/* Register the target. */
linux_nat_add_target (t);
}

View File

@ -1,325 +0,0 @@
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=233716
http://sources.redhat.com/ml/gdb-patches/2007-03/msg00129.html
2007-03-12 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdbtypes.h (TYPE_FLAG_STUB_SUPPORTED, TYPE_STUB_SUPPORTED): New
macros.
(TYPE_IS_OPAQUE): Empty vs. opaque structures are now
distinct on the TYPE_STUB_SUPPORTED debug targets.
* dwarf2read.c (read_structure_type): Set TYPE_FLAG_STUB_SUPPORTED.
* dwarfread.c (struct_type): New comment on TYPE_FLAG_STUB_SUPPORTED.
2007-03-12 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/type-opaque-lib.c, gdb.base/type-opaque-main.c,
gdb.base/type-opaque.exp: New files.
--- ./gdb/dwarf2read.c 12 Feb 2007 15:19:31 -0000 1.215
+++ ./gdb/dwarf2read.c 12 Mar 2007 21:33:06 -0000
@@ -3879,6 +3879,7 @@ read_structure_type (struct die_info *di
TYPE_LENGTH (type) = 0;
}
+ TYPE_FLAGS (type) |= TYPE_FLAG_STUB_SUPPORTED;
if (die_is_declaration (die, cu))
TYPE_FLAGS (type) |= TYPE_FLAG_STUB;
--- ./gdb/dwarfread.c 12 Feb 2007 15:19:31 -0000 1.47
+++ ./gdb/dwarfread.c 12 Mar 2007 21:33:07 -0000
@@ -1083,7 +1083,10 @@ struct_type (struct dieinfo *dip, char *
not even have any fields, if this DIE was generated due to a reference
to an anonymous structure or union. In this case, TYPE_FLAG_STUB is
set, which clues gdb in to the fact that it needs to search elsewhere
- for the full structure definition. */
+ for the full structure definition.
+ As such opaque reference is not distinguishable from an empty STRUCT
+ definition as DWARF1 is missing DW_AT_declaration we cannot set
+ TYPE_FLAG_STUB_SUPPORTED here. */
if (nfields == 0)
{
TYPE_FLAGS (type) |= TYPE_FLAG_STUB;
--- ./gdb/gdbtypes.h 29 Jan 2007 17:31:06 -0000 1.68
+++ ./gdb/gdbtypes.h 12 Mar 2007 21:33:08 -0000
@@ -319,6 +319,14 @@ enum type_code
#define TYPE_FLAG_FIXED_INSTANCE (1 << 15)
+/* This debug target supports TYPE_STUB(t). In the unsupported case we have to
+ rely on NFIELDS to be zero etc., see TYPE_IS_OPAQUE ().
+ TYPE_STUB(t) with !TYPE_STUB_SUPPORTED(t) may exist if we only guessed
+ the TYPE_STUB(t) value (see dwarfread.c). */
+
+#define TYPE_FLAG_STUB_SUPPORTED (1 << 16)
+#define TYPE_STUB_SUPPORTED(t) (TYPE_FLAGS (t) & TYPE_FLAG_STUB_SUPPORTED)
+
/* Array bound type. */
enum array_bound_type
{
@@ -969,7 +977,8 @@ extern void allocate_cplus_struct_type (
#define TYPE_IS_OPAQUE(thistype) (((TYPE_CODE (thistype) == TYPE_CODE_STRUCT) || \
(TYPE_CODE (thistype) == TYPE_CODE_UNION)) && \
(TYPE_NFIELDS (thistype) == 0) && \
- (TYPE_CPLUS_SPECIFIC (thistype) && (TYPE_NFN_FIELDS (thistype) == 0)))
+ (TYPE_CPLUS_SPECIFIC (thistype) && (TYPE_NFN_FIELDS (thistype) == 0)) && \
+ (TYPE_STUB (thistype) || !TYPE_STUB_SUPPORTED (thistype)))
struct builtin_type
{
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ./gdb/testsuite/gdb.base/type-opaque-lib.c 12 Mar 2007 21:33:09 -0000
@@ -0,0 +1,56 @@
+/* Test resolving of an opaque type from the loaded shared library.
+
+ Copyright 2007, Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+struct struct_libtype_opaque
+{
+ int libfield_opaque;
+};
+struct struct_libtype_opaque struct_libtype_opaque_use;
+
+struct struct_libtype_empty
+{
+ int libfield_empty;
+};
+struct struct_libtype_empty struct_libtype_empty_use;
+
+struct struct_libtype_filled
+{
+ int libfield_filled;
+};
+struct struct_libtype_filled struct_libtype_filled_use;
+
+union union_libtype_opaque
+{
+ int libfield_opaque;
+};
+union union_libtype_opaque union_libtype_opaque_use;
+
+union union_libtype_empty
+{
+ int libfield_empty;
+};
+union union_libtype_empty union_libtype_empty_use;
+
+union union_libtype_filled
+{
+ int libfield_filled;
+};
+union union_libtype_filled union_libtype_filled_use;
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ./gdb/testsuite/gdb.base/type-opaque-main.c 12 Mar 2007 21:33:09 -0000
@@ -0,0 +1,56 @@
+/* Test resolving of an opaque type from the loaded shared library.
+
+ Copyright 2007, Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+struct struct_libtype_opaque;
+
+struct struct_libtype_empty
+ {
+ };
+
+struct struct_libtype_filled
+ {
+ long mainfield_filled;
+ };
+
+union union_libtype_opaque;
+
+union union_libtype_empty
+ {
+ };
+
+union union_libtype_filled
+ {
+ long mainfield_filled;
+ };
+
+int main (void)
+{
+ volatile struct struct_libtype_opaque *pointer_struct_opaque = (void *) 0;
+ volatile struct struct_libtype_empty *pointer_struct_empty = (void *) 0;
+ volatile struct struct_libtype_filled *pointer_struct_filled = (void *) 0;
+ volatile union union_libtype_opaque *pointer_union_opaque = (void *) 0;
+ volatile union union_libtype_empty *pointer_union_empty = (void *) 0;
+ volatile union union_libtype_filled *pointer_union_filled = (void *) 0;
+
+ return (long) pointer_struct_opaque + (long) pointer_struct_empty
+ + (long) pointer_struct_filled + (long) pointer_union_opaque
+ + (long) pointer_union_empty + (long) pointer_union_filled;
+}
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ./gdb/testsuite/gdb.base/type-opaque.exp 12 Mar 2007 21:33:09 -0000
@@ -0,0 +1,134 @@
+# Copyright 2004, 2007 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test resolving of an opaque type from the loaded shared library.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set testfile type-opaque-main
+set libfile type-opaque-lib
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+set libsrc "${srcdir}/${subdir}/${libfile}.c"
+set libobj "${objdir}/${subdir}/${libfile}.so"
+set execsrc "${srcdir}/${subdir}/${srcfile}"
+
+remote_exec build "rm -f ${binfile}"
+
+# Are we on a target board? No support for downloading shared libraries
+# to a target yet.
+if ![isnative] then {
+ return 0
+}
+
+# get the value of gcc_compiled
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+if { [gdb_compile_shlib $libsrc $libobj {debug}] != ""
+ || [gdb_compile $execsrc ${binfile} executable \
+ [list debug shlib=${libobj}]] != "" } {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto_main] then {
+ fail "Can't run to main"
+ return 0
+}
+
+
+# DWARF3: An incomplete structure, union or class type is represented by
+# a structure, union or class entry that does not have a byte size attribute
+# and that has a DW_AT_declaration attribute.
+
+
+proc body { struct } {
+ global gdb_prompt
+
+
+ # <1><15f>: Abbrev Number: 8 (DW_TAG_structure_type)
+ # DW_AT_name : libtype_opaque
+ # DW_AT_declaration : 1
+
+ set name "opaque $struct type resolving"
+ gdb_test_multiple "ptype pointer_${struct}_opaque" $name \
+ {
+ -re "libfield_opaque.*$gdb_prompt $" {
+ pass $name
+ }
+ }
+
+
+ # <1><9e>: Abbrev Number: 2 (DW_TAG_structure_type)
+ # DW_AT_name : libtype_empty
+ # DW_AT_byte_size : 0
+ # DW_AT_decl_file : 1
+ # DW_AT_decl_line : 25
+
+ set name "empty $struct type resolving"
+ gdb_test_multiple "ptype pointer_${struct}_empty" $name \
+ {
+ -re "\\{\[ \t\r\n\]*<no data fields>\[ \t\r\n\]*\\}.*$gdb_prompt $" {
+ pass $name
+ }
+ -re "libfield_empty.*$gdb_prompt $" {
+ fail $name
+ }
+ }
+
+
+ # <1><b0>: Abbrev Number: 3 (DW_TAG_structure_type)
+ # DW_AT_sibling : <e3>
+ # DW_AT_name : libtype_filled
+ # DW_AT_byte_size : 4
+ # DW_AT_decl_file : 1
+ # DW_AT_decl_line : 29
+ # <2><c7>: Abbrev Number: 4 (DW_TAG_member)
+ # DW_AT_name : mainfield_filled
+ # DW_AT_decl_file : 1
+ # DW_AT_decl_line : 30
+ # DW_AT_type : <e3>
+ # DW_AT_data_member_location: 2 byte block: 23 0 (DW_OP_plus_uconst: 0)
+
+ set name "filled $struct type resolving"
+ gdb_test_multiple "ptype pointer_${struct}_filled" $name \
+ {
+ -re "mainfield_filled.*$gdb_prompt $" {
+ pass $name
+ }
+ -re "libfield_filled.*$gdb_prompt $" {
+ fail $name
+ }
+ }
+
+
+}
+
+
+body struct
+body union

File diff suppressed because it is too large Load Diff

View File

@ -1,151 +0,0 @@
Failing on _FORTIFY_SOURCE=2 for `gdb.base/corefile.exp'.
--- gdb-6.6/gdb/linux-nat.c-orig 2007-04-08 21:12:38.000000000 +0200
+++ gdb-6.6/gdb/linux-nat.c 2007-04-09 20:05:43.000000000 +0200
@@ -2838,7 +2838,9 @@ linux_nat_make_corefile_notes (bfd *obfd
{
struct linux_nat_corefile_thread_data thread_args;
struct cleanup *old_chain;
+ /* Length must be >= sizeof (prpsinfo_t.pr_fname). */
char fname[16] = { '\0' };
+ /* Length must be >= sizeof (prpsinfo_t.pr_psargs). */
char psargs[80] = { '\0' };
char *note_data = NULL;
ptid_t current_ptid = inferior_ptid;
@@ -2851,9 +2853,14 @@ linux_nat_make_corefile_notes (bfd *obfd
strncpy (psargs, get_exec_file (0), sizeof (psargs));
if (get_inferior_args ())
{
- strncat (psargs, " ", sizeof (psargs) - strlen (psargs));
- strncat (psargs, get_inferior_args (),
- sizeof (psargs) - strlen (psargs));
+ /* linux_elfcore_write_prpsinfo () handles zero non-terminated
+ strings right if they provide enough characters for its purposes.
+ Handle to fully filled (=> zero non-terminated) strings here. */
+ if (memchr (psargs, 0, sizeof (psargs)) != NULL)
+ strncat (psargs, " ", sizeof (psargs) - strlen (psargs) - 1);
+ if (memchr (psargs, 0, sizeof (psargs)) != NULL)
+ strncat (psargs, get_inferior_args (),
+ sizeof (psargs) - strlen (psargs) - 1);
}
note_data = (char *) linux_elfcore_write_prpsinfo (obfd, note_data,
note_size, fname,
2007-04-28 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/gcore-buffer-overflow.c, gdb.base/gcore-buffer-overflow.exp:
New files.
Index: ./gdb/testsuite/gdb.base/gcore-buffer-overflow.c
===================================================================
RCS file: gdb/testsuite/gdb.base/gcore-buffer-overflow.c
diff -N gdb/testsuite/gdb.base/gcore-buffer-overflow.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ./gdb/testsuite/gdb.base/gcore-buffer-overflow.c 28 Apr 2007 18:48:15 -0000
@@ -0,0 +1,27 @@
+/* Copyright 2007 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or (at
+ your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/*
+ * Test GDB's internal buffers safety for the GCORE command.
+ */
+
+int main (void)
+{
+ return 0;
+}
Index: ./gdb/testsuite/gdb.base/gcore-buffer-overflow.exp
===================================================================
RCS file: gdb/testsuite/gdb.base/gcore-buffer-overflow.exp
diff -N gdb/testsuite/gdb.base/gcore-buffer-overflow.exp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ./gdb/testsuite/gdb.base/gcore-buffer-overflow.exp 28 Apr 2007 18:48:15 -0000
@@ -0,0 +1,70 @@
+# Copyright 2007 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test GDB's internal buffers safety for the GCORE command.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "gcore-buffer-overflow"
+set srcfile ${testfile}.c
+# The ${binfile} basename needs to exceed 80 characters (`sizeof (psargs)')
+# plus some additional data to overwrite the stack frame.
+set pattern 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+set binfile ${objdir}/${subdir}/${testfile}-${pattern}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ untested gcore.exp
+ return -1
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_test "set args ${pattern}" \
+ "" \
+ "Set buffer exceeding arguments"
+
+if { ! [ runto_main ] } then {
+ untested gcore-buffer-overflow.exp
+ return -1
+}
+
+set escapedfilename [string_to_regexp ${objdir}/${subdir}/gcore-buffer-overflow.test]
+
+set test "save a corefile"
+gdb_test_multiple "gcore ${objdir}/${subdir}/gcore-buffer-overflow.test" $test {
+ -re "Saved corefile ${escapedfilename}\[\r\n\]+$gdb_prompt $" {
+ pass $test
+ }
+ -re "Can't create a corefile\[\r\n\]+$gdb_prompt $" {
+ unsupported $test
+ }
+ eof {
+ fail $test
+ }
+}

View File

@ -1,35 +0,0 @@
2007-08-08 Jan Kratochvil <jan.kratochvil@redhat.com>
* bfd/opncls.c (bfd_openr_iovec): Fix OPEN parameter macro expansion.
--- ./bfd/opncls.c 24 Jul 2007 19:58:06 -0000 1.48
+++ ./bfd/opncls.c 8 Aug 2007 19:12:15 -0000
@@ -545,7 +545,8 @@ bfd_openr_iovec (const char *filename, c
nbfd->filename = filename;
nbfd->direction = read_direction;
- stream = open (nbfd, open_closure);
+ /* `open (...)' would get expanded by an the open(2) syscall macro. */
+ stream = (*open) (nbfd, open_closure);
if (stream == NULL)
{
_bfd_delete_bfd (nbfd);
2007-08-08 Jan Kratochvil <jan.kratochvil@redhat.com>
* serial.c (serial_open): Fix OPEN parameter macro expansion.
--- ./gdb/serial.c 8 Apr 2007 15:20:07 -0000 1.29
+++ ./gdb/serial.c 8 Aug 2007 20:32:10 -0000
@@ -213,7 +213,8 @@ serial_open (const char *name)
scb->bufp = scb->buf;
scb->error_fd = -1;
- if (scb->ops->open (scb, open_name))
+ /* `...->open (...)' would get expanded by an the open(2) syscall macro. */
+ if ((*scb->ops->open) (scb, open_name))
{
xfree (scb);
return NULL;

View File

@ -1,13 +0,0 @@
--- gdb-6.6-orig/gdb/libunwind-frame.c 2007-04-08 20:49:09.000000000 +0200
+++ gdb-6.6/gdb/libunwind-frame.c 2007-04-10 23:45:22.000000000 +0200
@@ -74,7 +74,9 @@
#define STRINGIFY(name) STRINGIFY2(name)
#ifndef LIBUNWIND_SO
-#define LIBUNWIND_SO "libunwind-" STRINGIFY(UNW_TARGET) ".so"
+/* Use the stable ABI major version number. `libunwind-ia64.so' is a link time
+ only library, not a runtime one. */
+#define LIBUNWIND_SO "libunwind-" STRINGIFY(UNW_TARGET) ".so.7"
#endif
static char *get_reg_name = STRINGIFY(UNW_OBJ(get_reg));

View File

@ -1,234 +1,12 @@
diff -u -rup gdb-6.6-orig/configure gdb-6.6/configure 2007-10-16 Jan Kratochvil <jan.kratochvil@redhat.com>
--- gdb-6.6-orig/configure 2006-11-15 00:26:39.000000000 +0100
+++ gdb-6.6/configure 2007-07-04 21:04:45.000000000 +0200 Port to GDB-6.7.
@@ -895,14 +895,14 @@ build_tools="build-texinfo build-byacc b
Index: gdb-6.7/gdb/doc/Makefile.in
# these libraries are used by various programs built for the host environment ===================================================================
# --- gdb-6.7.orig/gdb/doc/Makefile.in 2007-07-26 12:34:00.000000000 +0200
-host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber" +++ gdb-6.7/gdb/doc/Makefile.in 2007-10-16 16:31:08.000000000 +0200
+host_libs="intl mmalloc libiberty opcodes bfd tcl tk itcl libgui zlib libcpp libdecnumber" @@ -109,9 +109,7 @@ DVIPS = dvips
# these tools are built for the host environment
# Note, the powerpc-eabi build depends on sim occurring before gdb in order to
# know that we are building the simulator.
# binutils, gas and ld appear in that order because it makes sense to run
# "make check" in that particular order.
-host_tools="texinfo byacc flex bison binutils gas ld fixincludes gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar gnattools"
+host_tools="byacc flex bison binutils gas ld fixincludes gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar gnattools"
# libgcj represents the runtime libraries only used by gcj.
libgcj="target-libffi \
@@ -1110,7 +1110,7 @@ case "${host}" in
noconfigdirs="$noconfigdirs patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl gnuserv"
;;
powerpc-*-beos*)
- noconfigdirs="$noconfigdirs tk itcl libgui gdb dejagnu readline"
+ noconfigdirs="$noconfigdirs tk itcl libgui gdb dejagnu"
;;
esac
@@ -1290,7 +1290,7 @@ case "${target}" in
noconfigdirs="$noconfigdirs target-newlib"
case "${host}" in
*-*-cygwin*) ;; # keep gdb and readline
- *) noconfigdirs="$noconfigdirs gdb readline"
+ *) noconfigdirs="$noconfigdirs gdb"
;;
esac
;;
@@ -1408,11 +1408,11 @@ case "${target}" in
;;
ia64*-*-elf*)
# No gdb support yet.
- noconfigdirs="$noconfigdirs readline mmalloc libgui itcl gdb"
+ noconfigdirs="$noconfigdirs mmalloc libgui itcl gdb"
;;
ia64*-**-hpux*)
# No gdb or ld support yet.
- noconfigdirs="$noconfigdirs ${libgcj} readline mmalloc libgui itcl gdb ld"
+ noconfigdirs="$noconfigdirs ${libgcj} mmalloc libgui itcl gdb ld"
;;
i370-*-opened*)
;;
diff -u -rup gdb-6.6-orig/configure.in gdb-6.6/configure.in
--- gdb-6.6-orig/configure.in 2006-12-18 08:22:58.000000000 +0100
+++ gdb-6.6/configure.in 2007-07-04 21:04:43.000000000 +0200
@@ -123,7 +123,7 @@ build_tools="build-texinfo build-byacc b
# these libraries are used by various programs built for the host environment
#
-host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber"
+host_libs="intl mmalloc libiberty opcodes bfd tcl tk itcl libgui zlib libcpp libdecnumber"
# these tools are built for the host environment
# Note, the powerpc-eabi build depends on sim occurring before gdb in order to
@@ -294,7 +294,7 @@ case "${host}" in
noconfigdirs="$noconfigdirs patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl gnuserv"
;;
powerpc-*-beos*)
- noconfigdirs="$noconfigdirs tk itcl libgui gdb dejagnu readline"
+ noconfigdirs="$noconfigdirs tk itcl libgui gdb dejagnu"
;;
esac
@@ -466,7 +466,7 @@ case "${target}" in
noconfigdirs="$noconfigdirs target-newlib"
case "${host}" in
*-*-cygwin*) ;; # keep gdb and readline
- *) noconfigdirs="$noconfigdirs gdb readline"
+ *) noconfigdirs="$noconfigdirs gdb"
;;
esac
;;
@@ -584,11 +584,11 @@ case "${target}" in
;;
ia64*-*-elf*)
# No gdb support yet.
- noconfigdirs="$noconfigdirs readline mmalloc libgui itcl gdb"
+ noconfigdirs="$noconfigdirs mmalloc libgui itcl gdb"
;;
ia64*-**-hpux*)
# No gdb or ld support yet.
- noconfigdirs="$noconfigdirs ${libgcj} readline mmalloc libgui itcl gdb ld"
+ noconfigdirs="$noconfigdirs ${libgcj} mmalloc libgui itcl gdb ld"
;;
i370-*-opened*)
;;
diff -u -rup gdb-6.6-orig/gdb/Makefile.in gdb-6.6/gdb/Makefile.in
--- gdb-6.6-orig/gdb/Makefile.in 2007-07-04 20:50:06.000000000 +0200
+++ gdb-6.6/gdb/Makefile.in 2007-07-04 20:58:56.000000000 +0200
@@ -123,10 +123,10 @@ BFD_SRC = $(srcdir)/$(BFD_DIR)
BFD_CFLAGS = -I$(BFD_DIR) -I$(BFD_SRC)
# Where is the READLINE library? Typically in ../readline.
-READLINE_DIR = ../readline
-READLINE = $(READLINE_DIR)/libreadline.a
-READLINE_SRC = $(srcdir)/$(READLINE_DIR)
-READLINE_CFLAGS = -I$(READLINE_SRC)/..
+# `readline' is required on the host.
+READLINE = -lreadline
+# Workaround a bug linking `bfd/elf-bfd.h' without `-I../bfd/..'.
+READLINE_CFLAGS = -I$(srcdir)/..
# Where is expat? This will be empty if expat was not available.
LIBEXPAT = @LIBEXPAT@
@@ -595,9 +594,9 @@ remote_sim_h = $(INCLUDE_DIR)/gdb/remote
demangle_h = $(INCLUDE_DIR)/demangle.h
obstack_h = $(INCLUDE_DIR)/obstack.h
opcode_m68hc11_h = $(INCLUDE_DIR)/opcode/m68hc11.h
-readline_h = $(READLINE_SRC)/readline.h
-readline_tilde_h = $(READLINE_SRC)/tilde.h
-readline_history_h = $(READLINE_SRC)/history.h
+readline_h =
+readline_tilde_h =
+readline_history_h =
frv_desc_h = $(OPCODES_SRC)/frv-desc.h
sh_opc_h = $(OPCODES_SRC)/sh-opc.h
gdb_callback_h = $(INCLUDE_DIR)/gdb/callback.h
diff -u -rup gdb-6.6-orig/gdb/configure gdb-6.6/gdb/configure
--- gdb-6.6-orig/gdb/configure 2007-07-04 20:50:06.000000000 +0200
+++ gdb-6.6/gdb/configure 2007-07-04 21:03:52.000000000 +0200
@@ -5697,6 +5697,61 @@ echo "$as_me: error: no termcap library
{ (exit 1); exit 1; }; }
fi
+# `-lreadline' is provided specifically by `Makefile.in'.
+saved_LIBS="$LIBS"
+LIBS="-lreadline $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+ main()
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+ { { echo "$as_me:$LINENO: error: no readline library found" >&5
+echo "$as_me: error: no readline library found" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS="$saved_LIBS"
+
if test "X$prefix" = "XNONE"; then
acl_final_prefix="$ac_default_prefix"
diff -u -rup gdb-6.6-orig/gdb/configure.ac gdb-6.6/gdb/configure.ac
--- gdb-6.6-orig/gdb/configure.ac 2007-07-04 20:50:06.000000000 +0200
+++ gdb-6.6/gdb/configure.ac 2007-07-04 21:02:41.000000000 +0200
@@ -321,6 +321,14 @@ if test "$ac_cv_search_tgetent" = no; th
AC_MSG_ERROR([no termcap library found])
fi
+# `-lreadline' is provided specifically by `Makefile.in'.
+saved_LIBS="$LIBS"
+LIBS="-lreadline $LIBS"
+AC_TRY_LINK(,[ main() ],,[
+ AC_MSG_ERROR([no readline library found])
+])
+LIBS="$saved_LIBS"
+
AC_LIB_HAVE_LINKFLAGS([expat], [], [#include "expat.h"],
[XML_Parser p = XML_ParserCreate (0);])
if test "$HAVE_LIBEXPAT" != yes; then
diff -u -ru gdb-6.6-orig/gdb/doc/Makefile.in gdb-6.6/gdb/doc/Makefile.in
--- gdb-6.6-orig/gdb/doc/Makefile.in 2006-05-05 20:26:11.000000000 +0200
+++ gdb-6.6/gdb/doc/Makefile.in 2007-07-05 11:58:30.000000000 +0200
@@ -58,13 +58,14 @@
# Where is the source dir for the READLINE library doc?
# Traditionally readline is in .. or .
-READLINE_DIR = ${gdbdir}/../readline/doc
+# `readline' is required on the host.
+#READLINE_DIR = ${gdbdir}/../readline/doc
# The GDB/MI docs come from a sibling directory ../mi
GDBMI_DIR = ${gdbdir}/mi
SET_TEXINPUTS = \
- TEXINPUTS=${TEXIDIR}:.:$(srcdir):$(READLINE_DIR):$(GDBMI_DIR):$$TEXINPUTS
+ TEXINPUTS=${TEXIDIR}:.:$(srcdir):$(GDBMI_DIR):$$TEXINPUTS
# Files which should be generated via 'info' and installed by 'install-info'
INFO_DEPS = gdb.info gdbint.info stabs.info annotate.info
@@ -100,9 +101,7 @@
GDB_DOC_SOURCE_INCLUDES = \ GDB_DOC_SOURCE_INCLUDES = \
$(srcdir)/fdl.texi \ $(srcdir)/fdl.texi \
$(srcdir)/gpl.texi \ $(srcdir)/gpl.texi \
@ -239,39 +17,22 @@ diff -u -ru gdb-6.6-orig/gdb/doc/Makefile.in gdb-6.6/gdb/doc/Makefile.in
GDB_DOC_BUILD_INCLUDES = \ GDB_DOC_BUILD_INCLUDES = \
gdb-cfg.texi \ gdb-cfg.texi \
GDBvn.texi GDBvn.texi
@@ -299,7 +298,7 @@ Index: gdb-6.7/gdb/doc/gdb.texinfo
===================================================================
--- gdb-6.7.orig/gdb/doc/gdb.texinfo 2007-10-16 16:19:19.000000000 +0200
+++ gdb-6.7/gdb/doc/gdb.texinfo 2007-10-16 16:32:10.000000000 +0200
@@ -158,8 +158,8 @@ software in general. We will miss him.
# GDB MANUAL: info file
gdb.info: ${GDB_DOC_FILES}
- $(MAKEINFO) -I ${READLINE_DIR} -I ${GDBMI_DIR} -I $(srcdir) \
+ $(MAKEINFO) -I ${GDBMI_DIR} -I $(srcdir) \
-o gdb.info $(srcdir)/gdb.texinfo
# GDB MANUAL: roff translations
@@ -375,7 +374,7 @@
# GDB MANUAL: HTML file
gdb_toc.html: ${GDB_DOC_FILES}
- $(MAKEHTML) $(MAKEHTMLFLAGS) -I ${READLINE_DIR} -I ${GDBMI_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo
+ $(MAKEHTML) $(MAKEHTMLFLAGS) -I ${GDBMI_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo
# Clean these up before each run. Avoids a catch 22 with not being
# able to re-generate these files (to fix a corruption) because these
diff -u -ru gdb-6.6-orig/gdb/doc/gdb.texinfo gdb-6.6/gdb/doc/gdb.texinfo
--- gdb-6.6-orig/gdb/doc/gdb.texinfo 2007-07-04 20:50:06.000000000 +0200
+++ gdb-6.6/gdb/doc/gdb.texinfo 2007-07-05 13:07:55.000000000 +0200
@@ -153,8 +153,8 @@
* GDB Bugs:: Reporting bugs in @value{GDBN} * GDB Bugs:: Reporting bugs in @value{GDBN}
* Formatting Documentation:: How to format and print @value{GDBN} documentation
-* Command Line Editing:: Command Line Editing -* Command Line Editing:: Command Line Editing
-* Using History Interactively:: Using History Interactively -* Using History Interactively:: Using History Interactively
+* Command Line Editing: (rluserman). Command Line Editing +* Command Line Editing: (rluserman). Command Line Editing
+* Using History Interactively: (history). Using History Interactively +* Using History Interactively: (history). Using History Interactively
* Formatting Documentation:: How to format and print @value{GDBN} documentation
* Installing GDB:: Installing GDB * Installing GDB:: Installing GDB
* Maintenance Commands:: Maintenance Commands * Maintenance Commands:: Maintenance Commands
* Remote Protocol:: GDB Remote Serial Protocol @@ -15533,7 +15533,7 @@ Disable command line editing.
@@ -15728,7 +15728,7 @@
Show whether command line editing is enabled. Show whether command line editing is enabled.
@end table @end table
@ -280,7 +41,7 @@ diff -u -ru gdb-6.6-orig/gdb/doc/gdb.texinfo gdb-6.6/gdb/doc/gdb.texinfo
interface. Users unfamiliar with @sc{gnu} Emacs or @code{vi} are interface. Users unfamiliar with @sc{gnu} Emacs or @code{vi} are
encouraged to read that chapter. encouraged to read that chapter.
@@ -15743,7 +15743,8 @@ @@ -15548,7 +15548,8 @@ history facility.
@value{GDBN} uses the @sc{gnu} History library, a part of the Readline @value{GDBN} uses the @sc{gnu} History library, a part of the Readline
package, to provide the history facility. @xref{Using History package, to provide the history facility. @xref{Using History
@ -289,8 +50,8 @@ diff -u -ru gdb-6.6-orig/gdb/doc/gdb.texinfo gdb-6.6/gdb/doc/gdb.texinfo
+of the History library. +of the History library.
To issue a command to @value{GDBN} without affecting certain aspects of To issue a command to @value{GDBN} without affecting certain aspects of
the state which is seen by users, prefix it with @samp{server }. This the state which is seen by users, prefix it with @samp{server }
@@ -15794,7 +15795,7 @@ @@ -15600,7 +15601,7 @@ This defaults to the value of the enviro
@end table @end table
History expansion assigns special meaning to the character @kbd{!}. History expansion assigns special meaning to the character @kbd{!}.
@ -299,16 +60,17 @@ diff -u -ru gdb-6.6-orig/gdb/doc/gdb.texinfo gdb-6.6/gdb/doc/gdb.texinfo
@cindex history expansion, turn on/off @cindex history expansion, turn on/off
Since @kbd{!} is also the logical not operator in C, history expansion Since @kbd{!} is also the logical not operator in C, history expansion
@@ -16867,7 +16868,7 @@ @@ -16660,7 +16661,8 @@ Indicates the current program counter ad
@cindex TUI key bindings @cindex TUI key bindings
The TUI installs several key bindings in the readline keymaps The TUI installs several key bindings in the readline keymaps
-(@pxref{Command Line Editing}). -(@pxref{Command Line Editing}). The following key bindings
+(@pxref{Command Line Editing, , , rluserman, GNU Readline Library}). +(@pxref{Command Line Editing, , , rluserman, GNU Readline Library}).
They allow to leave or enter in the TUI mode or they operate +The following key bindings
directly on the TUI layout and windows. The TUI also provides are installed for both TUI mode and the @value{GDBN} standard mode.
a @emph{SingleKey} keymap which binds several keys directly to
@@ -21934,15 +21935,6 @@ @table @kbd
@@ -21937,15 +21939,6 @@ Such guesses are usually wrong. Even we
things without first using the debugger to find the facts. things without first using the debugger to find the facts.
@end itemize @end itemize
@ -324,7 +86,7 @@ diff -u -ru gdb-6.6-orig/gdb/doc/gdb.texinfo gdb-6.6/gdb/doc/gdb.texinfo
@node Formatting Documentation @node Formatting Documentation
@appendix Formatting Documentation @appendix Formatting Documentation
@@ -22111,9 +22103,6 @@ @@ -22115,9 +22108,6 @@ source for the @samp{-liberty} free soft
@item gdb-@value{GDBVN}/opcodes @item gdb-@value{GDBVN}/opcodes
source for the library of opcode tables and disassemblers source for the library of opcode tables and disassemblers
@ -334,7 +96,7 @@ diff -u -ru gdb-6.6-orig/gdb/doc/gdb.texinfo gdb-6.6/gdb/doc/gdb.texinfo
@item gdb-@value{GDBVN}/glob @item gdb-@value{GDBVN}/glob
source for the @sc{gnu} filename pattern-matching subroutine source for the @sc{gnu} filename pattern-matching subroutine
@@ -22145,7 +22134,7 @@ @@ -22149,7 +22139,7 @@ where @var{host} is an identifier such a
correct value by examining your system.) correct value by examining your system.)
Running @samp{configure @var{host}} and then running @code{make} builds the Running @samp{configure @var{host}} and then running @code{make} builds the
@ -343,9 +105,9 @@ diff -u -ru gdb-6.6-orig/gdb/doc/gdb.texinfo gdb-6.6/gdb/doc/gdb.texinfo
libraries, then @code{gdb} itself. The configured source files, and the libraries, then @code{gdb} itself. The configured source files, and the
binaries, are left in the corresponding source directories. binaries, are left in the corresponding source directories.
@@ -22170,7 +22159,7 @@ @@ -22175,7 +22165,7 @@ source tree, the @file{gdb-@var{version-
that subdirectory. That is usually not what you want. In particular, that subdirectory. That is usually not what you want. In particular,
if you run the first @code{configure} from the @file{gdb} subdirectory if you run the first @file{configure} from the @file{gdb} subdirectory
of the @file{gdb-@var{version-number}} directory, you will omit the of the @file{gdb-@var{version-number}} directory, you will omit the
-configuration of @file{bfd}, @file{readline}, and other sibling -configuration of @file{bfd}, @file{readline}, and other sibling
+configuration of @file{bfd}, and other sibling +configuration of @file{bfd}, and other sibling

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,18 @@
Fix i386-on-x86_64 debugging giving the warning: Fix i386-on-x86_64 debugging giving the warning:
warning: Lowest section in system-supplied DSO at 0xffffe000 is .hash at ffffe0b4 warning: Lowest section in system-supplied DSO at 0xffffe000 is .hash at ffffe0b4
[ Backport for RH GDB-6.6. ] [base]
--- gdb-6.6/gdb/symfile.c 2007-10-08 19:52:06.000000000 +0200 2007-10-16 Jan Kratochvil <jan.kratochvil@redhat.com>
+++ gdb-6.6/gdb/symfile.c 2007-10-08 19:49:27.000000000 +0200
@@ -597,6 +597,37 @@ default_symfile_offsets (struct objfile Port to GDB-6.7.
init_objfile_sect_indices (objfile);
Index: gdb-6.7/gdb/symfile.c
===================================================================
--- gdb-6.7.orig/gdb/symfile.c 2007-10-16 16:46:30.000000000 +0200
+++ gdb-6.7/gdb/symfile.c 2007-10-16 20:08:42.000000000 +0200
@@ -717,6 +717,38 @@ default_symfile_segments (bfd *abfd)
return data;
} }
+/* Find lowest loadable section to be used as starting point for continguous +/* Find lowest loadable section to be used as starting point for continguous
@ -40,10 +46,11 @@ Fix i386-on-x86_64 debugging giving the warning:
+ else + else
+ return 0; + return 0;
+} +}
+
/* Process a symbol file, as either the main file or as a dynamically /* Process a symbol file, as either the main file or as a dynamically
loaded file. loaded file.
@@ -696,32 +727,11 @@ syms_from_objfile (struct objfile *objfi
@@ -815,32 +847,11 @@ syms_from_objfile (struct objfile *objfi
happens for the PA64 port. */ happens for the PA64 port. */
if (/*!mainline &&*/ addrs && addrs->other[0].name) if (/*!mainline &&*/ addrs && addrs->other[0].name)
{ {
@ -78,30 +85,38 @@ Fix i386-on-x86_64 debugging giving the warning:
/* Calculate offsets for the loadable sections. /* Calculate offsets for the loadable sections.
FIXME! Sections must be in order of increasing loadable section FIXME! Sections must be in order of increasing loadable section
so that contiguous sections can use the lower-offset!!! so that contiguous sections can use the lower-offset!!!
@@ -743,6 +753,7 @@ syms_from_objfile (struct objfile *objfi @@ -862,6 +873,7 @@ syms_from_objfile (struct objfile *objfi
addrs->other[i].addr addrs->other[i].addr
-= bfd_section_vma (objfile->obfd, sect); -= bfd_section_vma (objfile->obfd, sect);
lower_offset = addrs->other[i].addr; lower_offset = addrs->other[i].addr;
+ lower_offset_set = 1; + lower_offset_set = 1;
/* This is the index used by BFD. */ /* This is the index used by BFD. */
addrs->other[i].sectindex = sect->index ; addrs->other[i].sectindex = sect->index ;
} }
@@ -755,7 +766,17 @@ syms_from_objfile (struct objfile *objfi @@ -874,7 +886,17 @@ syms_from_objfile (struct objfile *objfi
} }
} }
else else
- addrs->other[i].addr = lower_offset; - addrs->other[i].addr = lower_offset;
+ { + {
+ /* Delay finding LOWER_OFFSET only if it is needed. Otherwise + /* Delay finding LOWER_OFFSET only if it is needed. Otherwise
+ we would print a warning to detect a values never used. */ + we would print a warning to detect a values never used. */
+ if (!lower_offset_set) + if (!lower_offset_set)
+ { + {
+ lower_offset = find_lower_offset (objfile); + lower_offset = find_lower_offset (objfile);
+ lower_offset_set = 1; + lower_offset_set = 1;
+ } + }
+ +
+ addrs->other[i].addr = lower_offset; + addrs->other[i].addr = lower_offset;
+ } + }
} }
} }
@@ -1174,7 +1196,6 @@ symbol_file_add_from_bfd (bfd *abfd, int
mainline, flags);
}
-
/* Process a symbol file, as either the main file or as a dynamically
loaded file. See symbol_file_add_with_addrs_or_offsets's comments
for details. */

125
gdb-6.7-charsign-test.patch Normal file
View File

@ -0,0 +1,125 @@
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=224128
2007-01-25 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/charsign.exp, gdb.base/charsign.c: New files.
[ stripped ]
2007-10-19 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.7 - only the testcase left, patch has been reverted,
char-vectors restricted.
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ./gdb/testsuite/gdb.base/charsign.c 26 Jan 2007 10:32:00 -0000
@@ -0,0 +1,37 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2007 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@prep.ai.mit.edu */
+
+int main()
+{
+ return 0;
+}
+
+char n[]="A";
+signed char s[]="A";
+unsigned char u[]="A";
+
+typedef char char_n;
+typedef signed char char_s;
+typedef unsigned char char_u;
+
+char_n n_typed[]="A";
+char_s s_typed[]="A";
+char_u u_typed[]="A";
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ./gdb/testsuite/gdb.base/charsign.exp 26 Jan 2007 10:32:00 -0000
@@ -0,0 +1,70 @@
+# Copyright 2007 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile charsign
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+proc do_test { cflags } {
+ global srcdir
+ global binfile
+ global subdir
+ global srcfile
+ global gdb_prompt
+
+ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug additional_flags=$cflags]] != "" } {
+ untested "Couldn't compile test program"
+ return -1
+ }
+
+ # Get things started.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load ${binfile}
+
+ # For C programs, "start" should stop in main().
+
+ gdb_test "p n" \
+ "= \"A\""
+ gdb_test "p s" \
+ "= \\{65 'A', 0 '\\\\0'\\}"
+ gdb_test "p u" \
+ "= \\{65 'A', 0 '\\\\0'\\}"
+ gdb_test "p n_typed" \
+ "= \"A\""
+ gdb_test "p s_typed" \
+ "= \\{65 'A', 0 '\\\\0'\\}"
+ gdb_test "p u_typed" \
+ "= \\{65 'A', 0 '\\\\0'\\}"
+}
+
+# The string identification works despite the compiler flags below due to
+# gdbtypes.c:
+# if (name && strcmp (name, "char") == 0)
+# TYPE_FLAGS (type) |= TYPE_FLAG_NOSIGN;
+
+do_test {}
+do_test {-fsigned-char}
+do_test {-funsigned-char}

View File

@ -0,0 +1,54 @@
2007-10-29 Jan Kratochvil <jan.kratochvil@redhat.com>
* symfile.c (reread_symbols): Reread also EXEC_BFD if changed.
Testcase: Regressed by the gdb-6.7 version of `gdb-6.3-pie-20050110.patch':
Running ../../../gdb/testsuite/gdb.base/reread.exp ...
PASS: gdb.base/reread.exp: breakpoint foo in first file (PRMS 13484)
PASS: gdb.base/reread.exp: run to foo() (PRMS 13484)
-PASS: gdb.base/reread.exp: run to foo() second time
+FAIL: gdb.base/reread.exp: run to foo() second time
PASS: gdb.base/reread.exp: second pass: breakpoint foo in first file
-PASS: gdb.base/reread.exp: second pass: run to foo()
-PASS: gdb.base/reread.exp: second pass: continue to completion
-PASS: gdb.base/reread.exp: second pass: run to foo() second time
+FAIL: gdb.base/reread.exp: second pass: run to foo()
+FAIL: gdb.base/reread.exp: second pass: continue to completion
+FAIL: gdb.base/reread.exp: second pass: run to foo() second time
--- gdb-6.7-orig/gdb/symfile.c 2007-10-29 01:04:35.000000000 +0100
+++ gdb-6.7-patched/gdb/symfile.c 2007-10-29 01:03:13.000000000 +0100
@@ -2810,6 +2810,33 @@ reread_symbols (void)
/* We need to do this whenever any symbols go away. */
make_cleanup (clear_symtab_users_cleanup, 0 /*ignore*/);
+ if (exec_bfd != NULL && strcmp (bfd_get_filename (objfile->obfd),
+ bfd_get_filename (exec_bfd)) == 0)
+ {
+ char *exec_filename = bfd_get_filename (exec_bfd);
+ bfd *exec_bfd_new;
+
+ /* We have to leak the memory here as there are stale
+ references to EXEC_BFD, at least by
+ `(struct section_table *)->bfd'. So far we need to update
+ only START_ADDRESS there. */
+#if 0
+ if (!bfd_close (exec_bfd))
+ error (_("Can't close BFD for %s: %s"), exec_filename,
+ bfd_errmsg (bfd_get_error ()));
+#endif
+ exec_bfd_new = bfd_openr (exec_filename, gnutarget);
+ if (exec_bfd_new == NULL)
+ error (_("Can't open %s as a new main executable."),
+ exec_filename);
+ /* bfd_openr sets cacheable to true, which is what we want. */
+ if (!bfd_check_format (exec_bfd_new, bfd_object))
+ error (_("Can't reopen the main executable %s: %s."),
+ exec_filename, bfd_errmsg (bfd_get_error ()));
+ /* FIXME: The non-freeing hack. */
+ memcpy (exec_bfd, exec_bfd_new, sizeof (*exec_bfd));
+ }
+
/* Clean up any state BFD has sitting around. We don't need
to close the descriptor but BFD lacks a way of closing the
BFD without closing the descriptor. */

98
gdb-6.7-upstream.patch Normal file
View File

@ -0,0 +1,98 @@
2007-09-15 Alan Modra <amodra@bigpond.net.au>
* configure.ac: Correct makeinfo version check.
* configure: Regenerate.
#--- ./configure.ac 14 Sep 2007 14:51:36 -0000 1.25
#+++ ./configure.ac 14 Sep 2007 15:47:01 -0000 1.26
#@@ -2462,7 +2462,7 @@ changequote(,)
# # For an installed makeinfo, we require it to be from texinfo 4.4 or
# # higher, else we use the "missing" dummy.
# if ${MAKEINFO} --version \
#- | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
#+ | egrep 'texinfo[^0-9]*(4\.([4-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
# :
# else
# MAKEINFO="$MISSING makeinfo"
--- ./configure 14 Sep 2007 14:51:36 -0000 1.277
+++ ./configure 14 Sep 2007 15:47:01 -0000 1.278
@@ -6192,7 +6192,7 @@ case " $build_configdirs " in
# For an installed makeinfo, we require it to be from texinfo 4.4 or
# higher, else we use the "missing" dummy.
if ${MAKEINFO} --version \
- | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
+ | egrep 'texinfo[^0-9]*(4\.([4-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
:
else
MAKEINFO="$MISSING makeinfo"
Fix:
FAIL: gdb.arch/powerpc-power6.exp: Power6 disassembly dsub
FAIL: gdb.arch/powerpc-power6.exp: Power6 disassembly dmul
FAIL: gdb.arch/powerpc-power6.exp: Power6 disassembly ddiv
FAIL: gdb.arch/powerpc-power6.exp: Power6 disassembly dcmpu
2007-10-15 Peter Bergner <bergner@vnet.ibm.com>
* ppc-opc.c (powerpc_opcodes): Fix the first two operands of
dquaiq. to use the TE and FRT macros.
--- ./opcodes/ppc-opc.c 16 Oct 2007 02:26:30 -0000 1.100
+++ ./opcodes/ppc-opc.c 16 Oct 2007 02:55:30 -0000 1.101
@@ -4680,7 +4680,7 @@ const struct powerpc_opcode powerpc_opco
{ "dscliq.", ZRC(63,66,1), Z_MASK, POWER6, { FRT, FRA, SH16 } },
{ "dquaiq", ZRC(63,67,0), Z2_MASK, POWER6, { TE, FRT, FRB, RMC } },
-{ "dquaiq.", ZRC(63,67,1), Z2_MASK, POWER6, { FRT, FRA, FRB, RMC } },
+{ "dquaiq.", ZRC(63,67,1), Z2_MASK, POWER6, { TE, FRT, FRB, RMC } },
{ "mtfsb0", XRC(63,70,0), XRARB_MASK, COM, { BT } },
{ "mtfsb0.", XRC(63,70,1), XRARB_MASK, COM, { BT } },
2007-10-15 Peter Bergner <bergner@vnet.ibm.com>
* ppc-opc.c (TE): Correct signedness.
(powerpc_opcodes): Sort psq_st and psq_stu according to major
opcode number.
--- ./opcodes/ppc-opc.c 24 Aug 2007 00:56:30 -0000 1.99
+++ ./opcodes/ppc-opc.c 16 Oct 2007 02:26:30 -0000 1.100
@@ -492,13 +492,13 @@ const struct powerpc_operand powerpc_ope
#define VS VD
{ 0x1f, 21, NULL, NULL, PPC_OPERAND_VR },
- /* The SIMM field in a VX form instruction. */
+ /* The SIMM field in a VX form instruction, and TE in Z form. */
#define SIMM VD + 1
+#define TE SIMM
{ 0x1f, 16, NULL, NULL, PPC_OPERAND_SIGNED},
- /* The UIMM field in a VX form instruction, and TE in Z form. */
+ /* The UIMM field in a VX form instruction. */
#define UIMM SIMM + 1
-#define TE UIMM
{ 0x1f, 16, NULL, NULL, 0 },
/* The SHB field in a VA form instruction. */
@@ -4495,9 +4495,6 @@ const struct powerpc_opcode powerpc_opco
{ "fnmadds", A(59,31,0), A_MASK, PPC, { FRT,FRA,FRC,FRB } },
{ "fnmadds.",A(59,31,1), A_MASK, PPC, { FRT,FRA,FRC,FRB } },
-{ "psq_st", OP(60), OP_MASK, PPCPS, { FRS, PSD, RA, PSW, PSQ } },
-{ "psq_stu", OP(61), OP_MASK, PPCPS, { FRS, PSD, RA, PSW, PSQ } },
-
{ "dmul", XRC(59,34,0), X_MASK, POWER6, { FRT, FRA, FRB } },
{ "dmul.", XRC(59,34,1), X_MASK, POWER6, { FRT, FRA, FRB } },
@@ -4561,6 +4558,9 @@ const struct powerpc_opcode powerpc_opco
{ "stfq", OP(60), OP_MASK, POWER2, { FRS, D, RA } },
+{ "psq_st", OP(60), OP_MASK, PPCPS, { FRS, PSD, RA, PSW, PSQ } },
+{ "psq_stu", OP(61), OP_MASK, PPCPS, { FRS, PSD, RA, PSW, PSQ } },
+
{ "stfqu", OP(61), OP_MASK, POWER2, { FRS, D, RA } },
{ "stfdp", OP(61), OP_MASK, POWER6, { FRT, D, RA0 } },

View File

@ -8,19 +8,19 @@ Name: gdb
# Set version to contents of gdb/version.in. # Set version to contents of gdb/version.in.
# NOTE: the FSF gdb versions are numbered N.M for official releases, like 6.3 # NOTE: the FSF gdb versions are numbered N.M for official releases, like 6.3
# and, since January 2005, X.Y.Z.date for daily snapshots, like 6.3.50.20050112 # (daily snapshot from mailine), or 6.3.0.20040112 (head of the release branch). # and, since January 2005, X.Y.Z.date for daily snapshots, like 6.3.50.20050112 # (daily snapshot from mailine), or 6.3.0.20040112 (head of the release branch).
Version: 6.6 Version: 6.7
# The release always contains a leading reserved number, start it at 1. # The release always contains a leading reserved number, start it at 1.
Release: 37%{?dist} Release: 1%{?dist}
License: GPL License: GPL
Group: Development/Debuggers Group: Development/Debuggers
Source: ftp://ftp.gnu.org/gnu/gdb/gdb-6.6.tar.bz2 Source: ftp://ftp.gnu.org/gnu/gdb/gdb-6.7.tar.bz2
Buildroot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) Buildroot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
URL: http://gnu.org/software/gdb/ URL: http://gnu.org/software/gdb/
# For our convenience # For our convenience
%define gdb_src gdb-6.6 %define gdb_src gdb-%{version}
%define gdb_build build-%{_target_platform} %define gdb_build build-%{_target_platform}
# Make sure we get rid of the old package gdb64, now that we have unified # Make sure we get rid of the old package gdb64, now that we have unified
@ -149,9 +149,6 @@ Patch147: gdb-6.3-warnings-20050317.patch
# Fix printing of inherited members # Fix printing of inherited members
Patch148: gdb-6.3-inheritance-20050324.patch Patch148: gdb-6.3-inheritance-20050324.patch
# Add vsyscall page support for ia64.
Patch149: gdb-6.3-ia64-vsyscall-20050330.patch
# Print a warning when the separate debug info's CRC doesn't match. # Print a warning when the separate debug info's CRC doesn't match.
Patch150: gdb-6.3-test-sepcrc-20050402.patch Patch150: gdb-6.3-test-sepcrc-20050402.patch
Patch151: gdb-6.3-sepcrc-20050402.patch Patch151: gdb-6.3-sepcrc-20050402.patch
@ -225,9 +222,6 @@ Patch188: gdb-6.5-bz203661-emit-relocs.patch
# CVE-2006-4146 # CVE-2006-4146
Patch190: gdb-6.5-dwarf-stack-overflow.patch Patch190: gdb-6.5-dwarf-stack-overflow.patch
# Fix gdb printf command argument using "%p" (BZ 205551).
Patch191: gdb-6.5-bz205551-printf-p.patch
# Support TLS symbols (+`errno' suggestion if no pthread is found) (BZ 185337). # Support TLS symbols (+`errno' suggestion if no pthread is found) (BZ 185337).
# FIXME: Still to be updated. # FIXME: Still to be updated.
Patch194: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch Patch194: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch
@ -252,12 +246,6 @@ Patch201: gdb-6.5-gcore-i386-on-amd64.patch
# Testcase for deadlocking on last address space byte; for corrupted backtraces. # Testcase for deadlocking on last address space byte; for corrupted backtraces.
Patch211: gdb-6.5-last-address-space-byte-test.patch Patch211: gdb-6.5-last-address-space-byte-test.patch
# Fix "??" resolving of symbols from (non-prelinked) debuginfo packages.
Patch206: gdb-6.5-relativedebug.patch
# Fix "??" resolving of symbols from overlapping functions (nanosleep(3)).
Patch207: gdb-6.5-symbols-overlap.patch
# Improved testsuite results by the testsuite provided by the courtesy of BEA. # Improved testsuite results by the testsuite provided by the courtesy of BEA.
Patch208: gdb-6.5-BEA-testsuite.patch Patch208: gdb-6.5-BEA-testsuite.patch
@ -265,10 +253,6 @@ Patch208: gdb-6.5-BEA-testsuite.patch
Patch209: gdb-6.5-readline-long-line-crash.patch Patch209: gdb-6.5-readline-long-line-crash.patch
Patch213: gdb-6.5-readline-long-line-crash-test.patch Patch213: gdb-6.5-readline-long-line-crash-test.patch
# Fix readline history for input mode commands like `command' (BZ 215816).
Patch212: gdb-6.5-bz215816-readline-from-callback.patch
Patch219: gdb-6.5-bz215816-readline-from-callback-test.patch
# Fix bogus 0x0 unwind of the thread's topmost function clone(3) (BZ 216711). # Fix bogus 0x0 unwind of the thread's topmost function clone(3) (BZ 216711).
Patch214: gdb-6.5-bz216711-clone-is-outermost.patch Patch214: gdb-6.5-bz216711-clone-is-outermost.patch
@ -279,26 +263,17 @@ Patch216: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch
# Fix lockup on trampoline vs. its function lookup; unreproducible (BZ 218379). # Fix lockup on trampoline vs. its function lookup; unreproducible (BZ 218379).
Patch217: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch Patch217: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch
# Fix unwinding crash on older gcj(1) code (extended CFI support) (BZ 165025).
Patch221: gdb-6.5-bz165025-DW_CFA_GNU_negative_offset_extended-fix.patch
Patch222: gdb-6.5-bz165025-DW_CFA_GNU_negative_offset_extended-test.patch
# Find symbols properly at their original (included) file (BZ 109921). # Find symbols properly at their original (included) file (BZ 109921).
Patch224: gdb-6.5-bz109921-DW_AT_decl_file-fix.patch
Patch225: gdb-6.5-bz109921-DW_AT_decl_file-test.patch Patch225: gdb-6.5-bz109921-DW_AT_decl_file-test.patch
# Update PPC unwinding patches to their upstream variants (BZ 140532). # Update PPC unwinding patches to their upstream variants (BZ 140532).
Patch226: gdb-6.3-bz140532-ppc-unwinding-fix.patch
Patch229: gdb-6.3-bz140532-ppc-unwinding-test.patch Patch229: gdb-6.3-bz140532-ppc-unwinding-test.patch
# Fix missing testsuite .log output of testcases using get_compiler_info().
Patch230: gdb-6.5-testsuite-log.patch
# Testcase for exec() from threaded program (BZ 202689). # Testcase for exec() from threaded program (BZ 202689).
Patch231: gdb-6.3-bz202689-exec-from-pthread-test.patch Patch231: gdb-6.3-bz202689-exec-from-pthread-test.patch
# Backported post gdb-6.6 release fixups. # Backported post gdb-6.7 release fixups.
Patch232: gdb-6.6-upstream.patch Patch232: gdb-6.7-upstream.patch
# Testcase for PPC Power6/DFP instructions disassembly (BZ 230000). # Testcase for PPC Power6/DFP instructions disassembly (BZ 230000).
Patch234: gdb-6.6-bz230000-power6-disassembly-test.patch Patch234: gdb-6.6-bz230000-power6-disassembly-test.patch
@ -309,21 +284,12 @@ Patch235: gdb-6.3-bz231832-obstack-2gb.patch
# Suggest SELinux permissions problem; no assertion failure anymore (BZ 232371). # Suggest SELinux permissions problem; no assertion failure anymore (BZ 232371).
Patch236: gdb-6.6-bz232371-selinux-thread-error.patch Patch236: gdb-6.6-bz232371-selinux-thread-error.patch
# Use definition of an empty structure as it is not an opaque type (BZ 233716).
Patch238: gdb-6.6-bz233716-empty-structure-override.patch
# Fix prelink(8) testcase for non-root $PATH missing `/usr/sbin' (BZ 225783). # Fix prelink(8) testcase for non-root $PATH missing `/usr/sbin' (BZ 225783).
Patch240: gdb-6.6-bz225783-prelink-path.patch Patch240: gdb-6.6-bz225783-prelink-path.patch
# Fix debugging GDB itself - the compiled in source files paths (BZ 225783). # Fix debugging GDB itself - the compiled in source files paths (BZ 225783).
Patch241: gdb-6.6-bz225783-gdb-debuginfo-paths.patch Patch241: gdb-6.6-bz225783-gdb-debuginfo-paths.patch
# Fix harmless GCORE stack buffer overflow, by _FORTIFY_SOURCE=2 (BZ 238285).
Patch243: gdb-6.6-bz238285-gcore-strings-overflow.patch
# Use the runtime variant of `libunwind-ARCH.so.7' rather than the `.so' one.
Patch244: gdb-6.6-libunwind-major-version.patch
# Allow running `/usr/bin/gcore' with provided but inaccessible tty (BZ 229517). # Allow running `/usr/bin/gcore' with provided but inaccessible tty (BZ 229517).
Patch245: gdb-6.6-bz229517-gcore-without-terminal.patch Patch245: gdb-6.6-bz229517-gcore-without-terminal.patch
@ -333,9 +299,6 @@ Patch246: gdb-6.6-bz237096-watchthreads-testcasefix.patch
# Notify user of a child forked process being detached (BZ 235197). # Notify user of a child forked process being detached (BZ 235197).
Patch247: gdb-6.6-bz234468-fork-detach-info.patch Patch247: gdb-6.6-bz234468-fork-detach-info.patch
# Fix `gcore' command for 32bit PPC inferiors on 64bit PPC hosts (BZ 232015).
Patch248: gdb-6.6-bz232015-gcore-ppc-on-ppc64.patch
# New testcase for gcore of 32bit inferiors on 64bit hosts. # New testcase for gcore of 32bit inferiors on 64bit hosts.
Patch249: gdb-6.6-gcore32-test.patch Patch249: gdb-6.6-gcore32-test.patch
@ -350,7 +313,6 @@ Patch254: gdb-6.6-testsuite-timeouts.patch
Patch256: gdb-6.6-bz233852-attach-signalled.patch Patch256: gdb-6.6-bz233852-attach-signalled.patch
# Support for stepping over PPC atomic instruction sequences (BZ 237572). # Support for stepping over PPC atomic instruction sequences (BZ 237572).
Patch257: gdb-6.6-bz237572-ppc-atomic-sequence-upstream.patch
Patch258: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch Patch258: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch
# Link with libreadline provided by the operating system. # Link with libreadline provided by the operating system.
@ -363,15 +325,7 @@ Patch263: gdb-6.3-attach-see-vdso-test.patch
Patch265: gdb-6.6-bz247354-leader-exit-fix.patch Patch265: gdb-6.6-bz247354-leader-exit-fix.patch
Patch266: gdb-6.6-bz247354-leader-exit-test.patch Patch266: gdb-6.6-bz247354-leader-exit-test.patch
# Fixed compatibility with Rawhide kernel fs.binfmt_elf.core_dump_elf_headers=1.
Patch269: gdb-6.6-bfd-core-dump_elf_headers.patch
# Fixed compatibility with the Rawhide glibc open(2) syscall sanity checking.
Patch272: gdb-6.6-glibc-open-fcntl2-compat.patch
# New fast verification whether the .debug file matches its peer (build-id).
# New locating of the matching binaries from the pure core file (build-id). # New locating of the matching binaries from the pure core file (build-id).
Patch273: gdb-6.6-buildid-verify.patch
Patch274: gdb-6.6-buildid-locate.patch Patch274: gdb-6.6-buildid-locate.patch
# Fixed the kernel 8KB VDSO loading (producing `no loadable sections found'). # Fixed the kernel 8KB VDSO loading (producing `no loadable sections found').
@ -386,6 +340,12 @@ Patch278: gdb-6.6-cu-ranges.patch
# Fix hardware watchpoints after inferior forks-off some process. # Fix hardware watchpoints after inferior forks-off some process.
Patch280: gdb-6.6-multifork-debugreg-for-i386-and-x86_64.patch Patch280: gdb-6.6-multifork-debugreg-for-i386-and-x86_64.patch
# Fix displaying of numeric char arrays as strings (BZ 224128).
Patch282: gdb-6.7-charsign-test.patch
# Fix rereading of the main executable on its change.
Patch283: gdb-6.7-reread-exec_bfd.patch
BuildRequires: ncurses-devel glibc-devel gcc make gzip texinfo dejagnu gettext BuildRequires: ncurses-devel glibc-devel gcc make gzip texinfo dejagnu gettext
BuildRequires: flex bison sharutils expat-devel BuildRequires: flex bison sharutils expat-devel
Requires: readline Requires: readline
@ -461,7 +421,6 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
%patch145 -p1 %patch145 -p1
%patch147 -p1 %patch147 -p1
%patch148 -p1 %patch148 -p1
%patch149 -p1
%patch150 -p1 %patch150 -p1
%patch151 -p1 %patch151 -p1
%patch153 -p1 %patch153 -p1
@ -486,65 +445,49 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
%patch187 -p1 %patch187 -p1
%patch188 -p1 %patch188 -p1
%patch190 -p1 %patch190 -p1
%patch191 -p1
%patch194 -p1 %patch194 -p1
%patch195 -p1 %patch195 -p1
%patch196 -p1 %patch196 -p1
%patch199 -p1 %patch199 -p1
%patch200 -p1 %patch200 -p1
%patch201 -p1 %patch201 -p1
%patch206 -p1
%patch207 -p1
%patch208 -p1 %patch208 -p1
%patch209 -p1 %patch209 -p1
%patch211 -p1 %patch211 -p1
%patch212 -p1
%patch213 -p1 %patch213 -p1
%patch214 -p1 %patch214 -p1
%patch215 -p1 %patch215 -p1
%patch216 -p1 %patch216 -p1
%patch217 -p1 %patch217 -p1
%patch219 -p1
%patch221 -p1
%patch222 -p1
%patch224 -p1
%patch225 -p1 %patch225 -p1
%patch226 -p1
%patch229 -p1 %patch229 -p1
%patch230 -p1
%patch231 -p1 %patch231 -p1
%patch232 -p1 %patch232 -p1
%patch234 -p1 %patch234 -p1
%patch235 -p1 %patch235 -p1
%patch236 -p1 %patch236 -p1
%patch238 -p1
%patch240 -p1 %patch240 -p1
%patch241 -p1 %patch241 -p1
%patch243 -p1
%patch244 -p1
%patch245 -p1 %patch245 -p1
%patch246 -p1 %patch246 -p1
%patch247 -p1 %patch247 -p1
%patch248 -p1
%patch249 -p1 %patch249 -p1
%patch251 -p1 %patch251 -p1
%patch254 -p1 %patch254 -p1
%patch256 -p1 %patch256 -p1
%patch257 -p1
%patch258 -p1 %patch258 -p1
%patch260 -p1 %patch260 -p1
%patch261 -p1 %patch261 -p1
%patch263 -p1 %patch263 -p1
%patch265 -p1 %patch265 -p1
%patch266 -p1 %patch266 -p1
%patch269 -p1
%patch272 -p1
%patch273 -p1
%patch274 -p1 %patch274 -p1
%patch276 -p1 %patch276 -p1
%patch277 -p1 %patch277 -p1
%patch278 -p1 %patch278 -p1
%patch280 -p1 %patch280 -p1
%patch282 -p1
%patch283 -p1
# Change the version that gets printed at GDB startup, so it is RedHat # Change the version that gets printed at GDB startup, so it is RedHat
# specific. # specific.
@ -559,9 +502,6 @@ rm -f bfd/doc/*.info-*
rm -f gdb/doc/*.info rm -f gdb/doc/*.info
rm -f gdb/doc/*.info-* rm -f gdb/doc/*.info-*
# Force the use of system readline includes as we link with the system readline.
rm -rf readline
%build %build
# Identify the build directory with the version of gdb as well as the # Identify the build directory with the version of gdb as well as the
@ -595,6 +535,7 @@ enable_build_warnings="$enable_build_warnings,-Werror"
$enable_build_warnings \ $enable_build_warnings \
--with-separate-debug-dir=/usr/lib/debug \ --with-separate-debug-dir=/usr/lib/debug \
--disable-rpath \ --disable-rpath \
--with-system-readline \
%ifarch ia64 %ifarch ia64
--with-libunwind \ --with-libunwind \
%else %else
@ -701,6 +642,10 @@ fi
# don't include the files in include, they are part of binutils # don't include the files in include, they are part of binutils
%changelog %changelog
* Thu Nov 1 2007 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.7-1
- Upgrade to GDB 6.7. Drop redundant patches, forward-port remaining ones.
- Fix rereading of the main executable on its change.
* Fri Oct 19 2007 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.6-37 * Fri Oct 19 2007 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.6-37
- Fix hiding unexpected breakpoints on intentional step/next commands. - Fix hiding unexpected breakpoints on intentional step/next commands.
- Fix s390 compilation warning/failure due to a wrongly sized type-cast. - Fix s390 compilation warning/failure due to a wrongly sized type-cast.

View File

@ -1 +1 @@
a4df41d28dd514d64e8ccbfe125fd9a6 gdb-6.6.tar.bz2 d6e7c0ad7654bc91a3a457fabb6ad6c6 gdb-6.7.tar.bz2