From 4d3aa56117188a28cdcbb527b0d253bb353b6f4c Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Sep 25 2009 06:49:21 +0000 Subject: - Upgrade to the FSF GDB gdb-7.0 snapshot: 6.8.91.20090925 - archer-jankratochvil-fedora12 commit: 4338ea85c798007c32594032f602db9fd230eba9 - [python] Don't directly reference self.frame (Tom Tromey). - [expr] Updates from branch (Keith Seitz). --- diff --git a/.cvsignore b/.cvsignore index 4cf7d05..650ec4a 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,2 +1,2 @@ libstdc++-v3-python-r151798.tar.xz -gdb-6.8.91.20090921.tar.bz2 +gdb-6.8.91.20090925.tar.bz2 diff --git a/gdb-6.3-readnever-20050907.patch b/gdb-6.3-readnever-20050907.patch index bcbfae8..823c38f 100644 --- a/gdb-6.3-readnever-20050907.patch +++ b/gdb-6.3-readnever-20050907.patch @@ -65,7 +65,7 @@ Index: gdb-6.8.50.20090811/gdb/dwarf2read.c --- gdb-6.8.50.20090811.orig/gdb/dwarf2read.c 2009-08-13 10:14:15.000000000 +0200 +++ gdb-6.8.50.20090811/gdb/dwarf2read.c 2009-08-13 10:14:29.000000000 +0200 @@ -53,6 +53,7 @@ - #include "typeprint.h" + #include "jv-lang.h" #include "vec.h" #include "block.h" +#include "top.h" diff --git a/gdb-6.8.50.20090921-upstream.patch b/gdb-6.8.50.20090921-upstream.patch deleted file mode 100644 index 1778552..0000000 --- a/gdb-6.8.50.20090921-upstream.patch +++ /dev/null @@ -1,965 +0,0 @@ -=================================================================== -RCS file: /cvs/src/src/gdb/ChangeLog,v -retrieving revision 1.10874.2.11 -retrieving revision 1.10874.2.12 -diff -u -r1.10874.2.11 -r1.10874.2.12 ---- src/gdb/ChangeLog 2009/09/19 16:36:08 1.10874.2.11 -+++ src/gdb/ChangeLog 2009/09/21 06:57:02 1.10874.2.12 -@@ -1,3 +1,47 @@ -+2009-09-21 Hui Zhu -+ Michael Snyder -+ -+ * amd64-linux-tdep.c (amd64_all_but_ip_registers_record): New -+ function. -+ (amd64_linux_syscall_record): Call -+ amd64_all_but_ip_registers_record if syscall is -+ sys_rt_sigreturn. -+ (AMD64_LINUX_redzone, AMD64_LINUX_xstate, -+ AMD64_LINUX_frame_size): New macros. -+ (amd64_linux_record_signal): New function. -+ (amd64_linux_init_abi): Call set_gdbarch_process_record_signal. -+ -+2009-09-21 Hui Zhu -+ Michael Snyder -+ -+ * i386-linux-tdep.c (i386_all_but_ip_registers_record): New -+ function. -+ (i386_linux_intx80_sysenter_record): Call -+ i386_all_but_ip_registers_record if syscall is sys_sigreturn -+ or sys_rt_sigreturn. -+ (I386_LINUX_xstate, I386_LINUX_frame_size): New macros. -+ (i386_linux_record_signal): New function. -+ (i386_linux_init_abi): Call set_gdbarch_process_record_signal. -+ -+2009-09-21 Hui Zhu -+ Michael Snyder -+ -+ * record.c (record_end_entry): New struct. -+ (record_type): Add end. -+ (record_arch_list_add_end): Set rec->u.end.sigval to -+ TARGET_SIGNAL_0. -+ (record_message_args): New struct. -+ (record_message): Call gdbarch_process_record_signal. -+ (do_record_message): Add argument "signal". -+ (record_resume): Ditto. -+ (record_wait): Ditto. Check record_list->u.end.sigval -+ in replay mode. -+ -+2009-09-21 Hui Zhu -+ Michael Snyder -+ -+ * gdbarch.sh (process_record_signal): New interface. -+ - 2009-09-19 Maxim Grigoriev - - * xtensa-tdep.c (call0_analyze_prologue): Replace INT_MAX by UNIT_MAX. -=================================================================== -RCS file: /cvs/src/src/gdb/gdbarch.sh,v -retrieving revision 1.496 -retrieving revision 1.496.2.1 -diff -u -r1.496 -r1.496.2.1 ---- src/gdb/gdbarch.sh 2009/09/15 03:30:05 1.496 -+++ src/gdb/gdbarch.sh 2009/09/21 06:57:02 1.496.2.1 -@@ -709,6 +709,10 @@ - # Return -1 if something goes wrong, 0 otherwise. - M:int:process_record:struct regcache *regcache, CORE_ADDR addr:regcache, addr - -+# Save process state after a signal. -+# Return -1 if something goes wrong, 0 otherwise. -+M:int:process_record_signal:struct regcache *regcache, enum target_signal signal:regcache, signal -+ - # Signal translation: translate inferior's signal (host's) number into - # GDB's representation. - m:enum target_signal:target_signal_from_host:int signo:signo::default_target_signal_from_host::0 -=================================================================== -RCS file: /cvs/src/src/gdb/gdbarch.c,v -retrieving revision 1.453 -retrieving revision 1.453.2.1 -diff -u -r1.453 -r1.453.2.1 ---- src/gdb/gdbarch.c 2009/09/15 03:30:05 1.453 -+++ src/gdb/gdbarch.c 2009/09/21 06:57:02 1.453.2.1 -@@ -240,6 +240,7 @@ - gdbarch_static_transform_name_ftype *static_transform_name; - int sofun_address_maybe_missing; - gdbarch_process_record_ftype *process_record; -+ gdbarch_process_record_signal_ftype *process_record_signal; - gdbarch_target_signal_from_host_ftype *target_signal_from_host; - gdbarch_target_signal_to_host_ftype *target_signal_to_host; - gdbarch_get_siginfo_type_ftype *get_siginfo_type; -@@ -378,6 +379,7 @@ - 0, /* static_transform_name */ - 0, /* sofun_address_maybe_missing */ - 0, /* process_record */ -+ 0, /* process_record_signal */ - default_target_signal_from_host, /* target_signal_from_host */ - default_target_signal_to_host, /* target_signal_to_host */ - 0, /* get_siginfo_type */ -@@ -635,6 +637,7 @@ - /* Skip verify of static_transform_name, has predicate */ - /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */ - /* Skip verify of process_record, has predicate */ -+ /* Skip verify of process_record_signal, has predicate */ - /* Skip verify of target_signal_from_host, invalid_p == 0 */ - /* Skip verify of target_signal_to_host, invalid_p == 0 */ - /* Skip verify of get_siginfo_type, has predicate */ -@@ -971,6 +974,12 @@ - "gdbarch_dump: process_record = <%s>\n", - host_address_to_string (gdbarch->process_record)); - fprintf_unfiltered (file, -+ "gdbarch_dump: gdbarch_process_record_signal_p() = %d\n", -+ gdbarch_process_record_signal_p (gdbarch)); -+ fprintf_unfiltered (file, -+ "gdbarch_dump: process_record_signal = <%s>\n", -+ host_address_to_string (gdbarch->process_record_signal)); -+ fprintf_unfiltered (file, - "gdbarch_dump: ps_regnum = %s\n", - plongest (gdbarch->ps_regnum)); - fprintf_unfiltered (file, -@@ -3307,6 +3316,30 @@ - gdbarch->process_record = process_record; - } - -+int -+gdbarch_process_record_signal_p (struct gdbarch *gdbarch) -+{ -+ gdb_assert (gdbarch != NULL); -+ return gdbarch->process_record_signal != NULL; -+} -+ -+int -+gdbarch_process_record_signal (struct gdbarch *gdbarch, struct regcache *regcache, enum target_signal signal) -+{ -+ gdb_assert (gdbarch != NULL); -+ gdb_assert (gdbarch->process_record_signal != NULL); -+ if (gdbarch_debug >= 2) -+ fprintf_unfiltered (gdb_stdlog, "gdbarch_process_record_signal called\n"); -+ return gdbarch->process_record_signal (gdbarch, regcache, signal); -+} -+ -+void -+set_gdbarch_process_record_signal (struct gdbarch *gdbarch, -+ gdbarch_process_record_signal_ftype process_record_signal) -+{ -+ gdbarch->process_record_signal = process_record_signal; -+} -+ - enum target_signal - gdbarch_target_signal_from_host (struct gdbarch *gdbarch, int signo) - { -=================================================================== -RCS file: /cvs/src/src/gdb/gdbarch.h,v -retrieving revision 1.403 -retrieving revision 1.403.2.1 -diff -u -r1.403 -r1.403.2.1 ---- src/gdb/gdbarch.h 2009/09/15 03:30:05 1.403 -+++ src/gdb/gdbarch.h 2009/09/21 06:57:02 1.403.2.1 -@@ -822,6 +822,15 @@ - extern int gdbarch_process_record (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr); - extern void set_gdbarch_process_record (struct gdbarch *gdbarch, gdbarch_process_record_ftype *process_record); - -+/* Save process state after a signal. -+ Return -1 if something goes wrong, 0 otherwise. */ -+ -+extern int gdbarch_process_record_signal_p (struct gdbarch *gdbarch); -+ -+typedef int (gdbarch_process_record_signal_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, enum target_signal signal); -+extern int gdbarch_process_record_signal (struct gdbarch *gdbarch, struct regcache *regcache, enum target_signal signal); -+extern void set_gdbarch_process_record_signal (struct gdbarch *gdbarch, gdbarch_process_record_signal_ftype *process_record_signal); -+ - /* Signal translation: translate inferior's signal (host's) number into - GDB's representation. */ - -=================================================================== -RCS file: /cvs/src/src/gdb/record.c,v -retrieving revision 1.17 -retrieving revision 1.17.2.1 -diff -u -r1.17 -r1.17.2.1 ---- src/gdb/record.c 2009/09/08 00:50:42 1.17 -+++ src/gdb/record.c 2009/09/21 06:57:03 1.17.2.1 -@@ -59,6 +59,11 @@ - gdb_byte *val; - }; - -+struct record_end_entry -+{ -+ enum target_signal sigval; -+}; -+ - enum record_type - { - record_end = 0, -@@ -77,6 +82,8 @@ - struct record_reg_entry reg; - /* mem */ - struct record_mem_entry mem; -+ /* end */ -+ struct record_end_entry end; - } u; - }; - -@@ -314,6 +321,7 @@ - rec->prev = NULL; - rec->next = NULL; - rec->type = record_end; -+ rec->u.end.sigval = TARGET_SIGNAL_0; - - record_arch_list_add (rec); - -@@ -360,11 +368,17 @@ - record_list_release (record_arch_list_tail); - } - -+struct record_message_args { -+ struct regcache *regcache; -+ enum target_signal signal; -+}; -+ - static int - record_message (void *args) - { - int ret; -- struct regcache *regcache = args; -+ struct record_message_args *myargs = args; -+ struct gdbarch *gdbarch = get_regcache_arch (myargs->regcache); - struct cleanup *old_cleanups = make_cleanup (record_message_cleanups, 0); - - record_arch_list_head = NULL; -@@ -373,9 +387,44 @@ - /* Check record_insn_num. */ - record_check_insn_num (1); - -- ret = gdbarch_process_record (get_regcache_arch (regcache), -- regcache, -- regcache_read_pc (regcache)); -+ /* If gdb sends a signal value to target_resume, -+ save it in the 'end' field of the previous instruction. -+ -+ Maybe process record should record what really happened, -+ rather than what gdb pretends has happened. -+ -+ So if Linux delivered the signal to the child process during -+ the record mode, we will record it and deliver it again in -+ the replay mode. -+ -+ If user says "ignore this signal" during the record mode, then -+ it will be ignored again during the replay mode (no matter if -+ the user says something different, like "deliver this signal" -+ during the replay mode). -+ -+ User should understand that nothing he does during the replay -+ mode will change the behavior of the child. If he tries, -+ then that is a user error. -+ -+ But we should still deliver the signal to gdb during the replay, -+ if we delivered it during the recording. Therefore we should -+ record the signal during record_wait, not record_resume. */ -+ if (record_list != &record_first) /* FIXME better way to check */ -+ { -+ gdb_assert (record_list->type == record_end); -+ record_list->u.end.sigval = myargs->signal; -+ } -+ -+ if (myargs->signal == TARGET_SIGNAL_0 -+ || !gdbarch_process_record_signal_p (gdbarch)) -+ ret = gdbarch_process_record (gdbarch, -+ myargs->regcache, -+ regcache_read_pc (myargs->regcache)); -+ else -+ ret = gdbarch_process_record_signal (gdbarch, -+ myargs->regcache, -+ myargs->signal); -+ - if (ret > 0) - error (_("Process record: inferior program stopped.")); - if (ret < 0) -@@ -396,9 +445,14 @@ - } - - static int --do_record_message (struct regcache *regcache) -+do_record_message (struct regcache *regcache, -+ enum target_signal signal) - { -- return catch_errors (record_message, regcache, NULL, RETURN_MASK_ALL); -+ struct record_message_args args; -+ -+ args.regcache = regcache; -+ args.signal = signal; -+ return catch_errors (record_message, &args, NULL, RETURN_MASK_ALL); - } - - /* Set to 1 if record_store_registers and record_xfer_partial -@@ -520,13 +574,13 @@ - - static void - record_resume (struct target_ops *ops, ptid_t ptid, int step, -- enum target_signal siggnal) -+ enum target_signal signal) - { - record_resume_step = step; - - if (!RECORD_IS_REPLAY) - { -- if (do_record_message (get_current_regcache ())) -+ if (do_record_message (get_current_regcache (), signal)) - { - record_resume_error = 0; - } -@@ -536,7 +590,7 @@ - return; - } - record_beneath_to_resume (record_beneath_to_resume_ops, ptid, 1, -- siggnal); -+ signal); - } - } - -@@ -611,15 +665,16 @@ - ret = record_beneath_to_wait (record_beneath_to_wait_ops, - ptid, status, options); - -+ /* Is this a SIGTRAP? */ - if (status->kind == TARGET_WAITKIND_STOPPED - && status->value.sig == TARGET_SIGNAL_TRAP) - { -- /* Check if there is a breakpoint. */ -+ /* Yes -- check if there is a breakpoint. */ - registers_changed (); - tmp_pc = regcache_read_pc (get_current_regcache ()); - if (breakpoint_inserted_here_p (tmp_pc)) - { -- /* There is a breakpoint. */ -+ /* There is a breakpoint. GDB will want to stop. */ - CORE_ADDR decr_pc_after_break = - gdbarch_decr_pc_after_break - (get_regcache_arch (get_current_regcache ())); -@@ -631,8 +686,12 @@ - } - else - { -- /* There is not a breakpoint. */ -- if (!do_record_message (get_current_regcache ())) -+ /* There is not a breakpoint, and gdb is not -+ stepping, therefore gdb will not stop. -+ Therefore we will not return to gdb. -+ Record the insn and resume. */ -+ if (!do_record_message (get_current_regcache (), -+ TARGET_SIGNAL_0)) - { - break; - } -@@ -827,6 +886,10 @@ - gdbarch_decr_pc_after_break (gdbarch)); - continue_flag = 0; - } -+ /* Check target signal */ -+ if (record_list->u.end.sigval != TARGET_SIGNAL_0) -+ /* FIXME: better way to check */ -+ continue_flag = 0; - } - } - -@@ -851,6 +914,9 @@ - replay_out: - if (record_get_sig) - status->value.sig = TARGET_SIGNAL_INT; -+ else if (record_list->u.end.sigval != TARGET_SIGNAL_0) -+ /* FIXME: better way to check */ -+ status->value.sig = record_list->u.end.sigval; - else - status->value.sig = TARGET_SIGNAL_TRAP; - -=================================================================== -RCS file: /cvs/src/src/gdb/i386-linux-tdep.c,v -retrieving revision 1.68 -retrieving revision 1.68.2.1 -diff -u -r1.68 -r1.68.2.1 ---- src/gdb/i386-linux-tdep.c 2009/09/15 03:30:06 1.68 -+++ src/gdb/i386-linux-tdep.c 2009/09/21 06:57:03 1.68.2.1 -@@ -358,7 +358,32 @@ - regcache_cooked_write_unsigned (regcache, I386_LINUX_ORIG_EAX_REGNUM, -1); - } - --static struct linux_record_tdep i386_linux_record_tdep; -+/* Record all registers but IP register for process-record. */ -+ -+static int -+i386_all_but_ip_registers_record (struct regcache *regcache) -+{ -+ if (record_arch_list_add_reg (regcache, I386_EAX_REGNUM)) -+ return -1; -+ if (record_arch_list_add_reg (regcache, I386_ECX_REGNUM)) -+ return -1; -+ if (record_arch_list_add_reg (regcache, I386_EDX_REGNUM)) -+ return -1; -+ if (record_arch_list_add_reg (regcache, I386_EBX_REGNUM)) -+ return -1; -+ if (record_arch_list_add_reg (regcache, I386_ESP_REGNUM)) -+ return -1; -+ if (record_arch_list_add_reg (regcache, I386_EBP_REGNUM)) -+ return -1; -+ if (record_arch_list_add_reg (regcache, I386_ESI_REGNUM)) -+ return -1; -+ if (record_arch_list_add_reg (regcache, I386_EDI_REGNUM)) -+ return -1; -+ if (record_arch_list_add_reg (regcache, I386_EFLAGS_REGNUM)) -+ return -1; -+ -+ return 0; -+} - - /* i386_canonicalize_syscall maps from the native i386 Linux set - of syscall ids into a canonical set of syscall ids used by -@@ -383,6 +408,8 @@ - - Return -1 if something wrong. */ - -+static struct linux_record_tdep i386_linux_record_tdep; -+ - static int - i386_linux_intx80_sysenter_record (struct regcache *regcache) - { -@@ -402,6 +429,14 @@ - return -1; - } - -+ if (syscall_gdb == gdb_sys_sigreturn -+ || syscall_gdb == gdb_sys_rt_sigreturn) -+ { -+ if (i386_all_but_ip_registers_record (regcache)) -+ return -1; -+ return 0; -+ } -+ - ret = record_linux_system_call (syscall_gdb, regcache, - &i386_linux_record_tdep); - if (ret) -@@ -413,6 +448,40 @@ - - return 0; - } -+ -+#define I386_LINUX_xstate 270 -+#define I386_LINUX_frame_size 732 -+ -+int -+i386_linux_record_signal (struct gdbarch *gdbarch, -+ struct regcache *regcache, -+ enum target_signal signal) -+{ -+ ULONGEST esp; -+ -+ if (i386_all_but_ip_registers_record (regcache)) -+ return -1; -+ -+ if (record_arch_list_add_reg (regcache, I386_EIP_REGNUM)) -+ return -1; -+ -+ /* Record the change in the stack. */ -+ regcache_raw_read_unsigned (regcache, I386_ESP_REGNUM, &esp); -+ /* This is for xstate. -+ sp -= sizeof (struct _fpstate); */ -+ esp -= I386_LINUX_xstate; -+ /* This is for frame_size. -+ sp -= sizeof (struct rt_sigframe); */ -+ esp -= I386_LINUX_frame_size; -+ if (record_arch_list_add_mem (esp, -+ I386_LINUX_xstate + I386_LINUX_frame_size)) -+ return -1; -+ -+ if (record_arch_list_add_end ()) -+ return -1; -+ -+ return 0; -+} - - - static LONGEST -@@ -529,6 +598,7 @@ - tdep->sc_num_regs = ARRAY_SIZE (i386_linux_sc_reg_offset); - - set_gdbarch_process_record (gdbarch, i386_process_record); -+ set_gdbarch_process_record_signal (gdbarch, i386_linux_record_signal); - - /* Initialize the i386_linux_record_tdep. */ - /* These values are the size of the type that will be used in a system -=================================================================== -RCS file: /cvs/src/src/gdb/amd64-linux-tdep.c,v -retrieving revision 1.29 -retrieving revision 1.29.2.1 -diff -u -r1.29 -r1.29.2.1 ---- src/gdb/amd64-linux-tdep.c 2009/09/15 03:30:04 1.29 -+++ src/gdb/amd64-linux-tdep.c 2009/09/21 06:57:03 1.29.2.1 -@@ -289,16 +289,48 @@ - regcache_cooked_write_unsigned (regcache, AMD64_LINUX_ORIG_RAX_REGNUM, -1); - } - --/* Parse the arguments of current system call instruction and record -- the values of the registers and memory that will be changed into -- "record_arch_list". This instruction is "syscall". -- -- Return -1 if something wrong. */ -+/* Record all registers but IP register for process-record. */ - --static struct linux_record_tdep amd64_linux_record_tdep; -+static int -+amd64_all_but_ip_registers_record (struct regcache *regcache) -+{ -+ if (record_arch_list_add_reg (regcache, AMD64_RAX_REGNUM)) -+ return -1; -+ if (record_arch_list_add_reg (regcache, AMD64_RCX_REGNUM)) -+ return -1; -+ if (record_arch_list_add_reg (regcache, AMD64_RDX_REGNUM)) -+ return -1; -+ if (record_arch_list_add_reg (regcache, AMD64_RBX_REGNUM)) -+ return -1; -+ if (record_arch_list_add_reg (regcache, AMD64_RSP_REGNUM)) -+ return -1; -+ if (record_arch_list_add_reg (regcache, AMD64_RBP_REGNUM)) -+ return -1; -+ if (record_arch_list_add_reg (regcache, AMD64_RSI_REGNUM)) -+ return -1; -+ if (record_arch_list_add_reg (regcache, AMD64_RDI_REGNUM)) -+ return -1; -+ if (record_arch_list_add_reg (regcache, AMD64_R8_REGNUM)) -+ return -1; -+ if (record_arch_list_add_reg (regcache, AMD64_R9_REGNUM)) -+ return -1; -+ if (record_arch_list_add_reg (regcache, AMD64_R10_REGNUM)) -+ return -1; -+ if (record_arch_list_add_reg (regcache, AMD64_R11_REGNUM)) -+ return -1; -+ if (record_arch_list_add_reg (regcache, AMD64_R12_REGNUM)) -+ return -1; -+ if (record_arch_list_add_reg (regcache, AMD64_R13_REGNUM)) -+ return -1; -+ if (record_arch_list_add_reg (regcache, AMD64_R14_REGNUM)) -+ return -1; -+ if (record_arch_list_add_reg (regcache, AMD64_R15_REGNUM)) -+ return -1; -+ if (record_arch_list_add_reg (regcache, AMD64_EFLAGS_REGNUM)) -+ return -1; - --#define RECORD_ARCH_GET_FS 0x1003 --#define RECORD_ARCH_GET_GS 0x1004 -+ return 0; -+} - - /* amd64_canonicalize_syscall maps from the native amd64 Linux set - of syscall ids into a canonical set of syscall ids used by -@@ -1111,6 +1143,17 @@ - } - } - -+/* Parse the arguments of current system call instruction and record -+ the values of the registers and memory that will be changed into -+ "record_arch_list". This instruction is "syscall". -+ -+ Return -1 if something wrong. */ -+ -+static struct linux_record_tdep amd64_linux_record_tdep; -+ -+#define RECORD_ARCH_GET_FS 0x1003 -+#define RECORD_ARCH_GET_GS 0x1004 -+ - static int - amd64_linux_syscall_record (struct regcache *regcache) - { -@@ -1120,27 +1163,39 @@ - - regcache_raw_read_unsigned (regcache, AMD64_RAX_REGNUM, &syscall_native); - -- syscall_gdb = amd64_canonicalize_syscall (syscall_native); -- -- if (syscall_native == amd64_sys_arch_prctl) -+ switch (syscall_native) - { -- ULONGEST arg3; -- -- regcache_raw_read_unsigned (regcache, amd64_linux_record_tdep.arg3, -- &arg3); -- if (arg3 == RECORD_ARCH_GET_FS || arg3 == RECORD_ARCH_GET_GS) -- { -- CORE_ADDR addr; -- -- regcache_raw_read_unsigned (regcache, amd64_linux_record_tdep.arg2, -- &addr); -- if (record_arch_list_add_mem (addr, -- amd64_linux_record_tdep.size_ulong)) -- return -1; -- } -- goto record_regs; -+ case amd64_sys_rt_sigreturn: -+ if (amd64_all_but_ip_registers_record (regcache)) -+ return -1; -+ return 0; -+ break; -+ -+ case amd64_sys_arch_prctl: -+ if (syscall_native == amd64_sys_arch_prctl) -+ { -+ ULONGEST arg3; -+ -+ regcache_raw_read_unsigned (regcache, amd64_linux_record_tdep.arg3, -+ &arg3); -+ if (arg3 == RECORD_ARCH_GET_FS || arg3 == RECORD_ARCH_GET_GS) -+ { -+ CORE_ADDR addr; -+ -+ regcache_raw_read_unsigned (regcache, -+ amd64_linux_record_tdep.arg2, -+ &addr); -+ if (record_arch_list_add_mem (addr, -+ amd64_linux_record_tdep.size_ulong)) -+ return -1; -+ } -+ goto record_regs; -+ } -+ break; - } - -+ syscall_gdb = amd64_canonicalize_syscall (syscall_native); -+ - if (syscall_gdb < 0) - { - printf_unfiltered (_("Process record and replay target doesn't " -@@ -1163,6 +1218,44 @@ - if (record_arch_list_add_reg (regcache, AMD64_R11_REGNUM)) - return -1; - -+ return 0; -+} -+ -+#define AMD64_LINUX_redzone 128 -+#define AMD64_LINUX_xstate 512 -+#define AMD64_LINUX_frame_size 560 -+ -+int -+amd64_linux_record_signal (struct gdbarch *gdbarch, -+ struct regcache *regcache, -+ enum target_signal signal) -+{ -+ ULONGEST rsp; -+ -+ if (amd64_all_but_ip_registers_record (regcache)) -+ return -1; -+ -+ if (record_arch_list_add_reg (regcache, AMD64_RIP_REGNUM)) -+ return -1; -+ -+ /* Record the change in the stack. */ -+ regcache_raw_read_unsigned (regcache, AMD64_RSP_REGNUM, &rsp); -+ /* redzone -+ sp -= 128; */ -+ rsp -= AMD64_LINUX_redzone; -+ /* This is for xstate. -+ sp -= sizeof (struct _fpstate); */ -+ rsp -= AMD64_LINUX_xstate; -+ /* This is for frame_size. -+ sp -= sizeof (struct rt_sigframe); */ -+ rsp -= AMD64_LINUX_frame_size; -+ if (record_arch_list_add_mem (rsp, AMD64_LINUX_redzone -+ + AMD64_LINUX_xstate -+ + AMD64_LINUX_frame_size)) -+ return -1; -+ -+ if (record_arch_list_add_end ()) -+ return -1; - - return 0; - } -@@ -1218,6 +1311,7 @@ - set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type); - - set_gdbarch_process_record (gdbarch, i386_process_record); -+ set_gdbarch_process_record_signal (gdbarch, amd64_linux_record_signal); - - /* Initialize the amd64_linux_record_tdep. */ - /* These values are the size of the type that will be used in a system -=================================================================== -RCS file: /cvs/src/src/gdb/ChangeLog,v -retrieving revision 1.10874.2.12 -retrieving revision 1.10874.2.13 -diff -u -r1.10874.2.12 -r1.10874.2.13 ---- src/gdb/ChangeLog 2009/09/21 06:57:02 1.10874.2.12 -+++ src/gdb/ChangeLog 2009/09/21 10:19:59 1.10874.2.13 -@@ -1,3 +1,8 @@ -+2009-09-21 Phil Muldoon -+ -+ * python/py-value.c (valpy_getitem): Test value before allowing -+ subscript operation. -+ - 2009-09-21 Hui Zhu - Michael Snyder - -=================================================================== -RCS file: /cvs/src/src/gdb/python/py-value.c,v -retrieving revision 1.1 -retrieving revision 1.1.2.1 -diff -u -r1.1 -r1.1.2.1 ---- src/gdb/python/py-value.c 2009/09/09 17:45:40 1.1 -+++ src/gdb/python/py-value.c 2009/09/21 10:20:00 1.1.2.1 -@@ -324,7 +324,18 @@ - type. */ - struct value *idx = convert_value_from_python (key); - if (idx != NULL) -- res_val = value_subscript (tmp, value_as_long (idx)); -+ { -+ /* Check the value's type is something that can be accessed via -+ a subscript. */ -+ struct type *type; -+ tmp = coerce_ref (tmp); -+ type = check_typedef (value_type (tmp)); -+ if (TYPE_CODE (type) != TYPE_CODE_ARRAY -+ && TYPE_CODE (type) != TYPE_CODE_PTR) -+ error( _("Cannot subscript requested type")); -+ else -+ res_val = value_subscript (tmp, value_as_long (idx)); -+ } - } - } - -=================================================================== -RCS file: /cvs/src/src/gdb/testsuite/ChangeLog,v -retrieving revision 1.1960 -retrieving revision 1.1960.2.1 -diff -u -r1.1960 -r1.1960.2.1 ---- src/gdb/testsuite/ChangeLog 2009/09/15 18:51:25 1.1960 -+++ src/gdb/testsuite/ChangeLog 2009/09/21 10:20:00 1.1960.2.1 -@@ -1,3 +1,10 @@ -+2009-09-21 Phil Muldoon -+ -+ * gdb.python/py-value.exp (test_subscript_regression): New -+ function. Test for invalid subscripts. -+ * gdb.python/py-value.c (main): Add test array, and pointer to it. -+ (ptr_ref): New function. -+ - 2009-09-15 Tom Tromey - - * lib/mi-support.exp (mi_create_varobj): Update. -=================================================================== -RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-value.c,v -retrieving revision 1.1 -retrieving revision 1.1.2.1 -diff -u -r1.1 -r1.1.2.1 ---- src/gdb/testsuite/gdb.python/py-value.c 2009/09/09 17:45:42 1.1 -+++ src/gdb/testsuite/gdb.python/py-value.c 2009/09/21 10:20:00 1.1.2.1 -@@ -37,6 +37,13 @@ - - enum e evalue = TWO; - -+#ifdef __cplusplus -+void ptr_ref(int*& rptr_int) -+{ -+ return; /* break to inspect pointer by reference. */ -+} -+#endif -+ - int - main (int argc, char *argv[]) - { -@@ -46,10 +53,18 @@ - PTR x = &s; - char st[17] = "divide et impera"; - char nullst[17] = "divide\0et\0impera"; -+ int a[3] = {1,2,3}; -+ int *p = a; -+ int i = 2; -+ int *ptr_i = &i; - - s.a = 3; - s.b = 5; - u.a = 7; - -+#ifdef __cplusplus -+ ptr_ref(ptr_i); -+#endif -+ - return 0; /* break to inspect struct and union */ - } -=================================================================== -RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-value.exp,v -retrieving revision 1.1 -retrieving revision 1.1.2.1 -diff -u -r1.1 -r1.1.2.1 ---- src/gdb/testsuite/gdb.python/py-value.exp 2009/09/09 17:45:42 1.1 -+++ src/gdb/testsuite/gdb.python/py-value.exp 2009/09/21 10:20:00 1.1.2.1 -@@ -292,6 +292,75 @@ - "print value's type" - } - -+# Regression test for invalid subscript operations. The bug was that -+# the type of the value was not being checked before allowing a -+# subscript operation to proceed. -+ -+proc test_subscript_regression {lang} { -+ -+ global srcdir subdir srcfile binfile testfile hex -+ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "debug $lang"] != "" } { -+ untested "Couldn't compile ${srcfile} in $lang mode" -+ return -1 -+ } -+ -+ # Start with a fresh gdb. -+ gdb_exit -+ gdb_start -+ gdb_reinitialize_dir $srcdir/$subdir -+ gdb_load ${binfile} -+ -+ if ![runto_main ] then { -+ perror "couldn't run to breakpoint" -+ return -+ } -+ -+ if {$lang == "c++"} { -+ gdb_breakpoint [gdb_get_line_number "break to inspect pointer by reference"] -+ gdb_continue_to_breakpoint "break to inspect pointer by reference" -+ -+ gdb_py_test_silent_cmd "print rptr_int" \ -+ "Obtain address" 1 -+ gdb_py_test_silent_cmd "python rptr = gdb.history(0)" \ -+ "Obtains value from GDB" 1 -+ gdb_test "python print rptr\[0\]" "2" "Check pointer passed as reference" -+ } -+ -+ gdb_breakpoint [gdb_get_line_number "break to inspect struct and union"] -+ gdb_continue_to_breakpoint "break to inspect struct and union" -+ -+ gdb_py_test_silent_cmd "python intv = gdb.Value(1)" \ -+ "Create a value for subscript test" 1 -+ gdb_py_test_silent_cmd "python stringv = gdb.Value(\"foo\")" \ -+ "Create a value for subscript test" 1 -+ -+ # Try to access an int with a subscript. This should fail. -+ gdb_test "python print intv" "1" "Baseline print of a Python value" -+ gdb_test "python print intv\[0\]" "RuntimeError: Cannot subscript requested type.*" \ -+ "Attempt to access an integer with a subscript" -+ -+ # Try to access a string with a subscript. This should pass. -+ gdb_test "python print stringv" "foo." "Baseline print of a Python value" -+ gdb_test "python print stringv\[0\]" "f." "Attempt to access a string with a subscript" -+ -+ # Try to access an int array via a pointer with a subscript. This should pass. -+ gdb_py_test_silent_cmd "print p" "Build pointer to array" 1 -+ gdb_py_test_silent_cmd "python pointer = gdb.history(0)" "" 1 -+ gdb_test "python print pointer\[0\]" "1" "Access array via pointer with int subscript" -+ gdb_test "python print pointer\[intv\]" "2" "Access array via pointer with value subscript" -+ -+ # Try to access a single dimension array with a subscript to the -+ # result. This should fail. -+ gdb_test "python print pointer\[intv\]\[0\]" "RuntimeError: Cannot subscript requested type.*" \ -+ "Attempt to access an integer with a subscript" -+ -+ # Lastly, test subscript access to an array with multiple -+ # dimensions. This should pass. -+ gdb_py_test_silent_cmd "print {\"fu \",\"foo\",\"bar\"}" "Build array" 1 -+ gdb_py_test_silent_cmd "python marray = gdb.history(0)" "" 1 -+ gdb_test "python print marray\[1\]\[2\]" "o." "Test multiple subscript" -+} -+ - # Start with a fresh gdb. - - gdb_exit -@@ -322,3 +391,8 @@ - - test_value_in_inferior - test_value_after_death -+ -+# The following test recompiles the binary to test either C or C++ -+# values. -+test_subscript_regression "c++" -+test_subscript_regression "c" -=================================================================== -RCS file: /cvs/src/src/gdb/ChangeLog,v -retrieving revision 1.10874.2.13 -retrieving revision 1.10874.2.14 -diff -u -r1.10874.2.13 -r1.10874.2.14 ---- src/gdb/ChangeLog 2009/09/21 10:19:59 1.10874.2.13 -+++ src/gdb/ChangeLog 2009/09/21 10:25:29 1.10874.2.14 -@@ -1,5 +1,12 @@ - 2009-09-21 Phil Muldoon - -+ PR python/10633 -+ -+ * c-lang.c (c_printstr): Do not loop past options->print_max when -+ iterating with wchar_iterate. -+ -+2009-09-21 Phil Muldoon -+ - * python/py-value.c (valpy_getitem): Test value before allowing - subscript operation. - -=================================================================== -RCS file: /cvs/src/src/gdb/c-lang.c,v -retrieving revision 1.75 -retrieving revision 1.75.4.1 -diff -u -r1.75 -r1.75.4.1 ---- src/gdb/c-lang.c 2009/07/10 10:35:16 1.75 -+++ src/gdb/c-lang.c 2009/09/21 10:25:29 1.75.4.1 -@@ -459,7 +459,7 @@ - single character in isolation. This makes the code simpler - and probably does the sensible thing in the majority of - cases. */ -- while (num_chars == 1) -+ while (num_chars == 1 && things_printed < options->print_max) - { - /* Count the number of repetitions. */ - unsigned int reps = 0; -=================================================================== -RCS file: /cvs/src/src/gdb/testsuite/ChangeLog,v -retrieving revision 1.1960.2.1 -retrieving revision 1.1960.2.2 -diff -u -r1.1960.2.1 -r1.1960.2.2 ---- src/gdb/testsuite/ChangeLog 2009/09/21 10:20:00 1.1960.2.1 -+++ src/gdb/testsuite/ChangeLog 2009/09/21 10:25:29 1.1960.2.2 -@@ -1,5 +1,13 @@ - 2009-09-21 Phil Muldoon - -+ PR python/10633 -+ -+ * gdb.python/py-prettyprint.exp (gdb_py_test_silent_cmd): New -+ Function. -+ (run_lang_tests): Add print elements test. -+ -+2009-09-21 Phil Muldoon -+ - * gdb.python/py-value.exp (test_subscript_regression): New - function. Test for invalid subscripts. - * gdb.python/py-value.c (main): Add test array, and pointer to it. -=================================================================== -RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-prettyprint.exp,v -retrieving revision 1.1 -retrieving revision 1.1.2.1 -diff -u -r1.1 -r1.1.2.1 ---- src/gdb/testsuite/gdb.python/py-prettyprint.exp 2009/09/09 17:45:42 1.1 -+++ src/gdb/testsuite/gdb.python/py-prettyprint.exp 2009/09/21 10:25:30 1.1.2.1 -@@ -35,6 +35,17 @@ - -re "$gdb_prompt $" {} - } - -+# Run a command in GDB, and report a failure if a Python exception is thrown. -+# If report_pass is true, report a pass if no exception is thrown. -+proc gdb_py_test_silent_cmd {cmd name report_pass} { -+ global gdb_prompt -+ -+ gdb_test_multiple $cmd $name { -+ -re "Traceback.*$gdb_prompt $" { fail $name } -+ -re "$gdb_prompt $" { if $report_pass { pass $name } } -+ } -+} -+ - proc run_lang_tests {lang} { - global srcdir subdir srcfile binfile testfile hex - if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "debug $lang"] != "" } { -@@ -79,6 +90,11 @@ - gdb_test "print derived" \ - " = \{.* = pp class name: Vbase1.* = \{.* = pp value variable is: 1,.*members of Vbase2:.*_vptr.Vbase2 = $hex.* = \{.*members of Vbase3.*members of Derived:.*value = 2.*" - gdb_test "print ns " "\"embedded\\\\000null\\\\000string\"" -+ gdb_py_test_silent_cmd "set print elements 3" "" 1 -+ gdb_test "print ns" "emb\.\.\.." -+ gdb_py_test_silent_cmd "set print elements 10" "" 1 -+ gdb_test "print ns" "embedded\\\\000n\.\.\.." -+ gdb_py_test_silent_cmd "set print elements 200" "" 1 - } - - gdb_test "print x" " = $hex \"this is x\"" diff --git a/gdb-archer.patch b/gdb-archer.patch index 6235b9f..1406ab8 100644 --- a/gdb-archer.patch +++ b/gdb-archer.patch @@ -2,7 +2,7 @@ http://sourceware.org/gdb/wiki/ProjectArcher http://sourceware.org/gdb/wiki/ArcherBranchManagement GIT snapshot: -commit 0d5c38dd89050c0ee1cf049656f177c170d675d4 +commit 4338ea85c798007c32594032f602db9fd230eba9 branch `archer' - the merge of branches: archer-tromey-call-frame-cfa @@ -3557,19 +3557,26 @@ index d2d8f2e..af0ba28 100644 if (sym != NULL) return sym; diff --git a/gdb/cp-support.c b/gdb/cp-support.c -index f12d785..ca10007 100644 +index f12d785..23b34c1 100644 --- a/gdb/cp-support.c +++ b/gdb/cp-support.c -@@ -70,6 +70,21 @@ struct cmd_list_element *maint_cplus_cmd_list = NULL; +@@ -32,6 +32,9 @@ + #include "block.h" + #include "complaints.h" + #include "gdbtypes.h" ++#include "exceptions.h" ++#include "expression.h" ++#include "value.h" + + #include "safe-ctype.h" + +@@ -70,6 +73,18 @@ struct cmd_list_element *maint_cplus_cmd_list = NULL; static void maint_cplus_command (char *arg, int from_tty); static void first_component_command (char *arg, int from_tty); -+/* Operator validation. This is used by cp_validate_opeartor, -+ which is in turn used by both the expression parser (clex) -+ and decode_line (decode_compound, actually). -+ ++/* Operator validation. + NOTE: Multi-byte operators (usually the assignment variety operator) -+ must appear before the single byte version, i.e., "+=" before "+". */ ++ must appear before the single byte version, i.e., "+=" before "+". */ +static const char *operator_tokens[] = + { + "++", "+=", "+", "->*", "->", "--", "-=", "-", "*=", "*", "/=", "/", @@ -3604,7 +3611,7 @@ index f12d785..ca10007 100644 != NULL)) psymtab_to_symtab (ps); } -@@ -909,6 +925,72 @@ first_component_command (char *arg, int from_tty) +@@ -909,6 +925,107 @@ first_component_command (char *arg, int from_tty) extern initialize_file_ftype _initialize_cp_support; /* -Wmissing-prototypes */ @@ -3617,18 +3624,23 @@ index f12d785..ca10007 100644 + while (0) + +/* Returns the length of the operator name or 0 if INPUT does not -+ point to a valid C++ operator. INPUT should start with "operator". */ ++ point to a valid C++ operator. INPUT should start with "operator". */ +int +cp_validate_operator (const char *input) +{ + int i; -+ const char *p = input; -+ int valid = 0; ++ char *copy; ++ const char *p; ++ struct expression *expr; ++ struct value *val; ++ struct gdb_exception except; ++ struct cleanup *old_chain; ++ ++ p = input; + -+ /* Most callers appear to do this already, but since this is not -+ really time-critical code, it is double-checked here. */ + if (strncmp (p, "operator", 8) == 0) + { ++ int valid = 0; + p += 8; + + SKIP_SPACE (p); @@ -3637,7 +3649,7 @@ index f12d785..ca10007 100644 + { + int length = strlen (operator_tokens[i]); + /* By using strncmp here, we MUST have operator_tokens ordered! -+ See additional notes where operator_tokens is defined above. */ ++ See additional notes where operator_tokens is defined above. */ + if (strncmp (p, operator_tokens[i], length) == 0) + { + const char *op = p; @@ -3648,8 +3660,8 @@ index f12d785..ca10007 100644 + || strncmp (op, "delete", 6) == 0) + { + -+ /* Special case: new[] and delete[]. We must be careful -+ to swallow whitespace before/in "[]".*/ ++ /* Special case: new[] and delete[]. We must be careful ++ to swallow whitespace before/in "[]". */ + SKIP_SPACE (p); + + if (*p == '[') @@ -3663,15 +3675,45 @@ index f12d785..ca10007 100644 + } + } + -+ break; ++ if (valid) ++ return (p - input); + } + } + -+ if (!valid) -+ p = input; ++ /* Check input for a conversion operator. */ ++ ++ /* Skip past base typename */ ++ while (*p != '*' && *p != '&' && *p != 0 && *p != ' ') ++ ++p; ++ SKIP_SPACE (p); ++ ++ /* Add modifiers '*'/'&' */ ++ while (*p == '*' || *p == '&') ++ { ++ ++p; ++ SKIP_SPACE (p); ++ } ++ ++ /* Check for valid type. [Remember: input starts with ++ "operator".] */ ++ copy = savestring (input + 8, p - input - 8); ++ expr = NULL; ++ val = NULL; ++ TRY_CATCH (except, RETURN_MASK_ALL) ++ { ++ expr = parse_expression (copy); ++ val = evaluate_type (expr); ++ } ++ ++ xfree (copy); ++ if (expr) ++ xfree (expr); ++ ++ if (val != NULL && value_type (val) != NULL) ++ return (p - input); + } + -+ return (p - input); ++ return 0; +} + void @@ -4921,7 +4963,7 @@ index 0bfcfca..01018d6 100644 #endif /* dwarf2loc.h */ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c -index 4cce36b..d394887 100644 +index 4cce36b..c2f5f23 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -48,6 +48,12 @@ @@ -4930,8 +4972,8 @@ index 4cce36b..d394887 100644 #include "addrmap.h" +#include "f-lang.h" +#include "c-lang.h" -+#include "jv-lang.h" +#include "typeprint.h" ++#include "jv-lang.h" +#include "vec.h" +#include "block.h" @@ -5023,20 +5065,18 @@ index 4cce36b..d394887 100644 static void dwarf2_read_abbrevs (bfd *abfd, struct dwarf2_cu *cu); static void dwarf2_free_abbrev_table (void *); -@@ -945,8 +978,13 @@ static struct type *tag_type_to_type (struct die_info *, struct dwarf2_cu *); +@@ -945,6 +978,11 @@ static struct type *tag_type_to_type (struct die_info *, struct dwarf2_cu *); static struct type *read_type_die (struct die_info *, struct dwarf2_cu *); ++static char *physname_prefix (struct die_info *die, struct dwarf2_cu *); ++ +static void physname_prefix_1 (struct ui_file *, struct die_info *, + struct dwarf2_cu *); + static char *determine_prefix (struct die_info *die, struct dwarf2_cu *); -+static char *physname_prefix (struct die_info *die, struct dwarf2_cu *); -+ static char *typename_concat (struct obstack *, - const char *prefix, - const char *suffix, @@ -964,7 +1002,8 @@ static int dwarf2_ranges_read (unsigned, CORE_ADDR *, CORE_ADDR *, struct dwarf2_cu *, struct partial_symtab *); @@ -5076,16 +5116,18 @@ index 4cce36b..d394887 100644 static const char *namespace_name (struct die_info *die, int *is_anonymous, struct dwarf2_cu *); -@@ -1034,6 +1081,9 @@ static void process_die (struct die_info *, struct dwarf2_cu *); +@@ -1032,7 +1079,10 @@ static gdb_byte *read_full_die (const struct die_reader_specs *reader, - static char *dwarf2_linkage_name (struct die_info *, struct dwarf2_cu *); + static void process_die (struct die_info *, struct dwarf2_cu *); +-static char *dwarf2_linkage_name (struct die_info *, struct dwarf2_cu *); ++static char *dwarf2_physname (struct die_info *, struct dwarf2_cu *); ++ +static char *fortran_module_linkage_name (struct die_info *die, + struct dwarf2_cu *cu); -+ + static char *dwarf2_canonicalize_name (char *, struct dwarf2_cu *, struct obstack *); - @@ -1076,7 +1126,7 @@ static int is_ref_attr (struct attribute *); static unsigned int dwarf2_get_ref_die_offset (struct attribute *); @@ -5536,7 +5578,7 @@ index 4cce36b..d394887 100644 case DW_TAG_class_type: case DW_TAG_interface_type: case DW_TAG_structure_type: -@@ -2532,22 +2819,6 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) +@@ -2532,34 +2819,17 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) break; } @@ -5559,8 +5601,12 @@ index 4cce36b..d394887 100644 if (built_actual_name) xfree (actual_name); } -@@ -2557,9 +2828,9 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) - name listed in the die. */ + +-/* Determine whether a die of type TAG living in a C++ class or +- namespace needs to have the name of the scope prepended to the +- name listed in the die. */ ++/* Determine whether DIE needs to have the name of the scope prepended ++ to the name listed in the die. */ static int -pdi_needs_namespace (enum dwarf_tag tag) @@ -5571,7 +5617,7 @@ index 4cce36b..d394887 100644 { case DW_TAG_namespace: case DW_TAG_typedef: -@@ -2569,7 +2840,23 @@ pdi_needs_namespace (enum dwarf_tag tag) +@@ -2569,7 +2839,23 @@ pdi_needs_namespace (enum dwarf_tag tag) case DW_TAG_union_type: case DW_TAG_enumeration_type: case DW_TAG_enumerator: @@ -5595,7 +5641,7 @@ index 4cce36b..d394887 100644 default: return 0; } -@@ -2602,12 +2889,12 @@ static void +@@ -2602,12 +2888,12 @@ static void add_partial_module (struct partial_die_info *pdi, CORE_ADDR *lowpc, CORE_ADDR *highpc, int need_pc, struct dwarf2_cu *cu) { @@ -5612,7 +5658,7 @@ index 4cce36b..d394887 100644 } /* Read a partial die corresponding to a subprogram and create a partial -@@ -2698,27 +2985,6 @@ guess_structure_name (struct partial_die_info *struct_pdi, +@@ -2698,27 +2984,6 @@ guess_structure_name (struct partial_die_info *struct_pdi, if (real_pdi->die_parent != NULL) return; @@ -5640,7 +5686,7 @@ index 4cce36b..d394887 100644 } } -@@ -3295,6 +3561,14 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) +@@ -3295,6 +3560,14 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) case DW_TAG_imported_declaration: case DW_TAG_imported_module: processing_has_namespace_info = 1; @@ -5655,7 +5701,7 @@ index 4cce36b..d394887 100644 if (die->child != NULL && (die->tag == DW_TAG_imported_declaration || cu->language != language_fortran)) complaint (&symfile_complaints, _("Tag '%s' has unexpected children"), -@@ -3310,41 +3584,68 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) +@@ -3310,41 +3583,68 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) /* Return the fully qualified name of DIE, based on its DW_AT_name. If scope qualifiers are appropriate they will be added. The result will be allocated on the objfile_obstack, or NULL if the DIE does @@ -5745,7 +5791,7 @@ index 4cce36b..d394887 100644 /* Read the import statement specified by the given die and record it. */ static void -@@ -3354,9 +3655,15 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) +@@ -3354,9 +3654,15 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) struct die_info *imported_die; const char *imported_name; const char *imported_name_prefix; @@ -5763,7 +5809,7 @@ index 4cce36b..d394887 100644 import_attr = dwarf2_attr (die, DW_AT_import, cu); if (import_attr == NULL) { -@@ -3404,17 +3711,27 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) +@@ -3404,17 +3710,27 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) return; } @@ -5797,7 +5843,7 @@ index 4cce36b..d394887 100644 canonical_name = alloca (strlen (imported_name_prefix) + 2 + strlen (imported_name) + 1); strcpy (canonical_name, imported_name_prefix); strcat (canonical_name, "::"); -@@ -3425,8 +3742,14 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) +@@ -3425,8 +3741,14 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu) canonical_name = alloca (strlen (imported_name) + 1); strcpy (canonical_name, imported_name); } @@ -5814,7 +5860,7 @@ index 4cce36b..d394887 100644 } static void -@@ -3695,6 +4018,14 @@ inherit_abstract_dies (struct die_info *die, struct dwarf2_cu *cu) +@@ -3695,6 +4017,14 @@ inherit_abstract_dies (struct die_info *die, struct dwarf2_cu *cu) struct attribute *attr; attr = dwarf2_attr (die, DW_AT_abstract_origin, cu); @@ -5829,7 +5875,7 @@ index 4cce36b..d394887 100644 if (!attr) return; -@@ -3793,6 +4124,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3793,6 +4123,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) char *name; CORE_ADDR baseaddr; struct block *block; @@ -5837,7 +5883,7 @@ index 4cce36b..d394887 100644 int inlined_func = (die->tag == DW_TAG_inlined_subroutine); if (inlined_func) -@@ -3811,13 +4143,23 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3811,13 +4142,23 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); @@ -5864,7 +5910,7 @@ index 4cce36b..d394887 100644 lowpc += baseaddr; highpc += baseaddr; -@@ -3844,14 +4186,19 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3844,14 +4185,19 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) cu->list_in_scope = &local_symbols; @@ -5891,7 +5937,7 @@ index 4cce36b..d394887 100644 } inherit_abstract_dies (die, cu); -@@ -3867,6 +4214,13 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3867,6 +4213,13 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) determine_prefix (die, cu), processing_has_namespace_info); @@ -5905,7 +5951,7 @@ index 4cce36b..d394887 100644 /* If we have address ranges, record them. */ dwarf2_record_block_ranges (die, block, baseaddr, cu); -@@ -3903,7 +4257,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3903,7 +4256,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) as multiple lexical blocks? Handling children in a sane way would be nasty. Might be easier to properly extend generic blocks to describe ranges. */ @@ -5914,7 +5960,7 @@ index 4cce36b..d394887 100644 return; lowpc += baseaddr; highpc += baseaddr; -@@ -3920,7 +4274,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -3920,7 +4273,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) } new = pop_context (); @@ -5923,7 +5969,7 @@ index 4cce36b..d394887 100644 { struct block *block = finish_block (0, &local_symbols, new->old_blocks, new->start_addr, -@@ -4075,7 +4429,8 @@ dwarf2_ranges_read (unsigned offset, CORE_ADDR *low_return, +@@ -4075,7 +4428,8 @@ dwarf2_ranges_read (unsigned offset, CORE_ADDR *low_return, discontinuous, i.e. derived from DW_AT_ranges information. */ static int dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc, @@ -5933,7 +5979,7 @@ index 4cce36b..d394887 100644 { struct attribute *attr; CORE_ADDR low = 0; -@@ -4103,7 +4458,7 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc, +@@ -4103,7 +4457,7 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc, { /* Value of the DW_AT_ranges attribute is the offset in the .debug_ranges section. */ @@ -5942,7 +5988,7 @@ index 4cce36b..d394887 100644 return 0; /* Found discontinuous range of addresses. */ ret = -1; -@@ -4142,7 +4497,7 @@ dwarf2_get_subprogram_pc_bounds (struct die_info *die, +@@ -4142,7 +4496,7 @@ dwarf2_get_subprogram_pc_bounds (struct die_info *die, CORE_ADDR low, high; struct die_info *child = die->child; @@ -5951,7 +5997,7 @@ index 4cce36b..d394887 100644 { *lowpc = min (*lowpc, low); *highpc = max (*highpc, high); -@@ -4179,7 +4534,7 @@ get_scope_pc_bounds (struct die_info *die, +@@ -4179,7 +4533,7 @@ get_scope_pc_bounds (struct die_info *die, CORE_ADDR best_high = (CORE_ADDR) 0; CORE_ADDR current_low, current_high; @@ -5960,7 +6006,25 @@ index 4cce36b..d394887 100644 { best_low = current_low; best_high = current_high; -@@ -4661,7 +5016,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, +@@ -4474,7 +4828,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, + return; + + /* Get physical name. */ +- physname = dwarf2_linkage_name (die, cu); ++ physname = dwarf2_physname (die, cu); + + /* The name is already allocated along with this objfile, so we don't + need to duplicate it for the type. */ +@@ -4617,7 +4971,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, + return; + + /* Get the mangled name. */ +- physname = dwarf2_linkage_name (die, cu); ++ physname = dwarf2_physname (die, cu); + + /* Look up member function name in fieldlist. */ + for (i = 0; i < fip->nfnfields; i++) +@@ -4661,7 +5015,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, /* The name is already allocated along with this objfile, so we don't need to duplicate it for the type. */ fnp->physname = physname ? physname : ""; @@ -5969,7 +6033,7 @@ index 4cce36b..d394887 100644 this_type = read_type_die (die, cu); if (this_type && TYPE_CODE (this_type) == TYPE_CODE_FUNC) { -@@ -4721,18 +5076,18 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, +@@ -4721,18 +5075,18 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, { /* Support the .debug_loc offsets */ if (attr_form_is_block (attr)) @@ -5995,7 +6059,7 @@ index 4cce36b..d394887 100644 } } -@@ -4845,7 +5200,7 @@ quirk_gcc_member_function_pointer (struct die_info *die, struct dwarf2_cu *cu) +@@ -4845,7 +5199,7 @@ quirk_gcc_member_function_pointer (struct die_info *die, struct dwarf2_cu *cu) return NULL; domain_type = TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (pfn_type, 0)); @@ -6004,7 +6068,7 @@ index 4cce36b..d394887 100644 smash_to_method_type (type, domain_type, TYPE_TARGET_TYPE (pfn_type), TYPE_FIELDS (pfn_type), TYPE_NFIELDS (pfn_type), TYPE_VARARGS (pfn_type)); -@@ -4898,7 +5253,7 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -4898,7 +5252,7 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) return set_die_type (die, type, cu); } @@ -6013,7 +6077,7 @@ index 4cce36b..d394887 100644 INIT_CPLUS_SPECIFIC (type); name = dwarf2_name (die, cu); -@@ -4907,14 +5262,18 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -4907,14 +5261,18 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) if (cu->language == language_cplus || cu->language == language_java) { @@ -6035,7 +6099,7 @@ index 4cce36b..d394887 100644 } } -@@ -5124,7 +5483,7 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5124,7 +5482,7 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu) return set_die_type (die, type, cu); } @@ -6044,7 +6108,7 @@ index 4cce36b..d394887 100644 TYPE_CODE (type) = TYPE_CODE_ENUM; name = dwarf2_full_name (die, cu); -@@ -5152,51 +5511,6 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5152,51 +5510,6 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu) return set_die_type (die, type, cu); } @@ -6096,7 +6160,7 @@ index 4cce36b..d394887 100644 /* Given a pointer to a die which begins an enumeration, process all the dies that define the members of the enumeration, and create the symbol for the enumeration type. -@@ -5274,6 +5588,29 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -5274,6 +5587,29 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu) new_symbol (die, this_type, cu); } @@ -6126,7 +6190,7 @@ index 4cce36b..d394887 100644 /* Extract all information from a DW_TAG_array_type DIE and put it in the DIE's type field. For now, this only handles one dimensional arrays. */ -@@ -5287,7 +5624,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5287,7 +5623,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) struct type *element_type, *range_type, *index_type; struct type **range_types = NULL; struct attribute *attr; @@ -6135,7 +6199,7 @@ index 4cce36b..d394887 100644 struct cleanup *back_to; char *name; -@@ -5334,16 +5671,11 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5334,16 +5670,11 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) type = element_type; if (read_array_order (die, cu) == DW_ORD_col_major) @@ -6157,7 +6221,7 @@ index 4cce36b..d394887 100644 /* Understand Dwarf2 support for vector types (like they occur on the PowerPC w/ AltiVec). Gcc just adds another attribute to the -@@ -5410,12 +5742,14 @@ read_set_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5410,12 +5741,14 @@ read_set_type (struct die_info *die, struct dwarf2_cu *cu) return set_die_type (die, set_type, cu); } @@ -6174,7 +6238,7 @@ index 4cce36b..d394887 100644 struct attribute *attr; struct symbol *sym; CORE_ADDR base = (CORE_ADDR) 0; -@@ -5425,25 +5759,55 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu) +@@ -5425,25 +5758,55 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu) { /* Support the .debug_loc offsets */ if (attr_form_is_block (attr)) @@ -6237,7 +6301,7 @@ index 4cce36b..d394887 100644 attr = dwarf2_attr (child_die, DW_AT_data_member_location, cu); if (attr) { -@@ -5461,8 +5825,25 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu) +@@ -5461,8 +5824,25 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu) SYMBOL_VALUE_ADDRESS (sym) = base + byte_offset; add_symbol_to_list (sym, &global_symbols); } @@ -6263,7 +6327,7 @@ index 4cce36b..d394887 100644 } } -@@ -5530,7 +5911,7 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) +@@ -5530,7 +5910,7 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) if (is_anonymous) { const char *previous_prefix = determine_prefix (die, cu); @@ -6272,7 +6336,7 @@ index 4cce36b..d394887 100644 } } -@@ -5546,20 +5927,155 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) +@@ -5546,20 +5926,155 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu) } } @@ -6312,18 +6376,18 @@ index 4cce36b..d394887 100644 + + if (die_is_declaration (die, cu)) + return NULL; -+ + +- /* FIXME: Support the separate Fortran module namespaces. */ + module_name = dwarf2_name (die, cu); + if (!module_name) + complaint (&symfile_complaints, _("DW_TAG_module has no name, offset 0x%x"), + die->offset); + type = init_type (TYPE_CODE_MODULE, 0, 0, module_name, objfile); -+ -+ /* Create a context for reading the module variables. */ -- /* FIXME: Support the separate Fortran module namespaces. */ ++ /* Create a context for reading the module variables. */ ++ + new = push_context (0, 0); - ++ + save_file_symbols = file_symbols; + file_symbols = NULL; + save_global_symbols = global_symbols; @@ -6431,7 +6495,7 @@ index 4cce36b..d394887 100644 } /* Return the name of the namespace represented by DIE. Set -@@ -5724,29 +6240,113 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5724,29 +6239,113 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) struct gdbarch *gdbarch = get_objfile_arch (objfile); struct type *type, *range_type, *index_type, *char_type; struct attribute *attr; @@ -6559,7 +6623,7 @@ index 4cce36b..d394887 100644 char_type = language_string_char_type (cu->language_defn, gdbarch); type = create_string_type (NULL, char_type, range_type); -@@ -5841,7 +6441,6 @@ static struct type * +@@ -5841,7 +6440,6 @@ static struct type * read_typedef (struct die_info *die, struct dwarf2_cu *cu) { struct objfile *objfile = cu->objfile; @@ -6567,7 +6631,7 @@ index 4cce36b..d394887 100644 const char *name = NULL; struct type *this_type; -@@ -5949,8 +6548,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5949,8 +6547,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) struct type *base_type; struct type *range_type; struct attribute *attr; @@ -6577,7 +6641,7 @@ index 4cce36b..d394887 100644 char *name; base_type = die_type (die, cu); -@@ -5963,42 +6561,89 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -5963,42 +6560,89 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) 0, NULL, cu->objfile); } @@ -6696,7 +6760,7 @@ index 4cce36b..d394887 100644 name = dwarf2_name (die, cu); if (name) -@@ -6469,6 +7114,7 @@ load_partial_dies (bfd *abfd, gdb_byte *buffer, gdb_byte *info_ptr, +@@ -6469,6 +7113,7 @@ load_partial_dies (bfd *abfd, gdb_byte *buffer, gdb_byte *info_ptr, && abbrev->tag != DW_TAG_lexical_block && abbrev->tag != DW_TAG_variable && abbrev->tag != DW_TAG_namespace @@ -6704,7 +6768,7 @@ index 4cce36b..d394887 100644 && abbrev->tag != DW_TAG_member) { /* Otherwise we skip to the next sibling, if any. */ -@@ -6689,9 +7335,6 @@ read_partial_die (struct partial_die_info *part_die, +@@ -6689,9 +7334,6 @@ read_partial_die (struct partial_die_info *part_die, if (part_die->dirname == NULL) part_die->dirname = DW_STRING (&attr); break; @@ -6714,7 +6778,7 @@ index 4cce36b..d394887 100644 case DW_AT_low_pc: has_low_pc_attr = 1; part_die->lowpc = DW_ADDR (&attr); -@@ -6923,7 +7566,8 @@ fixup_partial_die (struct partial_die_info *part_die, +@@ -6923,7 +7565,8 @@ fixup_partial_die (struct partial_die_info *part_die, /* If we found a reference attribute and the DIE has no name, try to find a name in the referred to DIE. */ @@ -6724,7 +6788,7 @@ index 4cce36b..d394887 100644 { struct partial_die_info *spec_die; -@@ -8265,10 +8909,12 @@ var_decode_location (struct attribute *attr, struct symbol *sym, +@@ -8265,10 +8908,12 @@ var_decode_location (struct attribute *attr, struct symbol *sym, (i.e. when the value of a register or memory location is referenced, or a thread-local block, etc.). Then again, it might not be worthwhile. I'm assuming that it isn't unless performance @@ -6739,7 +6803,7 @@ index 4cce36b..d394887 100644 } /* Given a pointer to a DWARF information entry, figure out if we need -@@ -8290,21 +8936,30 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -8290,21 +8935,30 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); @@ -6766,7 +6830,7 @@ index 4cce36b..d394887 100644 + + /* Cache this symbol's name and the name's demangled form (if any). */ + -+ linkagename = dwarf2_linkage_name (die, cu); ++ linkagename = dwarf2_physname (die, cu); + SYMBOL_SET_NAMES (sym, linkagename, strlen (linkagename), objfile); + if (cu->language == language_fortran) + { @@ -6777,7 +6841,7 @@ index 4cce36b..d394887 100644 /* Default assumptions. Use the passed type or decode it from the die. */ -@@ -8402,9 +9057,28 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -8402,9 +9056,28 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) if (attr) { var_decode_location (attr, sym, cu); @@ -6807,7 +6871,7 @@ index 4cce36b..d394887 100644 else add_symbol_to_list (sym, cu->list_in_scope); } -@@ -8534,7 +9208,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -8534,7 +9207,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) add_symbol_to_list (sym, cu->list_in_scope); break; case DW_TAG_enumerator: @@ -6816,7 +6880,7 @@ index 4cce36b..d394887 100644 attr = dwarf2_attr (die, DW_AT_const_value, cu); if (attr) { -@@ -8558,6 +9232,16 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -8558,6 +9231,16 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) SYMBOL_CLASS (sym) = LOC_TYPEDEF; add_symbol_to_list (sym, &global_symbols); break; @@ -6833,7 +6897,7 @@ index 4cce36b..d394887 100644 default: /* Not a tag we recognize. Hopefully we aren't processing trash data, but since we must specifically ignore things -@@ -8571,8 +9255,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -8571,8 +9254,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) /* For the benefit of old versions of GCC, check for anonymous namespaces based on the demangled name. */ if (!processing_has_namespace_info @@ -6843,7 +6907,7 @@ index 4cce36b..d394887 100644 cp_scan_for_anonymous_namespaces (sym); } return (sym); -@@ -8823,12 +9506,18 @@ read_type_die (struct die_info *die, struct dwarf2_cu *cu) +@@ -8823,12 +9505,18 @@ read_type_die (struct die_info *die, struct dwarf2_cu *cu) case DW_TAG_namespace: this_type = read_namespace_type (die, cu); break; @@ -6862,7 +6926,7 @@ index 4cce36b..d394887 100644 return this_type; } -@@ -8910,10 +9599,97 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu) +@@ -8910,10 +9598,100 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu) So it does not need a prefix. */ return ""; default: @@ -6871,10 +6935,10 @@ index 4cce36b..d394887 100644 } } -+/* Determines the prefix for a symbol's physname. Unlike determine_prefix, ++/* Determines the prefix for a symbol's physname. Unlike determine_prefix, + this method does not simply look at the DIE's immediate parent. + It will compute the symbol's physname by scanning through all parent -+ DIEs until it gets to the compilation unit's DIE. */ ++ DIEs until it gets to the compilation unit's DIE. */ + +static char * +physname_prefix (struct die_info *die, struct dwarf2_cu *cu) @@ -6883,6 +6947,7 @@ index 4cce36b..d394887 100644 + struct ui_file *buf; + struct die_info *d, *spec_die; + struct dwarf2_cu *spec_cu; ++ char *name; + + /* Construct a stack containing all of the DIE's parents. Caution + must be observed for dealing with DW_AT_specification. */ @@ -6904,7 +6969,7 @@ index 4cce36b..d394887 100644 + d = d->parent; + } + -+ /* Now pop all the elements, printing their names as we go */ ++ /* Now pop all the elements, printing their names as we go. */ + buf = mem_fileopen (); + while (!VEC_empty (die_info_p, die_list)) + { @@ -6920,7 +6985,9 @@ index 4cce36b..d394887 100644 + } + } + -+ return ui_file_obsavestring (buf, &cu->objfile->objfile_obstack, &length); ++ name = ui_file_obsavestring (buf, &cu->objfile->objfile_obstack, &length); ++ ui_file_delete (buf); ++ return name; +} + +static void @@ -6961,8 +7028,16 @@ index 4cce36b..d394887 100644 /* Return a newly-allocated string formed by concatenating PREFIX and SUFFIX with appropriate separator. If PREFIX or SUFFIX is NULL or empty, then simply copy the SUFFIX or PREFIX, respectively. If OBS is non-null, -@@ -8969,11 +9745,105 @@ static char * - dwarf2_linkage_name (struct die_info *die, struct dwarf2_cu *cu) +@@ -8963,17 +9741,111 @@ sibling_die (struct die_info *die) + return die->sibling; + } + +-/* Get linkage name of a die, return NULL if not found. */ ++/* Construct a physname for the given DIE in CU. */ + + static char * +-dwarf2_linkage_name (struct die_info *die, struct dwarf2_cu *cu) ++dwarf2_physname (struct die_info *die, struct dwarf2_cu *cu) { struct attribute *attr; + char *name; @@ -7015,11 +7090,7 @@ index 4cce36b..d394887 100644 + fputs_unfiltered (" const", buf); + } + } - -- attr = dwarf2_attr (die, DW_AT_MIPS_linkage_name, cu); -- if (attr && DW_STRING (attr)) -- return DW_STRING (attr); -- return dwarf2_name (die, cu); ++ + name = ui_file_obsavestring (buf, &cu->objfile->objfile_obstack, + &length); + ui_file_delete (buf); @@ -7056,7 +7127,11 @@ index 4cce36b..d394887 100644 + if (module_name) + { + char *retval; -+ + +- attr = dwarf2_attr (die, DW_AT_MIPS_linkage_name, cu); +- if (attr && DW_STRING (attr)) +- return DW_STRING (attr); +- return dwarf2_name (die, cu); + /* `__modulename_MOD_variablename0'. */ + retval = obstack_alloc (&cu->objfile->objfile_obstack, + 2 + strlen (module_name) + 5 + strlen (name) @@ -7071,7 +7146,7 @@ index 4cce36b..d394887 100644 } /* Get name of a die, return NULL if not found. */ -@@ -10200,11 +11070,11 @@ dwarf2_get_ref_die_offset (struct attribute *attr) +@@ -10200,11 +11072,11 @@ dwarf2_get_ref_die_offset (struct attribute *attr) return 0; } @@ -7086,7 +7161,7 @@ index 4cce36b..d394887 100644 { if (attr->form == DW_FORM_sdata) return DW_SND (attr); -@@ -11009,8 +11879,6 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -11009,8 +11881,6 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, { gdb_byte *mac_ptr, *mac_end; struct macro_source_file *current_file = 0; @@ -7095,7 +7170,7 @@ index 4cce36b..d394887 100644 if (dwarf2_per_objfile->macinfo.buffer == NULL) { -@@ -11018,29 +11886,19 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -11018,29 +11888,19 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, return; } @@ -7130,7 +7205,7 @@ index 4cce36b..d394887 100644 } macinfo_type = read_1_byte (abfd, mac_ptr); -@@ -11051,92 +11909,7 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -11051,92 +11911,7 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, /* A zero macinfo type indicates the end of the macro information. */ case 0: @@ -7224,7 +7299,7 @@ index 4cce36b..d394887 100644 case DW_MACINFO_define: case DW_MACINFO_undef: -@@ -11151,31 +11924,19 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -11151,31 +11926,19 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, mac_ptr += bytes_read; if (! current_file) @@ -7267,7 +7342,7 @@ index 4cce36b..d394887 100644 } break; -@@ -11189,22 +11950,9 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -11189,22 +11952,9 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, file = read_unsigned_leb128 (abfd, mac_ptr, &bytes_read); mac_ptr += bytes_read; @@ -7293,7 +7368,7 @@ index 4cce36b..d394887 100644 } break; -@@ -11258,7 +12006,7 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, +@@ -11258,7 +12008,7 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset, } break; } @@ -7302,7 +7377,7 @@ index 4cce36b..d394887 100644 } /* Check if the attribute's form is a DW_FORM_block* -@@ -11318,6 +12066,34 @@ attr_form_is_constant (struct attribute *attr) +@@ -11318,6 +12068,34 @@ attr_form_is_constant (struct attribute *attr) } } @@ -7337,7 +7412,7 @@ index 4cce36b..d394887 100644 static void dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, struct dwarf2_cu *cu) -@@ -11347,35 +12123,25 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, +@@ -11347,35 +12125,25 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, SYMBOL_COMPUTED_OPS (sym) = &dwarf2_loclist_funcs; SYMBOL_LOCATION_BATON (sym) = baton; } @@ -7388,7 +7463,7 @@ index 4cce36b..d394887 100644 } } -@@ -11663,6 +12429,31 @@ offset_and_type_eq (const void *item_lhs, const void *item_rhs) +@@ -11663,6 +12431,31 @@ offset_and_type_eq (const void *item_lhs, const void *item_rhs) return ofs_lhs->offset == ofs_rhs->offset; } @@ -7420,7 +7495,7 @@ index 4cce36b..d394887 100644 /* Set the type associated with DIE to TYPE. Save it in CU's hash table if necessary. For convenience, return TYPE. */ -@@ -11671,6 +12462,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -11671,6 +12464,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) { struct dwarf2_offset_and_type **slot, ofs; @@ -7429,7 +7504,7 @@ index 4cce36b..d394887 100644 if (cu->type_hash == NULL) { gdb_assert (cu->per_cu != NULL); -@@ -11813,23 +12606,13 @@ show_dwarf2_cmd (char *args, int from_tty) +@@ -11813,23 +12608,13 @@ show_dwarf2_cmd (char *args, int from_tty) cmd_show_list (show_dwarf2_cmdlist, from_tty, ""); } @@ -7457,7 +7532,7 @@ index 4cce36b..d394887 100644 } /* munmap debug sections for OBJFILE, if necessary. */ -@@ -11838,15 +12621,15 @@ static void +@@ -11838,15 +12623,15 @@ static void dwarf2_per_objfile_free (struct objfile *objfile, void *d) { struct dwarf2_per_objfile *data = d; @@ -7482,7 +7557,7 @@ index 4cce36b..d394887 100644 } void _initialize_dwarf2_read (void); -@@ -11854,6 +12637,7 @@ void _initialize_dwarf2_read (void); +@@ -11854,6 +12639,7 @@ void _initialize_dwarf2_read (void); void _initialize_dwarf2_read (void) { @@ -7523,7 +7598,7 @@ index 6e79d4a..198bae3 100644 default_symfile_offsets, /* sym_offsets: Translate ext. to int. relocation */ elf_symfile_segments, /* sym_segments: Get segment information from diff --git a/gdb/eval.c b/gdb/eval.c -index 7e41d39..37ffe23 100644 +index 2926465..4c6de78 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -39,8 +39,12 @@ @@ -7664,7 +7739,7 @@ index 7e41d39..37ffe23 100644 } else if (op == OP_VAR_VALUE) { -@@ -1542,7 +1594,10 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -1549,7 +1601,10 @@ evaluate_subexp_standard (struct type *expect_type, /* First determine the type code we are dealing with. */ arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); @@ -7675,7 +7750,7 @@ index 7e41d39..37ffe23 100644 code = TYPE_CODE (type); if (code == TYPE_CODE_PTR) -@@ -1709,6 +1764,37 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -1716,6 +1771,37 @@ evaluate_subexp_standard (struct type *expect_type, error (_("non-pointer-to-member value used in pointer-to-member construct")); } @@ -7713,7 +7788,7 @@ index 7e41d39..37ffe23 100644 case BINOP_CONCAT: arg1 = evaluate_subexp_with_coercion (exp, pos, noside); arg2 = evaluate_subexp_with_coercion (exp, pos, noside); -@@ -1980,13 +2066,19 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -1987,13 +2073,19 @@ evaluate_subexp_standard (struct type *expect_type, { int subscript_array[MAX_FORTRAN_DIMS]; int array_size_array[MAX_FORTRAN_DIMS]; @@ -7733,7 +7808,7 @@ index 7e41d39..37ffe23 100644 tmp_type = check_typedef (value_type (arg1)); ndimensions = calc_f77_array_dims (type); -@@ -2016,6 +2108,9 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -2023,6 +2115,9 @@ evaluate_subexp_standard (struct type *expect_type, upper = f77_get_upperbound (tmp_type); lower = f77_get_lowerbound (tmp_type); @@ -7743,7 +7818,7 @@ index 7e41d39..37ffe23 100644 array_size_array[nargs - i - 1] = upper - lower + 1; /* Zero-normalize subscripts so that offsetting will work. */ -@@ -2034,13 +2129,25 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -2041,13 +2136,25 @@ evaluate_subexp_standard (struct type *expect_type, tmp_type = check_typedef (TYPE_TARGET_TYPE (tmp_type)); } @@ -7773,7 +7848,7 @@ index 7e41d39..37ffe23 100644 /* Let us now play a dirty trick: we will take arg1 which is a value node pointing to the topmost level -@@ -2050,7 +2157,7 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -2057,7 +2164,7 @@ evaluate_subexp_standard (struct type *expect_type, returns the correct type value */ deprecated_set_value_type (arg1, tmp_type); @@ -7782,7 +7857,7 @@ index 7e41d39..37ffe23 100644 } case BINOP_LOGICAL_AND: -@@ -2591,7 +2698,7 @@ evaluate_subexp_for_address (struct expression *exp, int *pos, +@@ -2598,7 +2705,7 @@ evaluate_subexp_for_address (struct expression *exp, int *pos, (*pos) += 5 + BYTES_TO_EXP_ELEM (tem + 1); x = value_aggregate_elt (exp->elts[pc + 1].type, &exp->elts[pc + 3].string, @@ -7791,7 +7866,7 @@ index 7e41d39..37ffe23 100644 if (x == NULL) error (_("There is no field named %s"), &exp->elts[pc + 3].string); return x; -@@ -2636,7 +2743,7 @@ evaluate_subexp_with_coercion (struct expression *exp, +@@ -2643,7 +2750,7 @@ evaluate_subexp_with_coercion (struct expression *exp, { enum exp_opcode op; int pc; @@ -7800,7 +7875,7 @@ index 7e41d39..37ffe23 100644 struct symbol *var; struct type *type; -@@ -2647,12 +2754,17 @@ evaluate_subexp_with_coercion (struct expression *exp, +@@ -2654,12 +2761,17 @@ evaluate_subexp_with_coercion (struct expression *exp, { case OP_VAR_VALUE: var = exp->elts[pc + 2].symbol; @@ -7819,7 +7894,7 @@ index 7e41d39..37ffe23 100644 return value_cast (lookup_pointer_type (TYPE_TARGET_TYPE (type)), val); } -@@ -2704,9 +2816,13 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos) +@@ -2711,9 +2823,13 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos) case OP_VAR_VALUE: (*pos) += 4; @@ -9787,7 +9862,7 @@ index 79d33fe..d3b4fa1 100644 once for each known thread. */ typedef int (*thread_callback_func) (struct thread_info *, void *); diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c -index 2f77dca..8146175 100644 +index 2f77dca..90abf2c 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -38,6 +38,9 @@ @@ -10158,7 +10233,17 @@ index 2f77dca..8146175 100644 return type; } -@@ -2820,33 +2983,42 @@ type_pair_eq (const void *item_lhs, const void *item_rhs) +@@ -2004,7 +2167,8 @@ rank_one_type (struct type *parm, struct type *arg) + switch (TYPE_CODE (arg)) + { + case TYPE_CODE_PTR: +- if (TYPE_CODE (TYPE_TARGET_TYPE (parm)) == TYPE_CODE_VOID) ++ if (TYPE_CODE (TYPE_TARGET_TYPE (parm)) == TYPE_CODE_VOID ++ && TYPE_CODE (TYPE_TARGET_TYPE (arg)) != TYPE_CODE_VOID) + return VOID_PTR_CONVERSION_BADNESS; + else + return rank_one_type (TYPE_TARGET_TYPE (parm), +@@ -2820,33 +2984,42 @@ type_pair_eq (const void *item_lhs, const void *item_rhs) } /* Allocate the hash table used by copy_type_recursive to walk @@ -10216,7 +10301,7 @@ index 2f77dca..8146175 100644 return type; /* This type shouldn't be pointing to any types in other objfiles; -@@ -2861,8 +3033,10 @@ copy_type_recursive (struct objfile *objfile, +@@ -2861,8 +3034,10 @@ copy_type_recursive (struct objfile *objfile, new_type = alloc_type_arch (get_type_arch (type)); /* We must add the new type to the hash table immediately, in case @@ -10229,7 +10314,7 @@ index 2f77dca..8146175 100644 stored->old = type; stored->new = new_type; *slot = stored; -@@ -2873,6 +3047,19 @@ copy_type_recursive (struct objfile *objfile, +@@ -2873,6 +3048,19 @@ copy_type_recursive (struct objfile *objfile, TYPE_OBJFILE_OWNED (new_type) = 0; TYPE_OWNER (new_type).gdbarch = get_type_arch (type); @@ -10249,7 +10334,7 @@ index 2f77dca..8146175 100644 if (TYPE_NAME (type)) TYPE_NAME (new_type) = xstrdup (TYPE_NAME (type)); if (TYPE_TAG_NAME (type)) -@@ -2881,12 +3068,45 @@ copy_type_recursive (struct objfile *objfile, +@@ -2881,12 +3069,45 @@ copy_type_recursive (struct objfile *objfile, TYPE_INSTANCE_FLAGS (new_type) = TYPE_INSTANCE_FLAGS (type); TYPE_LENGTH (new_type) = TYPE_LENGTH (type); @@ -10295,7 +10380,7 @@ index 2f77dca..8146175 100644 TYPE_FIELDS (new_type) = XCALLOC (nfields, struct field); for (i = 0; i < nfields; i++) { -@@ -2895,8 +3115,8 @@ copy_type_recursive (struct objfile *objfile, +@@ -2895,8 +3116,8 @@ copy_type_recursive (struct objfile *objfile, TYPE_FIELD_BITSIZE (new_type, i) = TYPE_FIELD_BITSIZE (type, i); if (TYPE_FIELD_TYPE (type, i)) TYPE_FIELD_TYPE (new_type, i) @@ -10306,7 +10391,7 @@ index 2f77dca..8146175 100644 if (TYPE_FIELD_NAME (type, i)) TYPE_FIELD_NAME (new_type, i) = xstrdup (TYPE_FIELD_NAME (type, i)); -@@ -2915,6 +3135,16 @@ copy_type_recursive (struct objfile *objfile, +@@ -2915,6 +3136,16 @@ copy_type_recursive (struct objfile *objfile, xstrdup (TYPE_FIELD_STATIC_PHYSNAME (type, i))); break; @@ -10323,7 +10408,7 @@ index 2f77dca..8146175 100644 default: internal_error (__FILE__, __LINE__, _("Unexpected type field location kind: %d"), -@@ -2923,17 +3153,30 @@ copy_type_recursive (struct objfile *objfile, +@@ -2923,17 +3154,30 @@ copy_type_recursive (struct objfile *objfile, } } @@ -10360,7 +10445,7 @@ index 2f77dca..8146175 100644 /* Maybe copy the type_specific bits. NOTE drow/2005-12-09: We do not copy the C++-specific bits like -@@ -2951,6 +3194,17 @@ copy_type_recursive (struct objfile *objfile, +@@ -2951,6 +3195,17 @@ copy_type_recursive (struct objfile *objfile, return new_type; } @@ -10378,7 +10463,7 @@ index 2f77dca..8146175 100644 /* Make a copy of the given TYPE, except that the pointer & reference types are not preserved. -@@ -2973,6 +3227,217 @@ copy_type (const struct type *type) +@@ -2973,6 +3228,217 @@ copy_type (const struct type *type) return new_type; } @@ -10596,7 +10681,7 @@ index 2f77dca..8146175 100644 /* Helper functions to initialize architecture-specific types. */ -@@ -3463,6 +3928,11 @@ void +@@ -3463,6 +3929,11 @@ void _initialize_gdbtypes (void) { gdbtypes_data = gdbarch_data_register_post_init (gdbtypes_post_init); @@ -11538,7 +11623,7 @@ index c650e07..660fdf6 100644 const domain_enum); diff --git a/gdb/linespec.c b/gdb/linespec.c -index 3e943a1..3b8956c 100644 +index 3e943a1..b96d425 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -30,6 +30,7 @@ @@ -11584,36 +11669,33 @@ index 3e943a1..3b8956c 100644 /* Keep any template parameters */ if (*p == '<') p = find_template_name_end (p); -@@ -1257,7 +1278,10 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, +@@ -1257,6 +1278,9 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, /* Move pointer ahead to next double-colon. */ while (*p && (p[0] != ' ') && (p[0] != '\t') && (p[0] != '\'')) { -- if (p[0] == '<') -+ if (current_language->la_language == language_cplus -+ && strncmp (p, "operator", 8) == 0) ++ if (current_language->la_language == language_cplus) + p += cp_validate_operator (p); -+ else if (p[0] == '<') ++ + if (p[0] == '<') { temp_end = find_template_name_end (p); - if (!temp_end) -@@ -1334,6 +1358,16 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, +@@ -1334,6 +1358,15 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, while (*p && *p != ' ' && *p != '\t' && *p != ',' && *p != ':') p++; /* At this point p->"". String ended. */ -+ /* Nope. C++ operators could have spaces in them ++ /* Nope, C++ operators could have spaces in them + ("foo::operator <" or "foo::operator delete []"). -+ I apologize, this is a bit hacky... */ ++ I apologize, this is a bit hacky... */ + if (current_language->la_language == language_cplus -+ && *p == ' ' && p - 8 - *argptr + 1 > 0 -+ && strncmp (p - 8, "operator", 8) == 0) ++ && *p == ' ' && p - 8 - *argptr + 1 > 0) + { -+ /* The above loop has already swallowed "operator" */ ++ /* The above loop has already swallowed "operator". */ + p += cp_validate_operator (p - 8) - 8; + } } /* Allocate our own copy of the substring between argptr and -@@ -1407,6 +1441,7 @@ lookup_prefix_sym (char **argptr, char *p) +@@ -1407,6 +1440,7 @@ lookup_prefix_sym (char **argptr, char *p) { char *p1; char *copy; @@ -11621,7 +11703,7 @@ index 3e943a1..3b8956c 100644 /* Extract the class name. */ p1 = p; -@@ -1425,7 +1460,26 @@ lookup_prefix_sym (char **argptr, char *p) +@@ -1425,7 +1459,26 @@ lookup_prefix_sym (char **argptr, char *p) /* At this point p1->"::inA::fun", p->"inA::fun" copy->"AAA", argptr->"inA::fun" */ @@ -11649,7 +11731,36 @@ index 3e943a1..3b8956c 100644 } /* This finds the method COPY in the class whose type is T and whose -@@ -1780,7 +1834,7 @@ symbol_found (int funfirstline, char ***canonical, char *copy, +@@ -1474,26 +1527,16 @@ find_method (int funfirstline, char ***canonical, char *saved_arg, + } + else + { +- char *tmp; +- +- if (is_operator_name (copy)) +- { +- tmp = (char *) alloca (strlen (copy + 3) + 9); +- strcpy (tmp, "operator "); +- strcat (tmp, copy + 3); +- } +- else +- tmp = copy; + if (not_found_ptr) + *not_found_ptr = 1; +- if (tmp[0] == '~') ++ if (copy[0] == '~') + cplusplus_error (saved_arg, + "the class `%s' does not have destructor defined\n", + SYMBOL_PRINT_NAME (sym_class)); + else + cplusplus_error (saved_arg, + "the class %s does not have any method named %s\n", +- SYMBOL_PRINT_NAME (sym_class), tmp); ++ SYMBOL_PRINT_NAME (sym_class), copy); + } + } + +@@ -1780,7 +1823,7 @@ symbol_found (int funfirstline, char ***canonical, char *copy, { struct blockvector *bv = BLOCKVECTOR (SYMBOL_SYMTAB (sym)); struct block *b = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); @@ -12565,7 +12676,7 @@ index 0000000..5654546 + return result diff --git a/gdb/python/lib/gdb/FrameWrapper.py b/gdb/python/lib/gdb/FrameWrapper.py new file mode 100644 -index 0000000..39f8246 +index 0000000..b790a54 --- /dev/null +++ b/gdb/python/lib/gdb/FrameWrapper.py @@ -0,0 +1,112 @@ @@ -12601,7 +12712,7 @@ index 0000000..39f8246 + + stream.write (sym.print_name + "=") + try: -+ val = self.frame.read_var (sym) ++ val = self.read_var (sym) + if val != None: + val = str (val) + # FIXME: would be nice to have a more precise exception here. @@ -12646,21 +12757,21 @@ index 0000000..39f8246 + # FIXME: this should probably just be a method on gdb.Frame. + # But then we need stream wrappers. + def describe (self, stream, full): -+ if self.frame.type () == gdb.DUMMY_FRAME: ++ if self.type () == gdb.DUMMY_FRAME: + stream.write (" \n") -+ elif self.frame.type () == gdb.SIGTRAMP_FRAME: ++ elif self.type () == gdb.SIGTRAMP_FRAME: + stream.write (" \n") + else: -+ sal = self.frame.find_sal () -+ pc = self.frame.pc () -+ name = self.frame.name () ++ sal = self.find_sal () ++ pc = self.pc () ++ name = self.name () + if not name: + name = "??" + if pc != sal.pc or not sal.symtab: + stream.write (" 0x%08x in" % pc) + stream.write (" " + name + " (") + -+ func = self.frame.function () ++ func = self.function () + self.print_frame_args (stream, func) + + stream.write (")") @@ -12669,7 +12780,7 @@ index 0000000..39f8246 + stream.write (" at " + sal.symtab.filename) + stream.write (":" + str (sal.line)) + -+ if not self.frame.name () or (not sal.symtab or not sal.symtab.filename): ++ if not self.name () or (not sal.symtab or not sal.symtab.filename): + lib = gdb.solib_address (pc) + if lib: + stream.write (" from " + lib) @@ -17903,7 +18014,7 @@ index 49c0437..84a476e 100644 + return 1; +} diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c -index 714aa11..9fa1c44 100644 +index 58bcee3..b2e7b7d 100644 --- a/gdb/python/py-value.c +++ b/gdb/python/py-value.c @@ -25,6 +25,7 @@ @@ -17925,7 +18036,7 @@ index 714aa11..9fa1c44 100644 #define builtin_type_pybool \ language_bool_type (python_language, python_gdbarch) -@@ -902,7 +907,34 @@ convert_value_from_python (PyObject *obj) +@@ -913,7 +918,34 @@ convert_value_from_python (PyObject *obj) { LONGEST l = PyLong_AsLongLong (obj); @@ -17961,7 +18072,7 @@ index 714aa11..9fa1c44 100644 value = value_from_longest (builtin_type_pylong, l); } else if (PyFloat_Check (obj)) -@@ -961,6 +993,25 @@ gdbpy_history (PyObject *self, PyObject *args) +@@ -972,6 +1004,25 @@ gdbpy_history (PyObject *self, PyObject *args) return value_to_value_object (res_val); } @@ -17987,7 +18098,7 @@ index 714aa11..9fa1c44 100644 void gdbpy_initialize_values (void) { -@@ -971,6 +1022,8 @@ gdbpy_initialize_values (void) +@@ -982,6 +1033,8 @@ gdbpy_initialize_values (void) PyModule_AddObject (gdb_module, "Value", (PyObject *) &value_object_type); values_in_python = NULL; @@ -18749,7 +18860,7 @@ index 6cfaa85..68aadc0 100644 extern initialize_file_ftype _initialize_svr4_solib; /* -Wmissing-prototypes */ diff --git a/gdb/solib.c b/gdb/solib.c -index c7fd0fc..6f31852 100644 +index a2ad0c4..3574e62 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -1127,13 +1127,12 @@ show_auto_solib_add (struct ui_file *file, int from_tty, @@ -21695,10 +21806,30 @@ index 4095ccf..03c07d5 100644 +gdb_test "break *$func2_name" \ "Breakpoint $decimal at 0x2....: file .*" diff --git a/gdb/testsuite/gdb.cp/cplusfuncs.cc b/gdb/testsuite/gdb.cp/cplusfuncs.cc -index 7f033d6..1a50a32 100644 +index 7f033d6..11dba06 100644 --- a/gdb/testsuite/gdb.cp/cplusfuncs.cc +++ b/gdb/testsuite/gdb.cp/cplusfuncs.cc -@@ -191,6 +191,12 @@ char * dm_type_char_star (char * p) { return p; } +@@ -46,7 +46,9 @@ public: + void operator [] (foo&); + void operator () (foo&); + void* operator new (size_t) throw (); ++ void* operator new[] (size_t) throw (); + void operator delete (void *); ++ void operator delete[] (void *); + /**/ operator int (); + /**/ operator char* (); + +@@ -115,7 +117,9 @@ void foo::operator ->* (foo& afoo) { afoo.ifoo = 0; } + void foo::operator [] (foo& afoo) { afoo.ifoo = 0; } + void foo::operator () (foo& afoo) { afoo.ifoo = 0; } + void* foo::operator new (size_t ival) throw () { ival = 0; return 0; } ++void* foo::operator new[] (size_t ival) throw () { ival = 0; return 0; } + void foo::operator delete (void *ptr) { ptr = 0; } ++void foo::operator delete[] (void *ptr) { ptr = 0; } + /**/ foo::operator int () { return 0; } + /**/ foo::operator char* () { return 0; } + +@@ -191,6 +195,12 @@ char * dm_type_char_star (char * p) { return p; } int dm_type_foo_ref (foo & foo) { return foo.ifoo; } int * dm_type_int_star (int * p) { return p; } long * dm_type_long_star (long * p) { return p; } @@ -21712,11 +21843,15 @@ index 7f033d6..1a50a32 100644 +typedef int myint; +int dm_type_typedef (myint i) { return i; } diff --git a/gdb/testsuite/gdb.cp/cplusfuncs.exp b/gdb/testsuite/gdb.cp/cplusfuncs.exp -index 5e08768..8c8e038 100644 +index 5e08768..10ffdf0 100644 --- a/gdb/testsuite/gdb.cp/cplusfuncs.exp +++ b/gdb/testsuite/gdb.cp/cplusfuncs.exp -@@ -66,9 +66,25 @@ set dm_type_unsigned_int "unsigned" - set dm_type_void "" +@@ -63,12 +63,28 @@ set dm_type_foo_ref "foo&" + set dm_type_int_star "int*" + set dm_type_long_star "long*" + set dm_type_unsigned_int "unsigned" +-set dm_type_void "" ++set dm_type_void "void" set dm_type_void_star "void*" +# Some other vagaries of GDB's type printing machinery. The integer types @@ -21741,7 +21876,7 @@ index 5e08768..8c8e038 100644 global dm_type_char_star global dm_type_char_star_quoted global dm_type_foo_ref -@@ -77,6 +93,11 @@ proc probe_demangler { } { +@@ -77,8 +93,13 @@ proc probe_demangler { } { global dm_type_unsigned_int global dm_type_void global dm_type_void_star @@ -21751,13 +21886,16 @@ index 5e08768..8c8e038 100644 + global dm_type_unsigned_long + global dm_type_typedef - send_gdb "print &'foo::operator,(foo&)'\n" +- send_gdb "print &'foo::operator,(foo&)'\n" ++ send_gdb "print &foo::operator,(foo&)\n" gdb_expect { + -re ".*foo::operator, \\(.*foo.*&.*\\).*\r\n$gdb_prompt $" { + # v2 demangler @@ -97,6 +118,26 @@ proc probe_demangler { } { } } -+ send_gdb "print &'foo::operator char*()'\n" ++ send_gdb "print &foo::operator char*($dm_type_void)\n" + gdb_expect { + -re ".*foo::operator char \\*\\(void\\).*\r\n$gdb_prompt $" { + # v2 demangler or GDB type printer @@ -21894,7 +22032,50 @@ index 5e08768..8c8e038 100644 } # -@@ -345,8 +486,9 @@ proc print_addr { name } { +@@ -241,6 +382,7 @@ proc info_func_regexp { name demangled } { + global gdb_prompt + + send_gdb "info function $name\n" ++ set demangled [regsub {\\\(void\\\)} $demangled {\(\)}] + gdb_expect { + -re ".*File .*:\r\n(class |)$demangled\r\n.*$gdb_prompt $" { + pass "info function for \"$name\"" +@@ -277,16 +419,16 @@ proc print_addr_2 { name good } { + + set good_pattern [string_to_regexp $good] + +- send_gdb "print &'$name'\n" ++ send_gdb "print &$name\n" + gdb_expect { + -re ".* = .* $hex <$good_pattern>\r\n$gdb_prompt $" { +- pass "print &'$name'" ++ pass "print &$name" + } + -re ".*$gdb_prompt $" { +- fail "print &'$name'" ++ fail "print &$name" + } + timeout { +- fail "print &'$name' (timeout)" ++ fail "print &$name (timeout)" + } + } + } +@@ -327,7 +469,12 @@ proc print_addr_2_kfail { name good bad bugid } { + # + + proc print_addr { name } { +- print_addr_2 "$name" "$name" ++ set expected [regsub {\(void\)} $name {()}] ++ if {[string first "::" $name] == -1} { ++ # C function -- must be qutoed ++ set name "'$name'" ++ } ++ print_addr_2 "$name" $expected + } + + # +@@ -345,8 +492,9 @@ proc print_addr { name } { proc test_lookup_operator_functions {} { global dm_operator_comma @@ -21905,7 +22086,7 @@ index 5e08768..8c8e038 100644 global dm_type_foo_ref global dm_type_void global dm_type_void_star -@@ -404,8 +546,8 @@ proc test_lookup_operator_functions {} { +@@ -404,8 +552,8 @@ proc test_lookup_operator_functions {} { info_func "operator int(" "int foo::operator int($dm_type_void);" info_func "operator()(" "void foo::operator()($dm_type_foo_ref);" @@ -21916,7 +22097,7 @@ index 5e08768..8c8e038 100644 } -@@ -420,6 +562,7 @@ proc test_paddr_operator_functions {} { +@@ -420,6 +568,7 @@ proc test_paddr_operator_functions {} { global dm_type_unsigned_int global dm_type_void global dm_type_void_star @@ -21924,7 +22105,21 @@ index 5e08768..8c8e038 100644 print_addr "foo::operator*($dm_type_foo_ref)" print_addr "foo::operator%($dm_type_foo_ref)" -@@ -470,7 +613,7 @@ proc test_paddr_operator_functions {} { +@@ -460,17 +609,20 @@ proc test_paddr_operator_functions {} { + print_addr "foo::operator\[\]($dm_type_foo_ref)" + print_addr "foo::operator()($dm_type_foo_ref)" + +- gdb_test "print &'foo::operator new'" \ ++ gdb_test "print &foo::operator new" \ + " = .* $hex " ++ gdb_test "print &foo::operator new\[\]" \ ++ " = .* $hex " + if { !$hp_aCC_compiler } { + print_addr "foo::operator delete($dm_type_void_star)" ++ print_addr "foo::operator delete[]($dm_type_void_star)" + } else { + gdb_test "print &'foo::operator delete($dm_type_void_star) static'" \ + " = .*(0x\[0-9a-f\]+|) " } print_addr "foo::operator int($dm_type_void)" @@ -21933,7 +22128,7 @@ index 5e08768..8c8e038 100644 } # -@@ -480,17 +623,21 @@ proc test_paddr_operator_functions {} { +@@ -480,17 +632,21 @@ proc test_paddr_operator_functions {} { proc test_paddr_overloaded_functions {} { global dm_type_unsigned_int global dm_type_void @@ -21959,7 +22154,7 @@ index 5e08768..8c8e038 100644 print_addr "overload1arg(float)" print_addr "overload1arg(double)" -@@ -513,17 +660,31 @@ proc test_paddr_hairy_functions {} { +@@ -513,17 +669,31 @@ proc test_paddr_hairy_functions {} { global dm_type_char_star global dm_type_int_star global dm_type_long_star @@ -25592,7 +25787,7 @@ index a67eaa3..5380c0f 100644 + +gdb_test "python print 'result =', f0.block ()" "" "test Frame.block" diff --git a/gdb/testsuite/gdb.python/py-function.exp b/gdb/testsuite/gdb.python/py-function.exp -index 7feca2b..4ae519f 100644 +index 30fde7d..14cd90c 100644 --- a/gdb/testsuite/gdb.python/py-function.exp +++ b/gdb/testsuite/gdb.python/py-function.exp @@ -20,36 +20,15 @@ if $tracelevel then { diff --git a/gdb.spec b/gdb.spec index 9a2f3ee..a80900c 100644 --- a/gdb.spec +++ b/gdb.spec @@ -10,7 +10,7 @@ Name: gdb%{?_with_debug:-debug} # 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.8.91.20090921 +Version: 6.8.91.20090925 # The release always contains a leading reserved number, start it at 1. # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing. @@ -220,7 +220,7 @@ Patch229: gdb-6.3-bz140532-ppc-unwinding-test.patch Patch231: gdb-6.3-bz202689-exec-from-pthread-test.patch # Backported post gdb-6.8.50.20090991 snapshot fixups. -Patch232: gdb-6.8.50.20090921-upstream.patch +#Patch232: gdb-6.8.50.20090921-upstream.patch # Testcase for PPC Power6/DFP instructions disassembly (BZ 230000). Patch234: gdb-6.6-bz230000-power6-disassembly-test.patch @@ -453,7 +453,7 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %if 0%{!?_with_upstream:1} -%patch232 -p1 +#patch232 -p1 %patch349 -p1 %patch1 -p1 %patch3 -p1 @@ -847,6 +847,12 @@ fi %endif %changelog +* Fri Sep 25 2009 Jan Kratochvil - 6.8.91.20090925-1 +- Upgrade to the FSF GDB gdb-7.0 snapshot: 6.8.91.20090925 +- archer-jankratochvil-fedora12 commit: 4338ea85c798007c32594032f602db9fd230eba9 + - [python] Don't directly reference self.frame (Tom Tromey). + - [expr] Updates from branch (Keith Seitz). + * Mon Sep 21 2009 Jan Kratochvil - 6.8.91.20090921-1 - Upgrade to the FSF GDB gdb-7.0 snapshot: 6.8.91.20090921 - archer-jankratochvil-fedora12 commit: 0d5c38dd89050c0ee1cf049656f177c170d675d4 diff --git a/sources b/sources index 7d1f4b3..ccb3bfd 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ 1e3a26040dcdd3579d75967085eb92b9 libstdc++-v3-python-r151798.tar.xz -67b50a78d03200c6714cafd85b8044e8 gdb-6.8.91.20090921.tar.bz2 +b6ff9aa4c78ca41931052c8658bdabfd gdb-6.8.91.20090925.tar.bz2