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

This commit is contained in:
aoliva 2006-07-11 06:33:02 +00:00
parent 8f1d1491a9
commit 9231e41bc3
28 changed files with 1368 additions and 10788 deletions

View File

@ -1 +1,2 @@
gdb-6.3.tar.bz2
gdb-6.5.tar.bz2

View File

@ -11,8 +11,10 @@ testsuite/gdb.base:
* setshow.exp: Add testing of "set backtrace past-zero-pc" option.
--- gdb-6.3/gdb/testsuite/gdb.base/setshow.exp.fix 2005-12-01 14:43:02.000000000 -0500
+++ gdb-6.3/gdb/testsuite/gdb.base/setshow.exp 2005-12-01 14:43:20.000000000 -0500
Index: gdb-6.5/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.5/gdb/testsuite/gdb.base/setshow.exp 2006-07-11 02:47:24.000000000 -0300
@@ -1,4 +1,4 @@
-# Copyright 1992, 1994, 1996, 1997, 1998, 2001, 2003
+# Copyright 1992, 1994, 1996, 1997, 1998, 2001, 2003, 2005
@ -36,17 +38,28 @@ testsuite/gdb.base:
#test set check range on
gdb_test "set check range on" "" "set check range on"
#test show check range on
--- gdb-6.3/gdb/frame.c.fix 2005-12-01 14:42:47.000000000 -0500
+++ gdb-6.3/gdb/frame.c 2005-12-01 14:44:08.000000000 -0500
@@ -115,6 +115,7 @@ static int frame_debug;
/* Flag to indicate whether backtraces should stop at main et.al. */
Index: gdb-6.5/gdb/frame.c
===================================================================
--- gdb-6.5.orig/gdb/frame.c 2006-07-11 02:46:50.000000000 -0300
+++ gdb-6.5/gdb/frame.c 2006-07-11 02:51:20.000000000 -0300
@@ -131,6 +131,16 @@ Whether backtraces should continue past
value);
}
static int backtrace_past_main;
+static int backtrace_past_zero_pc;
static unsigned int backtrace_limit = UINT_MAX;
+static void
+show_backtrace_past_zero_pc (struct ui_file *file, int from_tty,
+ struct cmd_list_element *c, const char *value)
+{
+ fprintf_filtered (file, _("\
+Whether backtraces should continue past a zero pc value is %s.\n"),
+ value);
+}
+
static int backtrace_past_entry;
static void
@@ -1236,9 +1237,7 @@ get_prev_frame (struct frame_info *this_
show_backtrace_past_entry (struct ui_file *file, int from_tty,
@@ -1313,9 +1323,7 @@ get_prev_frame (struct frame_info *this_
}
if (this_frame->level > 0
@ -57,20 +70,21 @@ testsuite/gdb.base:
&& get_frame_type (this_frame) == NORMAL_FRAME
&& get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME
&& get_frame_pc (this_frame) == 0)
@@ -1537,6 +1536,16 @@ Whether backtraces should continue past
NULL, NULL, &set_backtrace_cmdlist,
@@ -1629,6 +1637,17 @@ the rest of the stack trace."),
&set_backtrace_cmdlist,
&show_backtrace_cmdlist);
+ add_setshow_boolean_cmd ("past-zero-pc", class_obscure,
+ &backtrace_past_zero_pc, "\
+Set whether backtraces should continue past a zero pc value.", "\
+Show whether backtraces should continue past a zero pc value..", "\
+ &backtrace_past_zero_pc, _("\
+Set whether backtraces should continue past a zero pc value."), _("\
+Show whether backtraces should continue past a zero pc value."), _("\
+Normally GDB stops backtracing when it finds a zero pc.\n\
+Set this variable if you need to see the rest of the stack trace.", "\
+Whether backtraces should continue past a zero pc value is %s.",
+ NULL, NULL, &set_backtrace_cmdlist,
+ &show_backtrace_cmdlist);
+Set this variable if you need to see the rest of the stack trace."),
+ NULL,
+ show_backtrace_past_zero_pc,
+ &set_backtrace_cmdlist,
+ &show_backtrace_cmdlist);
+
add_setshow_uinteger_cmd ("limit", class_obscure,
&backtrace_limit, "\
Set an upper bound on the number of backtrace levels.", "\
add_setshow_integer_cmd ("limit", class_obscure,
&backtrace_limit, _("\
Set an upper bound on the number of backtrace levels."), _("\

View File

@ -21,41 +21,46 @@
* tui/tui-win.c (make_visible_with_new_height): Ditto.
* tui/tui-winsource.c (tui_update_source_windows_with_addr): Ditto.
--- gdb-6.3/gdb/mi/mi-cmd-disas.c.fix Thu Jan 20 18:45:16 2005
+++ gdb-6.3/gdb/mi/mi-cmd-disas.c Thu Jan 20 19:08:00 2005
Index: gdb-6.5/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.5/gdb/mi/mi-cmd-disas.c 2006-07-11 02:16:07.000000000 -0300
@@ -1,5 +1,5 @@
/* MI Command Set - disassemble commands.
- Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
- 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,17 @@ mi_cmd_disassemble (char *command, char
@@ -145,11 +145,18 @@ mi_cmd_disassemble (char *command, char
if (line_seen && file_seen)
{
+ CORE_ADDR *pc_list;
+ int num_pc_values;
+
s = lookup_symtab (file_string);
if (s == NULL)
error ("mi_cmd_disassemble: Invalid filename.");
error (_("mi_cmd_disassemble: Invalid filename."));
- if (!find_line_pc (s, line_num, &start))
+ if (!find_line_pc (s, line_num, &pc_list, &num_pc_values))
error ("mi_cmd_disassemble: Invalid line number");
error (_("mi_cmd_disassemble: Invalid line number"));
+ /* FIXME: What do we do with multiple pc values for ctors/dtors
+ under mi? */
+ start = pc_list[0];
+ xfree (pc_list);
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"));
}
--- gdb-6.3/gdb/tui/tui-layout.c.fix Thu Jan 20 18:44:53 2005
+++ gdb-6.3/gdb/tui/tui-layout.c Thu Jan 20 19:08:16 2005
Index: gdb-6.5/gdb/tui/tui-layout.c
===================================================================
--- gdb-6.5.orig/gdb/tui/tui-layout.c 2006-07-11 01:30:43.000000000 -0300
+++ gdb-6.5/gdb/tui/tui-layout.c 2006-07-11 02:16:07.000000000 -0300
@@ -1,6 +1,6 @@
/* TUI layout window management.
- Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+ Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software
- 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.
@ -72,7 +77,7 @@
@@ -520,8 +521,11 @@ extract_display_start_addr (void)
case SRC_DATA_COMMAND:
find_line_pc (cursal.symtab,
TUI_SRC_WIN->detail.source_info.start_line_or_addr.line_no,
TUI_SRC_WIN->detail.source_info.start_line_or_addr.u.line_no,
- &pc);
- addr = pc;
+ &pc_list, &num_pc_values);
@ -83,44 +88,49 @@
break;
case DISASSEM_COMMAND:
case SRC_DISASSEM_COMMAND:
--- gdb-6.3/gdb/tui/tui-win.c.fix Thu Jan 20 18:44:58 2005
+++ gdb-6.3/gdb/tui/tui-win.c Thu Jan 20 19:08:24 2005
Index: gdb-6.5/gdb/tui/tui-win.c
===================================================================
--- gdb-6.5.orig/gdb/tui/tui-win.c 2006-07-11 01:30:43.000000000 -0300
+++ gdb-6.5/gdb/tui/tui-win.c 2006-07-11 02:16:12.000000000 -0300
@@ -1,6 +1,6 @@
/* TUI window generic functions.
- Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+ Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software
Foundation, Inc.
- 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.
@@ -1313,7 +1313,15 @@ make_visible_with_new_height (struct tui
line.line_no = cursal.line;
@@ -1342,8 +1342,16 @@ make_visible_with_new_height (struct tui
}
else
{
- find_line_pc (s, cursal.line, &line.addr);
+ CORE_ADDR *pc_list;
+ int num_pc_values;
line.loa = LOA_ADDRESS;
- find_line_pc (s, cursal.line, &line.u.addr);
+ if (find_line_pc (s, cursal.line, &pc_list, &num_pc_values))
+ {
+ /* FIXME: What do we do with multiple pc values for
+ ctors/dtors and inlined functions? */
+ line.addr = pc_list[0];
+ line.u.addr = pc_list[0];
+ xfree (pc_list);
+ }
}
tui_update_source_window (win_info, s, line, TRUE);
}
--- gdb-6.3/gdb/tui/tui-winsource.c.fix Thu Jan 20 18:45:04 2005
+++ gdb-6.3/gdb/tui/tui-winsource.c Thu Jan 20 19:08:34 2005
Index: gdb-6.5/gdb/tui/tui-winsource.c
===================================================================
--- gdb-6.5.orig/gdb/tui/tui-winsource.c 2006-07-11 01:30:43.000000000 -0300
+++ gdb-6.5/gdb/tui/tui-winsource.c 2006-07-11 01:39:20.000000000 -0300
@@ -1,6 +1,6 @@
/* TUI display source/assembly window.
- Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+ Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software
Foundation, Inc.
- 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.
@@ -171,14 +171,21 @@ tui_update_source_windows_with_addr (COR
@@ -173,14 +173,21 @@ tui_update_source_windows_with_addr (COR
void
tui_update_source_windows_with_line (struct symtab *s, int line)
{
@ -128,7 +138,7 @@
+ CORE_ADDR pc = 0;
+ CORE_ADDR *pc_list;
+ int num_pc_values;
union tui_line_or_address l;
struct tui_line_or_address l;
switch (tui_current_layout ())
{
@ -144,7 +154,7 @@
tui_update_source_windows_with_addr (pc);
break;
default:
@@ -186,7 +193,12 @@ tui_update_source_windows_with_line (str
@@ -189,7 +196,12 @@ tui_update_source_windows_with_line (str
tui_show_symtab_source (s, l, FALSE);
if (tui_current_layout () == SRC_DISASSEM_COMMAND)
{
@ -158,18 +168,20 @@
tui_show_disassem (pc);
}
break;
--- gdb-6.3/gdb/symtab.c.fix Thu Jan 20 18:44:33 2005
+++ gdb-6.3/gdb/symtab.c Thu Jan 20 19:07:26 2005
Index: gdb-6.5/gdb/symtab.c
===================================================================
--- gdb-6.5.orig/gdb/symtab.c 2006-07-11 01:30:43.000000000 -0300
+++ gdb-6.5/gdb/symtab.c 2006-07-11 02:16:05.000000000 -0300
@@ -1,7 +1,7 @@
/* Symbol table lookup for the GNU debugger, GDB.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
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.
@@ -72,7 +72,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 *);
@ -180,7 +192,7 @@
/* This one is used by linespec.c */
@@ -2230,6 +2232,9 @@ find_pc_line (CORE_ADDR pc, int notcurre
@@ -2233,6 +2235,9 @@ find_pc_line (CORE_ADDR pc, int notcurre
/* Find line number LINE in any symtab whose name is the same as
SYMTAB.
@ -190,7 +202,7 @@
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, and set *EXACT_MATCH nonzero if the value returned is an
@@ -2246,13 +2251,19 @@ find_line_symtab (struct symtab *symtab,
@@ -2249,13 +2254,19 @@ find_line_symtab (struct symtab *symtab,
so far seen. */
int best_index;
@ -211,7 +223,7 @@
if (best_index < 0 || !exact)
{
/* Didn't find an exact match. So we better keep looking for
@@ -2283,7 +2294,7 @@ find_line_symtab (struct symtab *symtab,
@@ -2286,7 +2297,7 @@ find_line_symtab (struct symtab *symtab,
if (strcmp (symtab->filename, s->filename) != 0)
continue;
l = LINETABLE (s);
@ -220,7 +232,7 @@
if (ind >= 0)
{
if (exact)
@@ -2319,13 +2330,23 @@ done:
@@ -2322,13 +2333,23 @@ done:
Returns zero for invalid line number (and sets the PC to 0).
The source file is specified with a struct symtab. */
@ -247,7 +259,7 @@
if (symtab == 0)
return 0;
@@ -2333,7 +2354,50 @@ find_line_pc (struct symtab *symtab, int
@@ -2336,7 +2357,50 @@ find_line_pc (struct symtab *symtab, int
if (symtab != NULL)
{
l = LINETABLE (symtab);
@ -299,7 +311,7 @@
return 1;
}
else
@@ -2351,12 +2415,22 @@ find_line_pc_range (struct symtab_and_li
@@ -2354,12 +2418,22 @@ find_line_pc_range (struct symtab_and_li
CORE_ADDR *endptr)
{
CORE_ADDR startaddr;
@ -323,7 +335,7 @@
/* 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
"info line *0x123" should say the line goes from 0x100 to 0x200
@@ -2386,7 +2460,7 @@ find_line_pc_range (struct symtab_and_li
@@ -2389,7 +2463,7 @@ find_line_pc_range (struct symtab_and_li
Set *EXACT_MATCH nonzero if the value returned is an exact match. */
static int
@ -332,7 +344,7 @@
int *exact_match)
{
int i;
@@ -2405,7 +2479,7 @@ find_line_common (struct linetable *l, i
@@ -2408,7 +2482,7 @@ find_line_common (struct linetable *l, i
return -1;
len = l->nitems;
@ -341,7 +353,7 @@
{
struct linetable_entry *item = &(l->item[i]);
@@ -2429,6 +2503,52 @@ find_line_common (struct linetable *l, i
@@ -2432,6 +2506,52 @@ find_line_common (struct linetable *l, i
return best_index;
}
@ -394,12 +406,14 @@
int
find_pc_line_pc_range (CORE_ADDR pc, CORE_ADDR *startptr, CORE_ADDR *endptr)
{
--- gdb-6.3/gdb/symtab.h.fix Thu Jan 20 18:44:38 2005
+++ gdb-6.3/gdb/symtab.h Thu Jan 20 19:07:41 2005
Index: gdb-6.5/gdb/symtab.h
===================================================================
--- gdb-6.5.orig/gdb/symtab.h 2006-07-11 01:30:43.000000000 -0300
+++ gdb-6.5/gdb/symtab.h 2006-07-11 01:39:20.000000000 -0300
@@ -1,7 +1,7 @@
/* Symbol table definitions for GDB.
Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
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.
@ -423,18 +437,11 @@
/* Given a string, return the line specified by it. For commands like "list"
and "breakpoint". */
--- gdb-6.3/gdb/breakpoint.c.fix Thu Jan 20 18:44:42 2005
+++ gdb-6.3/gdb/breakpoint.c Thu Jan 20 19:07:48 2005
@@ -1,7 +1,7 @@
/* Everything about breakpoints, for GDB.
Copyright 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.
@@ -5231,10 +5231,40 @@ static void
Index: gdb-6.5/gdb/breakpoint.c
===================================================================
--- gdb-6.5.orig/gdb/breakpoint.c 2006-07-11 01:30:53.000000000 -0300
+++ gdb-6.5/gdb/breakpoint.c 2006-07-11 01:39:20.000000000 -0300
@@ -5268,10 +5268,40 @@ static void
breakpoint_sals_to_pc (struct symtabs_and_lines *sals,
char *address)
{
@ -479,7 +486,7 @@
/* It's possible for the PC to be nonzero, but still an illegal
value on some targets.
@@ -5364,6 +5394,10 @@ break_command_1 (char *arg, int flag, in
@@ -5406,6 +5436,10 @@ break_command_1 (char *arg, int flag, in
if (!pending)
{
@ -490,7 +497,7 @@
/* Make sure that all storage allocated to SALS gets freed. */
make_cleanup (xfree, sals.sals);
@@ -5394,11 +5428,6 @@ break_command_1 (char *arg, int flag, in
@@ -5436,11 +5470,6 @@ break_command_1 (char *arg, int flag, in
make_cleanup (xfree, addr_string[i]);
}
@ -502,7 +509,7 @@
/* Verify that condition can be parsed, before setting any
breakpoints. Allocate a separate condition expression for each
breakpoint. */
@@ -5629,14 +5658,16 @@ gdb_breakpoint (char *address, char *con
@@ -5670,14 +5699,16 @@ gdb_breakpoint (char *address, char *con
void
resolve_sal_pc (struct symtab_and_line *sal)
{
@ -514,7 +521,7 @@
{
- if (!find_line_pc (sal->symtab, sal->line, &pc))
+ if (!find_line_pc (sal->symtab, sal->line, &pc_list, &num_pc_values))
error ("No line %d in file \"%s\".",
error (_("No line %d in file \"%s\"."),
sal->line, sal->symtab->filename);
- sal->pc = pc;
+ sal->pc = pc_list[0];
@ -522,7 +529,7 @@
}
if (sal->section == 0 && sal->symtab != NULL)
@@ -5673,6 +5704,54 @@ resolve_sal_pc (struct symtab_and_line *
@@ -5714,6 +5745,54 @@ resolve_sal_pc (struct symtab_and_line *
}
}

View File

@ -4,9 +4,11 @@
destructors as this will be handled in find_methods.
(find_methods): Fix ctor check to also check for dtor.
--- gdb-6.3/gdb/linespec.c.fix Fri Jan 21 17:03:18 2005
+++ gdb-6.3/gdb/linespec.c Fri Jan 21 17:04:39 2005
@@ -375,12 +375,14 @@ add_matching_methods (int method_counter
Index: gdb-6.5/gdb/linespec.c
===================================================================
--- gdb-6.5.orig/gdb/linespec.c 2006-07-07 01:04:56.000000000 -0300
+++ gdb-6.5/gdb/linespec.c 2006-07-07 02:05:35.000000000 -0300
@@ -377,12 +377,14 @@ add_matching_methods (int method_counter
/* Check for special case of looking for member that
doesn't have a mangled name provided. This will happen
@ -15,16 +17,16 @@
Since we don't have a mangled name to work with, if we
- look for the symbol, we can only find the class itself.
+ look for the symbol, we can at best find the class itself.
We can find the information we need in the minimal symbol
We can find the information we need in the minimal symbol
table which has the full member name information we need. */
- if (strlen (phys_name) <= strlen (class_name))
+ if (strlen (phys_name) <= strlen (class_name)
+ || (strlen (phys_name) == strlen (class_name) + 1
+ && phys_name[0] == '~'))
+ if (strlen (phys_name) <= strlen (class_name)
+ || (strlen (phys_name) == strlen (class_name) + 1
+ && phys_name[0] == '~'))
return add_minsym_members (class_name, phys_name, msym_arr);
/* Destructor is handled by caller, don't add it to
@@ -1707,6 +1709,11 @@ collect_methods (char *copy, struct type
@@ -1709,6 +1711,11 @@ collect_methods (char *copy, struct type
{
int i1 = 0; /* Counter for the symbol array. */
@ -36,7 +38,7 @@
if (destructor_name_p (copy, t))
{
/* Destructors are a special case. */
@@ -1725,6 +1732,7 @@ collect_methods (char *copy, struct type
@@ -1727,6 +1734,7 @@ collect_methods (char *copy, struct type
}
}
else

View File

@ -3,28 +3,23 @@
* linux-nat.c (linux_nat_xfer_memory): Don't use
linux_proc_xfer_memory for ia64.
--- gdb-6.3/gdb/linux-nat.c.fix Fri Feb 4 22:52:40 2005
+++ gdb-6.3/gdb/linux-nat.c Tue Feb 8 15:49:09 2005
@@ -2381,12 +2381,22 @@ linux_nat_xfer_memory (CORE_ADDR memaddr
struct cleanup *old_chain = save_inferior_ptid ();
int xfer;
Index: gdb-6.5/gdb/linux-nat.c
===================================================================
--- gdb-6.5.orig/gdb/linux-nat.c 2006-07-07 00:57:56.000000000 -0300
+++ gdb-6.5/gdb/linux-nat.c 2006-07-07 02:24:51.000000000 -0300
@@ -3152,10 +3152,15 @@ linux_xfer_partial (struct target_ops *o
return procfs_xfer_auxv (ops, object, annex, readbuf, writebuf,
offset, len);
+#ifdef NATIVE_XFER_UNWIND_TABLE
+#ifndef NATIVE_XFER_UNWIND_TABLE
+ /* FIXME: For ia64, we cannot currently use linux_proc_xfer_memory
+ for accessing thread storage. Revert when Bugzilla 147436
+ is fixed. */
+ if (is_lwp (inferior_ptid))
+ inferior_ptid = pid_to_ptid (GET_LWP (inferior_ptid));
+
+ xfer = child_xfer_memory (memaddr, myaddr, len, write, attrib, target);
+#else
if (is_lwp (inferior_ptid))
inferior_ptid = pid_to_ptid (GET_LWP (inferior_ptid));
xfer = linux_proc_xfer_memory (memaddr, myaddr, len, write, attrib, target);
if (xfer == 0)
xfer = child_xfer_memory (memaddr, myaddr, len, write, attrib, target);
xfer = linux_proc_xfer_partial (ops, object, annex, readbuf, writebuf,
offset, len);
if (xfer != 0)
return xfer;
+#endif
do_cleanups (old_chain);
return xfer;
return super_xfer_partial (ops, object, annex, readbuf, writebuf,
offset, len);

View File

@ -4,20 +4,23 @@
unwind table syscall to support backtracing from syscalls in
a corefile.
--- gdb-6.3/gdb/ia64-tdep.c.fix Thu Jan 27 12:03:40 2005
+++ gdb-6.3/gdb/ia64-tdep.c Thu Jan 27 12:06:23 2005
@@ -2357,8 +2357,14 @@ static int
getunwind_table (void *buf, size_t len)
{
LONGEST x;
- x = target_read_partial (&current_target, TARGET_OBJECT_UNWIND_TABLE, NULL,
- buf, 0, len);
+
Index: gdb-6.5/gdb/ia64-tdep.c
===================================================================
--- gdb-6.5.orig/gdb/ia64-tdep.c 2006-04-18 16:20:06.000000000 -0300
+++ gdb-6.5/gdb/ia64-tdep.c 2006-07-07 02:18:40.000000000 -0300
@@ -2470,8 +2470,17 @@ getunwind_table (void *buf, size_t len)
we want to preserve fall back to the running kernel's table, then
we should find a way to override the corefile layer's
xfer_partial method. */
+#if 0
x = target_read_partial (&current_target, TARGET_OBJECT_UNWIND_TABLE, NULL,
buf, 0, len);
+#endif
+ /* FIXME: This is a temporary solution to backtracing syscalls in corefiles.
+ To do this properly, the AUXV section should be used. This
+ fix will work as long as the kernel used to generate the corefile
+ is equivalent to the kernel used to debug the corefile. */
+ x = ia64_linux_xfer_unwind_table (&current_target,
+ x = ia64_linux_xfer_unwind_table (&current_target,
+ TARGET_OBJECT_UNWIND_TABLE, NULL,
+ buf, NULL, 0, len);

View File

@ -1,7 +1,9 @@
--- gdb-6.3/gdb/gcore.c.fix 2005-04-21 15:13:23.000000000 -0400
+++ gdb-6.3/gdb/gcore.c 2005-04-21 15:16:48.000000000 -0400
Index: gdb-6.5/gdb/gcore.c
===================================================================
--- gdb-6.5.orig/gdb/gcore.c 2005-12-17 20:33:59.000000000 -0200
+++ gdb-6.5/gdb/gcore.c 2006-07-07 02:41:33.000000000 -0300
@@ -462,8 +462,13 @@ gcore_copy_callback (bfd *obfd, asection
error ("Not enough memory to create corefile.");
error (_("Not enough memory to create corefile."));
old_chain = make_cleanup (xfree, memhunk);
+ /* Warn if read error occurs except if we were trying to read the
@ -12,6 +14,6 @@
+ memhunk, size) != 0
+ && (strcmp (TARGET_ARCHITECTURE->arch_name, "ia64")
+ || bfd_section_vma (obfd, osec) != 0))
warning ("Memory read failed for corefile section, %s bytes at 0x%s\n",
warning (_("Memory read failed for corefile section, %s bytes at 0x%s."),
paddr_d (size), paddr (bfd_section_vma (obfd, osec)));
if (!bfd_set_section_contents (obfd, osec, memhunk, 0, size))

View File

@ -7,58 +7,68 @@
(ia64_rse_skip_regs): Ditto.
(ia64_linux_check_stack_region): New function.
--- gdb-6.3/gdb/linux-nat.c.fix 2005-07-14 17:53:13.000000000 -0400
+++ gdb-6.3/gdb/linux-nat.c 2005-07-14 19:31:00.000000000 -0400
@@ -2438,7 +2438,9 @@ linux_nat_mourn_inferior (void)
deprecated_child_ops.to_mourn_inferior ();
Index: gdb-6.5/gdb/linux-nat.c
===================================================================
--- gdb-6.5.orig/gdb/linux-nat.c 2006-07-07 02:29:12.000000000 -0300
+++ gdb-6.5/gdb/linux-nat.c 2006-07-07 03:03:55.000000000 -0300
@@ -2473,7 +2473,9 @@ linux_nat_xfer_partial (struct target_op
do_cleanups (old_chain);
return xfer;
}
-
+#ifdef NATIVE_XFER_UNWIND_TABLE
+extern int ia64_linux_check_stack_region(struct lwp_info *lwp, void *range);
+#endif
static int
linux_nat_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
struct mem_attrib *attrib, struct target_ops *target)
@@ -2446,14 +2448,29 @@ linux_nat_xfer_memory (CORE_ADDR memaddr
struct cleanup *old_chain = save_inferior_ptid ();
int xfer;
linux_nat_thread_alive (ptid_t ptid)
{
@@ -3214,15 +3216,34 @@ linux_xfer_partial (struct target_ops *o
return procfs_xfer_auxv (ops, object, annex, readbuf, writebuf,
offset, len);
-#ifdef NATIVE_XFER_UNWIND_TABLE
-#ifndef NATIVE_XFER_UNWIND_TABLE
- /* FIXME: For ia64, we cannot currently use linux_proc_xfer_memory
- for accessing thread storage. Revert when Bugzilla 147436
- is fixed. */
xfer = linux_proc_xfer_partial (ops, object, annex, readbuf, writebuf,
offset, len);
if (xfer != 0)
- return xfer;
+ {
+#ifdef NATIVE_XFER_UNWIND_TABLE
+ struct mem_region range;
+ range.lo = memaddr;
+ range.hi = memaddr + len;
+ struct mem_region range;
+ range.lo = memaddr;
+ range.hi = memaddr + len;
+
+ /* FIXME: For ia64, we cannot currently trust linux_proc_xfer_memory
+ for accessing rse register storage. Revert when Bugzilla 147436
is fixed. */
if (is_lwp (inferior_ptid))
inferior_ptid = pid_to_ptid (GET_LWP (inferior_ptid));
- xfer = child_xfer_memory (memaddr, myaddr, len, write, attrib, target);
+ xfer = linux_proc_xfer_memory (memaddr, myaddr, len, write, attrib, target);
+ if (xfer == 0)
+ xfer = child_xfer_memory (memaddr, myaddr, len, write, attrib, target);
+ else if (iterate_over_lwps (ia64_linux_check_stack_region, &range) != NULL)
+ { /* This region contains ia64 rse registers, we have to re-read. */
+ int xxfer;
+ /* Re-read register stack area. */
+ xxfer = child_xfer_memory (range.lo, myaddr + (range.lo - memaddr),
+ range.hi - range.lo, write, attrib, target);
+ if (xxfer == 0)
+ xfer = 0;
+ /* FIXME: For ia64, we cannot currently use
+ linux_proc_xfer_partial for accessing rse register storage.
+ Revert when Bugzilla 147436 is fixed. */
+ if (iterate_over_lwps (ia64_linux_check_stack_region, &range) != NULL)
+ { /* This region contains ia64 rse registers, we have to re-read. */
+ int xxfer;
+
+ /* Re-read register stack area. */
+ xxfer = super_xfer_partial (ops, object, annex,
+ readbuf + (range.lo - memaddr),
+ writebuf + (range.lo - memaddr),
+ offset + (range.lo - memaddr),
+ range.hi - range.lo);
+ if (xxfer == 0)
+ xfer = 0;
+ }
#endif
+ return xfer;
+ }
#else
if (is_lwp (inferior_ptid))
inferior_ptid = pid_to_ptid (GET_LWP (inferior_ptid));
--- gdb-6.3/gdb/ia64-linux-nat.c.fix 2005-07-14 17:54:43.000000000 -0400
+++ gdb-6.3/gdb/ia64-linux-nat.c 2005-07-14 17:55:19.000000000 -0400
@@ -784,6 +784,64 @@ ia64_linux_save_sigtrap_info (void *queu
lp->saved_trap_data);
}
return super_xfer_partial (ops, object, annex, readbuf, writebuf,
offset, len);
Index: gdb-6.5/gdb/ia64-linux-nat.c
===================================================================
--- gdb-6.5.orig/gdb/ia64-linux-nat.c 2006-03-24 20:08:16.000000000 -0300
+++ gdb-6.5/gdb/ia64-linux-nat.c 2006-07-07 02:52:25.000000000 -0300
@@ -687,6 +687,64 @@ ia64_linux_xfer_partial (struct target_o
void _initialize_ia64_linux_nat (void);
+/*
+ * Note: taken from ia64_tdep.c

View File

@ -1,6 +1,6 @@
2005-11-15 Jeff Johnston <jjohnstn@redhat.com>
* thread-db.c (thread_db_wait): Don't bother continuing if
* linux-thread-db.c (thread_db_wait): Don't bother continuing if
the wait result indicates the program terminated with a signal.
* linux-nat.c (linux_nat_wait): For SIGILL and SIGTRAP, don't
throw away the event if the user has specified nostop noprint.
@ -12,8 +12,10 @@ gdb/testsuite:
* gdb.arch/ia64-sigill.c: New test.
* gdb.arch/ia64-sigill.exp: Ditto.
--- gdb-6.3/gdb/testsuite/gdb.arch/ia64-sigill.exp.fix 2005-11-15 17:52:56.000000000 -0500
+++ gdb-6.3/gdb/testsuite/gdb.arch/ia64-sigill.exp 2005-11-15 17:52:10.000000000 -0500
Index: gdb-6.5/gdb/testsuite/gdb.arch/ia64-sigill.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.5/gdb/testsuite/gdb.arch/ia64-sigill.exp 2006-07-07 03:16:54.000000000 -0300
@@ -0,0 +1,59 @@
+# Copyright 2005 Free Software Foundation, Inc.
+
@ -74,8 +76,10 @@ gdb/testsuite:
+gdb_test "handle SIGILL nostop noprint" "SIGILL.*No.*No.*Yes.*" "handle sigill"
+gdb_test "run" "Starting program.*ia64-sigill.*\[New thread.*\].*hello world.*Program exited normally." "run to exit"
+
--- gdb-6.3/gdb/testsuite/gdb.arch/ia64-sigill.c.fix 2005-11-15 17:53:02.000000000 -0500
+++ gdb-6.3/gdb/testsuite/gdb.arch/ia64-sigill.c 2005-11-15 17:52:05.000000000 -0500
Index: gdb-6.5/gdb/testsuite/gdb.arch/ia64-sigill.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.5/gdb/testsuite/gdb.arch/ia64-sigill.c 2006-07-07 03:16:54.000000000 -0300
@@ -0,0 +1,8 @@
+#include <stdio.h>
+
@ -85,9 +89,11 @@ gdb/testsuite:
+ return 0;
+}
+
--- gdb-6.3/gdb/thread-db.c.fix 2005-11-15 17:51:09.000000000 -0500
+++ gdb-6.3/gdb/thread-db.c 2005-11-15 17:51:50.000000000 -0500
@@ -930,7 +930,8 @@ thread_db_wait (ptid_t ptid, struct targ
Index: gdb-6.5/gdb/linux-thread-db.c
===================================================================
--- gdb-6.5.orig/gdb/linux-thread-db.c 2006-07-07 01:06:36.000000000 -0300
+++ gdb-6.5/gdb/linux-thread-db.c 2006-07-07 03:16:54.000000000 -0300
@@ -926,7 +926,8 @@ thread_db_wait (ptid_t ptid, struct targ
post-processing and bail out early. */
return ptid;
@ -97,9 +103,11 @@ gdb/testsuite:
return pid_to_ptid (-1);
if (ourstatus->kind == TARGET_WAITKIND_STOPPED
--- gdb-6.3/gdb/linux-nat.c.fix 2005-11-15 17:51:14.000000000 -0500
+++ gdb-6.3/gdb/linux-nat.c 2005-11-15 17:51:46.000000000 -0500
@@ -2216,7 +2216,8 @@ retry:
Index: gdb-6.5/gdb/linux-nat.c
===================================================================
--- gdb-6.5.orig/gdb/linux-nat.c 2006-07-07 03:03:55.000000000 -0300
+++ gdb-6.5/gdb/linux-nat.c 2006-07-07 03:16:54.000000000 -0300
@@ -2209,7 +2209,8 @@ retry:
threads can be a bit time-consuming so if we want decent
performance with heavily multi-threaded programs, especially when
they're using a high frequency timer, we'd better avoid it if we
@ -109,9 +117,9 @@ gdb/testsuite:
if (WIFSTOPPED (status))
{
@@ -2224,7 +2225,9 @@ retry:
if (signal_stop_state (signo) == 0
@@ -2220,7 +2221,9 @@ retry:
if (!lp->step
&& signal_stop_state (signo) == 0
&& signal_print_state (signo) == 0
- && signal_pass_state (signo) == 1)
+ && signal_pass_state (signo) == 1

View File

@ -12,8 +12,10 @@
the base address using the current stack pointer plus a fixed
offset.
--- gdb-6.3/gdb/libunwind-frame.c.fix 2005-09-26 14:45:45.000000000 -0400
+++ gdb-6.3/gdb/libunwind-frame.c 2005-09-26 14:46:27.000000000 -0400
Index: gdb-6.5/gdb/libunwind-frame.c
===================================================================
--- gdb-6.5.orig/gdb/libunwind-frame.c 2006-07-07 03:04:32.000000000 -0300
+++ gdb-6.5/gdb/libunwind-frame.c 2006-07-07 03:07:33.000000000 -0300
@@ -62,6 +62,7 @@ static unw_word_t (*unw_find_dyn_list_p)
struct libunwind_frame_cache
{
@ -56,7 +58,7 @@
- uw_sp_regnum = descr->gdb2uw (SP_REGNUM);
ret = unw_get_reg_p (&cache->cursor, uw_sp_regnum, &fp);
if (ret < 0)
error ("Can't get libunwind sp register.");
error (_("Can't get libunwind sp register."));
+ cache->sp = (CORE_ADDR)sp;
cache->base = (CORE_ADDR)fp;
@ -103,8 +105,10 @@
return NULL;
}
--- gdb-6.3/gdb/libunwind-frame.h.fix 2005-09-26 14:45:57.000000000 -0400
+++ gdb-6.3/gdb/libunwind-frame.h 2005-09-26 14:46:30.000000000 -0400
Index: gdb-6.5/gdb/libunwind-frame.h
===================================================================
--- gdb-6.5.orig/gdb/libunwind-frame.h 2006-07-07 02:51:32.000000000 -0300
+++ gdb-6.5/gdb/libunwind-frame.h 2006-07-07 03:05:49.000000000 -0300
@@ -49,6 +49,9 @@ void libunwind_frame_set_descr (struct g
void libunwind_frame_this_id (struct frame_info *next_frame, void **this_cache,
@ -115,9 +119,11 @@
void libunwind_frame_prev_register (struct frame_info *next_frame, void **this_cache,
int regnum, int *optimizedp,
enum lval_type *lvalp, CORE_ADDR *addrp,
--- gdb-6.3/gdb/ia64-tdep.c.fix 2005-09-26 14:46:04.000000000 -0400
+++ gdb-6.3/gdb/ia64-tdep.c 2005-09-26 14:46:22.000000000 -0400
@@ -3035,7 +3035,7 @@ ia64_libunwind_sigtramp_frame_this_id (s
Index: gdb-6.5/gdb/ia64-tdep.c
===================================================================
--- gdb-6.5.orig/gdb/ia64-tdep.c 2006-07-07 02:51:32.000000000 -0300
+++ gdb-6.5/gdb/ia64-tdep.c 2006-07-07 03:05:49.000000000 -0300
@@ -3031,7 +3031,7 @@ ia64_libunwind_sigtramp_frame_this_id (s
struct frame_id id;
CORE_ADDR prev_ip;
@ -126,7 +132,7 @@
if (frame_id_eq (id, null_frame_id))
{
(*this_id) = null_frame_id;
@@ -3047,8 +3047,14 @@ ia64_libunwind_sigtramp_frame_this_id (s
@@ -3043,8 +3043,14 @@ ia64_libunwind_sigtramp_frame_this_id (s
frame_unwind_register (next_frame, IA64_BSP_REGNUM, buf);
bsp = extract_unsigned_integer (buf, 8);

View File

@ -1,64 +1,13 @@
2005-03-30 Jeff Johnston <jjohnstn@redhat.com>
* gdb/ia64-tdep.c (ia64_find_unwind_table): Change code to
allow for idiosyncrasies of ia64 vsyscall page.
* bfd/elfcode.h: Ditto.
* bfd/elfcode.h: Change code to allow for idiosyncrasies of
ia64 vsyscall page.
--- gdb-6.3/gdb/ia64-tdep.c.fix 2005-03-30 13:34:00.000000000 -0500
+++ gdb-6.3/gdb/ia64-tdep.c 2005-03-30 13:36:45.000000000 -0500
@@ -2449,16 +2449,35 @@ ia64_find_unwind_table (struct objfile *
}
}
- if (!p_text || !p_unwind
- /* Verify that the segment that contains the IP also contains
- the static unwind table. If not, we are dealing with
- runtime-generated code, for which we have no info here. */
- || (p_unwind->p_vaddr - p_text->p_vaddr) >= p_text->p_memsz)
+ if (!p_text || !p_unwind)
return -UNW_ENOINFO;
+ /* Verify that the segment that contains the IP also contains
+ the static unwind table. If not, we may be in the Linux kernel's
+ DSO gate page in which case the unwind table is another segment.
+ Otherwise, we are dealing with runtime-generated code, for which we
+ have no info here. */
segbase = p_text->p_vaddr + load_base;
- dip->start_ip = segbase;
+ if ((p_unwind->p_vaddr - p_text->p_vaddr) >= p_text->p_memsz)
+ {
+ int ok = 0;
+ for (i = 0; i < ehdr->e_phnum; ++i)
+ {
+ if (phdr[i].p_type == PT_LOAD
+ && (p_unwind->p_vaddr - phdr[i].p_vaddr) < phdr[i].p_memsz)
+ {
+ ok = 1;
+ /* Get the segbase from the section containing the
+ libunwind table. */
+ segbase = phdr[i].p_vaddr + load_base;
+ }
+ }
+ if (!ok)
+ return -UNW_ENOINFO;
+ }
+
+ dip->start_ip = p_text->p_vaddr + load_base;
dip->end_ip = dip->start_ip + p_text->p_memsz;
dip->gp = FIND_GLOBAL_POINTER (ip);
dip->format = UNW_INFO_FORMAT_REMOTE_TABLE;
--- gdb-6.3/bfd/elfcode.h.fix 2005-03-30 13:34:53.000000000 -0500
+++ gdb-6.3/bfd/elfcode.h 2005-03-30 13:37:48.000000000 -0500
@@ -1,6 +1,6 @@
/* ELF executable support for BFD.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Written by Fred Fish @ Cygnus Support, from information published
in "UNIX System V Release 4, Programmers Guide: ANSI C and
@@ -1619,7 +1619,8 @@ NAME(_bfd_elf,bfd_from_remote_memory)
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;

View File

@ -1,11 +1,3 @@
2004-11-07 Andrew Cagney <cagney@redhat.com>
Daniel Jacobowitz <dan@debian.org>
Roland McGrath <roland@redhat.com>
* inftarg.c (child_attach): Notify any observers of
inferior creation.
* inf-ptrace.c (inf_ptrace_attach): Ditto.
2005-07-21 Jeff Johnston <jjohnstn@redhat.com>
* gdb.base/attach-32.exp: New test for attaching in 32-bit
@ -13,19 +5,6 @@
* gdb.base/attach-32.c: Ditto.
* gdb.base/attach-32b.c: Ditto.
--- gdb-6.3/gdb/inftarg.c.fix3 2005-07-21 13:43:05.000000000 -0400
+++ gdb-6.3/gdb/inftarg.c 2005-07-21 13:45:17.000000000 -0400
@@ -211,6 +211,10 @@ child_attach (char *args, int from_tty)
inferior_ptid = pid_to_ptid (pid);
push_target (&deprecated_child_ops);
+
+ /* Do this first, before anything has had a chance to query the
+ inferior's symbol table or similar. */
+ observer_notify_inferior_created (&current_target, from_tty);
}
#if !defined(CHILD_POST_ATTACH)
--- gdb-6.3/gdb/testsuite/gdb.base/attach-32.c.fix3 2005-07-21 14:23:50.000000000 -0400
+++ gdb-6.3/gdb/testsuite/gdb.base/attach-32.c 2005-07-21 14:05:56.000000000 -0400
@@ -0,0 +1,20 @@
@ -326,16 +305,3 @@
+ }
+ return (0);
+}
--- gdb-6.3/gdb/inf-ptrace.c.fix3 2005-07-21 13:44:34.000000000 -0400
+++ gdb-6.3/gdb/inf-ptrace.c 2005-07-21 13:45:59.000000000 -0400
@@ -220,6 +220,10 @@ inf_ptrace_attach (char *args, int from_
inferior_ptid = pid_to_ptid (pid);
push_target (ptrace_ops_hack);
+
+ /* Do this first, before anything has had a chance to query the
+ inferior's symbol table or similar. */
+ observer_notify_inferior_created (&current_target, from_tty);
}
static void

View File

@ -3,24 +3,18 @@
* valops.c (check_field_in): Use check_typedef for base classes
to avoid problems with opaque type references.
--- gdb-6.3/gdb/valops.c.fix 2005-03-24 19:07:09.000000000 -0500
+++ gdb-6.3/gdb/valops.c 2005-03-24 19:08:31.000000000 -0500
@@ -1,6 +1,6 @@
/* Perform non-arithmetic operations on values, for GDB.
Copyright 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.
@@ -2315,8 +2315,13 @@ check_field_in (struct type *type, const
Index: gdb-6.5/gdb/valops.c
===================================================================
--- gdb-6.5.orig/gdb/valops.c 2005-12-17 20:34:03.000000000 -0200
+++ gdb-6.5/gdb/valops.c 2006-07-07 02:35:09.000000000 -0300
@@ -2257,8 +2257,13 @@ check_field_in (struct type *type, const
}
for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--)
- if (check_field_in (TYPE_BASECLASS (type, i), name))
- return 1;
+ {
+ /* Check the base classes. Make sure we have the real type for
+ /* Check the base classes. Make sure we have the real type for
+ each base class as opposed to an opaque declaration. */
+ struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
+ if (check_field_in (baseclass, name))

View File

@ -21,66 +21,61 @@
* remote.h: Ditto.
* dcache.h: Ditto.
--- gdb-6.3/gdb/symfile-mem.c.fix 2005-12-14 17:57:05.000000000 -0500
+++ gdb-6.3/gdb/symfile-mem.c 2005-12-14 18:10:19.000000000 -0500
@@ -57,6 +57,14 @@
Index: gdb-6.5/gdb/symfile-mem.c
===================================================================
--- gdb-6.5.orig/gdb/symfile-mem.c 2006-07-11 02:35:34.000000000 -0300
+++ gdb-6.5/gdb/symfile-mem.c 2006-07-11 02:35:49.000000000 -0300
@@ -58,6 +58,14 @@
#include "elf/common.h"
+/* Local callback routine to pass to bfd to read from target memory,
+ using a len constrained to INT_MAX. */
+static int
+read_target_memory (CORE_ADDR addr, char *buf, int len)
+read_target_memory (bfd_vma addr, bfd_byte *buf, int len)
+{
+ return target_read_memory (addr, buf, (LONGEST)len);
+}
+
/* 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
representing the target's format. */
@@ -74,7 +82,7 @@ symbol_file_add_from_memory (struct bfd
error ("add-symbol-file-from-memory not supported for this target");
representing the target's format. NAME is the name to use for this
@@ -78,7 +86,7 @@ symbol_file_add_from_memory (struct bfd
error (_("add-symbol-file-from-memory not supported for this target"));
nbfd = bfd_elf_bfd_from_remote_memory (templ, addr, &loadbase,
- target_read_memory);
+ read_target_memory);
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."));
--- gdb-6.3/gdb/target.c.fix 2005-12-06 16:16:29.000000000 -0500
+++ gdb-6.3/gdb/target.c 2005-12-14 18:16:06.000000000 -0500
@@ -82,7 +82,7 @@ static LONGEST default_xfer_partial (str
Index: gdb-6.5/gdb/target.c
===================================================================
--- gdb-6.5.orig/gdb/target.c 2006-07-11 02:35:49.000000000 -0300
+++ gdb-6.5/gdb/target.c 2006-07-11 02:35:49.000000000 -0300
@@ -83,8 +83,8 @@ static LONGEST default_xfer_partial (str
partial transfers, try either target_read_memory_partial or
target_write_memory_partial). */
-static int target_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
+static int target_xfer_memory (CORE_ADDR memaddr, char *myaddr, LONGEST len,
int write);
-static int target_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len,
- int write);
+static int target_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr,
+ LONGEST len, int write);
static void init_dummy_target (void);
@@ -109,9 +109,9 @@ static void debug_to_store_registers (in
static void debug_to_prepare_to_store (void);
-static int deprecated_debug_xfer_memory (CORE_ADDR, char *, int, int,
- struct mem_attrib *,
- struct target_ops *);
+static LONGEST deprecated_debug_xfer_memory (CORE_ADDR, char *, LONGEST, int,
+ struct mem_attrib *,
+ struct target_ops *);
static void debug_to_files_info (struct target_ops *);
@@ -514,7 +514,7 @@ update_current_target (void)
@@ -511,8 +511,8 @@ update_current_target (void)
de_fault (to_prepare_to_store,
(void (*) (void))
noprocess);
de_fault (deprecated_xfer_memory,
- (int (*) (CORE_ADDR, char *, int, int, struct mem_attrib *, struct target_ops *))
+ (LONGEST (*) (CORE_ADDR, char *, LONGEST, int, struct mem_attrib *, struct target_ops *))
- de_fault (deprecated_xfer_memory,
- (int (*) (CORE_ADDR, gdb_byte *, int, int, struct mem_attrib *, struct target_ops *))
+ de_fault (deprecated_xfer_memory,
+ (LONGEST (*) (CORE_ADDR, gdb_byte *, LONGEST, int, struct mem_attrib *, struct target_ops *))
nomemory);
de_fault (to_files_info,
(void (*) (struct target_ops *))
@@ -945,7 +945,7 @@ target_xfer_partial (struct target_ops *
@@ -940,7 +940,7 @@ target_xfer_partial (struct target_ops *
implementing another singluar mechanism (for instance, a generic
object:annex onto inferior:object:annex say). */
@ -89,32 +84,32 @@
xfer_using_stratum (enum target_object object, const char *annex,
ULONGEST offset, LONGEST len, void *readbuf,
const void *writebuf)
@@ -1010,7 +1010,7 @@ xfer_using_stratum (enum target_object o
@@ -1005,7 +1005,7 @@ xfer_using_stratum (enum target_object o
deal with partial reads should call target_read_memory_partial. */
int
-target_read_memory (CORE_ADDR memaddr, char *myaddr, int len)
+target_read_memory (CORE_ADDR memaddr, char *myaddr, LONGEST len)
-target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
+target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len)
{
if (target_xfer_partial_p ())
return xfer_using_stratum (TARGET_OBJECT_MEMORY, NULL,
@@ -1020,7 +1020,7 @@ target_read_memory (CORE_ADDR memaddr, c
@@ -1015,7 +1015,7 @@ target_read_memory (CORE_ADDR memaddr, g
}
int
-target_write_memory (CORE_ADDR memaddr, char *myaddr, int len)
+target_write_memory (CORE_ADDR memaddr, char *myaddr, LONGEST len)
-target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, int len)
+target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, LONGEST len)
{
if (target_xfer_partial_p ())
return xfer_using_stratum (TARGET_OBJECT_MEMORY, NULL,
@@ -1051,11 +1051,11 @@ static int trust_readonly = 0;
gdb_byte *bytes = alloca (len);
memcpy (bytes, myaddr, len);
@@ -1056,11 +1056,11 @@ Mode for reading from readonly sections
Result is -1 on error, or the number of bytes transfered. */
-int
-do_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
-do_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write,
+LONGEST
+do_xfer_memory (CORE_ADDR memaddr, char *myaddr, LONGEST len, int write,
+do_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len, int write,
struct mem_attrib *attrib)
{
- int res;
@ -122,12 +117,13 @@
int done = 0;
struct target_ops *t;
@@ -1113,10 +1113,10 @@ do_xfer_memory (CORE_ADDR memaddr, char
@@ -1118,10 +1118,11 @@ do_xfer_memory (CORE_ADDR memaddr, gdb_b
Result is 0 or errno value. */
static int
-target_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write)
+target_xfer_memory (CORE_ADDR memaddr, char *myaddr, LONGEST len, int write)
-target_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write)
+target_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr,
+ LONGEST len, int write)
{
- int res;
- int reg_len;
@ -136,14 +132,14 @@
struct mem_region *region;
/* Zero length requests are ok and require no work. */
@@ -1186,12 +1186,12 @@ target_xfer_memory (CORE_ADDR memaddr, c
Result is -1 on error, or the number of bytes transfered. */
@@ -1192,12 +1193,12 @@ target_xfer_memory (CORE_ADDR memaddr, g
If we succeed, set *ERR to zero and return the number of bytes transferred.
If we fail, set *ERR to a non-zero errno value, and return -1. */
-static int
-target_xfer_memory_partial (CORE_ADDR memaddr, char *myaddr, int len,
-target_xfer_memory_partial (CORE_ADDR memaddr, gdb_byte *myaddr, int len,
+static LONGEST
+target_xfer_memory_partial (CORE_ADDR memaddr, char *myaddr, LONGEST len,
+target_xfer_memory_partial (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len,
int write_p, int *err)
{
- int res;
@ -153,41 +149,42 @@
struct mem_region *region;
/* Zero length requests are ok and require no work. */
@@ -1250,8 +1250,8 @@ target_xfer_memory_partial (CORE_ADDR me
@@ -1256,9 +1257,9 @@ target_xfer_memory_partial (CORE_ADDR me
return res;
}
-int
-target_read_memory_partial (CORE_ADDR memaddr, char *buf, int len, int *err)
+LONGEST
+target_read_memory_partial (CORE_ADDR memaddr, char *buf, LONGEST len, int *err)
target_read_memory_partial (CORE_ADDR memaddr, gdb_byte *buf,
- int len, int *err)
+ LONGEST len, int *err)
{
if (target_xfer_partial_p ())
return target_xfer_partial (target_stack, TARGET_OBJECT_MEMORY, NULL,
@@ -1260,8 +1260,9 @@ target_read_memory_partial (CORE_ADDR me
{
@@ -1285,9 +1286,9 @@ target_read_memory_partial (CORE_ADDR me
return target_xfer_memory_partial (memaddr, buf, len, 0, err);
}
-int
-target_write_memory_partial (CORE_ADDR memaddr, char *buf, int len, int *err)
+LONGEST
+target_write_memory_partial (CORE_ADDR memaddr, char *buf, LONGEST len,
+ int *err)
target_write_memory_partial (CORE_ADDR memaddr, gdb_byte *buf,
- int len, int *err)
+ LONGEST len, int *err)
{
if (target_xfer_partial_p ())
return target_xfer_partial (target_stack, TARGET_OBJECT_MEMORY, NULL,
@@ -1985,8 +1986,8 @@ debug_to_prepare_to_store (void)
{
@@ -2044,8 +2045,8 @@ debug_to_prepare_to_store (void)
fprintf_unfiltered (gdb_stdlog, "target_prepare_to_store ()\n");
}
-static int
-deprecated_debug_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
-deprecated_debug_xfer_memory (CORE_ADDR memaddr, bfd_byte *myaddr, int len,
+static LONGEST
+deprecated_debug_xfer_memory (CORE_ADDR memaddr, char *myaddr, LONGEST len,
+deprecated_debug_xfer_memory (CORE_ADDR memaddr, bfd_byte *myaddr, LONGEST len,
int write, struct mem_attrib *attrib,
struct target_ops *target)
{
@@ -1996,9 +1997,9 @@ deprecated_debug_xfer_memory (CORE_ADDR
@@ -2055,9 +2056,9 @@ deprecated_debug_xfer_memory (CORE_ADDR
attrib, target);
fprintf_unfiltered (gdb_stdlog,
@ -199,74 +196,85 @@
if (retval > 0)
{
--- gdb-6.3/gdb/target.h.fix 2005-12-06 16:16:33.000000000 -0500
+++ gdb-6.3/gdb/target.h 2005-12-14 17:56:47.000000000 -0500
@@ -330,8 +330,8 @@ struct target_ops
Index: gdb-6.5/gdb/target.h
===================================================================
--- gdb-6.5.orig/gdb/target.h 2006-07-11 02:35:48.000000000 -0300
+++ gdb-6.5/gdb/target.h 2006-07-11 02:35:49.000000000 -0300
@@ -332,10 +332,10 @@ struct target_ops
NOTE: cagney/2004-10-01: This has been entirely superseeded by
to_xfer_partial and inferior inheritance. */
- int (*deprecated_xfer_memory) (CORE_ADDR memaddr, char *myaddr,
- int (*deprecated_xfer_memory) (CORE_ADDR memaddr, gdb_byte *myaddr,
- int len, int write,
+ LONGEST (*deprecated_xfer_memory) (CORE_ADDR memaddr, char *myaddr,
+ LONGEST len, int write,
struct mem_attrib *attrib,
struct target_ops *target);
- struct mem_attrib *attrib,
- struct target_ops *target);
+ LONGEST (*deprecated_xfer_memory) (CORE_ADDR memaddr, gdb_byte *myaddr,
+ LONGEST len, int write,
+ struct mem_attrib *attrib,
+ struct target_ops *target);
@@ -533,20 +533,20 @@ extern void target_disconnect (char *, i
void (*to_files_info) (struct target_ops *);
int (*to_insert_breakpoint) (struct bp_target_info *);
@@ -535,21 +535,23 @@ extern void target_disconnect (char *, i
extern DCACHE *target_dcache;
-extern int do_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
- struct mem_attrib *attrib);
+extern LONGEST do_xfer_memory (CORE_ADDR memaddr, char *myaddr, LONGEST len,
+ int write, struct mem_attrib *attrib);
-extern int do_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len,
- int write, struct mem_attrib *attrib);
+extern LONGEST do_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr,
+ LONGEST len, int write,
+ struct mem_attrib *attrib);
extern int target_read_string (CORE_ADDR, char **, int, int *);
-extern int target_read_memory (CORE_ADDR memaddr, char *myaddr, int len);
+extern int target_read_memory (CORE_ADDR memaddr, char *myaddr, LONGEST len);
-extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len);
+extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr,
+ LONGEST len);
-extern int target_write_memory (CORE_ADDR memaddr, char *myaddr, int len);
+extern int target_write_memory (CORE_ADDR memaddr, char *myaddr, LONGEST len);
extern int target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr,
- int len);
+ LONGEST len);
-extern int xfer_memory (CORE_ADDR, char *, int, int,
-extern int xfer_memory (CORE_ADDR, gdb_byte *, int, int,
- struct mem_attrib *, struct target_ops *);
+extern LONGEST xfer_memory (CORE_ADDR, char *, LONGEST, int,
+extern LONGEST xfer_memory (CORE_ADDR, gdb_byte *, LONGEST, int,
+ struct mem_attrib *, struct target_ops *);
-extern int child_xfer_memory (CORE_ADDR, char *, int, int,
-extern int child_xfer_memory (CORE_ADDR, gdb_byte *, int, int,
- struct mem_attrib *, struct target_ops *);
+extern LONGEST child_xfer_memory (CORE_ADDR, char *, LONGEST, int,
+ struct mem_attrib *, struct target_ops *);
+extern LONGEST child_xfer_memory (CORE_ADDR, gdb_byte *, LONGEST, int,
+ struct mem_attrib *, struct target_ops *);
/* Make a single attempt at transfering LEN bytes. On a successful
transfer, the number of bytes actually transfered is returned and
@@ -554,11 +554,11 @@ extern int child_xfer_memory (CORE_ADDR,
@@ -557,11 +559,11 @@ extern int child_xfer_memory (CORE_ADDR,
of bytes actually transfered is not defined) and ERR is set to a
non-zero error indication. */
-extern int target_read_memory_partial (CORE_ADDR addr, char *buf, int len,
- int *err);
+extern LONGEST target_read_memory_partial (CORE_ADDR addr, char *buf, LONGEST len,
+ int *err);
-extern int target_read_memory_partial (CORE_ADDR addr, gdb_byte *buf,
- int len, int *err);
+extern LONGEST target_read_memory_partial (CORE_ADDR addr, gdb_byte *buf,
+ LONGEST len, int *err);
-extern int target_write_memory_partial (CORE_ADDR addr, char *buf, int len,
- int *err);
+extern LONGEST target_write_memory_partial (CORE_ADDR addr, char *buf, LONGEST len,
+ int *err);
-extern int target_write_memory_partial (CORE_ADDR addr, gdb_byte *buf,
- int len, int *err);
+extern LONGEST target_write_memory_partial (CORE_ADDR addr, gdb_byte *buf,
+ LONGEST len, int *err);
extern char *child_pid_to_exec_file (int);
--- gdb-6.3/gdb/infptrace.c.fix 2005-12-06 16:16:38.000000000 -0500
+++ gdb-6.3/gdb/infptrace.c 2005-12-14 14:22:10.000000000 -0500
@@ -443,17 +443,17 @@ store_inferior_registers (int regnum)
Index: gdb-6.5/gdb/infptrace.c
===================================================================
--- gdb-6.5.orig/gdb/infptrace.c 2006-07-11 02:35:49.000000000 -0300
+++ gdb-6.5/gdb/infptrace.c 2006-07-11 02:35:49.000000000 -0300
@@ -368,17 +368,17 @@ store_inferior_registers (int regnum)
deprecated_child_ops doesn't allow memory operations to cross below
us in the target stack anyway. */
-int
-child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
-child_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write,
+LONGEST
+child_xfer_memory (CORE_ADDR memaddr, char *myaddr, LONGEST len, int write,
+child_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len, int write,
struct mem_attrib *attrib, struct target_ops *target)
{
- int i;
@ -275,109 +283,76 @@
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)
+ LONGEST count = ((((memaddr + len) - addr) + sizeof (PTRACE_TYPE_RET) - 1)
/ sizeof (PTRACE_TYPE_RET));
- / 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;
--- gdb-6.3/gdb/dcache.c.fix 2005-12-06 16:16:44.000000000 -0500
+++ gdb-6.3/gdb/dcache.c 2005-12-14 15:18:22.000000000 -0500
@@ -524,9 +524,9 @@ dcache_free (DCACHE *dcache)
Index: gdb-6.5/gdb/dcache.c
===================================================================
--- gdb-6.5.orig/gdb/dcache.c 2006-07-11 02:35:34.000000000 -0300
+++ gdb-6.5/gdb/dcache.c 2006-07-11 02:35:49.000000000 -0300
@@ -527,9 +527,9 @@ dcache_free (DCACHE *dcache)
This routine is indended to be called by remote_xfer_ functions. */
-int
-dcache_xfer_memory (DCACHE *dcache, CORE_ADDR memaddr, char *myaddr, int len,
- int should_write)
+LONGEST
+dcache_xfer_memory (DCACHE *dcache, CORE_ADDR memaddr, char *myaddr,
dcache_xfer_memory (DCACHE *dcache, CORE_ADDR memaddr, gdb_byte *myaddr,
- int len, int should_write)
+ LONGEST len, int should_write)
{
int i;
int (*xfunc) (DCACHE *dcache, CORE_ADDR addr, char *ptr);
--- gdb-6.3/gdb/dcache.h.fix 2005-12-06 16:16:50.000000000 -0500
+++ gdb-6.3/gdb/dcache.h 2005-12-14 15:18:47.000000000 -0500
int (*xfunc) (DCACHE *dcache, CORE_ADDR addr, gdb_byte *ptr);
Index: gdb-6.5/gdb/dcache.h
===================================================================
--- gdb-6.5.orig/gdb/dcache.h 2006-07-11 02:35:34.000000000 -0300
+++ gdb-6.5/gdb/dcache.h 2006-07-11 02:35:49.000000000 -0300
@@ -37,7 +37,7 @@ void dcache_free (DCACHE *);
/* Simple to call from <remote>_xfer_memory */
-int dcache_xfer_memory (DCACHE *cache, CORE_ADDR mem, char *my, int len,
- int should_write);
+LONGEST dcache_xfer_memory (DCACHE *cache, CORE_ADDR mem, char *my, LONGEST len,
+ int should_write);
-int dcache_xfer_memory (DCACHE *cache, CORE_ADDR mem, gdb_byte *my,
- int len, int should_write);
+LONGEST dcache_xfer_memory (DCACHE *cache, CORE_ADDR mem, gdb_byte *my,
+ LONGEST len, int should_write);
#endif /* DCACHE_H */
--- gdb-6.3/gdb/exec.c.fix 2005-12-06 16:16:56.000000000 -0500
+++ gdb-6.3/gdb/exec.c 2005-12-14 15:06:30.000000000 -0500
@@ -444,8 +444,8 @@ map_vmap (bfd *abfd, bfd *arch)
Index: gdb-6.5/gdb/exec.c
===================================================================
--- gdb-6.5.orig/gdb/exec.c 2006-07-11 02:35:34.000000000 -0300
+++ gdb-6.5/gdb/exec.c 2006-07-11 02:35:49.000000000 -0300
@@ -447,8 +447,8 @@ map_vmap (bfd *abfd, bfd *arch)
The same routine is used to handle both core and exec files;
we just tail-call it with more arguments to select between them. */
-int
-xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
-xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write,
+LONGEST
+xfer_memory (CORE_ADDR memaddr, char *myaddr, LONGEST len, int write,
struct mem_attrib *attrib,
struct target_ops *target)
+xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len, int write,
struct mem_attrib *attrib, struct target_ops *target)
{
--- gdb-6.3/gdb/linux-nat.c.fix 2005-12-06 16:17:02.000000000 -0500
+++ gdb-6.3/gdb/linux-nat.c 2005-12-14 14:26:41.000000000 -0500
@@ -2444,12 +2444,12 @@ linux_nat_mourn_inferior (void)
#ifdef NATIVE_XFER_UNWIND_TABLE
extern int ia64_linux_check_stack_region(struct lwp_info *lwp, void *range);
#endif
-static int
-linux_nat_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
+static LONGEST
+linux_nat_xfer_memory (CORE_ADDR memaddr, char *myaddr, LONGEST len, int write,
struct mem_attrib *attrib, struct target_ops *target)
{
struct cleanup *old_chain = save_inferior_ptid ();
- int xfer;
+ LONGEST xfer;
int res;
Index: gdb-6.5/gdb/linux-nat.c
===================================================================
--- gdb-6.5.orig/gdb/linux-nat.c 2006-07-11 02:35:49.000000000 -0300
+++ gdb-6.5/gdb/linux-nat.c 2006-07-11 02:36:39.000000000 -0300
@@ -3264,7 +3264,7 @@ linux_xfer_partial (struct target_ops *o
Revert when Bugzilla 147436 is fixed. */
if (iterate_over_lwps (ia64_linux_check_stack_region, &range) != NULL)
{ /* This region contains ia64 rse registers, we have to re-read. */
- int xxfer;
+ LONGEST xxfer;
#ifdef NATIVE_XFER_UNWIND_TABLE
struct mem_region range;
@@ -2467,7 +2467,7 @@ linux_nat_xfer_memory (CORE_ADDR memaddr
xfer = child_xfer_memory (memaddr, myaddr, len, write, attrib, target);
else if (iterate_over_lwps (ia64_linux_check_stack_region, &range) != NULL)
{ /* This region contains ia64 rse registers, we have to re-read. */
- int xxfer;
+ LONGEST xxfer;
/* Re-read register stack area. */
xxfer = child_xfer_memory (range.lo, myaddr + (range.lo - memaddr),
range.hi - range.lo, write, attrib, target);
@@ -3091,8 +3091,8 @@ linux_nat_info_proc_cmd (char *args, int
}
}
-int
-linux_proc_xfer_memory (CORE_ADDR addr, char *myaddr, int len, int write,
+LONGEST
+linux_proc_xfer_memory (CORE_ADDR addr, char *myaddr, LONGEST len, int write,
struct mem_attrib *attrib, struct target_ops *target)
{
int fd, ret;
--- gdb-6.3/gdb/linux-nat.h.fix 2005-12-06 16:17:07.000000000 -0500
+++ gdb-6.3/gdb/linux-nat.h 2005-12-14 14:27:44.000000000 -0500
@@ -80,9 +80,10 @@ struct linux_watchpoint
struct mem_attrib;
struct target_ops;
-extern int linux_proc_xfer_memory (CORE_ADDR addr, char *myaddr, int len,
- int write, struct mem_attrib *attrib,
- struct target_ops *target);
+extern LONGEST linux_proc_xfer_memory (CORE_ADDR addr, char *myaddr,
+ LONGEST len,
+ int write, struct mem_attrib *attrib,
+ struct target_ops *target);
/* Find process PID's pending signal set from /proc/pid/status. */
void linux_proc_pending_signals (int pid, sigset_t *pending, sigset_t *blocked, sigset_t *ignored);
--- gdb-6.3/gdb/remote.c.fix 2005-12-06 16:17:17.000000000 -0500
+++ gdb-6.3/gdb/remote.c 2005-12-14 15:14:39.000000000 -0500
/* Re-read register stack area. */
xxfer = super_xfer_partial (ops, object, annex,
Index: gdb-6.5/gdb/remote.c
===================================================================
--- gdb-6.5.orig/gdb/remote.c 2006-07-11 02:35:48.000000000 -0300
+++ gdb-6.5/gdb/remote.c 2006-07-11 02:37:02.000000000 -0300
@@ -27,6 +27,7 @@
#include "gdb_string.h"
#include <ctype.h>
@ -386,29 +361,14 @@
#include "inferior.h"
#include "bfd.h"
#include "symfile.h"
@@ -69,10 +70,10 @@ static void build_remote_gdbarch_data (v
static void remote_files_info (struct target_ops *ignore);
-static int remote_xfer_memory (CORE_ADDR memaddr, char *myaddr,
- int len, int should_write,
- struct mem_attrib *attrib,
- struct target_ops *target);
+static LONGEST remote_xfer_memory (CORE_ADDR memaddr, char *myaddr,
+ LONGEST len, int should_write,
+ struct mem_attrib *attrib,
+ struct target_ops *target);
static void remote_prepare_to_store (void);
@@ -3791,18 +3792,25 @@ remote_read_bytes (CORE_ADDR memaddr, ch
SHOULD_WRITE is nonzero. Returns length of data written or read; 0
for error. TARGET is unused. */
@@ -3701,19 +3702,27 @@ remote_read_bytes (CORE_ADDR memaddr, gd
if SHOULD_WRITE is nonzero. Returns length of data written or
read; 0 for error. TARGET is unused. */
-static int
-remote_xfer_memory (CORE_ADDR mem_addr, char *buffer, int mem_len,
-remote_xfer_memory (CORE_ADDR mem_addr, gdb_byte *buffer, int mem_len,
+static LONGEST
+remote_xfer_memory (CORE_ADDR mem_addr, char *buffer, LONGEST mem_len,
+remote_xfer_memory (CORE_ADDR mem_addr, gdb_byte *buffer, LONGEST mem_len,
int should_write, struct mem_attrib *attrib,
struct target_ops *target)
{
@ -417,6 +377,7 @@
int res;
+ int len;
+
+
+ /* This routine is not set up to handle > INT_MAX bytes. */
+ if (mem_len >= (LONGEST)INT_MAX)
+ return 0;
@ -424,13 +385,14 @@
+ len = (int)mem_len;
/* Should this be the selected frame? */
gdbarch_remote_translate_xfer_address (current_gdbarch, current_regcache,
gdbarch_remote_translate_xfer_address (current_gdbarch,
current_regcache,
- mem_addr, mem_len,
+ mem_addr, len,
&targ_addr, &targ_len);
if (targ_len <= 0)
return 0;
@@ -3812,7 +3820,7 @@ remote_xfer_memory (CORE_ADDR mem_addr,
@@ -3723,7 +3732,7 @@ remote_xfer_memory (CORE_ADDR mem_addr,
else
res = remote_read_bytes (targ_addr, buffer, targ_len);
@ -439,49 +401,18 @@
}
static void
--- gdb-6.3/gdb/thread-db.c.fix 2005-12-06 16:17:22.000000000 -0500
+++ gdb-6.3/gdb/thread-db.c 2005-12-14 14:42:28.000000000 -0500
@@ -955,12 +955,12 @@ thread_db_wait (ptid_t ptid, struct targ
return ptid;
}
-static int
-thread_db_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
+static LONGEST
+thread_db_xfer_memory (CORE_ADDR memaddr, char *myaddr, LONGEST len, int write,
struct mem_attrib *attrib, struct target_ops *target)
{
struct cleanup *old_chain = save_inferior_ptid ();
- int xfer;
+ LONGEST xfer;
if (is_thread (inferior_ptid))
{
--- gdb-6.3/gdb/remote-sim.c.fix 2005-12-07 16:02:02.000000000 -0500
+++ gdb-6.3/gdb/remote-sim.c 2005-12-14 15:15:53.000000000 -0500
@@ -93,10 +93,10 @@ static ptid_t gdbsim_wait (ptid_t ptid,
static void gdbsim_prepare_to_store (void);
-static int gdbsim_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr,
- int len, int write,
- struct mem_attrib *attrib,
- struct target_ops *target);
+static LONGEST gdbsim_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr,
+ LONGEST len, int write,
+ struct mem_attrib *attrib,
+ struct target_ops *target);
static void gdbsim_files_info (struct target_ops *target);
@@ -741,11 +741,14 @@ gdbsim_prepare_to_store (void)
Index: gdb-6.5/gdb/remote-sim.c
===================================================================
--- gdb-6.5.orig/gdb/remote-sim.c 2006-07-11 02:35:34.000000000 -0300
+++ gdb-6.5/gdb/remote-sim.c 2006-07-11 02:35:49.000000000 -0300
@@ -742,11 +742,14 @@ gdbsim_prepare_to_store (void)
Returns the number of bytes transferred. */
-static int
-gdbsim_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len,
-gdbsim_xfer_inferior_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len,
+static LONGEST
+gdbsim_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, LONGEST len,
+gdbsim_xfer_inferior_memory (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len,
int write, struct mem_attrib *attrib,
struct target_ops *target)
{
@ -489,9 +420,9 @@
+ int xfer_len = (int)len;
+
if (!program_loaded)
error ("No program loaded.");
error (_("No program loaded."));
@@ -755,22 +758,22 @@ gdbsim_xfer_inferior_memory (CORE_ADDR m
@@ -756,22 +759,22 @@ gdbsim_xfer_inferior_memory (CORE_ADDR m
printf_filtered ("gdbsim_xfer_inferior_memory: myaddr 0x");
gdb_print_host_address (myaddr, gdb_stdout);
printf_filtered (", memaddr 0x%s, len %d, write %d\n",

View File

@ -1,6 +1,8 @@
--- gdb-6.3/gdb/linespec.c.fix Mon Dec 13 19:55:27 2004
+++ gdb-6.3/gdb/linespec.c Mon Dec 13 19:59:05 2004
@@ -73,7 +73,8 @@ static struct symtabs_and_lines find_met
Index: gdb-6.5/gdb/linespec.c
===================================================================
--- gdb-6.5.orig/gdb/linespec.c 2006-01-10 20:14:43.000000000 -0200
+++ gdb-6.5/gdb/linespec.c 2006-07-07 01:04:56.000000000 -0300
@@ -75,7 +75,8 @@ static struct symtabs_and_lines find_met
struct symbol *sym_class);
static int collect_methods (char *copy, struct type *t,
@ -10,7 +12,7 @@
static NORETURN void cplusplus_error (const char *name,
const char *fmt, ...)
@@ -81,10 +82,12 @@ static NORETURN void cplusplus_error (co
@@ -83,10 +84,12 @@ static NORETURN void cplusplus_error (co
static int total_number_of_methods (struct type *type);
@ -25,7 +27,7 @@
static int add_constructors (int method_counter, struct type *t,
struct symbol **sym_arr);
@@ -99,6 +102,9 @@ static int is_objc_method_format (const
@@ -101,6 +104,9 @@ static int is_objc_method_format (const
static struct symtabs_and_lines decode_line_2 (struct symbol *[],
int, int, char ***);
@ -35,7 +37,7 @@
static struct symtab *symtab_from_filename (char **argptr,
char *p, int is_quote_enclosed,
int *not_found_ptr);
@@ -189,12 +195,18 @@ total_number_of_methods (struct type *ty
@@ -191,12 +197,18 @@ total_number_of_methods (struct type *ty
/* Recursive helper function for decode_line_1.
Look for methods named NAME in type T.
Return number of matches.
@ -56,7 +58,7 @@
{
int i1 = 0;
int ibase;
@@ -237,7 +249,8 @@ find_methods (struct type *t, char *name
@@ -239,7 +251,8 @@ find_methods (struct type *t, char *name
if (strcmp_iw (name, method_name) == 0)
/* Find all the overloaded methods with that name. */
i1 += add_matching_methods (method_counter, t,
@ -66,7 +68,7 @@
else if (strncmp (class_name, name, name_len) == 0
&& (class_name[name_len] == '\0'
|| class_name[name_len] == '<'))
@@ -259,21 +272,83 @@ find_methods (struct type *t, char *name
@@ -261,21 +274,83 @@ find_methods (struct type *t, char *name
if (i1 == 0)
for (ibase = 0; ibase < TYPE_N_BASECLASSES (t); ibase++)
@ -78,8 +80,8 @@
}
+static int
+add_minsym_members (const char *class_name,
+ const char *member_name,
+add_minsym_members (const char *class_name,
+ const char *member_name,
+ struct minimal_symbol **msym_arr)
+{
+ char *completion_name;
@ -129,7 +131,7 @@
+ ++counter;
+ }
+ xfree (list);
+ xfree (completion_name);
+ xfree (completion_name);
+
+ return counter;
+}
@ -152,7 +154,7 @@
for (field_counter = TYPE_FN_FIELDLIST_LENGTH (t, method_counter) - 1;
field_counter >= 0;
@@ -297,6 +372,16 @@ add_matching_methods (int method_counter
@@ -299,6 +374,16 @@ add_matching_methods (int method_counter
}
else
phys_name = TYPE_FN_FIELD_PHYSNAME (f, field_counter);
@ -162,14 +164,14 @@
+ when we have in-charge and not-in-charge constructors.
+ Since we don't have a mangled name to work with, if we
+ look for the symbol, we can only find the class itself.
+ We can find the information we need in the minimal symbol
+ We can find the information we need in the minimal symbol
+ table which has the full member name information we need. */
+ if (strlen (phys_name) <= strlen (class_name))
+ return add_minsym_members (class_name, phys_name, msym_arr);
/* Destructor is handled by caller, don't add it to
the list. */
@@ -322,6 +407,9 @@ add_matching_methods (int method_counter
@@ -324,6 +409,9 @@ add_matching_methods (int method_counter
}
}
@ -179,7 +181,7 @@
return i1;
}
@@ -601,6 +689,146 @@ decode_line_2 (struct symbol *sym_arr[],
@@ -603,6 +691,146 @@ decode_line_2 (struct symbol *sym_arr[],
discard_cleanups (old_chain);
return return_values;
}
@ -224,9 +226,9 @@
+ init_sal (&values.sals[i]);
+ if (msym_arr[i])
+ {
+ struct symtabs_and_lines msal = minsym_found (funfirstline,
+ struct symtabs_and_lines msal = minsym_found (funfirstline,
+ msym_arr[i]);
+ memcpy (&values.sals[i], &msal.sals[0],
+ memcpy (&values.sals[i], &msal.sals[0],
+ sizeof (struct symtab_and_line));
+ if (values.sals[i].symtab)
+ printf_unfiltered ("[%d] %s at %s:%d\n",
@ -326,7 +328,7 @@
/* The parser of linespec itself. */
@@ -1404,35 +1632,46 @@ find_method (int funfirstline, char ***c
@@ -1406,36 +1634,46 @@ find_method (int funfirstline, char ***c
int i1; /* Counter for the symbol array. */
struct symbol **sym_arr = alloca (total_number_of_methods (t)
* sizeof (struct symbol *));
@ -358,6 +360,7 @@
+ return minsym_found (funfirstline, msym_arr[0]);
else
{
- values.sals = NULL;
- values.nelts = 0;
+ sym = sym_arr[0];
+
@ -386,7 +389,7 @@
return decode_line_2 (sym_arr, i1, funfirstline, canonical);
}
else
@@ -1459,11 +1698,12 @@ find_method (int funfirstline, char ***c
@@ -1462,11 +1700,12 @@ find_method (int funfirstline, char ***c
}
/* Find all methods named COPY in the class whose type is T, and put
@ -401,7 +404,7 @@
{
int i1 = 0; /* Counter for the symbol array. */
@@ -1485,7 +1725,7 @@ collect_methods (char *copy, struct type
@@ -1488,7 +1727,7 @@ collect_methods (char *copy, struct type
}
}
else

View File

@ -1,11 +1,11 @@
2004-12-16 Jeff Johnston <jjohnstn@redhat.com>
* thread-db.c (clear_lwp_callback): Removed.
* linux-thread-db.c (clear_lwpip_callback): Removed.
(thread_db_resume): Do not iterate and call
clear_lwp_callback.
--- gdb-6.3/gdb/thread-db.c.fix Thu Dec 16 16:32:13 2004
+++ gdb-6.3/gdb/thread-db.c Thu Dec 16 16:32:30 2004
--- gdb-6.3/gdb/linux-thread-db.c.fix Thu Dec 16 16:32:13 2004
+++ gdb-6.3/gdb/linux-thread-db.c Thu Dec 16 16:32:30 2004
@@ -822,19 +822,6 @@ thread_db_detach (char *args, int from_t
target_beneath->to_detach (args, from_tty);
}

View File

@ -1,7 +1,9 @@
--- gdb-6.3/gdb/doc/observer.texi.fix Tue Jan 18 16:51:56 2005
+++ gdb-6.3/gdb/doc/observer.texi Tue Jan 18 17:38:57 2005
@@ -91,6 +91,10 @@ at the entry-point instruction. For @sa
inferior, and before any information on the inferior has been printed.
Index: gdb-6.5/gdb/doc/observer.texi
===================================================================
--- gdb-6.5.orig/gdb/doc/observer.texi 2006-07-07 04:08:37.000000000 -0300
+++ gdb-6.5/gdb/doc/observer.texi 2006-07-07 04:19:00.000000000 -0300
@@ -119,6 +119,10 @@ when @value{GDBN} calls this observer, t
haven't been loaded yet.
@end deftypefun
+@deftypefun void mourn_inferior (struct target_ops *@var{target})
@ -9,18 +11,12 @@
+@end deftypefun
+
@deftypefun void solib_unloaded (struct so_list *@var{solib})
The specified shared library has been discovered to be unloaded.
The shared library specified by @var{solib} has been unloaded.
@end deftypefun
--- gdb-6.3/gdb/linux-nat.c.fix Tue Jan 18 16:52:24 2005
+++ gdb-6.3/gdb/linux-nat.c Tue Jan 18 17:14:01 2005
@@ -1,6 +1,6 @@
/* GNU/Linux native-dependent code common to multiple platforms.
- Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GDB.
Index: gdb-6.5/gdb/linux-nat.c
===================================================================
--- gdb-6.5.orig/gdb/linux-nat.c 2006-07-07 04:00:05.000000000 -0300
+++ gdb-6.5/gdb/linux-nat.c 2006-07-07 04:20:40.000000000 -0300
@@ -802,11 +802,23 @@ iterate_over_lwps (int (*callback) (stru
{
struct lwp_info *lp, *lpnext;
@ -48,8 +44,8 @@
}
return NULL;
@@ -3103,6 +3115,18 @@ linux_proc_pending_signals (int pid, sig
fclose (procfile);
@@ -3262,6 +3274,18 @@ linux_nat_add_target (struct target_ops
thread_db_init (t);
}
+/* Observer function for a mourn inferior event. This is needed
@ -67,29 +63,20 @@
void
_initialize_linux_nat (void)
{
@@ -3120,7 +3144,9 @@ Specify any of the following keywords fo
stat -- list a bunch of random process info.\n\
@@ -3276,6 +3300,8 @@ Specify any of the following keywords fo
status -- list a different bunch of random process info.\n\
all -- list all available /proc info.");
-
+
all -- list all available /proc info."));
+ observer_attach_mourn_inferior (linux_nat_mourn_inferior_observer);
+
init_linux_nat_ops ();
add_target (&linux_nat_ops);
thread_db_init (&linux_nat_ops);
--- gdb-6.3/gdb/target.c.fix Tue Jan 18 17:02:37 2005
+++ gdb-6.3/gdb/target.c Tue Jan 18 17:39:43 2005
@@ -1,7 +1,7 @@
/* Select target systems and architectures at runtime for GDB.
+
/* Save the original signal mask. */
sigprocmask (SIG_SETMASK, NULL, &normal_mask);
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Cygnus Support.
@@ -38,6 +38,7 @@
Index: gdb-6.5/gdb/target.c
===================================================================
--- gdb-6.5.orig/gdb/target.c 2006-07-07 03:52:38.000000000 -0300
+++ gdb-6.5/gdb/target.c 2006-07-07 04:19:00.000000000 -0300
@@ -39,6 +39,7 @@
#include "regcache.h"
#include "gdb_assert.h"
#include "gdbcore.h"
@ -97,7 +84,7 @@
static void target_info (char *, int);
@@ -266,6 +267,13 @@ target_load (char *arg, int from_tty)
@@ -267,6 +268,13 @@ target_load (char *arg, int from_tty)
(*current_target.to_load) (arg, from_tty);
}
@ -111,18 +98,11 @@
static int
nomemory (CORE_ADDR memaddr, char *myaddr, int len, int write,
struct target_ops *t)
--- gdb-6.3/gdb/target.h.fix Tue Jan 18 17:02:42 2005
+++ gdb-6.3/gdb/target.h Tue Jan 18 17:15:30 2005
@@ -1,7 +1,7 @@
/* Interface between GDB and target environments, including files and processes
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Cygnus Support. Written by John Gilmore.
@@ -779,8 +779,7 @@ extern void target_load (char *arg, int
Index: gdb-6.5/gdb/target.h
===================================================================
--- gdb-6.5.orig/gdb/target.h 2006-07-07 03:52:40.000000000 -0300
+++ gdb-6.5/gdb/target.h 2006-07-07 04:19:00.000000000 -0300
@@ -783,8 +783,7 @@ int target_follow_fork (int follow_child
/* The inferior process has died. Do what is right. */

View File

@ -1,6 +1,8 @@
--- gdb-6.3/gdb/dwarf2read.c.fix Mon Jan 10 14:36:22 2005
+++ gdb-6.3/gdb/dwarf2read.c Mon Jan 10 14:39:34 2005
@@ -1201,7 +1201,7 @@ dwarf2_build_psymtabs (struct objfile *o
Index: gdb-6.5/gdb/dwarf2read.c
===================================================================
--- gdb-6.5.orig/gdb/dwarf2read.c 2006-07-11 02:47:11.000000000 -0300
+++ gdb-6.5/gdb/dwarf2read.c 2006-07-11 02:56:58.000000000 -0300
@@ -1208,7 +1208,7 @@ dwarf2_build_psymtabs (struct objfile *o
else
dwarf2_per_objfile->loc_buffer = NULL;
@ -9,17 +11,19 @@
|| (objfile->global_psymbols.size == 0
&& objfile->static_psymbols.size == 0))
{
--- gdb-6.3/gdb/auxv.c.fix Mon Jan 10 14:36:34 2005
+++ gdb-6.3/gdb/auxv.c Mon Jan 10 14:39:34 2005
Index: gdb-6.5/gdb/auxv.c
===================================================================
--- gdb-6.5.orig/gdb/auxv.c 2006-07-11 02:47:06.000000000 -0300
+++ gdb-6.5/gdb/auxv.c 2006-07-11 02:47:11.000000000 -0300
@@ -119,7 +119,7 @@ target_auxv_read (struct target_ops *ops
Return 1 if an entry was read into *TYPEP and *VALP. */
int
target_auxv_parse (struct target_ops *ops, char **readptr, char *endptr,
- CORE_ADDR *typep, CORE_ADDR *valp)
+ ULONGEST *typep, CORE_ADDR *valp)
target_auxv_parse (struct target_ops *ops, gdb_byte **readptr,
- gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
+ gdb_byte *endptr, ULONGEST *typep, CORE_ADDR *valp)
{
const int sizeof_auxv_field = TYPE_LENGTH (builtin_type_void_data_ptr);
char *ptr = *readptr;
gdb_byte *ptr = *readptr;
@@ -144,9 +144,10 @@ target_auxv_parse (struct target_ops *op
an error getting the information. On success, return 1 after
storing the entry's value field in *VALP. */
@ -30,9 +34,9 @@
- CORE_ADDR type, val;
+ CORE_ADDR val;
+ ULONGEST at_type;
char *data;
gdb_byte *data;
int n = target_auxv_read (ops, &data);
char *ptr = data;
gdb_byte *ptr = data;
@@ -156,10 +157,10 @@ target_auxv_search (struct target_ops *o
return n;
@ -53,9 +57,9 @@
- CORE_ADDR type, val;
+ CORE_ADDR val;
+ ULONGEST at_type;
char *data;
gdb_byte *data;
int len = target_auxv_read (ops, &data);
char *ptr = data;
gdb_byte *ptr = data;
@@ -191,14 +193,14 @@ fprint_target_auxv (struct ui_file *file
if (len <= 0)
return len;
@ -82,12 +86,14 @@
switch (flavor)
{
case dec:
--- gdb-6.3/gdb/auxv.h.fix Mon Jan 10 14:36:39 2005
+++ gdb-6.3/gdb/auxv.h Mon Jan 10 14:39:34 2005
Index: gdb-6.5/gdb/auxv.h
===================================================================
--- gdb-6.5.orig/gdb/auxv.h 2006-07-11 02:47:06.000000000 -0300
+++ gdb-6.5/gdb/auxv.h 2006-07-11 02:47:11.000000000 -0300
@@ -43,14 +43,14 @@ extern LONGEST target_auxv_read (struct
Return 1 if an entry was read into *TYPEP and *VALP. */
extern int target_auxv_parse (struct target_ops *ops,
char **readptr, char *endptr,
gdb_byte **readptr, gdb_byte *endptr,
- CORE_ADDR *typep, CORE_ADDR *valp);
+ ULONGEST *typep, CORE_ADDR *valp);
@ -101,8 +107,10 @@
/* 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);
--- gdb-6.3/gdb/breakpoint.h.fix Mon Jan 10 14:36:45 2005
+++ gdb-6.3/gdb/breakpoint.h Mon Jan 10 14:39:34 2005
Index: gdb-6.5/gdb/breakpoint.h
===================================================================
--- gdb-6.5.orig/gdb/breakpoint.h 2006-07-11 02:47:06.000000000 -0300
+++ gdb-6.5/gdb/breakpoint.h 2006-07-11 02:47:11.000000000 -0300
@@ -159,6 +159,7 @@ enum enable_state
automatically enabled and reset when the call
"lands" (either completes, or stops at another
@ -111,7 +119,7 @@
bp_permanent /* There is a breakpoint instruction hard-wired into
the target's code. Don't try to write another
breakpoint instruction on top of it, or restore
@@ -778,8 +779,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);
@ -124,9 +132,11 @@
extern void create_solib_load_event_breakpoint (char *, int, char *, char *);
extern void create_solib_unload_event_breakpoint (char *, int,
--- gdb-6.3/gdb/symfile-mem.c.fix Mon Jan 10 14:36:15 2005
+++ gdb-6.3/gdb/symfile-mem.c Mon Jan 10 14:39:34 2005
@@ -103,7 +103,7 @@ symbol_file_add_from_memory (struct bfd
Index: gdb-6.5/gdb/symfile-mem.c
===================================================================
--- gdb-6.5.orig/gdb/symfile-mem.c 2006-07-11 02:47:06.000000000 -0300
+++ gdb-6.5/gdb/symfile-mem.c 2006-07-11 02:56:55.000000000 -0300
@@ -110,7 +110,7 @@ symbol_file_add_from_memory (struct bfd
}
objf = symbol_file_add_from_bfd (nbfd, from_tty,
@ -135,9 +145,11 @@
/* This might change our ideas about frames already looked at. */
reinit_frame_cache ();
--- gdb-6.3/gdb/infrun.c.fix Mon Jan 10 14:36:50 2005
+++ gdb-6.3/gdb/infrun.c Mon Jan 10 14:39:34 2005
@@ -2203,6 +2203,11 @@ process_event_stop_test:
Index: gdb-6.5/gdb/infrun.c
===================================================================
--- gdb-6.5.orig/gdb/infrun.c 2006-07-11 02:47:06.000000000 -0300
+++ gdb-6.5/gdb/infrun.c 2006-07-11 02:56:58.000000000 -0300
@@ -2230,6 +2230,11 @@ process_event_stop_test:
code segments in shared libraries might be mapped in now. */
re_enable_breakpoints_in_shlibs ();
@ -149,18 +161,21 @@
/* If requested, stop when the dynamic linker notifies
gdb of events. This allows the user to get control
and place breakpoints in initializer routines for
--- gdb-6.3/gdb/objfiles.c.fix Mon Jan 10 14:37:04 2005
+++ gdb-6.3/gdb/objfiles.c Mon Jan 10 14:39:34 2005
@@ -46,6 +46,8 @@
#include "block.h"
Index: gdb-6.5/gdb/objfiles.c
===================================================================
--- gdb-6.5.orig/gdb/objfiles.c 2006-07-11 02:47:06.000000000 -0300
+++ gdb-6.5/gdb/objfiles.c 2006-07-11 02:47:11.000000000 -0300
@@ -47,6 +47,9 @@
#include "dictionary.h"
#include "source.h"
+#include "auxv.h"
+#include "elf/common.h"
+
/* Prototypes for local functions */
static void objfile_alloc_data (struct objfile *objfile);
@@ -257,7 +259,19 @@ init_entry_point_info (struct objfile *o
@@ -258,7 +261,19 @@ init_entry_point_info (struct objfile *o
CORE_ADDR
entry_point_address (void)
{
@ -181,17 +196,20 @@
}
/* Create the terminating entry of OBJFILE's minimal symbol table.
--- gdb-6.3/gdb/solib-svr4.c.fix Mon Jan 10 14:37:15 2005
+++ gdb-6.3/gdb/solib-svr4.c Mon Jan 10 14:39:34 2005
@@ -34,6 +34,7 @@
Index: gdb-6.5/gdb/solib-svr4.c
===================================================================
--- gdb-6.5.orig/gdb/solib-svr4.c 2006-07-11 02:47:06.000000000 -0300
+++ gdb-6.5/gdb/solib-svr4.c 2006-07-11 02:47:11.000000000 -0300
@@ -34,6 +34,8 @@
#include "gdbcore.h"
#include "target.h"
#include "inferior.h"
+#include "auxv.h"
+#include "command.h"
#include "solist.h"
#include "solib-svr4.h"
@@ -168,7 +169,9 @@ static CORE_ADDR breakpoint_addr; /* Add
#include "gdb_assert.h"
@@ -254,7 +256,9 @@ static CORE_ADDR breakpoint_addr; /* Add
/* Local function prototypes */
@ -201,14 +219,14 @@
static CORE_ADDR bfd_lookup_symbol (bfd *, char *, flagword);
@@ -290,22 +293,79 @@ elf_locate_base (void)
@@ -376,22 +380,79 @@ elf_locate_base (void)
{
struct bfd_section *dyninfo_sect;
int dyninfo_sect_size;
- CORE_ADDR dyninfo_addr;
+ CORE_ADDR dyninfo_addr, relocated_dyninfo_addr, entry_addr;
char *buf;
char *bufend;
gdb_byte *buf;
gdb_byte *bufend;
int arch_size;
+ int ret;
+
@ -285,7 +303,7 @@
/* Find the DT_DEBUG entry in the the .dynamic section.
For mips elf we look for DT_MIPS_RLD_MAP, mips elf apparently has
@@ -332,6 +392,10 @@ elf_locate_base (void)
@@ -418,6 +479,10 @@ elf_locate_base (void)
{
dyn_ptr = bfd_h_get_32 (exec_bfd,
(bfd_byte *) x_dynp->d_un.d_ptr);
@ -296,29 +314,30 @@
return dyn_ptr;
}
else if (dyn_tag == DT_MIPS_RLD_MAP)
@@ -470,6 +534,10 @@ first_link_map_member (void)
char *r_map_buf = xmalloc (lmo->r_map_size);
struct cleanup *cleanups = make_cleanup (xfree, r_map_buf);
@@ -543,6 +608,10 @@ solib_svr4_r_map (void)
{
struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
+ if (debug_solib)
+ fprintf_unfiltered (gdb_stdlog,
+ "first_link_map_member: read at 0x%s\n",
+ "solib_svr4_r_map: read at 0x%s\n",
+ paddr_nz (debug_base + lmo->r_map_offset));
read_memory (debug_base + lmo->r_map_offset, r_map_buf, lmo->r_map_size);
/* Assume that the address is unsigned. */
@@ -583,6 +651,10 @@ svr4_current_sos (void)
CORE_ADDR lm;
struct so_list *head = 0;
return read_memory_typed_address (debug_base + lmo->r_map_offset,
builtin_type_void_data_ptr);
}
@@ -669,6 +738,11 @@ svr4_current_sos (void)
struct so_list **link_ptr = &head;
CORE_ADDR ldsomap = 0;
+ if (debug_solib)
+ fprintf_unfiltered (gdb_stdlog,
+ "svr4_current_sos: exec_bfd %s\n",
+ exec_bfd->filename);
+
/* Make sure we've looked up the inferior's dynamic linker's base
structure. */
@@ -593,12 +665,22 @@ svr4_current_sos (void)
if (! debug_base)
@@ -678,11 +752,21 @@ svr4_current_sos (void)
/* If we can't find the dynamic linker's base structure, this
must not be a dynamically linked executable. Hmm. */
if (! debug_base)
@ -334,18 +353,16 @@
/* Walk the inferior's link map list, and build our list of
`struct so_list' nodes. */
- lm = first_link_map_member ();
+ if (debug_solib)
+ fprintf_unfiltered (gdb_stdlog,
+ "svr4_current_sos: walk link map in %s\n",
+ exec_bfd->filename);
+ lm = first_link_map_member ();
lm = solib_svr4_r_map ();
while (lm)
{
struct link_map_offsets *lmo = SVR4_FETCH_LINK_MAP_OFFSETS ();
@@ -615,54 +697,156 @@ svr4_current_sos (void)
@@ -697,23 +781,103 @@ svr4_current_sos (void)
new->lm_info->lm = xzalloc (lmo->link_map_size);
make_cleanup (xfree, new->lm_info->lm);
memset (new->lm_info->lm, 0, lmo->link_map_size);
+ if (debug_solib)
+ fprintf_unfiltered (gdb_stdlog,
@ -364,7 +381,7 @@
SVR4, it has no name. For others (Solaris 2.3 for example), it
does have a name, so we can no longer use a missing name to
decide when to ignore it. */
if (IGNORE_FIRST_LINK_MAP_ENTRY (new))
if (IGNORE_FIRST_LINK_MAP_ENTRY (new) && ldsomap == 0)
- free_so (new);
+ {
+ /* It is the first link map entry, i.e. it is the main executable. */
@ -448,46 +465,16 @@
target_read_string (LM_NAME (new), &buffer,
SO_NAME_MAX_PATH_SIZE - 1, &errcode);
if (errcode != 0)
{
- warning ("current_sos: Can't read pathname for load map: %s\n",
+ warning ("svr4_current_sos: Can't read pathname for load map: %s\n",
safe_strerror (errcode));
}
@@ -721,22 +885,37 @@ svr4_current_sos (void)
safe_strerror (errcode));
else
{
+ if (debug_solib)
+ fprintf_unfiltered (gdb_stdlog,
+ "svr4_current_sos: LM_NAME is <%s>\n",
+ buffer);
+ /* The name could be empty, in which case it is the
+ system supplied DSO. */
+ if (strcmp (buffer, "") == 0)
+ {
+ xfree (buffer);
+ free_so (new);
+ }
+
+ else
+ {
strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
xfree (buffer);
strcpy (new->so_original_name, new->so_name);
- strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
- new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
- xfree (buffer);
- strcpy (new->so_original_name, new->so_name);
- }
+ if (debug_solib)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "svr4_current_sos: Processing DSO: %s\n",
+ new->so_name);
+ fprintf_unfiltered (gdb_stdlog,
+ "svr4_current_sos: first link entry %d\n",
+ IGNORE_FIRST_LINK_MAP_ENTRY (new));
+ }
+
+ new->next = 0;
+ *link_ptr = new;
+ link_ptr = &new->next;
-
- /* If this entry has no name, or its name matches the name
- for the main executable, don't include it in the list. */
- if (! new->so_name[0]
@ -498,11 +485,41 @@
- new->next = 0;
- *link_ptr = new;
- link_ptr = &new->next;
- }
+ }
+ }
+ if (debug_solib)
+ fprintf_unfiltered (gdb_stdlog,
+ "svr4_current_sos: LM_NAME is <%s>\n",
+ buffer);
+ /* The name could be empty, in which case it is the
+ system supplied DSO. */
+ if (strcmp (buffer, "") == 0)
+ {
+ xfree (buffer);
+ free_so (new);
+ }
+ else
+ {
+ strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1);
+ new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
+ xfree (buffer);
+ strcpy (new->so_original_name, new->so_name);
+ if (debug_solib)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "svr4_current_sos: Processing DSO: %s\n",
+ new->so_name);
+ fprintf_unfiltered (gdb_stdlog,
+ "svr4_current_sos: first link entry %d\n",
+ IGNORE_FIRST_LINK_MAP_ENTRY (new));
+ }
+
+ new->next = 0;
+ *link_ptr = new;
+ link_ptr = &new->next;
+ }
}
}
@@ -750,6 +929,11 @@ svr4_current_sos (void)
discard_cleanups (old_chain);
}
@ -514,16 +531,7 @@
return head;
}
@@ -681,7 +865,7 @@ svr4_fetch_objfile_link_map (struct objf
return 0; /* failed somehow... */
/* Position ourselves on the first link map. */
- lm = first_link_map_member ();
+ lm = first_link_map_member ();
while (lm)
{
/* Get info on the layout of the r_debug and link_map structures. */
@@ -742,7 +926,7 @@ svr4_fetch_objfile_link_map (struct objf
@@ -826,7 +1010,7 @@ svr4_fetch_objfile_link_map (struct objf
/* On some systems, the only way to recognize the link map entry for
the main executable file is by looking at its name. Return
non-zero iff SONAME matches one of the known main executable names. */
@ -532,7 +540,7 @@
static int
match_main (char *soname)
{
@@ -756,6 +940,7 @@ match_main (char *soname)
@@ -840,6 +1024,7 @@ match_main (char *soname)
return (0);
}
@ -540,7 +548,7 @@
/* Return 1 if PC lies in the dynamic symbol resolution code of the
SVR4 run time loader. */
@@ -855,6 +1040,11 @@ enable_break (void)
@@ -939,6 +1124,11 @@ enable_break (void)
/* Find the .interp section; if not found, warn the user and drop
into the old breakpoint at symbol code. */
interp_sect = bfd_get_section_by_name (exec_bfd, ".interp");
@ -552,9 +560,9 @@
if (interp_sect)
{
unsigned int interp_sect_size;
@@ -888,6 +1078,9 @@ enable_break (void)
@@ -972,6 +1162,9 @@ enable_break (void)
if (tmp_fd >= 0)
tmp_bfd = bfd_fdopenr (tmp_pathname, gnutarget, tmp_fd);
tmp_bfd = bfd_fopen (tmp_pathname, gnutarget, FOPEN_RB, tmp_fd);
+ if (debug_solib)
+ fprintf_unfiltered (gdb_stdlog,
@ -562,7 +570,7 @@
if (tmp_bfd == NULL)
goto bkpt_at_symbol;
@@ -968,6 +1161,9 @@ enable_break (void)
@@ -1052,6 +1245,9 @@ enable_break (void)
if (sym_addr != 0)
{
create_solib_event_breakpoint (load_addr + sym_addr);
@ -572,7 +580,7 @@
return 1;
}
@@ -1227,6 +1423,8 @@ svr4_solib_create_inferior_hook (void)
@@ -1311,6 +1507,8 @@ svr4_solib_create_inferior_hook (void)
while (stop_signal != TARGET_SIGNAL_TRAP);
stop_soon = NO_STOP_QUIETLY;
#endif /* defined(_SCO_DS) */
@ -581,7 +589,7 @@
}
static void
@@ -1430,6 +1628,75 @@ svr4_lp64_fetch_link_map_offsets (void)
@@ -1493,6 +1691,75 @@ svr4_lp64_fetch_link_map_offsets (void)
return lmp;
}
@ -610,36 +618,36 @@
+
+ /* Walk the inferior's link map list, and print the info. */
+
+ lm = first_link_map_member ();
+ lm = solib_svr4_r_map ();
+ while (lm)
+ {
+ int errcode;
+ char *buffer;
+ CORE_ADDR load_addr;
+
+ struct link_map_offsets *lmo = SVR4_FETCH_LINK_MAP_OFFSETS ();
+ struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
+ struct so_list *new
+ = (struct so_list *) xmalloc (sizeof (struct so_list));
+ struct cleanup *old_chain = make_cleanup (xfree, new);
+
+
+ memset (new, 0, sizeof (*new));
+
+ new->lm_info = xmalloc (sizeof (struct lm_info));
+ make_cleanup (xfree, new->lm_info);
+
+
+ new->lm_info->lm = xmalloc (lmo->link_map_size);
+ make_cleanup (xfree, new->lm_info->lm);
+ memset (new->lm_info->lm, 0, lmo->link_map_size);
+
+
+ if (debug_solib)
+ fprintf_unfiltered (gdb_stdlog,
+ "svr4_print_linkmap: read lm at 0x%s\n", paddr_nz(lm));
+ read_memory (lm, new->lm_info->lm, lmo->link_map_size);
+
+
+ lm = LM_NEXT (new);
+
+
+ /* Load address. */
+ load_addr = LM_ADDR (new);
+ load_addr = LM_ADDR_CHECK (new, NULL);
+ /* Shared object's name. */
+ target_read_string (LM_NAME (new), &buffer,
+ SO_NAME_MAX_PATH_SIZE - 1, &errcode);
@ -657,7 +665,7 @@
static struct target_so_ops svr4_so_ops;
@@ -1453,4 +1720,8 @@ _initialize_svr4_solib (void)
@@ -1515,4 +1782,8 @@ _initialize_svr4_solib (void)
/* FIXME: Don't do this here. *_gdbarch_init() should set so_ops. */
current_target_so_ops = &svr4_so_ops;
@ -666,9 +674,11 @@
+ "Display the inferior's linkmap.");
+
}
--- gdb-6.3/gdb/varobj.c.fix Mon Jan 10 14:38:00 2005
+++ gdb-6.3/gdb/varobj.c Mon Jan 10 14:39:35 2005
@@ -854,6 +854,62 @@ varobj_list (struct varobj ***varlist)
Index: gdb-6.5/gdb/varobj.c
===================================================================
--- gdb-6.5.orig/gdb/varobj.c 2006-07-11 02:47:06.000000000 -0300
+++ gdb-6.5/gdb/varobj.c 2006-07-11 02:56:57.000000000 -0300
@@ -870,6 +870,62 @@ varobj_list (struct varobj ***varlist)
return rootcount;
}
@ -679,17 +689,17 @@
+ struct varobj_root *croot;
+ int mycount = rootcount;
+ char * name;
+
+
+ croot = rootlist;
+ while ((croot != NULL) && (mycount > 0))
+ {
+ var = croot->rootvar;
+
+
+ /* Get rid of the memory for the old expression. This also
+ leaves var->root->exp == NULL, which is ok for the parsing
+ below. */
+ free_current_contents ((char **) &var->root->exp);
+
+ free_current_contents (&var->root->exp);
+
+ value_free (var->value);
+ var->type = NULL;
+
@ -701,7 +711,7 @@
+ {
+ return;
+ }
+
+
+ /* We definitively need to catch errors here.
+ If evaluate_expression succeeds we got the value we wanted.
+ But if it fails, we still go on with a call to evaluate_type() */
@ -709,30 +719,32 @@
+ {
+ /* no error */
+ release_value (var->value);
+ if (VALUE_LAZY (var->value))
+ if (value_lazy (var->value))
+ gdb_value_fetch_lazy (var->value);
+ }
+ else
+ var->value = evaluate_type (var->root->exp);
+
+ var->type = VALUE_TYPE (var->value);
+
+
+ var->type = value_type (var->value);
+
+ mycount--;
+ croot = croot->next;
+ }
+
+
+ if (mycount || (croot != NULL))
+ warning
+ ("varobj_refresh: assertion failed - wrong tally of root vars (%d:%d)",
+ rootcount, mycount);
+}
+
+
+
/* Update the values for a variable and its children. This is a
two-pronged attack. First, re-parse the value for the root's
expression to see if it's changed. Then go all the way
--- gdb-6.3/gdb/solist.h.fix Mon Jan 10 14:37:45 2005
+++ gdb-6.3/gdb/solist.h Mon Jan 10 14:39:35 2005
Index: gdb-6.5/gdb/solist.h
===================================================================
--- gdb-6.5.orig/gdb/solist.h 2006-07-11 02:47:06.000000000 -0300
+++ gdb-6.5/gdb/solist.h 2006-07-11 02:47:11.000000000 -0300
@@ -62,6 +62,8 @@ struct so_list
bfd *abfd;
char symbols_loaded; /* flag: symbols read in yet? */
@ -758,33 +770,37 @@
/* FIXME: gdbarch needs to control this variable */
extern struct target_so_ops *current_target_so_ops;
@@ -135,4 +143,6 @@ extern struct target_so_ops *current_tar
#define TARGET_SO_FIND_AND_OPEN_SOLIB \
(current_target_so_ops->find_and_open_solib)
@@ -126,4 +134,6 @@ extern struct target_so_ops *current_tar
#define TARGET_SO_IN_DYNSYM_RESOLVE_CODE \
(current_target_so_ops->in_dynsym_resolve_code)
+/* Controls the printing of debugging output. */
+extern int debug_solib;
#endif
--- gdb-6.3/gdb/varobj.h.fix Mon Jan 10 14:38:06 2005
+++ gdb-6.3/gdb/varobj.h Mon Jan 10 14:39:35 2005
@@ -97,4 +97,6 @@ extern int varobj_list (struct varobj **
Index: gdb-6.5/gdb/varobj.h
===================================================================
--- gdb-6.5.orig/gdb/varobj.h 2006-07-11 02:47:06.000000000 -0300
+++ gdb-6.5/gdb/varobj.h 2006-07-11 02:47:11.000000000 -0300
@@ -99,4 +99,6 @@ extern int varobj_list (struct varobj **
extern int varobj_update (struct varobj **varp, struct varobj ***changelist);
+extern void varobj_refresh(void);
+
#endif /* VAROBJ_H */
--- gdb-6.3/gdb/symfile.c.fix Mon Jan 10 14:38:16 2005
+++ gdb-6.3/gdb/symfile.c Mon Jan 10 14:39:35 2005
@@ -48,6 +48,7 @@
Index: gdb-6.5/gdb/symfile.c
===================================================================
--- gdb-6.5.orig/gdb/symfile.c 2006-07-11 02:47:06.000000000 -0300
+++ gdb-6.5/gdb/symfile.c 2006-07-11 02:56:57.000000000 -0300
@@ -49,6 +49,7 @@
#include "readline/readline.h"
#include "gdb_assert.h"
#include "block.h"
+#include "varobj.h"
#include "observer.h"
#include "exec.h"
#include <sys/types.h>
#include <fcntl.h>
@@ -558,7 +559,7 @@ syms_from_objfile (struct objfile *objfi
@@ -658,7 +659,7 @@ syms_from_objfile (struct objfile *objfi
/* Now either addrs or offsets is non-zero. */
@ -793,7 +809,7 @@
{
/* We will modify the main symbol table, make sure that all its users
will be cleaned up if an error occurs during symbol reading. */
@@ -586,7 +587,7 @@ syms_from_objfile (struct objfile *objfi
@@ -686,7 +687,7 @@ syms_from_objfile (struct objfile *objfi
We no longer warn if the lowest section is not a text segment (as
happens for the PA64 port. */
@ -802,7 +818,7 @@
{
asection *lower_sect;
asection *sect;
@@ -755,17 +756,21 @@ new_symfile_objfile (struct objfile *obj
@@ -855,17 +856,21 @@ new_symfile_objfile (struct objfile *obj
/* 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
breakpoints that may have been redefined by this symbol file. */
@ -826,7 +842,7 @@
/* We're done reading the symbol file; finish off complaints. */
clear_complaints (&symfile_complaints, 0, verbo);
@@ -808,7 +813,7 @@ symbol_file_add_with_addrs_or_offsets (b
@@ -908,7 +913,7 @@ symbol_file_add_with_addrs_or_offsets (b
interactively wiping out any existing symbols. */
if ((have_full_symbols () || have_partial_symbols ())
@ -834,11 +850,11 @@
+ && (mainline == 1)
&& from_tty
&& !query ("Load new symbol table from \"%s\"? ", name))
error ("Not confirmed.");
@@ -987,6 +992,10 @@ symbol_file_clear (int from_tty)
&& !query ("Discard symbol table from `%s'? ",
symfile_objfile->name))
error ("Not confirmed.");
error (_("Not confirmed."));
@@ -1089,6 +1094,10 @@ symbol_file_clear (int from_tty)
symfile_objfile->name)
: !query (_("Discard symbol table? "))))
error (_("Not confirmed."));
+#ifdef CLEAR_SOLIB
+ CLEAR_SOLIB ();
+#endif
@ -846,7 +862,7 @@
free_all_objfiles ();
/* solib descriptors may have handles to objfiles. Since their
@@ -1979,6 +1988,8 @@ reread_symbols (void)
@@ -2154,6 +2163,8 @@ reread_symbols (void)
/* Discard cleanups as symbol reading was successful. */
discard_cleanups (old_cleanups);
@ -855,7 +871,7 @@
/* 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
again now. */
@@ -2338,6 +2349,7 @@ clear_symtab_users (void)
@@ -2529,6 +2540,7 @@ clear_symtab_users (void)
clear_pc_function_cache ();
if (deprecated_target_new_objfile_hook)
deprecated_target_new_objfile_hook (NULL);
@ -863,9 +879,101 @@
}
static void
--- gdb-6.3/gdb/breakpoint.c.fix Mon Jan 10 14:38:20 2005
+++ gdb-6.3/gdb/breakpoint.c Mon Jan 10 14:39:35 2005
@@ -3900,6 +3900,7 @@ describe_other_breakpoints (CORE_ADDR pc
Index: gdb-6.5/gdb/breakpoint.c
===================================================================
--- gdb-6.5.orig/gdb/breakpoint.c 2006-07-11 02:47:11.000000000 -0300
+++ gdb-6.5/gdb/breakpoint.c 2006-07-11 02:56:59.000000000 -0300
@@ -782,15 +782,15 @@ insert_watchpoints_for_new_thread (ptid_
struct value *v = b->owner->val_chain;
/* Look at each value on the value chain. */
- for (; v; v = v->next)
+ for (; v; v = value_next (v))
{
/* If it's a memory location, and GDB actually needed
its contents to evaluate the expression, then we
must watch it. */
if (VALUE_LVAL (v) == lval_memory
- && ! VALUE_LAZY (v))
+ && ! value_lazy (v))
{
- struct type *vtype = check_typedef (VALUE_TYPE (v));
+ struct type *vtype = check_typedef (value_type (v));
/* We only watch structs and arrays if user asked
for it explicitly, never if they just happen to
@@ -802,8 +802,8 @@ insert_watchpoints_for_new_thread (ptid_
CORE_ADDR addr;
int len, type;
- addr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
- len = TYPE_LENGTH (VALUE_TYPE (v));
+ addr = VALUE_ADDRESS (v) + value_offset (v);
+ len = TYPE_LENGTH (value_type (v));
type = hw_write;
if (b->owner->type == bp_read_watchpoint)
type = hw_read;
@@ -2680,12 +2680,12 @@ mark_triggered_watchpoints (CORE_ADDR st
|| b->type == bp_read_watchpoint
|| b->type == bp_access_watchpoint)
{
- for (v = b->val_chain; v; v = v->next)
+ for (v = b->val_chain; v; v = value_next (v))
{
if (VALUE_LVAL (v) == lval_memory
- && ! VALUE_LAZY (v))
+ && ! value_lazy (v))
{
- struct type *vtype = check_typedef (VALUE_TYPE (v));
+ struct type *vtype = check_typedef (value_type (v));
if (v == b->val_chain
|| (TYPE_CODE (vtype) != TYPE_CODE_STRUCT
@@ -2693,11 +2693,11 @@ mark_triggered_watchpoints (CORE_ADDR st
{
CORE_ADDR vaddr;
- vaddr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
+ vaddr = VALUE_ADDRESS (v) + value_offset (v);
/* Exact match not required. Within range is
sufficient. */
if (addr >= vaddr &&
- addr < vaddr + TYPE_LENGTH (VALUE_TYPE (v)))
+ addr < vaddr + TYPE_LENGTH (value_type (v)))
b->watchpoint_triggered = 1;
}
}
@@ -2867,12 +2867,12 @@ bpstat_stop_status (CORE_ADDR bp_addr, p
bs->stop = 0;
continue;
}
- for (v = b->val_chain; v; v = v->next)
+ for (v = b->val_chain; v; v = value_next (v))
{
if (VALUE_LVAL (v) == lval_memory
- && ! VALUE_LAZY (v))
+ && ! value_lazy (v))
{
- struct type *vtype = check_typedef (VALUE_TYPE (v));
+ struct type *vtype = check_typedef (value_type (v));
if (v == b->val_chain
|| (TYPE_CODE (vtype) != TYPE_CODE_STRUCT
@@ -2880,11 +2880,11 @@ bpstat_stop_status (CORE_ADDR bp_addr, p
{
CORE_ADDR vaddr;
- vaddr = VALUE_ADDRESS (v) + VALUE_OFFSET (v);
+ vaddr = VALUE_ADDRESS (v) + value_offset (v);
/* Exact match not required. Within range is
sufficient. */
if (addr >= vaddr &&
- addr < vaddr + TYPE_LENGTH (VALUE_TYPE (v)))
+ addr < vaddr + TYPE_LENGTH (value_type (v)))
must_check_value = 1;
}
}
@@ -3931,6 +3931,7 @@ describe_other_breakpoints (CORE_ADDR pc
b->number,
((b->enable_state == bp_disabled ||
b->enable_state == bp_shlib_disabled ||
@ -873,9 +981,9 @@
b->enable_state == bp_call_disabled)
? " (disabled)"
: b->enable_state == bp_permanent
@@ -4575,6 +4576,62 @@ re_enable_breakpoints_in_shlibs (void)
#endif
@@ -4609,6 +4610,62 @@ re_enable_breakpoints_in_shlibs (void)
}
}
+void
+disable_breakpoints_at_startup (int silent)
@ -936,7 +1044,7 @@
static void
solib_load_unload_1 (char *hookname, int tempflag, char *dll_pathname,
char *cond_string, enum bptype bp_kind)
@@ -6915,6 +6972,7 @@ delete_breakpoint (struct breakpoint *bp
@@ -6955,6 +7012,7 @@ delete_breakpoint (struct breakpoint *bp
&& !b->loc->duplicate
&& b->enable_state != bp_disabled
&& b->enable_state != bp_shlib_disabled
@ -944,7 +1052,7 @@
&& !b->pending
&& b->enable_state != bp_call_disabled)
{
@@ -7128,7 +7186,8 @@ breakpoint_re_set_one (void *bint)
@@ -7170,7 +7228,8 @@ breakpoint_re_set_one (void *bint)
break;
save_enable = b->enable_state;
@ -954,9 +1062,11 @@
b->enable_state = bp_disabled;
else
/* If resetting a shlib-disabled breakpoint, we don't want to
--- gdb-6.3/gdb/solib.c.fix Mon Jan 10 14:38:26 2005
+++ gdb-6.3/gdb/solib.c Mon Jan 10 15:04:59 2005
@@ -47,6 +47,8 @@
Index: gdb-6.5/gdb/solib.c
===================================================================
--- gdb-6.5.orig/gdb/solib.c 2006-07-11 02:47:06.000000000 -0300
+++ gdb-6.5/gdb/solib.c 2006-07-11 02:47:11.000000000 -0300
@@ -72,6 +72,8 @@ solib_ops (struct gdbarch *gdbarch)
/* external data declarations */
@ -965,16 +1075,16 @@
/* FIXME: gdbarch needs to control this variable */
struct target_so_ops *current_target_so_ops;
@@ -69,6 +71,8 @@ static char *solib_absolute_prefix = NUL
and LD_LIBRARY_PATH. */
static char *solib_search_path = NULL;
@@ -102,6 +104,8 @@ The search path for loading non-absolute
value);
}
+void add_to_target_sections (int, struct target_ops *, struct so_list *);
+
/*
GLOBAL FUNCTION
@@ -335,7 +339,6 @@ free_so (struct so_list *so)
@@ -372,7 +376,6 @@ free_so (struct so_list *so)
xfree (so);
}
@ -982,7 +1092,7 @@
/* Return address of first so_list entry in master shared object list. */
struct so_list *
master_so_list (void)
@@ -343,7 +346,6 @@ master_so_list (void)
@@ -380,7 +383,6 @@ master_so_list (void)
return so_list_head;
}
@ -990,7 +1100,7 @@
/* A small stub to get us past the arg-passing pinhole of catch_errors. */
static int
@@ -355,15 +357,40 @@ symbol_add_stub (void *arg)
@@ -392,15 +394,40 @@ symbol_add_stub (void *arg)
/* Have we already loaded this shared object? */
ALL_OBJFILES (so->objfile)
{
@ -1034,7 +1144,7 @@
free_section_addr_info (sap);
return (1);
@@ -458,6 +485,10 @@ update_solib_list (int from_tty, struct
@@ -523,6 +550,10 @@ update_solib_list (int from_tty, struct
the inferior's current list. */
while (i)
{
@ -1045,7 +1155,7 @@
if (! strcmp (gdb->so_original_name, i->so_original_name))
break;
@@ -511,32 +542,46 @@ update_solib_list (int from_tty, struct
@@ -576,28 +607,7 @@ update_solib_list (int from_tty, struct
/* Fill in the rest of each of the `struct so_list' nodes. */
for (i = inferior; i; i = i->next)
{
@ -1072,7 +1182,10 @@
- }
- }
+ add_to_target_sections (from_tty, target, i);
}
/* Notify any observer that the shared object has been
loaded now that we've added it to GDB's tables. */
@@ -606,6 +616,41 @@ update_solib_list (int from_tty, struct
}
}
@ -1114,20 +1227,24 @@
/* GLOBAL FUNCTION
@@ -917,4 +962,10 @@ This takes precedence over the environme
deprecated_add_show_from_set (c, &showlist);
set_cmd_cfunc (c, reload_shared_libraries);
set_cmd_completer (c, filename_completer);
@@ -978,4 +1023,12 @@ This takes precedence over the environme
reload_shared_libraries,
show_solib_search_path,
&setlist, &showlist);
+
+ c = add_set_cmd ("solib", no_class, var_zinteger,
+ (char *) &debug_solib,
+ "Set debugging of GNU/Linux shlib module.\n\
+Enables printf debugging output.\n", &setdebuglist);
+ deprecated_add_show_from_set (c, &showdebuglist);
+ add_setshow_boolean_cmd ("solib", no_class, &debug_solib,
+ _("\
+Set debugging of GNU/Linux shlib module.\n"), _("\
+Show debugging status of GNU/Linux shlib module.\n"), _("\
+Enables printf debugging output of GNU/Linux shlib module.\n"),
+ NULL, NULL,
+ &setdebuglist, &showdebuglist);
}
--- gdb-6.3/gdb/elfread.c.fix Mon Jan 10 14:38:32 2005
+++ gdb-6.3/gdb/elfread.c Mon Jan 10 14:39:35 2005
@@ -528,7 +528,7 @@ elf_symfile_read (struct objfile *objfil
Index: gdb-6.5/gdb/elfread.c
===================================================================
--- gdb-6.5.orig/gdb/elfread.c 2006-07-11 02:47:06.000000000 -0300
+++ gdb-6.5/gdb/elfread.c 2006-07-11 02:47:11.000000000 -0300
@@ -556,7 +556,7 @@ elf_symfile_read (struct objfile *objfil
/* If we are reinitializing, or if we have never loaded syms yet,
set table to empty. MAINLINE is cleared so that *_read_psymtab
functions do not all also re-initialize the psymbol table. */

View File

@ -6,14 +6,11 @@
use to skip over first half of a GNU/Linux syscall and update
"func_start".
Index: ./gdb/rs6000-tdep.c
Index: gdb-6.5/gdb/rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.215
diff -p -u -r1.215 rs6000-tdep.c
--- ./gdb/rs6000-tdep.c 20 Jun 2004 17:18:06 -0000 1.215
+++ ./gdb/rs6000-tdep.c 22 Jun 2004 19:06:46 -0000
@@ -71,6 +71,7 @@
--- gdb-6.5.orig/gdb/rs6000-tdep.c 2006-04-23 11:15:01.000000000 -0300
+++ gdb-6.5/gdb/rs6000-tdep.c 2006-07-07 00:54:50.000000000 -0300
@@ -76,6 +76,7 @@
struct rs6000_framedata
{
@ -21,15 +18,15 @@ diff -p -u -r1.215 rs6000-tdep.c
int offset; /* total size of frame --- the distance
by which we decrement sp to allocate
the frame */
@@ -694,7 +695,6 @@ store_param_on_stack_p (unsigned long op
@@ -905,7 +906,6 @@ store_param_on_stack_p (unsigned long op
static CORE_ADDR
skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata)
{
- CORE_ADDR orig_pc = pc;
CORE_ADDR last_prologue_pc = pc;
CORE_ADDR li_found_pc = 0;
char buf[4];
@@ -712,6 +712,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l
gdb_byte buf[4];
@@ -923,6 +923,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l
int minimal_toc_loaded = 0;
int prev_insn_was_prologue_insn = 1;
int num_skip_non_prologue_insns = 0;
@ -37,7 +34,7 @@ diff -p -u -r1.215 rs6000-tdep.c
int r0_contains_arg = 0;
const struct bfd_arch_info *arch_info = gdbarch_bfd_arch_info (current_gdbarch);
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
@@ -732,6 +733,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l
@@ -943,6 +944,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l
lim_pc = refine_prologue_limit (pc, lim_pc);
memset (fdata, 0, sizeof (struct rs6000_framedata));
@ -45,7 +42,7 @@ diff -p -u -r1.215 rs6000-tdep.c
fdata->saved_gpr = -1;
fdata->saved_fpr = -1;
fdata->saved_vr = -1;
@@ -760,6 +762,55 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l
@@ -971,6 +973,55 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l
break;
op = extract_signed_integer (buf, 4);
@ -101,12 +98,12 @@ diff -p -u -r1.215 rs6000-tdep.c
if ((op & 0xfc1fffff) == 0x7c0802a6)
{ /* mflr Rx */
/* Since shared library / PIC code, which needs to get its
@@ -913,7 +964,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l
fdata->frameless = 0;
/* Don't skip over the subroutine call if it is not within
the first three instructions of the prologue. */
@@ -1138,7 +1189,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l
we have no line table information or the line info tells
us that the subroutine call is not part of the line
associated with the prologue. */
- if ((pc - orig_pc) > 8)
+ if ((pc - fdata->func_start) > 8)
break;
op = read_memory_integer (pc + 4, 4);
{
struct symtab_and_line prologue_sal = find_pc_line (orig_pc, 0);
struct symtab_and_line this_sal = find_pc_line (pc, 0);

File diff suppressed because it is too large Load Diff

View File

@ -20,8 +20,10 @@
* testsuite/gdb.threads/step-thread-exit.c: New testcase.
* testsuite/gdb.threads/step-thread-exit.exp: Ditto.
--- gdb-6.3/gdb/testsuite/gdb.threads/step-thread-exit.c.fix 2005-02-11 16:51:43.000000000 -0500
+++ gdb-6.3/gdb/testsuite/gdb.threads/step-thread-exit.c 2005-02-11 18:27:55.000000000 -0500
Index: gdb-6.5/gdb/testsuite/gdb.threads/step-thread-exit.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.5/gdb/testsuite/gdb.threads/step-thread-exit.c 2006-07-07 02:26:54.000000000 -0300
@@ -0,0 +1,43 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -66,8 +68,10 @@
+}
+
+
--- gdb-6.3/gdb/testsuite/gdb.threads/step-thread-exit.exp.fix 2005-02-11 16:51:47.000000000 -0500
+++ gdb-6.3/gdb/testsuite/gdb.threads/step-thread-exit.exp 2005-02-11 18:28:23.000000000 -0500
Index: gdb-6.5/gdb/testsuite/gdb.threads/step-thread-exit.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.5/gdb/testsuite/gdb.threads/step-thread-exit.exp 2006-07-07 02:26:54.000000000 -0300
@@ -0,0 +1,100 @@
+# This testcase is part of GDB, the GNU debugger.
+
@ -169,9 +173,11 @@
+ }
+}
+
--- gdb-6.3/gdb/infrun.c.fix 2005-02-11 16:50:08.000000000 -0500
+++ gdb-6.3/gdb/infrun.c 2005-02-11 16:52:45.000000000 -0500
@@ -1072,6 +1072,7 @@ init_execution_control_state (struct exe
Index: gdb-6.5/gdb/infrun.c
===================================================================
--- gdb-6.5.orig/gdb/infrun.c 2006-07-07 01:17:35.000000000 -0300
+++ gdb-6.5/gdb/infrun.c 2006-07-07 02:26:54.000000000 -0300
@@ -1088,6 +1088,7 @@ init_execution_control_state (struct exe
ecs->current_symtab = ecs->sal.symtab;
ecs->infwait_state = infwait_normal_state;
ecs->waiton_ptid = pid_to_ptid (-1);
@ -179,7 +185,7 @@
ecs->wp = &(ecs->ws);
}
@@ -1296,6 +1297,16 @@ handle_inferior_event (struct execution_
@@ -1307,6 +1308,16 @@ handle_inferior_event (struct execution_
ui_out_text (uiout, "]\n");
}
@ -196,7 +202,7 @@
switch (ecs->ws.kind)
{
case TARGET_WAITKIND_LOADED:
@@ -2665,11 +2676,12 @@ process_event_stop_test:
@@ -2651,11 +2662,12 @@ process_event_stop_test:
static int
currently_stepping (struct execution_control_state *ecs)
{
@ -214,9 +220,11 @@
}
/* Subroutine call with source code we should not step over. Do step
--- gdb-6.3/gdb/linux-nat.c.fix 2005-02-11 16:50:14.000000000 -0500
+++ gdb-6.3/gdb/linux-nat.c 2005-02-11 17:02:54.000000000 -0500
@@ -1032,17 +1032,20 @@ linux_nat_detach (char *args, int from_t
Index: gdb-6.5/gdb/linux-nat.c
===================================================================
--- gdb-6.5.orig/gdb/linux-nat.c 2006-07-07 02:24:51.000000000 -0300
+++ gdb-6.5/gdb/linux-nat.c 2006-07-07 02:29:12.000000000 -0300
@@ -1121,18 +1121,21 @@ linux_nat_detach (char *args, int from_t
static int
resume_callback (struct lwp_info *lp, void *data)
{
@ -226,8 +234,9 @@
{
struct thread_info *tp;
- child_resume (pid_to_ptid (GET_LWP (lp->ptid)), 0, TARGET_SIGNAL_0);
+ child_resume (pid_to_ptid (GET_LWP (lp->ptid)), step, TARGET_SIGNAL_0);
linux_ops->to_resume (pid_to_ptid (GET_LWP (lp->ptid)),
- 0, TARGET_SIGNAL_0);
+ step, TARGET_SIGNAL_0);
if (debug_linux_nat)
fprintf_unfiltered (gdb_stdlog,
- "RC: PTRACE_CONT %s, 0, 0 (resume sibling)\n",
@ -240,11 +249,11 @@
}
return 0;
@@ -1110,13 +1113,17 @@ linux_nat_resume (ptid_t ptid, int step,
@@ -1243,13 +1246,17 @@ linux_nat_resume (ptid_t ptid, int step,
if (resume_all)
iterate_over_lwps (resume_callback, NULL);
- child_resume (ptid, step, signo);
- linux_ops->to_resume (ptid, step, signo);
- if (debug_linux_nat)
- fprintf_unfiltered (gdb_stdlog,
- "LLR: %s %s, %s (resume event thread)\n",
@ -253,10 +262,10 @@
- signo ? strsignal (signo) : "0");
+ if (lp)
+ {
+ child_resume (ptid, step, signo);
+ linux_ops->to_resume (ptid, step, signo);
+
+ if (debug_linux_nat)
+ fprintf_unfiltered (gdb_stdlog,
+ fprintf_unfiltered (gdb_stdlog,
+ "LLR: %s %s, %s (resume event thread)\n",
+ step ? "PTRACE_SINGLESTEP" : "PTRACE_CONT",
+ target_pid_to_str (ptid),
@ -265,7 +274,7 @@
}
/* Issue kill to specified lwp. */
@@ -1826,7 +1833,7 @@ stop_and_resume_callback (struct lwp_inf
@@ -1840,7 +1847,7 @@ stop_and_resume_callback (struct lwp_inf
for (ptr = lwp_list; ptr; ptr = ptr->next)
if (lp == ptr)
{
@ -274,7 +283,7 @@
resume_set_callback (lp, NULL);
}
}
@@ -1837,8 +1844,10 @@ static ptid_t
@@ -1851,8 +1858,10 @@ static ptid_t
linux_nat_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
{
struct lwp_info *lp = NULL;
@ -285,7 +294,7 @@
pid_t pid = PIDGET (ptid);
sigset_t flush_mask;
@@ -1864,14 +1873,12 @@ retry:
@@ -1890,14 +1899,12 @@ retry:
gets the expected trap so we don't want to wait on any LWP.
This has ramifications when adjustment of the PC is required which can be
different after a breakpoint vs a step (e.g. x86). */
@ -303,7 +312,7 @@
}
/* If any pid, check if there is a LWP with a wait status pending. */
@@ -2134,8 +2141,9 @@ retry:
@@ -2130,8 +2137,9 @@ retry:
}
/* Make sure we don't report a SIGSTOP that we sent
@ -315,7 +324,7 @@
&& WIFSTOPPED (status) && WSTOPSIG (status) == SIGSTOP)
{
if (debug_linux_nat)
@@ -2169,6 +2177,20 @@ retry:
@@ -2165,6 +2173,20 @@ retry:
if (pid == -1)
{
@ -379,7 +388,7 @@
/* Now stop all other LWP's ... */
iterate_over_lwps (stop_callback, NULL);
@@ -2278,6 +2336,10 @@ retry:
@@ -2275,6 +2333,10 @@ retry:
else
store_waitstatus (ourstatus, status);
@ -387,12 +396,14 @@
+ if (step_lp && step_lp != lp)
+ ourstatus->step_thread_exit = 1;
+
return (threaded ? lp->ptid : pid_to_ptid (GET_LWP (lp->ptid)));
return lp->ptid;
}
--- gdb-6.3/gdb/target.h.fix 2005-02-11 16:50:19.000000000 -0500
+++ gdb-6.3/gdb/target.h 2005-02-11 16:52:52.000000000 -0500
@@ -134,6 +134,7 @@ enum target_waitkind
Index: gdb-6.5/gdb/target.h
===================================================================
--- gdb-6.5.orig/gdb/target.h 2006-05-05 17:08:45.000000000 -0300
+++ gdb-6.5/gdb/target.h 2006-07-07 02:26:54.000000000 -0300
@@ -136,6 +136,7 @@ enum target_waitkind
struct target_waitstatus
{
enum target_waitkind kind;

View File

@ -3,18 +3,11 @@
* top.c (gdb_readline_wrapper): Ensure terminal is gdb's before calling
readline.
--- gdb-6.3/gdb/top.c.fix 2005-02-14 16:28:56.000000000 -0500
+++ gdb-6.3/gdb/top.c 2005-02-14 16:30:20.000000000 -0500
@@ -1,7 +1,7 @@
/* Top level stuff for GDB, the GNU debugger.
Copyright 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.
@@ -982,6 +982,14 @@ gdb_readline_wrapper (char *prompt)
Index: gdb-6.5/gdb/top.c
===================================================================
--- gdb-6.5.orig/gdb/top.c 2006-03-29 19:53:33.000000000 -0300
+++ gdb-6.5/gdb/top.c 2006-07-07 02:29:42.000000000 -0300
@@ -728,6 +728,14 @@ gdb_readline_wrapper (char *prompt)
after_char_processing_hook = NULL;
}

View File

@ -1,33 +1,38 @@
--- gdb-6.3/gdb/testsuite/configure.in.fix Fri Jan 7 19:32:06 2005
+++ gdb-6.3/gdb/testsuite/configure.in Fri Jan 7 19:33:29 2005
@@ -123,4 +123,4 @@ AC_OUTPUT([Makefile \
gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \
Index: gdb-6.5/gdb/testsuite/configure.ac
===================================================================
--- gdb-6.5.orig/gdb/testsuite/configure.ac 2006-07-07 01:12:31.000000000 -0300
+++ gdb-6.5/gdb/testsuite/configure.ac 2006-07-07 01:13:23.000000000 -0300
@@ -114,4 +114,4 @@ AC_OUTPUT([Makefile \
gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \
gdb.fortran/Makefile gdb.java/Makefile gdb.mi/Makefile \
gdb.fortran/Makefile gdb.server/Makefile \
gdb.java/Makefile gdb.mi/Makefile \
- gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile])
+ gdb.objc/Makefile gdb.pie/Makefile gdb.threads/Makefile gdb.trace/Makefile])
--- gdb-6.3/gdb/testsuite/configure.fix Fri Jan 7 19:32:11 2005
+++ gdb-6.3/gdb/testsuite/configure Fri Jan 7 19:33:54 2005
@@ -1054,7 +1054,7 @@ trap 'rm -fr `echo "Makefile \
gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \
gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \
gdb.fortran/Makefile gdb.java/Makefile gdb.mi/Makefile \
- gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+ gdb.objc/Makefile gdb.pie/Makefile gdb.threads/Makefile gdb.trace/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
Index: gdb-6.5/gdb/testsuite/configure
===================================================================
--- gdb-6.5.orig/gdb/testsuite/configure 2006-07-07 01:12:31.000000000 -0300
+++ gdb-6.5/gdb/testsuite/configure 2006-07-07 01:13:23.000000000 -0300
@@ -3075,7 +3075,7 @@ done
@@ -1151,7 +1151,7 @@ CONFIG_FILES=\${CONFIG_FILES-"Makefile \
gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \
gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \
gdb.fortran/Makefile gdb.java/Makefile gdb.mi/Makefile \
- gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile"}
+ gdb.objc/Makefile gdb.pie/Makefile gdb.threads/Makefile gdb.trace/Makefile"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
--- gdb-6.3/gdb/testsuite/gdb.pie/attach.c.fix Fri Jan 7 19:35:04 2005
+++ gdb-6.3/gdb/testsuite/gdb.pie/attach.c Fri Jan 7 19:32:33 2005
- 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.pie/Makefile gdb.threads/Makefile gdb.trace/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
@@ -3639,6 +3639,7 @@ do
"gdb.java/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.java/Makefile" ;;
"gdb.mi/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.mi/Makefile" ;;
"gdb.objc/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.objc/Makefile" ;;
+ "gdb.pie/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.pie/Makefile" ;;
"gdb.threads/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.threads/Makefile" ;;
"gdb.trace/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.trace/Makefile" ;;
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
Index: gdb-6.5/gdb/testsuite/gdb.pie/attach.c
===================================================================
--- /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
@@ -0,0 +1,20 @@
+/* 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
@ -49,8 +54,10 @@
+ }
+ return 0;
+}
--- gdb-6.3/gdb/testsuite/gdb.pie/attach2.c.fix Fri Jan 7 19:35:04 2005
+++ gdb-6.3/gdb/testsuite/gdb.pie/attach2.c Fri Jan 7 19:32:33 2005
Index: gdb-6.5/gdb/testsuite/gdb.pie/attach2.c
===================================================================
--- /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
@@ -0,0 +1,24 @@
+/* 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
@ -76,8 +83,10 @@
+ }
+ return (0);
+}
--- gdb-6.3/gdb/testsuite/gdb.pie/break.c.fix Fri Jan 7 19:35:04 2005
+++ gdb-6.3/gdb/testsuite/gdb.pie/break.c Fri Jan 7 19:32:33 2005
Index: gdb-6.5/gdb/testsuite/gdb.pie/break.c
===================================================================
--- /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
@@ -0,0 +1,146 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -225,8 +234,10 @@
+ }
+ return 0;
+}
--- gdb-6.3/gdb/testsuite/gdb.pie/break1.c.fix Fri Jan 7 19:35:04 2005
+++ gdb-6.3/gdb/testsuite/gdb.pie/break1.c Fri Jan 7 19:32:33 2005
Index: gdb-6.5/gdb/testsuite/gdb.pie/break1.c
===================================================================
--- /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
@@ -0,0 +1,44 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -272,8 +283,10 @@
+void marker3 (a, b) char *a, *b; {} /* set breakpoint 18 here */
+void marker4 (d) long d; {} /* set breakpoint 13 here */
+#endif
--- gdb-6.3/gdb/testsuite/gdb.pie/coremaker.c.fix Fri Jan 7 19:35:04 2005
+++ gdb-6.3/gdb/testsuite/gdb.pie/coremaker.c Fri Jan 7 19:32:33 2005
Index: gdb-6.5/gdb/testsuite/gdb.pie/coremaker.c
===================================================================
--- /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
@@ -0,0 +1,142 @@
+/* Copyright 1992, 1993, 1994, 1995, 1996, 1999
+ Free Software Foundation, Inc.
@ -417,8 +430,10 @@
+ return 0;
+}
+
--- gdb-6.3/gdb/testsuite/gdb.pie/attach.exp.fix Fri Jan 7 19:35:13 2005
+++ gdb-6.3/gdb/testsuite/gdb.pie/attach.exp Fri Jan 7 19:32:33 2005
Index: gdb-6.5/gdb/testsuite/gdb.pie/attach.exp
===================================================================
--- /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
@@ -0,0 +1,432 @@
+# Copyright 1997, 1999, 2002 Free Software Foundation, Inc.
+
@ -852,8 +867,10 @@
+do_call_attach_tests
+
+return 0
--- gdb-6.3/gdb/testsuite/gdb.pie/break.exp.fix Fri Jan 7 19:35:13 2005
+++ gdb-6.3/gdb/testsuite/gdb.pie/break.exp Fri Jan 7 19:32:33 2005
Index: gdb-6.5/gdb/testsuite/gdb.pie/break.exp
===================================================================
--- /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
@@ -0,0 +1,973 @@
+# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2002, 2003, 2004
@ -1828,8 +1845,10 @@
+ send_gdb "set args main\n"
+ gdb_expect -re ".*$gdb_prompt $" {}
+}
--- gdb-6.3/gdb/testsuite/gdb.pie/corefile.exp.fix Fri Jan 7 19:35:13 2005
+++ gdb-6.3/gdb/testsuite/gdb.pie/corefile.exp Fri Jan 7 19:32:33 2005
Index: gdb-6.5/gdb/testsuite/gdb.pie/corefile.exp
===================================================================
--- /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
@@ -0,0 +1,243 @@
+# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Free Software Foundation, Inc.
@ -2074,8 +2093,10 @@
+gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(\\).*" "up in corefile.exp (reinit)"
+
+gdb_test "core" "No core file now."
--- gdb-6.3/gdb/testsuite/gdb.pie/Makefile.in.fix Fri Jan 7 19:35:19 2005
+++ gdb-6.3/gdb/testsuite/gdb.pie/Makefile.in Fri Jan 7 19:32:33 2005
Index: gdb-6.5/gdb/testsuite/gdb.pie/Makefile.in
===================================================================
--- /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
@@ -0,0 +1,19 @@
+VPATH = @srcdir@
+srcdir = @srcdir@

File diff suppressed because it is too large Load Diff

View File

@ -35,16 +35,10 @@
* testsuite/gdb.threads/watchthreads2.c: New test case.
* testsuite/gdb.threads/watchthreads2.exp: Ditto.
--- gdb-6.3/gdb/config/i386/nm-linux64.h.fix 2004-08-15 12:10:23.000000000 -0400
+++ gdb-6.3/gdb/config/i386/nm-linux64.h 2005-02-28 17:36:09.000000000 -0500
@@ -1,6 +1,6 @@
/* Native support for GNU/Linux x86-64.
- Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Jiri Smid, SuSE Labs.
Index: gdb-6.5/gdb/config/i386/nm-linux64.h
===================================================================
--- gdb-6.5.orig/gdb/config/i386/nm-linux64.h 2006-07-11 02:44:36.000000000 -0300
+++ gdb-6.5/gdb/config/i386/nm-linux64.h 2006-07-11 02:45:16.000000000 -0300
@@ -35,22 +35,59 @@
/* Provide access to the i386 hardware debugging registers. */
@ -87,11 +81,11 @@
+
+/* Insert a hardware-assisted breakpoint at address ADDR. SHADOW is
+ * * unused. Return 0 on success, EBUSY on failure. */
+extern int amd64_linux_insert_hw_breakpoint (CORE_ADDR addr, void *shadow);
+extern int amd64_linux_insert_hw_breakpoint (struct bp_target_info *bp_tgt);
+
+/* Remove a hardware-assisted breakpoint at address ADDR. SHADOW is
+ * * unused. Return 0 on success, -1 on failure. */
+extern int amd64_linux_remove_hw_breakpoint (CORE_ADDR addr, void *shadow);
+extern int amd64_linux_remove_hw_breakpoint (struct bp_target_info *bp_tgt);
+
+/* Override basic amd64 macros for watchpoint and hardware breakpoint
+ * insertion/removal to support threads. */
@ -104,27 +98,20 @@
+ amd64_linux_remove_watchpoint (addr, len, type)
+
+#undef target_insert_hw_breakpoint
+#define target_insert_hw_breakpoint(addr, shadow) \
+ amd64_linux_insert_hw_breakpoint (addr, shadow)
+#define target_insert_hw_breakpoint(bp_tgt) \
+ amd64_linux_insert_hw_breakpoint (bp_tgt)
+
+#undef target_remove_hw_breakpoint
+#define target_remove_hw_breakpoint(addr, shadow) \
+ amd64_linux_remove_hw_breakpoint (addr, shadow)
+#define target_remove_hw_breakpoint(bp_tgt) \
+ amd64_linux_remove_hw_breakpoint (bp_tgt)
/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'. */
#define FETCH_INFERIOR_REGISTERS
--- gdb-6.3/gdb/config/i386/nm-linux.h.fix 2004-09-20 12:39:35.000000000 -0400
+++ gdb-6.3/gdb/config/i386/nm-linux.h 2005-02-28 17:36:00.000000000 -0500
@@ -1,7 +1,7 @@
/* Native support for GNU/Linux x86.
Copyright 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
- 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ 1998, 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
This file is part of GDB.
@@ -45,23 +45,61 @@ extern CORE_ADDR register_u_addr (CORE_A
Index: gdb-6.5/gdb/config/i386/nm-linux.h
===================================================================
--- gdb-6.5.orig/gdb/config/i386/nm-linux.h 2006-07-11 02:44:36.000000000 -0300
+++ gdb-6.5/gdb/config/i386/nm-linux.h 2006-07-11 02:45:16.000000000 -0300
@@ -46,23 +46,61 @@ extern CORE_ADDR register_u_addr (CORE_A
/* Provide access to the i386 hardware debugging registers. */
@ -167,11 +154,11 @@
+
+/* Insert a hardware-assisted breakpoint at address ADDR. SHADOW is
+ * unused. Return 0 on success, EBUSY on failure. */
+extern int i386_linux_insert_hw_breakpoint (CORE_ADDR addr, void *shadow);
+extern int i386_linux_insert_hw_breakpoint (struct bp_target_info *bp_tgt);
+
+/* Remove a hardware-assisted breakpoint at address ADDR. SHADOW is
+ * unused. Return 0 on success, -1 on failure. */
+extern int i386_linux_remove_hw_breakpoint (CORE_ADDR addr, void *shadow);
+extern int i386_linux_remove_hw_breakpoint (struct bp_target_info *bp_tgt);
+
+/* Override basic i386 macros for watchpoint and hardware breakpoint
+ insertion/removal to support threads. */
@ -184,26 +171,20 @@
+ i386_linux_remove_watchpoint (addr, len, type)
+
+#undef target_insert_hw_breakpoint
+#define target_insert_hw_breakpoint(addr, shadow) \
+ i386_linux_insert_hw_breakpoint (addr, shadow)
+#define target_insert_hw_breakpoint(bp_tgt) \
+ i386_linux_insert_hw_breakpoint (bp_tgt)
+
+#undef target_remove_hw_breakpoint
+#define target_remove_hw_breakpoint(addr, shadow) \
+ i386_linux_remove_hw_breakpoint (addr, shadow)
+#define target_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
--- gdb-6.3/gdb/i386-nat.c.fix 2005-02-25 16:53:44.000000000 -0500
+++ gdb-6.3/gdb/i386-nat.c 2005-02-28 17:33:11.000000000 -0500
@@ -1,6 +1,6 @@
/* Native-dependent code for the i386.
- Copyright 2001, 2004 Free Software Foundation, Inc.
+ Copyright 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GDB.
Index: gdb-6.5/gdb/i386-nat.c
===================================================================
--- gdb-6.5.orig/gdb/i386-nat.c 2006-07-11 02:44:36.000000000 -0300
+++ gdb-6.5/gdb/i386-nat.c 2006-07-11 02:45:16.000000000 -0300
@@ -21,6 +21,7 @@
#include "defs.h"
@ -212,8 +193,10 @@
#include "command.h"
#include "gdbcmd.h"
--- gdb-6.3/gdb/testsuite/gdb.threads/watchthreads2.c.fix 2005-02-28 17:33:54.000000000 -0500
+++ gdb-6.3/gdb/testsuite/gdb.threads/watchthreads2.c 2005-02-28 17:35:37.000000000 -0500
Index: gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.c 2006-07-11 02:45:16.000000000 -0300
@@ -0,0 +1,66 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -281,8 +264,10 @@
+ pthread_exit(NULL);
+}
+
--- gdb-6.3/gdb/testsuite/gdb.threads/watchthreads2.exp.fix 2005-02-28 17:33:57.000000000 -0500
+++ gdb-6.3/gdb/testsuite/gdb.threads/watchthreads2.exp 2005-02-28 17:35:33.000000000 -0500
Index: gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.5/gdb/testsuite/gdb.threads/watchthreads2.exp 2006-07-11 02:45:16.000000000 -0300
@@ -0,0 +1,133 @@
+# This testcase is part of GDB, the GNU debugger.
+
@ -417,26 +402,19 @@
+} else {
+ fail $message
+}
--- gdb-6.3/gdb/i386-linux-nat.c.fix 2005-02-24 19:36:12.000000000 -0500
+++ gdb-6.3/gdb/i386-linux-nat.c 2005-02-28 17:33:01.000000000 -0500
@@ -1,6 +1,7 @@
/* Native-dependent code for GNU/Linux i386.
- Copyright 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
This file is part of GDB.
@@ -23,6 +24,7 @@
Index: gdb-6.5/gdb/i386-linux-nat.c
===================================================================
--- gdb-6.5.orig/gdb/i386-linux-nat.c 2006-07-11 02:44:36.000000000 -0300
+++ gdb-6.5/gdb/i386-linux-nat.c 2006-07-11 02:45:16.000000000 -0300
@@ -24,6 +24,7 @@
#include "inferior.h"
#include "gdbcore.h"
#include "regcache.h"
+#include "observer.h"
#include "target.h"
#include "linux-nat.h"
#include "gdb_assert.h"
@@ -612,14 +614,14 @@ store_inferior_registers (int regno)
@@ -614,14 +615,14 @@ i386_linux_store_inferior_registers (int
/* Support for debug registers. */
static unsigned long
@ -454,7 +432,7 @@
/* FIXME: kettenis/2001-03-27: Calling perror_with_name if the
ptrace call fails breaks debugging remote targets. The correct
@@ -640,13 +642,13 @@ i386_linux_dr_get (int regnum)
@@ -642,13 +643,13 @@ i386_linux_dr_get (int regnum)
}
static void
@ -471,7 +449,7 @@
errno = 0;
ptrace (PTRACE_POKEUSER, tid,
@@ -656,34 +658,158 @@ i386_linux_dr_set (int regnum, unsigned
@@ -658,34 +659,158 @@ i386_linux_dr_set (int regnum, unsigned
}
void
@ -599,10 +577,10 @@
+/* Insert a hardware-assisted breakpoint at address ADDR. SHADOW is
+ unused. Return 0 on success, EBUSY on failure. */
+int
+i386_linux_insert_hw_breakpoint (CORE_ADDR addr, void *shadow)
+i386_linux_insert_hw_breakpoint (struct bp_target_info *bp_tgt)
+{
+ int rc;
+ rc = i386_insert_hw_breakpoint (addr, shadow);
+ rc = i386_insert_hw_breakpoint (bt_tgt);
+ if (!rc)
+ i386_linux_sync_debug_registers_across_threads ();
+ return rc;
@ -611,10 +589,10 @@
+/* Remove a hardware-assisted breakpoint at address ADDR. SHADOW is
+ unused. Return 0 on success, -1 on failure. */
+int
+i386_linux_remove_hw_breakpoint (CORE_ADDR addr, void *shadow)
+i386_linux_remove_hw_breakpoint (struct bp_target_info *bp_tgt)
+{
+ int rc;
+ rc = i386_remove_hw_breakpoint (addr, shadow);
+ rc = i386_remove_hw_breakpoint (bp_tgt);
+ if (!rc)
+ i386_linux_sync_debug_registers_across_threads ();
+ return rc;
@ -638,9 +616,9 @@
/* Called by libthread_db. Returns a pointer to the thread local
storage (or its descriptor). */
@@ -817,3 +943,10 @@ child_post_startup_inferior (ptid_t ptid
i386_cleanup_dregs ();
linux_child_post_startup_inferior (ptid);
@@ -844,3 +969,10 @@ _initialize_i386_linux_nat (void)
/* Register the target. */
linux_nat_add_target (t);
}
+
+void
@ -649,17 +627,11 @@
+ observer_attach_linux_new_thread (i386_linux_new_thread);
+}
+
--- gdb-6.3/gdb/amd64-linux-nat.c.fix 2005-02-24 19:37:56.000000000 -0500
+++ gdb-6.3/gdb/amd64-linux-nat.c 2005-02-28 17:32:44.000000000 -0500
@@ -1,6 +1,6 @@
/* Native-dependent code for GNU/Linux x86-64.
- Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Jiri Smid, SuSE Labs.
This file is part of GDB.
@@ -24,6 +24,7 @@
Index: gdb-6.5/gdb/amd64-linux-nat.c
===================================================================
--- gdb-6.5.orig/gdb/amd64-linux-nat.c 2006-07-11 02:44:36.000000000 -0300
+++ gdb-6.5/gdb/amd64-linux-nat.c 2006-07-11 02:45:16.000000000 -0300
@@ -25,6 +25,7 @@
#include "inferior.h"
#include "gdbcore.h"
#include "regcache.h"
@ -667,7 +639,7 @@
#include "linux-nat.h"
#include "gdb_assert.h"
@@ -228,14 +229,14 @@ store_inferior_registers (int regnum)
@@ -229,14 +230,14 @@ amd64_linux_store_inferior_registers (in
static unsigned long
@ -685,7 +657,7 @@
/* FIXME: kettenis/2001-03-27: Calling perror_with_name if the
ptrace call fails breaks debugging remote targets. The correct
@@ -256,13 +257,13 @@ amd64_linux_dr_get (int regnum)
@@ -257,13 +258,13 @@ amd64_linux_dr_get (int regnum)
}
static void
@ -702,7 +674,7 @@
errno = 0;
ptrace (PT_WRITE_U, tid, offsetof (struct user, u_debugreg[regnum]), value);
@@ -271,34 +272,158 @@ amd64_linux_dr_set (int regnum, unsigned
@@ -272,34 +273,158 @@ amd64_linux_dr_set (int regnum, unsigned
}
void
@ -830,10 +802,10 @@
+/* Insert a hardware-assisted breakpoint at address ADDR. SHADOW is
+ unused. Return 0 on success, EBUSY on failure. */
+int
+amd64_linux_insert_hw_breakpoint (CORE_ADDR addr, void *shadow)
+amd64_linux_insert_hw_breakpoint (struct bp_target_info *bp_tgt)
+{
+ int rc;
+ rc = i386_insert_hw_breakpoint (addr, shadow);
+ rc = i386_insert_hw_breakpoint (bp_tgt);
+ if (!rc)
+ amd64_linux_sync_debug_registers_across_threads ();
+ return rc;
@ -842,10 +814,10 @@
+/* Remove a hardware-assisted breakpoint at address ADDR. SHADOW is
+ unused. Return 0 on success, -1 on failure. */
+int
+amd64_linux_remove_hw_breakpoint (CORE_ADDR addr, void *shadow)
+amd64_linux_remove_hw_breakpoint (struct bp_target_info *bp_tgt)
+{
+ int rc;
+ rc = i386_remove_hw_breakpoint (addr, shadow);
+ rc = i386_remove_hw_breakpoint (bp_tgt);
+ if (!rc)
+ amd64_linux_sync_debug_registers_across_threads ();
+ return rc;
@ -869,10 +841,10 @@
/* This function is called by libthread_db as part of its handling of
a request for a thread's local storage address. */
@@ -380,4 +505,6 @@ _initialize_amd64_linux_nat (void)
== amd64_native_gregset32_num_regs);
gdb_assert (ARRAY_SIZE (amd64_linux_gregset64_reg_offset)
== amd64_native_gregset64_num_regs);
@@ -399,4 +524,6 @@ _initialize_amd64_linux_nat (void)
/* Register the target. */
linux_nat_add_target (t);
+
+ observer_attach_linux_new_thread (amd64_linux_new_thread);
}

File diff suppressed because it is too large Load Diff

116
gdb.spec
View File

@ -8,19 +8,19 @@ Name: gdb
# Set version to contents of gdb/version.in.
# 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).
Version: 6.3.0.0
Version: 6.5
# The release always contains a leading reserved number, start it at 0.
Release: 1.132.FC6
Release: 1%{?dist}
License: GPL
Group: Development/Debuggers
Source: ftp://ftp.gnu.org/gnu/gdb/gdb-6.3.tar.bz2
Source: ftp://ftp.gnu.org/gnu/gdb/gdb-6.5.tar.bz2
Buildroot: %{_tmppath}/%{name}-%{version}-root
URL: http://gnu.org/software/gdb/
# For our convenience
%define gdb_src gdb-6.3
%define gdb_src gdb-6.5
%define gdb_build %{gdb_src}/build-%{_target_platform}
# Make sure we get rid of the old package gdb64, now that we have unified
@ -56,14 +56,6 @@ Patch4: gdb-6.3-rh-testlibunwind1fix-20041202.patch
# frames are identified as signal frames.
Patch101: gdb-6.3-sigx86-20040621.patch
# Don't reject signal trampoline frames that have a [data] symbol
# associated with them as occures when backtracing through an
# alt-stack in the data address space.
Patch102: gdb-6.3-sigsymtramp-20040621.patch
# Add unwinders for PPC and PPC64 signal trampolines.
Patch103: gdb-6.3-ppcsignals-20040621.patch
# Use convert_from_func_ptr_addr on the solib breakpoint address;
# simplifies and makes more consistent the logic.
Patch104: gdb-6.3-ppcdotsolib-20041022.patch
@ -74,23 +66,10 @@ Patch105: gdb-6.3-ppc64syscall-20040622.patch
# Stop a backtrace when a zero PC is encountered.
Patch106: gdb-6.3-framepczero-20040927.patch
# Hack around broken header files that incorrectly define the FPSCR
# macro.
Patch107: gdb-6.3-ppc64fpscrhack-20041026.patch
# Pass the pc's section into the symbol search code; stops the lookup
# finding a symbol from the wrong section.
Patch108: gdb-6.3-ppc64section-20041026.patch
# Add PPC register groups so that info registers et.al.; along with
# register save and restore; work better. On PPC-64 it was restoring
# the PS register setting the break-on-branch bit!
Patch109: gdb-6.3-ppcreggroups-20041124.patch
# Fix up 64-bit PPC inferior function calls so that function
# parameters are passed correctly.
Patch110: gdb-6.3-ppc64abi-20040621.patch
# Include the pc's section when doing a symbol lookup so that the
# correct symbol is found.
Patch111: gdb-6.3-ppc64displaysymbol-20041124.patch
@ -101,9 +80,6 @@ Patch112: gdb-6.3-thread-step-20041207.patch
# Threaded watchpoint support
Patch113: gdb-6.3-threaded-watchpoints-20041213.patch
# Multiple patches to ia64 backtrace
Patch114: gdb-6.3-ia64-backtrace-20041213.patch
# Fix to expose multiple constructors to end-user
Patch115: gdb-6.3-constructor-20041216.patch
@ -123,46 +99,28 @@ Patch119: gdb-6.3-lwp-cache-20041216.patch
# Fix to ensure types are visible
Patch120: gdb-6.3-type-fix-20041213.patch
# Fix for allowing macros to continue after backtrace errors
Patch121: gdb-6.3-backtrace-20041216.patch
# VSYSCALL and PIE
Patch122: gdb-6.3-test-pie-20050107.patch
Patch123: gdb-6.3-vsyscall-20041216.patch
Patch124: gdb-6.3-pie-20050110.patch
# Get selftest working with sep-debug-info
Patch125: gdb-6.3-test-self-20050110.patch
# No longer a need to set .malloc on ppc64.
Patch126: gdb-6.3-ppcmalloc-20041124.patch
# Enable PPC CFI support.
Patch127: gdb-6.3-ppccfi-20041104.patch
# Fix for non-threaded watchpoints.
Patch128: gdb-6.3-nonthreaded-wp-20050117.patch
# Add synthetic symbols (esp PPC-64 .symbols) to min symtab
Patch129: gdb-6.3-ppcdotsym-20050126.patch
# Add PPC .symbols to min-symtable.
Patch130: gdb-6.3-ctorline-20050120.patch
# Handle nested, and back-to-back signals when stepping.
Patch131: gdb-6.3-sigrepeats-20050121.patch
Patch132: gdb-6.3-test-sigrepeats-20050121.patch
# Fix to support multiple destructors just like multiple constructors
Patch133: gdb-6.3-test-dtorfix-20050121.patch
Patch134: gdb-6.3-dtorfix-20050121.patch
# Fix for ia64 to prevent SIGSEGV in debugger
Patch135: gdb-6.3-ia64fix-20050121.patch
# Fix to support executable moving
Patch136: gdb-6.3-test-movedir-20050125.patch
Patch137: gdb-6.3-movedir-20050125.patch
# Fix to support unwinding syscalls in ia64 corefiles
Patch138: gdb-6.3-ia64-corefile-fix-20050127.patch
@ -179,18 +137,9 @@ Patch141: gdb-6.3-step-thread-exit-20050211.patch
# Prevent gdb from being pushed into background
Patch142: gdb-6.3-terminal-fix-20050214.patch
# Fix for unload.exp testcase
Patch143: gdb-6.3-unload-test-20050216.patch
# Backport addition symfile-mem.o to all GNU/Linux systems.
Patch144: gdb-6.3-addsymfilemem-20050209.patch
# Allow sibling threads to set threaded watchpoints for x86 and x86-64
Patch145: gdb-6.3-threaded-watchpoints2-20050225.patch
# Follow vfork fix from mainline sources
Patch146: gdb-6.3-follow-vfork-20050303.patch
# Fix unexpected compiler warning messages.
Patch147: gdb-6.3-warnings-20050317.patch
@ -204,22 +153,10 @@ Patch149: gdb-6.3-ia64-vsyscall-20050330.patch
Patch150: gdb-6.3-test-sepcrc-20050402.patch
Patch151: gdb-6.3-sepcrc-20050402.patch
# Handle read side of DW_OP_piece.
Patch152: gdb-6.3-dwoppieceread-20050407.patch
# Do not issue warning message about first page of storage for ia64 gcore
Patch153: gdb-6.3-ia64-gcore-page0-20050421.patch
# Ia64 patch for added libunwind support
Patch154: gdb-6.3-ia64-sigtramp-20050427.patch
# Partial die in cache fix
Patch155: gdb-6.3-partial-die-20050503.patch
# SA_RESTART patch
Patch156: gdb-6.3-sarestart-20050518.patch
# Security errata for bfd overflow and untrusted .gdbinit
# Security errata for untrusted .gdbinit
Patch157: gdb-6.3-security-errata-20050610.patch
# IA64 sigtramp prev register patch
@ -249,9 +186,6 @@ Patch165: gdb-6.3-xfree-20050922.patch
# Fix frame pointer for ia64 sigtramp frame
Patch166: gdb-6.3-ia64-sigtramp-fp-20050926.patch
# Fix DSO read logic for attached process
Patch167: gdb-6.3-attach-dso-20050929.patch
# Support gdb attaching to a stopped process
Patch168: gdb-6.3-attach-stop-20051011.patch
@ -261,23 +195,12 @@ Patch169: gdb-6.3-ia64-sigill-20051115.patch
# Allow option to continue backtracing past a zero pc value
Patch170: gdb-6.3-bt-past-zero-20051201.patch
# Silence type-punning warnings that cause compilation errors because
# of -Werror.
Patch171: gdb-6.3-type-punning-20060214.patch
# Enable gdb to debug using executables and core files with different
# prelink base addresses.
Patch172: gdb-6.3-prelink-core-20060223.patch
# Enable gdb to recognize stack frames annotated with the "S" augmentation.
Patch173: gdb-6.3-augmS-20060303.patch
# Enable gdb to recognize CFA value expressions introduced in Dwarf3.
Patch174: gdb-6.3-cfaval-20060303.patch
# Use fopen64 where available.
Patch175: gdb-6.3-support-fopen64-20060413.patch
# Use bigger numbers than int.
Patch176: gdb-6.3-large-core-20051206.patch
@ -323,61 +246,40 @@ and printing their data.
%patch4 -p1
%patch101 -p1
%patch102 -p1
%patch103 -p1
%patch104 -p1
%patch105 -p1
%patch106 -p1
%patch107 -p1
%patch108 -p1
%patch109 -p1
%patch110 -p1
%patch111 -p1
%patch112 -p1
%patch113 -p1
%patch114 -p1
%patch115 -p1
%patch116 -p1
%patch117 -p1
%patch118 -p1
%patch119 -p1
%patch120 -p1
%patch121 -p1
%patch122 -p1
%patch123 -p1
%patch124 -p1
%patch125 -p1
%patch126 -p1
%patch127 -p1
%patch128 -p1
%patch129 -p1
%patch130 -p1
%patch131 -p1
%patch132 -p1
%patch133 -p1
%patch134 -p1
%patch135 -p1
%patch136 -p1
%patch137 -p1
%patch138 -p1
%patch139 -p1
%patch140 -p1
%patch141 -p1
%patch142 -p1
%patch143 -p1
%patch144 -p1
%patch145 -p1
%patch146 -p1
%patch147 -p1
%patch148 -p1
%patch149 -p1
%patch150 -p1
%patch151 -p1
%patch152 -p1
%patch153 -p1
%patch154 -p1
%patch155 -p1
%patch156 -p1
%patch157 -p1
%patch158 -p1
%patch159 -p1
@ -388,15 +290,11 @@ and printing their data.
%patch164 -p1
%patch165 -p1
%patch166 -p1
%patch167 -p1
%patch168 -p1
%patch169 -p1
%patch170 -p1
%patch171 -p1
%patch172 -p1
%patch173 -p1
%patch174 -p1
%patch175 -p1
%patch176 -p1
%patch177 -p1
%patch178 -p1
@ -569,6 +467,10 @@ fi
# don't include the files in include, they are part of binutils
%changelog
* Tue Jul 11 2006 Alexandre Oliva <aoliva@redhat.com> - 6.5-1
- Upgrade to GDB 6.5. Drop redundant patches, forward-port remaining
ones.
* Thu Jun 15 2006 Alexandre Oliva <aoliva@redhat.com> - 6.3.0.0-1.132
- Require flex and bison at build time.
- Additional patch for BZ 175083, to cope with waitpid setting status

View File

@ -1 +1 @@
05b928f41fa5b482e49ca2c24762a0ae gdb-6.3.tar.bz2
af6c8335230d7604aee0803b1df14f54 gdb-6.5.tar.bz2