diff --git a/bfd/version.h b/bfd/version.h index 7e8381ad7aa..50af28cf8fd 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -16,7 +16,7 @@ In releases, the date is not included in either version strings or sonames. */ -#define BFD_VERSION_DATE 20260818 +#define BFD_VERSION_DATE 20260819 #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/dwarf2/read.c b/gdb/dwarf2/read.c index ca475f53745..a8b99425554 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -3770,15 +3770,16 @@ process_queue (dwarf2_per_objfile *per_objfile) if (signatured_type *sig_type = per_cu->as_signatured_type (); sig_type != nullptr) { - sprintf (buf, "TU %s at offset %s", hex_string (sig_type->signature), - sect_offset_str (per_cu->sect_off ())); + xsnprintf (buf, sizeof (buf), "TU %s at offset %s", + hex_string (sig_type->signature), + sect_offset_str (per_cu->sect_off ())); /* There can be 100s of TUs. Only print them in verbose mode. */ debug_print_threshold = 2; } else { - sprintf (buf, "CU at offset %s", - sect_offset_str (per_cu->sect_off ())); + xsnprintf (buf, sizeof (buf), "CU at offset %s", + sect_offset_str (per_cu->sect_off ())); debug_print_threshold = 1; } diff --git a/gdb/elfread.c b/gdb/elfread.c index e3890ae0270..fcbd0176d08 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -804,20 +804,17 @@ static int elf_gnu_ifunc_resolve_by_got (const char *name, CORE_ADDR *addr_p) { gnu_ifunc_debug_printf ("resolving \"%s\" by GOT", name); - char *name_got_plt; - const size_t got_suffix_len = strlen (SYMBOL_GOT_PLT_SUFFIX); int found = 0; const char *func = __func__; - name_got_plt = (char *) alloca (strlen (name) + got_suffix_len + 1); - sprintf (name_got_plt, "%s" SYMBOL_GOT_PLT_SUFFIX, name); + std::string name_got_plt = std::string (name) + SYMBOL_GOT_PLT_SUFFIX; /* FIXME: we only search the initial namespace. To search other namespaces, we would need to provide context, e.g. in form of an objfile in that namespace. */ current_program_space->iterate_over_objfiles_in_search_order - ([name, name_got_plt, &addr_p, &found, func] (struct objfile *objfile) + ([name, &name_got_plt, &addr_p, &found, func] (struct objfile *objfile) { bfd *obfd = objfile->obfd.get (); struct gdbarch *gdbarch = objfile->arch (); @@ -828,8 +825,8 @@ elf_gnu_ifunc_resolve_by_got (const char *name, CORE_ADDR *addr_p) gdb_byte *buf = (gdb_byte *) alloca (ptr_size); bound_minimal_symbol msym - = lookup_minimal_symbol (current_program_space, name_got_plt, - objfile); + = lookup_minimal_symbol (current_program_space, + name_got_plt.c_str (), objfile); if (msym.minsym == NULL) return 0; if (msym.minsym->type () != mst_slot_got_plt) @@ -850,7 +847,8 @@ elf_gnu_ifunc_resolve_by_got (const char *name, CORE_ADDR *addr_p) addr = gdbarch_addr_bits_remove (gdbarch, addr); gnu_ifunc_debug_printf_func (func, "GOT entry \"%s\" points to %s", - name_got_plt, paddress (gdbarch, addr)); + name_got_plt.c_str (), + paddress (gdbarch, addr)); if (elf_gnu_ifunc_record_cache (name, addr)) { diff --git a/gdb/testsuite/gdb.ada/bp_c_mixed_case.exp b/gdb/testsuite/gdb.ada/bp_c_mixed_case.exp index 4dd4106649a..d428825e051 100644 --- a/gdb/testsuite/gdb.ada/bp_c_mixed_case.exp +++ b/gdb/testsuite/gdb.ada/bp_c_mixed_case.exp @@ -60,8 +60,12 @@ gdb_test "p " \ " = void" \ "p , in Ada" +# The optional leading dot is for ppc64 v1 ABI function descriptors. gdb_test "p " \ - " = {} $hex " \ + [quotemeta \ + [string cat \ + {$@DECIMAL = {} @HEX} \ + { <@/[.]?/NoDebugMixedCaseFunc>}]] \ "p , in Ada" # Try inserting a breakpoint inside a C function. Because the function's diff --git a/gdb/testsuite/gdb.ada/unchecked_union.exp b/gdb/testsuite/gdb.ada/unchecked_union.exp index 6a54e606712..ef9da787e65 100644 --- a/gdb/testsuite/gdb.ada/unchecked_union.exp +++ b/gdb/testsuite/gdb.ada/unchecked_union.exp @@ -24,20 +24,23 @@ standard_ada_testfile unchecked_union proc multi_line_string {str} { set result {} foreach line $str { - lappend result [string_to_regexp $line] + lappend result [quotemeta $line] } set res [multi_line {*}$result] verbose -log "RES: '$res'" return $res } +# Note the quotemeta expression here. gnat-llvm emits slightly a +# different encoding here, which lets gdb see the discriminant for a +# branch. set inner_string \ [list \ " case ? is" \ " when 0 =>" \ " small: range 0 .. 255;" \ " second: range 0 .. 255;" \ - " when ? =>" \ + " when @/\[1?\]/ =>" \ " bval: range 0 .. 255;" \ " when others =>" \ " large: range 255 .. 510;" \ @@ -50,12 +53,15 @@ set inner_full \ $inner_string \ [list "end record"]] +# Note the quotemeta expression here. gnat-llvm emits slightly a +# different encoding here, which lets gdb see the discriminant for a +# branch. set pair_string \ [list \ " case ? is" \ - " when ? =>" \ + " when @/\[0?\]/ =>" \ " field_one: range 0 .. 255;" \ - " when ? =>" \ + " when @/(\\?|others)/ =>" \ " field_two: range 255 .. 510;" \ " end case;"] diff --git a/gdb/testsuite/gdb.base/tailcall-msym.exp b/gdb/testsuite/gdb.base/tailcall-msym.exp index d6cd06f88cd..9ffaa7f17c1 100644 --- a/gdb/testsuite/gdb.base/tailcall-msym.exp +++ b/gdb/testsuite/gdb.base/tailcall-msym.exp @@ -132,6 +132,25 @@ if { [prepare_for_testing "prepare" ${testfile}-updated $asm_file {nodebug}] } { return } +foreach func {caller callee main dummy_func} { + set re_found \ + "^$valnum_re = {} $hex <$func>" + + set found 0 + gdb_test_multiple "p $func" "" { + -re -wrap $re_found { + set found 1 + } + -re -wrap "" { + } + } + + if {!$found} { + unsupported "couldn't find function $func" + return + } +} + if {![runto callee]} { return } diff --git a/gdb/testsuite/gdb.opt/break-on-_exit.exp b/gdb/testsuite/gdb.opt/break-on-_exit.exp index fa7cd96d61d..9caa54e4ad8 100644 --- a/gdb/testsuite/gdb.opt/break-on-_exit.exp +++ b/gdb/testsuite/gdb.opt/break-on-_exit.exp @@ -62,4 +62,6 @@ gdb_test "info shared" # If the skip_prologue analysis of _exit is too eager, we may not hit the # breakpoint. -gdb_continue_to_breakpoint "_exit" "_exit \\(\\) .*" +# The optional leading dot is for ppc64 v1 ABI function descriptors. +gdb_continue_to_breakpoint "_exit" \ + [quotemeta {@/[.]?/_exit () @...}] diff --git a/gdb/testsuite/gdb.python/py-failed-init.exp b/gdb/testsuite/gdb.python/py-failed-init.exp index c2b9c990e29..b2ea8c152fe 100644 --- a/gdb/testsuite/gdb.python/py-failed-init.exp +++ b/gdb/testsuite/gdb.python/py-failed-init.exp @@ -22,7 +22,7 @@ save_vars { env(PYTHONHOME) } { } gdb_test "python print (1)" \ - "Python not initialized" + "(Python not initialized|1)" set output_seen 0 gdb_test_multiple "quit" "" { diff --git a/gdb/testsuite/gdb.python/py-selected-context.exp b/gdb/testsuite/gdb.python/py-selected-context.exp index 28b9b456003..07ace151f26 100644 --- a/gdb/testsuite/gdb.python/py-selected-context.exp +++ b/gdb/testsuite/gdb.python/py-selected-context.exp @@ -46,7 +46,9 @@ proc event_regexp { inferior {thread "None"} {frame "None"}} { # inferior. INF should be an inferior number, e.g. '1', '2', etc. proc check_inferior { inf testname } { gdb_test "info inferiors" \ - "\r\n\\*\\s+[string_to_regexp $inf]\\s+\[^\r\n\]*(?=\r\n)" \ + [multi_line \ + "" \ + [subst_vars {[*]\s+$inf\s+[^\r\n]*(?=\r\n).*}]] \ $testname } diff --git a/gdb/testsuite/gdb.rocm/watchpoint-at-end-of-shader.exp b/gdb/testsuite/gdb.rocm/watchpoint-at-end-of-shader.exp index 2ae0e044a53..298b5be9461 100644 --- a/gdb/testsuite/gdb.rocm/watchpoint-at-end-of-shader.exp +++ b/gdb/testsuite/gdb.rocm/watchpoint-at-end-of-shader.exp @@ -71,7 +71,8 @@ proc do_test {precise_memory has_xfail} { setup_xfail "*-*-*" } gdb_test "continue" \ - [multi_line "Switching to \[^\r\n\]+(?=\r\n)" \ + [multi_line \ + {Switching to [^\r\n]+} \ "" \ "Thread $::decimal \[^\r\n\]*hit Hardware watchpoint $::decimal: -location \\*v" \ "" \ diff --git a/gdb/testsuite/gdb.tui/tailcall-msym.exp b/gdb/testsuite/gdb.tui/tailcall-msym.exp index 81b52355c01..1e13414f760 100644 --- a/gdb/testsuite/gdb.tui/tailcall-msym.exp +++ b/gdb/testsuite/gdb.tui/tailcall-msym.exp @@ -136,15 +136,36 @@ if { [build_executable "build" $real_testfile $asm_file {nodebug}] } { Term::clean_restart 24 80 $real_testfile -if {![runto callee]} { +if {![Term::prepare_for_tui]} { + unsupported "TUI not supported" return } -if {![Term::enter_tui]} { - unsupported "TUI not supported" +foreach func {caller callee main dummy_func} { + set re_found \ + "^$valnum_re = {} $hex <$func>" + + set found 0 + gdb_test_multiple "p $func" "" { + -re -wrap $re_found { + set found 1 + } + -re -wrap "" { + } + } + + if {!$found} { + unsupported "couldn't find function $func" + return + } +} + +if {![runto callee]} { return } +Term::command_no_prompt_prefix "tui enable" + # Check the function name on display in the status bar. The interesting # case here is 'caller', which is a tailcall function in an objfile with # no debug information. diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 798bb9a552d..932a8f557e4 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -1164,6 +1164,9 @@ collection_list::stringify () gdb_printf ("\n"); if (!m_memranges.empty () && info_verbose) gdb_printf ("Collecting memranges: \n"); + + char *buf_end = temp_buf.data () + temp_buf.size (); + for (i = 0, count = 0, end = temp_buf.data (); i < m_memranges.size (); i++) { @@ -1193,11 +1196,12 @@ collection_list::stringify () "FFFFFFFF" (or more, depending on sizeof (unsigned)). Special-case it. */ if (m_memranges[i].type == memrange_absolute) - sprintf (end, "M-1,%s,%lX", phex_nz (m_memranges[i].start, 0), - (long) length); + xsnprintf (end, buf_end - end, "M-1,%s,%lX", + phex_nz (m_memranges[i].start, 0), (long) length); else - sprintf (end, "M%X,%s,%lX", m_memranges[i].type, - phex_nz (m_memranges[i].start, 0), (long) length); + xsnprintf (end, buf_end - end, "M%X,%s,%lX", + m_memranges[i].type, phex_nz (m_memranges[i].start, 0), + (long) length); } count += strlen (end); @@ -1213,7 +1217,9 @@ collection_list::stringify () count = 0; end = temp_buf.data (); } - sprintf (end, "X%08X,", (int) m_aexprs[i]->buf.size ()); + + xsnprintf (end, buf_end - end, "X%08X,", + (int) m_aexprs[i]->buf.size ()); end += 10; /* 'X' + 8 hex digits + ',' */ count += 10; @@ -2816,11 +2822,14 @@ encode_source_string (int tpnum, ULONGEST addr, { if (80 + strlen (srctype) > buf_size) error (_("Buffer too small for source encoding")); - sprintf (buf, "%x:%s:%s:%x:%x:", - tpnum, phex_nz (addr), - srctype, 0, (int) strlen (src)); + + xsnprintf (buf, buf_size, "%x:%s:%s:%x:%x:", + tpnum, phex_nz (addr), + srctype, 0, (int) strlen (src)); + if (strlen (buf) + strlen (src) * 2 >= buf_size) error (_("Source string too long for buffer")); + bin2hex ((gdb_byte *) src, buf + strlen (buf), strlen (src)); return -1; } diff --git a/gdbsupport/common-utils.cc b/gdbsupport/common-utils.cc index 3ae3afcc380..f31699be13a 100644 --- a/gdbsupport/common-utils.cc +++ b/gdbsupport/common-utils.cc @@ -92,10 +92,9 @@ std::string string_printf (const char* fmt, ...) { va_list vp; - int size; va_start (vp, fmt); - size = vsnprintf (NULL, 0, fmt, vp); + int size = vsnprintf (NULL, 0, fmt, vp); va_end (vp); std::string str (size, '\0'); @@ -103,7 +102,8 @@ string_printf (const char* fmt, ...) /* C++11 and later guarantee std::string uses contiguous memory and always includes the terminating '\0'. */ va_start (vp, fmt); - vsprintf (&str[0], fmt, vp); + int ret = vsnprintf (&str[0], size + 1, fmt, vp); + gdb_assert (ret == size); va_end (vp); return str; @@ -115,17 +115,17 @@ std::string string_vprintf (const char* fmt, va_list args) { va_list vp; - size_t size; va_copy (vp, args); - size = vsnprintf (NULL, 0, fmt, vp); + int size = vsnprintf (NULL, 0, fmt, vp); va_end (vp); std::string str (size, '\0'); /* C++11 and later guarantee std::string uses contiguous memory and always includes the terminating '\0'. */ - vsprintf (&str[0], fmt, args); + int ret = vsnprintf (&str[0], size + 1, fmt, args); + gdb_assert (ret == size); return str; } @@ -152,10 +152,9 @@ std::string & string_vappendf (std::string &str, const char *fmt, va_list args) { va_list vp; - int grow_size; va_copy (vp, args); - grow_size = vsnprintf (NULL, 0, fmt, vp); + int grow_size = vsnprintf (NULL, 0, fmt, vp); va_end (vp); size_t curr_size = str.size (); @@ -163,7 +162,8 @@ string_vappendf (std::string &str, const char *fmt, va_list args) /* C++11 and later guarantee std::string uses contiguous memory and always includes the terminating '\0'. */ - vsprintf (&str[curr_size], fmt, args); + int ret = vsnprintf (&str[curr_size], grow_size + 1, fmt, args); + gdb_assert (ret == grow_size); return str; } diff --git a/gdbsupport/xml-utils.cc b/gdbsupport/xml-utils.cc index 13dc2749912..cec7281c929 100644 --- a/gdbsupport/xml-utils.cc +++ b/gdbsupport/xml-utils.cc @@ -88,52 +88,55 @@ string_xml_appendf (std::string &buffer, const char *format, ...) str = va_arg (ap, char *); break; case 'd': - sprintf (str, "%d", va_arg (ap, int)); + xsnprintf (buf, sizeof (buf), "%d", va_arg (ap, int)); break; case 'u': - sprintf (str, "%u", va_arg (ap, unsigned int)); + xsnprintf (buf, sizeof (buf), "%u", va_arg (ap, unsigned int)); break; case 'x': - sprintf (str, "%x", va_arg (ap, unsigned int)); + xsnprintf (buf, sizeof (buf), "%x", va_arg (ap, unsigned int)); break; case 'o': - sprintf (str, "%o", va_arg (ap, unsigned int)); + xsnprintf (buf, sizeof (buf), "%o", va_arg (ap, unsigned int)); break; case 'l': f++; switch (*f) { case 'd': - sprintf (str, "%ld", va_arg (ap, long)); + xsnprintf (buf, sizeof (buf), "%ld", va_arg (ap, long)); break; case 'u': - sprintf (str, "%lu", va_arg (ap, unsigned long)); + xsnprintf (buf, sizeof (buf), "%lu", + va_arg (ap, unsigned long)); break; case 'x': - sprintf (str, "%lx", va_arg (ap, unsigned long)); + xsnprintf (buf, sizeof (buf), "%lx", + va_arg (ap, unsigned long)); break; case 'o': - sprintf (str, "%lo", va_arg (ap, unsigned long)); + xsnprintf (buf, sizeof (buf), "%lo", + va_arg (ap, unsigned long)); break; case 'l': f++; switch (*f) { case 'd': - sprintf (str, "%" PRId64, - (int64_t) va_arg (ap, long long)); + xsnprintf (buf, sizeof (buf), "%" PRId64, + (int64_t) va_arg (ap, long long)); break; case 'u': - sprintf (str, "%" PRIu64, - (uint64_t) va_arg (ap, unsigned long long)); + xsnprintf (buf, sizeof (buf), "%" PRIu64, + (uint64_t) va_arg (ap, unsigned long long)); break; case 'x': - sprintf (str, "%" PRIx64, - (uint64_t) va_arg (ap, unsigned long long)); + xsnprintf (buf, sizeof (buf), "%" PRIx64, + (uint64_t) va_arg (ap, unsigned long long)); break; case 'o': - sprintf (str, "%" PRIo64, - (uint64_t) va_arg (ap, unsigned long long)); + xsnprintf (buf, sizeof (buf), "%" PRIo64, + (uint64_t) va_arg (ap, unsigned long long)); break; default: str = 0; diff --git a/ld/ldfile.c b/ld/ldfile.c index 00fe1d90d44..cad1e168af0 100644 --- a/ld/ldfile.c +++ b/ld/ldfile.c @@ -881,15 +881,30 @@ ldfile_find_command_file (const char *name, the same linker script twice. */ if (stat (filename, &sbuf1) == 0) { - struct stat sbuf2; +#if defined _WIN32 && ! defined __CYGWIN__ + /* Native Windows stat reports st_ino as zero on most file + systems. Compare file names there. */ + bool have_inode = sbuf1.st_ino != 0; +#else + bool have_inode = true; +#endif + for (script = processed_scripts; script != NULL; script = script->next) - if ((open_how != script_nonT || script->open_how != script_nonT) - && stat (script->name, &sbuf2) == 0 - && SAME_INODE (sbuf1, sbuf2)) - fatal (_("%P: error: linker script file '%s (%s)'" - " appears multiple times\n"), filename, script->name); + { + struct stat sbuf2; + + if (open_how == script_nonT && script->open_how == script_nonT) + continue; + + if (have_inode + ? (stat (script->name, &sbuf2) == 0 + && SAME_INODE (sbuf1, sbuf2)) + : filename_cmp (filename, script->name) == 0) + fatal (_("%P: error: linker script file '%s (%s)'" + " appears multiple times\n"), filename, script->name); + } } len = strlen (filename); diff --git a/opcodes/z80-dis.c b/opcodes/z80-dis.c index d5b4c4210d0..0269b6f3415 100644 --- a/opcodes/z80-dis.c +++ b/opcodes/z80-dis.c @@ -21,6 +21,7 @@ #include "sysdep.h" #include "disassemble.h" +#include "libiberty.h" #include struct buffer @@ -768,11 +769,55 @@ pref_ind (struct buffer *buf, disassemble_info *info, const char *txt) static int print_insn_z80_buf (struct buffer *buf, disassemble_info *info); +struct sized_buf +{ + char *buf; + size_t size; +}; + +/* An fprintf_ftype implementation writing to STREAM, which must point to a + struct sized_buf. */ + +static int ATTRIBUTE_PRINTF_2 +sized_buf_printf (void *stream, const char *format, ...) +{ + va_list ap; + int ret; + struct sized_buf *sbuf = stream; + + va_start (ap, format); + ret = vsnprintf (sbuf->buf, sbuf->size, format, ap); + va_end (ap); + + return ret; +} + +/* Same as sized_buf_printf, but as an fprintf_styled_ftype implementation. + The style is ignored for now. */ + +static int ATTRIBUTE_PRINTF_3 +sized_buf_styled_printf (void *stream, + enum disassembler_style style ATTRIBUTE_UNUSED, + const char *format, ...) +{ + va_list ap; + int ret; + struct sized_buf *sbuf = stream; + + va_start (ap, format); + ret = vsnprintf (sbuf->buf, sbuf->size, format, ap); + va_end (ap); + + return ret; +} + static int suffix (struct buffer *buf, disassemble_info *info, const char *txt) { char mybuf[TXTSIZ*4]; + struct sized_buf sbuf = { mybuf, ARRAY_SIZE (mybuf) }; fprintf_ftype old_fprintf; + fprintf_styled_ftype old_fprintf_styled; void *old_stream; char *p; @@ -800,15 +845,15 @@ suffix (struct buffer *buf, disassemble_info *info, const char *txt) } old_fprintf = info->fprintf_func; + old_fprintf_styled = info->fprintf_styled_func; old_stream = info->stream; - info->fprintf_func = (fprintf_ftype) &sprintf; - info->stream = mybuf; + disassemble_set_printf (info, &sbuf, sized_buf_printf, + sized_buf_styled_printf); mybuf[0] = 0; buf->base++; if (print_insn_z80_buf (buf, info) >= 0) buf->n_used++; - info->fprintf_func = old_fprintf; - info->stream = old_stream; + disassemble_set_printf (info, old_stream, old_fprintf, old_fprintf_styled); for (p = mybuf; *p; ++p) if (*p == ' ') diff --git a/sim/Makefile.in b/sim/Makefile.in index 1f9bbfec03f..2a23b5c2eaa 100644 --- a/sim/Makefile.in +++ b/sim/Makefile.in @@ -5722,7 +5722,7 @@ testsuite/common/bits64m63.c: testsuite/common/bits-gen$(EXEEXT) testsuite/commo @SIM_ENABLE_ARCH_ppc_TRUE@ppc/defines.h: ppc/stamp-defines ; @true @SIM_ENABLE_ARCH_ppc_TRUE@ppc/stamp-defines: config.h Makefile -@SIM_ENABLE_ARCH_ppc_TRUE@ $(AM_V_GEN)$(SED) -n -e '/^#define HAVE_.*1$$/{ s/ 1$$/",/; s/.* HAVE_/"HAVE_/; p }' < config.h > ppc/defines.hin +@SIM_ENABLE_ARCH_ppc_TRUE@ $(AM_V_GEN)$(SED) -n -e '/^#define HAVE_.*1$$/{ s/ 1$$/",/; s/.* HAVE_/"HAVE_/; p; }' < config.h > ppc/defines.hin @SIM_ENABLE_ARCH_ppc_TRUE@ $(AM_V_at)$(SHELL) $(srcroot)/move-if-change ppc/defines.hin ppc/defines.h @SIM_ENABLE_ARCH_ppc_TRUE@ $(AM_V_at)touch $@ diff --git a/sim/m32r/traps.c b/sim/m32r/traps.c index 7b98b245397..43a81c915d1 100644 --- a/sim/m32r/traps.c +++ b/sim/m32r/traps.c @@ -134,7 +134,9 @@ m32r_core_signal (SIM_DESC sd, SIM_CPU *current_cpu, sim_cia cia, sim_core_signal (sd, current_cpu, cia, map, nr_bytes, addr, transfer, sig); } - + +#ifdef __linux__ + /* Translate target's address to host's address. */ static void * @@ -180,6 +182,8 @@ translate_endian_t2h (void *addr, size_t size) *((unsigned short *) p) = T2H_2 (*((unsigned short *) p)); } +#endif /* __linux__ */ + /* Trap support. The result is the pc address to continue at. Preprocessing like saving the various registers has already been done. */ @@ -188,7 +192,6 @@ USI m32r_trap (SIM_CPU *current_cpu, PCADDR pc, int num) { SIM_DESC sd = CPU_STATE (current_cpu); - host_callback *cb = STATE_CALLBACK (sd); if (STATE_ENVIRONMENT (sd) == OPERATING_ENVIRONMENT) goto case_default; @@ -217,6 +220,7 @@ m32r_trap (SIM_CPU *current_cpu, PCADDR pc, int num) #ifdef __linux__ case TRAP_LINUX_SYSCALL: { + host_callback *cb = STATE_CALLBACK (sd); CB_SYSCALL s; unsigned int func, arg1, arg2, arg3, arg4, arg5, arg6, arg7; int result, errcode; diff --git a/sim/ppc/local.mk b/sim/ppc/local.mk index f9f134abe3c..9aca96465ac 100644 --- a/sim/ppc/local.mk +++ b/sim/ppc/local.mk @@ -80,7 +80,7 @@ noinst_PROGRAMS += %D%/run %D%/defines.h: %D%/stamp-defines ; @true %D%/stamp-defines: config.h Makefile - $(AM_V_GEN)$(SED) -n -e '/^#define HAVE_.*1$$/{ s/ 1$$/",/; s/.* HAVE_/"HAVE_/; p }' < config.h > %D%/defines.hin + $(AM_V_GEN)$(SED) -n -e '/^#define HAVE_.*1$$/{ s/ 1$$/",/; s/.* HAVE_/"HAVE_/; p; }' < config.h > %D%/defines.hin $(AM_V_at)$(SHELL) $(srcroot)/move-if-change %D%/defines.hin %D%/defines.h $(AM_V_at)touch $@