From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29968 invoked by alias); 17 Oct 2010 20:27:55 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 29923 invoked by uid 9674); 17 Oct 2010 20:27:53 -0000 Date: Sun, 17 Oct 2010 20:27:00 -0000 Message-ID: <20101017202753.29908.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] master: Merge remote branch 'gdb/master' X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: a96476131a8045900eb407d2cc1fc712bcded2bc X-Git-Newrev: 653d38b1806744712655bdd45d0afd85e29a6588 X-SW-Source: 2010-q4/txt/msg00035.txt.bz2 List-Id: The branch, master has been updated via 653d38b1806744712655bdd45d0afd85e29a6588 (commit) via 414455fb0544ec67c3258a8673a355d208399892 (commit) via 31401e24be886bdf460f115f7804c69aa118e5b6 (commit) via cbca720518e5efd7761e29a995944ad1c8535ff4 (commit) via 36d1deeb2f285dfb4f588c6c81dea897dc120899 (commit) via 1bc4710e30694c7f0319d57ed8e1ee6c23ebd759 (commit) via d9cf29db9c3c4c608efe3c34f6c36b7e9e2c50b7 (commit) via 2bf6d9050c558824b2b0204d6ae18c33e81a193d (commit) via 96d5306dea53311a18432583ca865f793a31f4f2 (commit) via 1670b2d209b4416a5e4a8763a6d16ffa3b6710ad (commit) via d5f4a84e0662cfa26c730eb7f81959a778591ef2 (commit) via 06dd19c7dcc8ef5098f1b98f24b657a81f24d99c (commit) via b2237005769b8de286894f2d8d36e9e959019c46 (commit) via d0b8a5a2be345f831d188e55c69778a49c10264f (commit) via 7e9d52e9df72f3dd3a925e1527104318658d8451 (commit) from a96476131a8045900eb407d2cc1fc712bcded2bc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 653d38b1806744712655bdd45d0afd85e29a6588 Merge: a964761 414455f Author: Jan Kratochvil Date: Sun Oct 17 22:27:43 2010 +0200 Merge remote branch 'gdb/master' commit 414455fb0544ec67c3258a8673a355d208399892 Author: Jan Kratochvil Date: Sun Oct 17 18:55:09 2010 +0000 gdb/testsuite/ Fix s390x compatibility. * gdb.dwarf2/pr11465.S (DW_TAG_pointer_type): Use PTRBITS. Twice. * gdb.dwarf2/pr11465.exp: Set ptrbits, use it for -DPTRBITS. commit 31401e24be886bdf460f115f7804c69aa118e5b6 Author: Jan Kratochvil Date: Sun Oct 17 18:49:46 2010 +0000 gdb/ Fix the `stopped language detection' testcase for gcc-4.5. * dwarf2read.c (read_partial_die): Set also LANGUAGE_OF_MAIN. * symfile.c (set_initial_language): Move variable filename to a more inner block. Prefer LANGUAGE_OF_MAIN. * symtab.c (language_of_main): New variable. (set_main_name): Always reset LANGUAGE_OF_MAIN. * symtab.h (language_of_main): New declaration. commit cbca720518e5efd7761e29a995944ad1c8535ff4 Author: Jan Kratochvil Date: Sun Oct 17 18:24:46 2010 +0000 gdb/ * gdbthread.h (currently_stepping): New declaration. * infrun.c (currently_stepping): Remove the forward declaration. (currently_stepping): Make it global. * linux-nat.c (resume_callback) stopped && lp->status == 0>: New variables tp and step, initialized them. Pass STEP to to_resume. Print also possibly "PTRACE_SINGLESTEP" if STEP. Initialize LP->STEP. * remote.c (currently_stepping_callback): New. (remote_vcont_resume) : New variable tp. Call currently_stepping_callback and step such thread. gdb/testsuite/ * gdb.threads/sigstep-threads.exp: New file. * gdb.threads/sigstep-threads.c: New file. commit 36d1deeb2f285dfb4f588c6c81dea897dc120899 Author: Jan Kratochvil Date: Sun Oct 17 17:45:16 2010 +0000 gdb/ * infrun.c (follow_exec): Replace symbol_file_add_main by symbol_file_add with SYMFILE_DEFER_BP_RESET, set_initial_language and breakpoint_re_set. * m32r-rom.c (m32r_load, m32r_upload_command): Use parameter 0 for clear_symtab_users. * objfiles.c (free_all_objfiles): Likewise. * remote-m32r-sdi.c (m32r_load): Likewise. * solib-som.c (som_solib_create_inferior_hook): Likewise. * symfile.c (new_symfile_objfile): New comment for add_flags. Call clear_symtab_users with ADD_FLAGS. (reread_symbols): Use parameter 0 for clear_symtab_users. (clear_symtab_users): New parameter add_flags. Do not call breakpoint_re_set if SYMFILE_DEFER_BP_RESET. (clear_symtab_users_cleanup): Use parameter 0 for clear_symtab_users. * symtab.h (clear_symtab_users): New parameter add_flags. gdb/testsuite/ * gdb.base/pie-execl.exp: New file. * gdb.base/pie-execl.c: New file. commit 1bc4710e30694c7f0319d57ed8e1ee6c23ebd759 Author: Jan Kratochvil Date: Sun Oct 17 08:43:45 2010 +0000 gdb/ Fix GCC false warning. * varobj.c (value_get_print_value) : Initialize it. commit d9cf29db9c3c4c608efe3c34f6c36b7e9e2c50b7 Author: gdbadmin Date: Sun Oct 17 00:00:32 2010 +0000 *** empty log message *** commit 2bf6d9050c558824b2b0204d6ae18c33e81a193d Author: Alan Modra Date: Sat Oct 16 23:00:05 2010 +0000 daily update commit 96d5306dea53311a18432583ca865f793a31f4f2 Author: H.J. Lu Date: Sat Oct 16 21:53:16 2010 +0000 Add CpuNop to CPU_GENERIC64_FLAGS. gas/testsuite/ 2010-10-16 H.J. Lu * gas/i386/i386.exp: Run x86-64-nops-1-g64. * gas/i386/x86-64-nops-1.d: Remove -mtune=generic64. * gas/i386/x86-64-nops-1-g64.d: New. opcodes/ 2010-10-16 H.J. Lu * i386-gen.c (cpu_flag_init): Add CpuNop to CPU_GENERIC64_FLAGS. * i386-init.h: Regenerated. commit 1670b2d209b4416a5e4a8763a6d16ffa3b6710ad Author: gdbadmin Date: Sat Oct 16 00:00:33 2010 +0000 *** empty log message *** commit d5f4a84e0662cfa26c730eb7f81959a778591ef2 Author: Pierre Muller Date: Fri Oct 15 23:08:04 2010 +0000 * p-typeprint.c (pascal_type_print_method_args): Fix problem in display of type of method arguments. commit 06dd19c7dcc8ef5098f1b98f24b657a81f24d99c Author: Alan Modra Date: Fri Oct 15 23:00:05 2010 +0000 daily update commit b2237005769b8de286894f2d8d36e9e959019c46 Author: Mike Frysinger Date: Fri Oct 15 20:44:46 2010 +0000 gas: blackfin: fix encoding of BYTEOP2M insn The BYTEOP2M parser incorrectly calls BYTEOP2P to generate the opcode. Once we've fixed that, it's easy to see that the disassembler also likes to decode this insn incorrectly. So fix that and then add some tests. Signed-off-by: Mike Frysinger commit d0b8a5a2be345f831d188e55c69778a49c10264f Author: Tom Tromey Date: Fri Oct 15 18:54:10 2010 +0000 PR python/11948: * varobj.c (value_get_print_value): Use val_print_string to print lazy strings. * python/py-prettyprint.c (print_string_repr): Use val_print_string to print lazy strings. Fix cleanup logic. (print_children): Likewise. * python/python-internal.h (gdbpy_extract_lazy_string): Update. * python/py-lazy-string.c (gdbpy_extract_lazy_string): Rewrite. Change return type to 'void', add 'addr' argument. * value.h (val_print_string): Update. * valprint.c (val_print_string): Add 'encoding' argument. * printcmd.c (print_formatted): Update. * p-valprint.c (pascal_val_print): Update. * m2-valprint.c (print_unpacked_pointer): Update. (m2_print_array_contents): Likewise. * jv-valprint.c (java_value_print): Update. * f-valprint.c (f_val_print): Update. * c-valprint.c (c_val_print): Update. * auxv.c (fprint_target_auxv): Update. commit 7e9d52e9df72f3dd3a925e1527104318658d8451 Author: Jan Kratochvil Date: Fri Oct 15 17:48:40 2010 +0000 gdb/ PR exp/12117 * gdbtypes.c (check_typedef): Clean up function comment. Keep track of instance flags as we strip typedefs and create a new type to preserve them if necessary. * gdbtypes.h (type) : Extend the comment. gdb/testsuite/ PR exp/12117 * gdb.cp/ptype-cv-cp.cc: New file. * gdb.cp/ptype-cv-cp.exp: New file. ----------------------------------------------------------------------- Summary of changes: bfd/version.h | 2 +- gdb/ChangeLog | 84 ++++++++++++++++++++ gdb/auxv.c | 2 +- gdb/c-valprint.c | 2 +- gdb/dwarf2read.c | 8 ++- gdb/f-valprint.c | 4 +- gdb/gdbthread.h | 2 + gdb/gdbtypes.c | 87 ++++++++++++++------- gdb/gdbtypes.h | 9 ++- gdb/infrun.c | 17 +++- gdb/jv-valprint.c | 3 +- gdb/linux-nat.c | 14 +++- gdb/m2-valprint.c | 4 +- gdb/m32r-rom.c | 4 +- gdb/objfiles.c | 2 +- gdb/p-typeprint.c | 9 +- gdb/p-valprint.c | 6 +- gdb/printcmd.c | 2 +- gdb/python/py-lazy-string.c | 93 ++++------------------ gdb/python/py-prettyprint.c | 105 ++++++++++++------------- gdb/python/python-internal.h | 6 +- gdb/remote-m32r-sdi.c | 2 +- gdb/remote.c | 14 ++++ gdb/solib-som.c | 2 +- gdb/symfile.c | 29 ++++--- gdb/symtab.c | 3 + gdb/symtab.h | 3 +- gdb/testsuite/ChangeLog | 23 ++++++ gdb/testsuite/gdb.base/pie-execl.c | 51 ++++++++++++ gdb/testsuite/gdb.base/pie-execl.exp | 100 +++++++++++++++++++++++ gdb/testsuite/gdb.cp/ptype-cv-cp.cc | 34 ++++++++ gdb/testsuite/gdb.cp/ptype-cv-cp.exp | 41 ++++++++++ gdb/testsuite/gdb.dwarf2/pr11465.S | 4 +- gdb/testsuite/gdb.dwarf2/pr11465.exp | 8 ++- gdb/testsuite/gdb.threads/sigstep-threads.c | 54 +++++++++++++ gdb/testsuite/gdb.threads/sigstep-threads.exp | 74 +++++++++++++++++ gdb/valprint.c | 7 +- gdb/value.h | 3 +- gdb/varobj.c | 42 ++++++----- gdb/version.in | 2 +- opcodes/ChangeLog | 10 +++ opcodes/bfin-dis.c | 16 ++-- opcodes/i386-gen.c | 2 +- opcodes/i386-init.h | 2 +- 44 files changed, 752 insertions(+), 239 deletions(-) create mode 100644 gdb/testsuite/gdb.base/pie-execl.c create mode 100644 gdb/testsuite/gdb.base/pie-execl.exp create mode 100644 gdb/testsuite/gdb.cp/ptype-cv-cp.cc create mode 100644 gdb/testsuite/gdb.cp/ptype-cv-cp.exp create mode 100644 gdb/testsuite/gdb.threads/sigstep-threads.c create mode 100644 gdb/testsuite/gdb.threads/sigstep-threads.exp First 500 lines of diff: diff --git a/bfd/version.h b/bfd/version.h index 772627e..a68d523 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -1,4 +1,4 @@ -#define BFD_VERSION_DATE 20101015 +#define BFD_VERSION_DATE 20101017 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@ diff --git a/gdb/ChangeLog b/gdb/ChangeLog index bcfe2b7..d1f4477 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,87 @@ +2010-10-17 Jan Kratochvil + + Fix the `stopped language detection' testcase for gcc-4.5. + * dwarf2read.c (read_partial_die): Set also LANGUAGE_OF_MAIN. + * symfile.c (set_initial_language): Move variable filename to a more + inner block. Prefer LANGUAGE_OF_MAIN. + * symtab.c (language_of_main): New variable. + (set_main_name): Always reset LANGUAGE_OF_MAIN. + * symtab.h (language_of_main): New declaration. + +2010-10-17 Jan Kratochvil + Pedro Alves + + * gdbthread.h (currently_stepping): New declaration. + * infrun.c (currently_stepping): Remove the forward declaration. + (currently_stepping): Make it global. + * linux-nat.c (resume_callback) stopped && lp->status == 0>: New + variables tp and step, initialized them. Pass STEP to to_resume. + Print also possibly "PTRACE_SINGLESTEP" if STEP. Initialize LP->STEP. + * remote.c (currently_stepping_callback): New. + (remote_vcont_resume) + : + New variable tp. Call currently_stepping_callback and step such + thread. + +2010-10-17 Jan Kratochvil + + * infrun.c (follow_exec): Replace symbol_file_add_main by + symbol_file_add with SYMFILE_DEFER_BP_RESET, set_initial_language and + breakpoint_re_set. + * m32r-rom.c (m32r_load, m32r_upload_command): Use parameter 0 for + clear_symtab_users. + * objfiles.c (free_all_objfiles): Likewise. + * remote-m32r-sdi.c (m32r_load): Likewise. + * solib-som.c (som_solib_create_inferior_hook): Likewise. + * symfile.c (new_symfile_objfile): New comment for add_flags. Call + clear_symtab_users with ADD_FLAGS. + (reread_symbols): Use parameter 0 for clear_symtab_users. + (clear_symtab_users): New parameter add_flags. Do not call + breakpoint_re_set if SYMFILE_DEFER_BP_RESET. + (clear_symtab_users_cleanup): Use parameter 0 for clear_symtab_users. + * symtab.h (clear_symtab_users): New parameter add_flags. + +2010-10-17 Jan Kratochvil + + Fix GCC false warning. + * varobj.c (value_get_print_value) : Initialize it. + +2010-10-16 Pierre Muller + + * p-typeprint.c (pascal_type_print_method_args): Fix problem in + display of type of method arguments. + +2010-10-15 Tom Tromey + + PR python/11948: + * varobj.c (value_get_print_value): Use val_print_string to print + lazy strings. + * python/py-prettyprint.c (print_string_repr): Use + val_print_string to print lazy strings. Fix cleanup logic. + (print_children): Likewise. + * python/python-internal.h (gdbpy_extract_lazy_string): Update. + * python/py-lazy-string.c (gdbpy_extract_lazy_string): Rewrite. + Change return type to 'void', add 'addr' argument. + * value.h (val_print_string): Update. + * valprint.c (val_print_string): Add 'encoding' argument. + * printcmd.c (print_formatted): Update. + * p-valprint.c (pascal_val_print): Update. + * m2-valprint.c (print_unpacked_pointer): Update. + (m2_print_array_contents): Likewise. + * jv-valprint.c (java_value_print): Update. + * f-valprint.c (f_val_print): Update. + * c-valprint.c (c_val_print): Update. + * auxv.c (fprint_target_auxv): Update. + +2010-10-15 Doug Evans + Jan Kratochvil + + PR exp/12117 + * gdbtypes.c (check_typedef): Clean up function comment. + Keep track of instance flags as we strip typedefs and create a new + type to preserve them if necessary. + * gdbtypes.h (type) : Extend the comment. + 2010-10-15 Pierre Muller * p-lang.c (is_pascal_string_type): Use TYPE_FIELD_NAME accessor. diff --git a/gdb/auxv.c b/gdb/auxv.c index 593b0c8..71144dc 100644 --- a/gdb/auxv.c +++ b/gdb/auxv.c @@ -401,7 +401,7 @@ fprint_target_auxv (struct ui_file *file, struct target_ops *ops) if (opts.addressprint) fprintf_filtered (file, "%s", paddress (target_gdbarch, val)); val_print_string (builtin_type (target_gdbarch)->builtin_char, - val, -1, file, &opts); + NULL, val, -1, file, &opts); fprintf_filtered (file, "\n"); } break; diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index 521460b..bc524bd 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -289,7 +289,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, if (c_textual_element_type (unresolved_elttype, options->format) && addr != 0) { - i = val_print_string (unresolved_elttype, addr, -1, stream, + i = val_print_string (unresolved_elttype, NULL, addr, -1, stream, options); } else if (cp_is_vtbl_member (type)) diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index e92795b..7c78454 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -8880,7 +8880,13 @@ read_partial_die (struct partial_die_info *part_die, practice. */ if (DW_UNSND (&attr) == DW_CC_program && cu->language == language_fortran) - set_main_name (part_die->name); + { + set_main_name (part_die->name); + + /* As this DIE has a static linkage the name would be difficult + to look up later. */ + language_of_main = language_fortran; + } break; default: break; diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c index 85f698d..e27f79e 100644 --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c @@ -299,8 +299,8 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, && TYPE_CODE (elttype) == TYPE_CODE_INT && (options->format == 0 || options->format == 's') && addr != 0) - i = val_print_string (TYPE_TARGET_TYPE (type), addr, -1, stream, - options); + i = val_print_string (TYPE_TARGET_TYPE (type), NULL, addr, -1, + stream, options); /* Return number of characters printed, including the terminating '\0' if we reached the end. val_print_string takes care including diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h index cd24eaf..e89e88d 100644 --- a/gdb/gdbthread.h +++ b/gdb/gdbthread.h @@ -352,4 +352,6 @@ extern struct thread_info* inferior_thread (void); extern void update_thread_list (void); +extern int currently_stepping (struct thread_info *tp); + #endif /* GDBTHREAD_H */ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index e983fe7..204bab5 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -1347,7 +1347,21 @@ stub_noname_complaint (void) complaint (&symfile_complaints, _("stub type has NULL name")); } -/* Added by Bryan Boreham, Kewill, Sun Sep 17 18:07:17 1989. +/* Find the real type of TYPE. This function returns the real type, + after removing all layers of typedefs, and completing opaque or stub + types. Completion changes the TYPE argument, but stripping of + typedefs does not. + + Instance flags (e.g. const/volatile) are preserved as typedefs are + stripped. If necessary a new qualified form of the underlying type + is created. + + NOTE: This will return a typedef if TYPE_TARGET_TYPE for the typedef has + not been computed and we're either in the middle of reading symbols, or + there was no name for the typedef in the debug info. + + If TYPE is a TYPE_CODE_TYPEDEF, its length is updated to the length of + the target type. If this is a stubbed struct (i.e. declared as struct foo *), see if we can find a full definition in some other file. If so, copy this @@ -1355,26 +1369,15 @@ stub_noname_complaint (void) (but not any code) that if we don't find a full definition, we'd set a flag so we don't spend time in the future checking the same type. That would be a mistake, though--we might load in more - symbols which contain a full definition for the type. - - This used to be coded as a macro, but I don't think it is called - often enough to merit such treatment. - - Find the real type of TYPE. This function returns the real type, - after removing all layers of typedefs and completing opaque or stub - types. Completion changes the TYPE argument, but stripping of - typedefs does not. - - If TYPE is a TYPE_CODE_TYPEDEF, its length is (also) set to the length of - the target type instead of zero. However, in the case of TYPE_CODE_TYPEDEF - check_typedef can still return different type than the original TYPE - pointer. */ + symbols which contain a full definition for the type. */ struct type * check_typedef (struct type *type) { struct type *orig_type = type; - int is_const, is_volatile; + /* While we're removing typedefs, we don't want to lose qualifiers. + E.g., const/volatile. */ + int instance_flags = TYPE_INSTANCE_FLAGS (type); gdb_assert (type); @@ -1388,7 +1391,7 @@ check_typedef (struct type *type) /* It is dangerous to call lookup_symbol if we are currently reading a symtab. Infinite recursion is one danger. */ if (currently_reading_symtab) - return type; + return make_qualified_type (type, instance_flags, NULL); name = type_name_no_tag (type); /* FIXME: shouldn't we separately check the TYPE_NAME and @@ -1398,7 +1401,7 @@ check_typedef (struct type *type) if (name == NULL) { stub_noname_complaint (); - return type; + return make_qualified_type (type, instance_flags, NULL); } sym = lookup_symbol (name, 0, STRUCT_DOMAIN, 0); if (sym) @@ -1407,10 +1410,33 @@ check_typedef (struct type *type) TYPE_TARGET_TYPE (type) = alloc_type_arch (get_type_arch (type)); } type = TYPE_TARGET_TYPE (type); - } - is_const = TYPE_CONST (type); - is_volatile = TYPE_VOLATILE (type); + /* Preserve the instance flags as we traverse down the typedef chain. + + Handling address spaces/classes is nasty, what do we do if there's a + conflict? + E.g., what if an outer typedef marks the type as class_1 and an inner + typedef marks the type as class_2? + This is the wrong place to do such error checking. We leave it to + the code that created the typedef in the first place to flag the + error. We just pick the outer address space (akin to letting the + outer cast in a chain of casting win), instead of assuming + "it can't happen". */ + { + const int ALL_SPACES = (TYPE_INSTANCE_FLAG_CODE_SPACE + | TYPE_INSTANCE_FLAG_DATA_SPACE); + const int ALL_CLASSES = TYPE_INSTANCE_FLAG_ADDRESS_CLASS_ALL; + int new_instance_flags = TYPE_INSTANCE_FLAGS (type); + + /* Treat code vs data spaces and address classes separately. */ + if ((instance_flags & ALL_SPACES) != 0) + new_instance_flags &= ~ALL_SPACES; + if ((instance_flags & ALL_CLASSES) != 0) + new_instance_flags &= ~ALL_CLASSES; + + instance_flags |= new_instance_flags; + } + } /* If this is a struct/class/union with no fields, then check whether a full definition exists somewhere else. This is for @@ -1428,7 +1454,7 @@ check_typedef (struct type *type) if (name == NULL) { stub_noname_complaint (); - return type; + return make_qualified_type (type, instance_flags, NULL); } newtype = lookup_transparent_type (name); @@ -1445,7 +1471,9 @@ check_typedef (struct type *type) move over any other types NEWTYPE refers to, which could be an unbounded amount of stuff. */ if (TYPE_OBJFILE (newtype) == TYPE_OBJFILE (type)) - make_cv_type (is_const, is_volatile, newtype, &type); + type = make_qualified_type (newtype, + TYPE_INSTANCE_FLAGS (type), + type); else type = newtype; } @@ -1464,17 +1492,18 @@ check_typedef (struct type *type) if (name == NULL) { stub_noname_complaint (); - return type; + return make_qualified_type (type, instance_flags, NULL); } sym = lookup_symbol (name, 0, STRUCT_DOMAIN, 0); if (sym) { /* Same as above for opaque types, we can replace the stub - with the complete type only if they are int the same + with the complete type only if they are in the same objfile. */ if (TYPE_OBJFILE (SYMBOL_TYPE(sym)) == TYPE_OBJFILE (type)) - make_cv_type (is_const, is_volatile, - SYMBOL_TYPE (sym), &type); + type = make_qualified_type (SYMBOL_TYPE (sym), + TYPE_INSTANCE_FLAGS (type), + type); else type = SYMBOL_TYPE (sym); } @@ -1534,8 +1563,12 @@ check_typedef (struct type *type) TYPE_TARGET_STUB (type) = 0; } } + + type = make_qualified_type (type, instance_flags, NULL); + /* Cache TYPE_LENGTH for future use. */ TYPE_LENGTH (orig_type) = TYPE_LENGTH (type); + return type; } diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 87defcd..e4dac49 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -623,7 +623,14 @@ struct type struct type *chain; /* Flags specific to this instance of the type, indicating where - on the ring we are. */ + on the ring we are. + + For TYPE_CODE_TYPEDEF the flags of the typedef type should be binary + or-ed with the target type, with a special case for address class and + space class. For example if this typedef does not specify any new + qualifiers, TYPE_INSTANCE_FLAGS is 0 and the instance flags are + completely inherited from the target type. No qualifiers can be cleared + by the typedef. See also check_typedef. */ int instance_flags; /* Length of storage for a value of this type. This is what diff --git a/gdb/infrun.c b/gdb/infrun.c index 0720b31..edd4a40 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -74,8 +74,6 @@ static int follow_fork (void); static void set_schedlock_func (char *args, int from_tty, struct cmd_list_element *c); -static int currently_stepping (struct thread_info *tp); - static int currently_stepping_or_nexting_callback (struct thread_info *tp, void *data); @@ -835,8 +833,15 @@ follow_exec (ptid_t pid, char *execd_pathname) /* That a.out is now the one to use. */ exec_file_attach (execd_pathname, 0); - /* Load the main file's symbols. */ - symbol_file_add_main (execd_pathname, 0); + /* SYMFILE_DEFER_BP_RESET is used as the proper displacement for PIE + (Position Independent Executable) main symbol file will get applied by + solib_create_inferior_hook below. breakpoint_re_set would fail to insert + the breakpoints with the zero displacement. */ + + symbol_file_add (execd_pathname, SYMFILE_MAINLINE | SYMFILE_DEFER_BP_RESET, + NULL, 0); + + set_initial_language (); #ifdef SOLIB_CREATE_INFERIOR_HOOK SOLIB_CREATE_INFERIOR_HOOK (PIDGET (inferior_ptid)); @@ -846,6 +851,8 @@ follow_exec (ptid_t pid, char *execd_pathname) jit_inferior_created_hook (); + breakpoint_re_set (); + /* Reinsert all breakpoints. (Those which were symbolic have been reset to the proper address in the new a.out, thanks to symbol_file_command...) */ @@ -4842,7 +4849,7 @@ infrun: not switching back to stepped thread, it has vanished\n"); /* Is thread TP in the middle of single-stepping? */ -static int +int currently_stepping (struct thread_info *tp) { return ((tp->step_range_end && tp->step_resume_breakpoint == NULL) diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c index 1819b50..0a2cc53 100644 --- a/gdb/jv-valprint.c +++ b/gdb/jv-valprint.c @@ -239,7 +239,8 @@ java_value_print (struct value *val, struct ui_file *stream, value_free_to_mark (mark); /* Release unnecessary values */ char_type = builtin_java_type (gdbarch)->builtin_char; - val_print_string (char_type, data + boffset, count, stream, options); + val_print_string (char_type, NULL, data + boffset, count, stream, + options); return 0; } diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 0e18034..f8de481 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -1820,20 +1820,26 @@ resume_callback (struct lwp_info *lp, void *data) } else if (lp->stopped && lp->status == 0) { + struct thread_info *tp = find_thread_ptid (lp->ptid); + /* lp->step may already contain a stale value. */ + int step = tp ? currently_stepping (tp) : 0; + if (debug_linux_nat) fprintf_unfiltered (gdb_stdlog, - "RC: PTRACE_CONT %s, 0, 0 (resuming sibling)\n", + "RC: %s %s, 0, 0 (resuming sibling)\n", + step ? "PTRACE_SINGLESTEP" : "PTRACE_CONT", target_pid_to_str (lp->ptid)); linux_ops->to_resume (linux_ops, 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", + "RC: %s %s, 0, 0 (resume sibling)\n", + step ? "PTRACE_SINGLESTEP" : "PTRACE_CONT", target_pid_to_str (lp->ptid)); lp->stopped = 0; - lp->step = 0; + lp->step = step; memset (&lp->siginfo, 0, sizeof (lp->siginfo)); lp->stopped_by_watchpoint = 0; } diff --git a/gdb/m2-valprint.c b/gdb/m2-valprint.c index e27ce8c..f826ca4 100644 --- a/gdb/m2-valprint.c +++ b/gdb/m2-valprint.c @@ -235,7 +235,7 @@ print_unpacked_pointer (struct type *type, && TYPE_CODE (elttype) == TYPE_CODE_INT && (options->format == 0 || options->format == 's') && addr != 0) - return val_print_string (TYPE_TARGET_TYPE (type), addr, -1, + return val_print_string (TYPE_TARGET_TYPE (type), NULL, addr, -1, stream, options); return 0; @@ -296,7 +296,7 @@ m2_print_array_contents (struct type *type, const gdb_byte *valaddr, || ((current_language->la_language == language_m2) && (TYPE_CODE (type) == TYPE_CODE_CHAR))) && (options->format == 0 || options->format == 's')) - val_print_string (type, address, len+1, stream, options); + val_print_string (type, NULL, address, len+1, stream, options); else { fprintf_filtered (stream, "{"); diff --git a/gdb/m32r-rom.c b/gdb/m32r-rom.c index 1e4e698..5f0126b 100644 --- a/gdb/m32r-rom.c +++ b/gdb/m32r-rom.c @@ -188,7 +188,7 @@ m32r_load (char *filename, int from_tty) the stack may not be valid, and things would get horribly confused... */ - clear_symtab_users (); + clear_symtab_users (0); } static void @@ -551,7 +551,7 @@ m32r_upload_command (char *args, int from_tty) the stack may not be valid, and things would get horribly confused... */ - clear_symtab_users (); hooks/post-receive -- Repository for Project Archer.