Date: Sun, 17 May 2015 16:17:16 +0000 (UTC) From: Sean Bruno <sbruno@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r283031 - in projects/ci20_mips: cddl/contrib/opensolaris/lib/libdtrace/common cddl/lib/libdtrace contrib/gcc contrib/gdb/gdb contrib/libarchive/libarchive gnu/lib include lib/libthr/th... Message-ID: <201505171617.t4HGHGaf068075@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sbruno Date: Sun May 17 16:17:15 2015 New Revision: 283031 URL: https://svnweb.freebsd.org/changeset/base/283031 Log: MFH @283030 Added: projects/ci20_mips/cddl/lib/libdtrace/siftr.d - copied unchanged from r283030, head/cddl/lib/libdtrace/siftr.d projects/ci20_mips/sys/arm/annapurna/ - copied from r283030, head/sys/arm/annapurna/ projects/ci20_mips/sys/arm/conf/ALPINE - copied unchanged from r283030, head/sys/arm/conf/ALPINE projects/ci20_mips/sys/boot/fdt/dts/arm/annapurna-alpine.dts - copied unchanged from r283030, head/sys/boot/fdt/dts/arm/annapurna-alpine.dts projects/ci20_mips/tools/build/stdlib.h - copied unchanged from r283030, head/tools/build/stdlib.h Modified: projects/ci20_mips/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l projects/ci20_mips/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c projects/ci20_mips/cddl/lib/libdtrace/Makefile projects/ci20_mips/cddl/lib/libdtrace/tcp.d projects/ci20_mips/contrib/gcc/dwarf2.h projects/ci20_mips/contrib/gdb/gdb/c-valprint.c projects/ci20_mips/contrib/gdb/gdb/dwarf2expr.c projects/ci20_mips/contrib/gdb/gdb/dwarf2expr.h projects/ci20_mips/contrib/gdb/gdb/dwarf2loc.c projects/ci20_mips/contrib/gdb/gdb/dwarf2read.c projects/ci20_mips/contrib/gdb/gdb/value.h projects/ci20_mips/contrib/gdb/gdb/values.c projects/ci20_mips/contrib/libarchive/libarchive/archive_read.c projects/ci20_mips/contrib/libarchive/libarchive/archive_read_support_format_cpio.c projects/ci20_mips/gnu/lib/Makefile projects/ci20_mips/include/stdlib.h projects/ci20_mips/lib/libthr/thread/thr_spec.c projects/ci20_mips/sbin/ifconfig/ifconfig.8 projects/ci20_mips/sbin/ifconfig/ifgif.c projects/ci20_mips/sbin/ifconfig/sfp.c projects/ci20_mips/share/man/man4/iic.4 projects/ci20_mips/share/mk/src.libnames.mk projects/ci20_mips/sys/amd64/amd64/pmap.c projects/ci20_mips/sys/arm/arm/cpufunc.c projects/ci20_mips/sys/arm/arm/cpufunc_asm_armv7.S projects/ci20_mips/sys/arm/arm/cpuinfo.c projects/ci20_mips/sys/arm/arm/pmap.c projects/ci20_mips/sys/arm/include/cpu-v6.h projects/ci20_mips/sys/arm/include/cpufunc.h projects/ci20_mips/sys/boot/arm/uboot/Makefile projects/ci20_mips/sys/boot/i386/boot0/boot0.S projects/ci20_mips/sys/dev/acpi_support/acpi_ibm.c projects/ci20_mips/sys/dev/fdt/simplebus.c projects/ci20_mips/sys/dev/gpio/ofw_gpiobus.c projects/ci20_mips/sys/dev/iscsi/icl_soft.c projects/ci20_mips/sys/dev/iwn/if_iwn.c projects/ci20_mips/sys/dev/ixl/if_ixlv.c projects/ci20_mips/sys/dev/netmap/netmap_mem2.c projects/ci20_mips/sys/dev/ofw/ofw_bus_subr.c projects/ci20_mips/sys/dev/ofw/ofw_bus_subr.h projects/ci20_mips/sys/dev/ofw/ofw_iicbus.c projects/ci20_mips/sys/dev/sfxge/sfxge.c projects/ci20_mips/sys/dev/sfxge/sfxge_port.c projects/ci20_mips/sys/dev/sfxge/sfxge_rx.c projects/ci20_mips/sys/dev/sfxge/sfxge_tx.c projects/ci20_mips/sys/dev/sfxge/sfxge_tx.h projects/ci20_mips/sys/kern/init_main.c projects/ci20_mips/sys/kern/kern_condvar.c projects/ci20_mips/sys/kern/kern_thread.c projects/ci20_mips/sys/mips/beri/beri_simplebus.c projects/ci20_mips/sys/mips/include/intr_machdep.h projects/ci20_mips/sys/net/if_gif.h projects/ci20_mips/sys/net/sff8436.h projects/ci20_mips/sys/net/sff8472.h projects/ci20_mips/sys/netinet/in_gif.c projects/ci20_mips/sys/netinet6/in6_gif.c projects/ci20_mips/sys/netipsec/esp.h projects/ci20_mips/sys/powerpc/ofw/ofw_pcibus.c projects/ci20_mips/sys/powerpc/pseries/vdevice.c projects/ci20_mips/sys/sys/cdefs.h projects/ci20_mips/sys/sys/condvar.h projects/ci20_mips/sys/sys/malloc.h projects/ci20_mips/sys/sys/proc.h projects/ci20_mips/sys/x86/acpica/srat.c projects/ci20_mips/tools/build/Makefile projects/ci20_mips/tools/build/mk/OptionalObsoleteFiles.inc projects/ci20_mips/tools/regression/p1003_1b/main.c projects/ci20_mips/tools/regression/p1003_1b/prutil.c projects/ci20_mips/tools/tools/ath/athaggrstats/Makefile projects/ci20_mips/tools/tools/ath/athstats/Makefile projects/ci20_mips/tools/tools/mwl/mwlstats/Makefile projects/ci20_mips/tools/tools/net80211/wlanstats/Makefile projects/ci20_mips/tools/tools/npe/npestats/Makefile projects/ci20_mips/usr.bin/man/man.sh projects/ci20_mips/usr.bin/netstat/route.c projects/ci20_mips/usr.bin/ssh-copy-id/ssh-copy-id.sh projects/ci20_mips/usr.sbin/bsdinstall/scripts/zfsboot projects/ci20_mips/usr.sbin/mountd/mountd.c projects/ci20_mips/usr.sbin/syslogd/pathnames.h Directory Properties: projects/ci20_mips/ (props changed) projects/ci20_mips/cddl/ (props changed) projects/ci20_mips/cddl/contrib/opensolaris/ (props changed) projects/ci20_mips/contrib/gcc/ (props changed) projects/ci20_mips/contrib/gdb/ (props changed) projects/ci20_mips/contrib/libarchive/ (props changed) projects/ci20_mips/contrib/libarchive/libarchive/ (props changed) projects/ci20_mips/gnu/lib/ (props changed) projects/ci20_mips/include/ (props changed) projects/ci20_mips/sbin/ (props changed) projects/ci20_mips/share/ (props changed) projects/ci20_mips/share/man/man4/ (props changed) projects/ci20_mips/sys/ (props changed) projects/ci20_mips/sys/boot/ (props changed) Modified: projects/ci20_mips/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l ============================================================================== --- projects/ci20_mips/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l Sun May 17 16:14:48 2015 (r283030) +++ projects/ci20_mips/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l Sun May 17 16:17:15 2015 (r283031) @@ -743,6 +743,7 @@ yyinit(dt_pcb_t *pcb) #ifdef illumos yysptr = yysbuf; #endif + YY_FLUSH_BUFFER; } /* Modified: projects/ci20_mips/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- projects/ci20_mips/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Sun May 17 16:14:48 2015 (r283030) +++ projects/ci20_mips/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Sun May 17 16:17:15 2015 (r283031) @@ -1785,17 +1785,11 @@ dtrace_program_link(dtrace_hdl_t *dtp, d "failed to open %s: %s", file, strerror(errno))); } #else - if (dtp->dt_lazyload) { - if ((fd = open(file, O_RDWR | O_CREAT | O_TRUNC, 0666)) < 0) - return (dt_link_error(dtp, NULL, -1, NULL, - "failed to open %s: %s", file, strerror(errno))); - } else { - snprintf(tfile, sizeof(tfile), "%s.XXXXXX", file); - if ((fd = mkstemp(tfile)) == -1) - return (dt_link_error(dtp, NULL, -1, NULL, - "failed to create temporary file %s: %s", - tfile, strerror(errno))); - } + snprintf(tfile, sizeof(tfile), "%s.XXXXXX", file); + if ((fd = mkostemp(tfile, O_CLOEXEC)) == -1) + return (dt_link_error(dtp, NULL, -1, NULL, + "failed to create temporary file %s: %s", + tfile, strerror(errno))); #endif /* @@ -1951,14 +1945,23 @@ dtrace_program_link(dtrace_hdl_t *dtp, d } #endif } else { +#ifdef __FreeBSD__ + if (rename(tfile, file) != 0) { + ret = dt_link_error(dtp, NULL, fd, NULL, + "failed to rename %s to %s: %s", tfile, file, + strerror(errno)); + goto done; + } +#endif (void) close(fd); } done: dtrace_dof_destroy(dtp, dof); -#ifndef illumos - unlink(tfile); +#ifdef illumos + if (!dtp->dt_lazyload) + (void) unlink(tfile); #endif return (ret); } Modified: projects/ci20_mips/cddl/lib/libdtrace/Makefile ============================================================================== --- projects/ci20_mips/cddl/lib/libdtrace/Makefile Sun May 17 16:14:48 2015 (r283030) +++ projects/ci20_mips/cddl/lib/libdtrace/Makefile Sun May 17 16:17:15 2015 (r283031) @@ -50,6 +50,7 @@ DSRCS= errno.d \ io.d \ ip.d \ psinfo.d \ + siftr.d \ signal.d \ tcp.d \ udp.d \ Copied: projects/ci20_mips/cddl/lib/libdtrace/siftr.d (from r283030, head/cddl/lib/libdtrace/siftr.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/ci20_mips/cddl/lib/libdtrace/siftr.d Sun May 17 16:17:15 2015 (r283031, copy of r283030, head/cddl/lib/libdtrace/siftr.d) @@ -0,0 +1,100 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + * + * $FreeBSD$ + */ + +#pragma D depends_on module siftr +#pragma D depends_on provider tcp + +/* + * Convert a SIFTR direction value to a string + */ +#pragma D binding "1.12.1" SIFTR_IN +inline int SIFTR_IN = 1; +#pragma D binding "1.12.1" SIFTR_OUT +inline int SIFTR_OUT = 2; + +/* SIFTR direction strings. */ +#pragma D binding "1.12.1" siftr_dir_string +inline string siftr_dir_string[uint8_t direction] = + direction == SIFTR_IN ? "in" : + direction == SIFTR_OUT ? "out" : + "unknown" ; + +typedef struct siftrinfo { + struct timeval tval; + uint8_t direction; + uint8_t ipver; + uint32_t hash; + uint16_t tcp_localport; + uint16_t tcp_foreignport; + uint64_t snd_cwnd; + u_long snd_wnd; + u_long rcv_wnd; + u_long snd_bwnd; + u_long snd_ssthresh; + int conn_state; + u_int max_seg_size; + int smoothed_rtt; + u_char sack_enabled; + u_char snd_scale; + u_char rcv_scale; + u_int flags; + int rxt_length; + u_int snd_buf_hiwater; + u_int snd_buf_cc; + u_int rcv_buf_hiwater; + u_int rcv_buf_cc; + u_int sent_inflight_bytes; + int t_segqlen; + u_int flowid; + u_int flowtype; +} siftrinfo_t; + +#pragma D binding "1.12.1" translator +translator siftrinfo_t < struct pkt_node *p > { + direction = p == NULL ? 0 : p->direction; + ipver = p == NULL ? 0 : p->ipver; + hash = p == NULL ? 0 : p->hash; + tcp_localport = p == NULL ? 0 : ntohs(p->tcp_localport); + tcp_foreignport = p == NULL ? 0 : ntohs(p->tcp_foreignport); + snd_cwnd = p == NULL ? 0 : p->snd_cwnd; + snd_wnd = p == NULL ? 0 : p->snd_wnd; + rcv_wnd = p == NULL ? 0 : p->rcv_wnd; + snd_bwnd = p == NULL ? 0 : p->snd_bwnd; + snd_ssthresh = p == NULL ? 0 : p->snd_ssthresh; + conn_state = p == NULL ? 0 : p->conn_state; + max_seg_size = p == NULL ? 0 : p->max_seg_size; + smoothed_rtt = p == NULL ? 0 : p->smoothed_rtt; + sack_enabled = p == NULL ? 0 : p->sack_enabled; + snd_scale = p == NULL ? 0 : p->snd_scale; + rcv_scale = p == NULL ? 0 : p->rcv_scale; + flags = p == NULL ? 0 : p->flags; + rxt_length = p == NULL ? 0 : p->rxt_length; + snd_buf_hiwater = p == NULL ? 0 : p->snd_buf_hiwater; + snd_buf_cc = p == NULL ? 0 : p->snd_buf_cc; + rcv_buf_hiwater = p == NULL ? 0 : p->rcv_buf_hiwater; + rcv_buf_cc = p == NULL ? 0 : p->rcv_buf_cc; + sent_inflight_bytes = p == NULL ? 0 : p->sent_inflight_bytes; + t_segqlen = p == NULL ? 0 : p->t_segqlen; + flowid = p == NULL ? 0 : p->flowid; + flowtype = p == NULL ? 0 : p->flowtype; +}; Modified: projects/ci20_mips/cddl/lib/libdtrace/tcp.d ============================================================================== --- projects/ci20_mips/cddl/lib/libdtrace/tcp.d Sun May 17 16:14:48 2015 (r283030) +++ projects/ci20_mips/cddl/lib/libdtrace/tcp.d Sun May 17 16:17:15 2015 (r283031) @@ -241,78 +241,3 @@ translator tcpinfoh_t < struct tcphdr *p translator tcplsinfo_t < int s > { tcps_state = s; }; - -/* - * Convert a SIFTR direction value to a string - */ -#pragma D binding "1.12.1" SIFTR_IN -inline int SIFTR_IN = 1; -#pragma D binding "1.12.1" SIFTR_OUT -inline int SIFTR_OUT = 2; - -/* SIFTR direction strings. */ -#pragma D binding "1.12.1" siftr_dir_string -inline string siftr_dir_string[uint8_t direction] = - direction == SIFTR_IN ? "in" : - direction == SIFTR_OUT ? "out" : - "unknown" ; - -typedef struct siftrinfo { - struct timeval tval; - uint8_t direction; - uint8_t ipver; - uint32_t hash; - uint16_t tcp_localport; - uint16_t tcp_foreignport; - uint64_t snd_cwnd; - u_long snd_wnd; - u_long rcv_wnd; - u_long snd_bwnd; - u_long snd_ssthresh; - int conn_state; - u_int max_seg_size; - int smoothed_rtt; - u_char sack_enabled; - u_char snd_scale; - u_char rcv_scale; - u_int flags; - int rxt_length; - u_int snd_buf_hiwater; - u_int snd_buf_cc; - u_int rcv_buf_hiwater; - u_int rcv_buf_cc; - u_int sent_inflight_bytes; - int t_segqlen; - u_int flowid; - u_int flowtype; -} siftrinfo_t; - -#pragma D binding "1.12.1" translator -translator siftrinfo_t < struct pkt_node *p > { - direction = p == NULL ? 0 : p->direction; - ipver = p == NULL ? 0 : p->ipver; - hash = p == NULL ? 0 : p->hash; - tcp_localport = p == NULL ? 0 : ntohs(p->tcp_localport); - tcp_foreignport = p == NULL ? 0 : ntohs(p->tcp_foreignport); - snd_cwnd = p == NULL ? 0 : p->snd_cwnd; - snd_wnd = p == NULL ? 0 : p->snd_wnd; - rcv_wnd = p == NULL ? 0 : p->rcv_wnd; - snd_bwnd = p == NULL ? 0 : p->snd_bwnd; - snd_ssthresh = p == NULL ? 0 : p->snd_ssthresh; - conn_state = p == NULL ? 0 : p->conn_state; - max_seg_size = p == NULL ? 0 : p->max_seg_size; - smoothed_rtt = p == NULL ? 0 : p->smoothed_rtt; - sack_enabled = p == NULL ? 0 : p->sack_enabled; - snd_scale = p == NULL ? 0 : p->snd_scale; - rcv_scale = p == NULL ? 0 : p->rcv_scale; - flags = p == NULL ? 0 : p->flags; - rxt_length = p == NULL ? 0 : p->rxt_length; - snd_buf_hiwater = p == NULL ? 0 : p->snd_buf_hiwater; - snd_buf_cc = p == NULL ? 0 : p->snd_buf_cc; - rcv_buf_hiwater = p == NULL ? 0 : p->rcv_buf_hiwater; - rcv_buf_cc = p == NULL ? 0 : p->rcv_buf_cc; - sent_inflight_bytes = p == NULL ? 0 : p->sent_inflight_bytes; - t_segqlen = p == NULL ? 0 : p->t_segqlen; - flowid = p == NULL ? 0 : p->flowid; - flowtype = p == NULL ? 0 : p->flowtype; -}; Modified: projects/ci20_mips/contrib/gcc/dwarf2.h ============================================================================== --- projects/ci20_mips/contrib/gcc/dwarf2.h Sun May 17 16:14:48 2015 (r283030) +++ projects/ci20_mips/contrib/gcc/dwarf2.h Sun May 17 16:17:15 2015 (r283031) @@ -547,6 +547,7 @@ enum dwarf_location_atom DW_OP_bit_piece = 0x9d, /* GNU extensions. */ DW_OP_GNU_push_tls_address = 0xe0, + DW_OP_GNU_uninit = 0xf0, /* HP extensions. */ DW_OP_HP_unknown = 0xe0, /* Ouch, the same as GNU_push_tls_address. */ DW_OP_HP_is_value = 0xe1, Modified: projects/ci20_mips/contrib/gdb/gdb/c-valprint.c ============================================================================== --- projects/ci20_mips/contrib/gdb/gdb/c-valprint.c Sun May 17 16:14:48 2015 (r283030) +++ projects/ci20_mips/contrib/gdb/gdb/c-valprint.c Sun May 17 16:17:15 2015 (r283031) @@ -559,6 +559,10 @@ c_value_print (struct value *val, struct fprintf_filtered (stream, ") "); } } + + if (!value_initialized (val)) + fprintf_filtered (stream, " [uninitialized] "); + if (objectprint && (TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_CLASS)) { /* Attempt to determine real type of object */ Modified: projects/ci20_mips/contrib/gdb/gdb/dwarf2expr.c ============================================================================== --- projects/ci20_mips/contrib/gdb/gdb/dwarf2expr.c Sun May 17 16:14:48 2015 (r283030) +++ projects/ci20_mips/contrib/gdb/gdb/dwarf2expr.c Sun May 17 16:17:15 2015 (r283031) @@ -42,6 +42,8 @@ new_dwarf_expr_context (void) retval->stack_len = 0; retval->stack_allocated = 10; retval->stack = xmalloc (retval->stack_allocated * sizeof (CORE_ADDR)); + retval->num_pieces = 0; + retval->pieces = 0; return retval; } @@ -51,6 +53,7 @@ void free_dwarf_expr_context (struct dwarf_expr_context *ctx) { xfree (ctx->stack); + xfree (ctx->pieces); xfree (ctx); } @@ -100,6 +103,29 @@ dwarf_expr_fetch (struct dwarf_expr_cont } +/* Add a new piece to CTX's piece list. */ +static void +add_piece (struct dwarf_expr_context *ctx, + int in_reg, CORE_ADDR value, ULONGEST size) +{ + struct dwarf_expr_piece *p; + + ctx->num_pieces++; + + if (ctx->pieces) + ctx->pieces = xrealloc (ctx->pieces, + (ctx->num_pieces + * sizeof (struct dwarf_expr_piece))); + else + ctx->pieces = xmalloc (ctx->num_pieces + * sizeof (struct dwarf_expr_piece)); + + p = &ctx->pieces[ctx->num_pieces - 1]; + p->in_reg = in_reg; + p->value = value; + p->size = size; +} + /* Evaluate the expression at ADDR (LEN bytes long) using the context CTX. */ @@ -230,6 +256,7 @@ execute_stack_op (struct dwarf_expr_cont unsigned char *op_end) { ctx->in_reg = 0; + ctx->initialized = 1; /* Default is initialized. */ while (op_ptr < op_end) { @@ -356,9 +383,12 @@ execute_stack_op (struct dwarf_expr_cont case DW_OP_reg29: case DW_OP_reg30: case DW_OP_reg31: - if (op_ptr != op_end && *op_ptr != DW_OP_piece) - error ("DWARF-2 expression error: DW_OP_reg operations must be " - "used either alone or in conjuction with DW_OP_piece."); + if (op_ptr != op_end + && *op_ptr != DW_OP_piece + && *op_ptr != DW_OP_bit_piece + && *op_ptr != DW_OP_GNU_uninit) + error (_("DWARF-2 expression error: DW_OP_reg operations must be " + "used either alone or in conjuction with DW_OP_piece.")); result = op - DW_OP_reg0; ctx->in_reg = 1; @@ -661,6 +691,30 @@ execute_stack_op (struct dwarf_expr_cont case DW_OP_nop: goto no_push; + case DW_OP_piece: + { + ULONGEST size; + CORE_ADDR addr_or_regnum; + + /* Record the piece. */ + op_ptr = read_uleb128 (op_ptr, op_end, &size); + addr_or_regnum = dwarf_expr_fetch (ctx, 0); + add_piece (ctx, ctx->in_reg, addr_or_regnum, size); + + /* Pop off the address/regnum, and clear the in_reg flag. */ + dwarf_expr_pop (ctx); + ctx->in_reg = 0; + } + goto no_push; + + case DW_OP_GNU_uninit: + if (op_ptr != op_end) + error (_("DWARF-2 expression error: DW_OP_GNU_unint must always " + "be the very last op.")); + + ctx->initialized = 0; + goto no_push; + default: error ("Unhandled dwarf expression opcode 0x%x", op); } Modified: projects/ci20_mips/contrib/gdb/gdb/dwarf2expr.h ============================================================================== --- projects/ci20_mips/contrib/gdb/gdb/dwarf2expr.h Sun May 17 16:14:48 2015 (r283030) +++ projects/ci20_mips/contrib/gdb/gdb/dwarf2expr.h Sun May 17 16:17:15 2015 (r283031) @@ -74,6 +74,51 @@ struct dwarf_expr_context /* Non-zero if the result is in a register. The register number will be on the expression stack. */ int in_reg; + /* Initialization status of variable: Non-zero if variable has been + initialized; zero otherwise. */ + int initialized; + + /* An array of pieces. PIECES points to its first element; + NUM_PIECES is its length. + + Each time DW_OP_piece is executed, we add a new element to the + end of this array, recording the current top of the stack, the + current in_reg flag, and the size given as the operand to + DW_OP_piece. We then pop the top value from the stack, clear the + in_reg flag, and resume evaluation. + + The Dwarf spec doesn't say whether DW_OP_piece pops the top value + from the stack. We do, ensuring that clients of this interface + expecting to see a value left on the top of the stack (say, code + evaluating frame base expressions or CFA's specified with + DW_CFA_def_cfa_expression) will get an error if the expression + actually marks all the values it computes as pieces. + + If an expression never uses DW_OP_piece, num_pieces will be zero. + (It would be nice to present these cases as expressions yielding + a single piece, with in_reg clear, so that callers need not + distinguish between the no-DW_OP_piece and one-DW_OP_piece cases. + But expressions with no DW_OP_piece operations have no value to + place in a piece's 'size' field; the size comes from the + surrounding data. So the two cases need to be handled + separately.) */ + int num_pieces; + struct dwarf_expr_piece *pieces; +}; + +/* A piece of an object, as recorded by DW_OP_piece or DW_OP_bit_piece. */ +struct dwarf_expr_piece +{ + /* If IN_REG is zero, then the piece is in memory, and VALUE is its address. + If IN_REG is non-zero, then the piece is in a register, and VALUE + is the register number. */ + int in_reg; + + /* This piece's address or register number. */ + CORE_ADDR value; + + /* The length of the piece, in bytes. */ + ULONGEST size; }; struct dwarf_expr_context *new_dwarf_expr_context (void); Modified: projects/ci20_mips/contrib/gdb/gdb/dwarf2loc.c ============================================================================== --- projects/ci20_mips/contrib/gdb/gdb/dwarf2loc.c Sun May 17 16:14:48 2015 (r283030) +++ projects/ci20_mips/contrib/gdb/gdb/dwarf2loc.c Sun May 17 16:17:15 2015 (r283031) @@ -206,6 +206,7 @@ dwarf2_evaluate_loc_desc (struct symbol struct objfile *objfile) { CORE_ADDR result; + struct gdbarch *arch = get_frame_arch (frame); struct value *retval; struct dwarf_expr_baton baton; struct dwarf_expr_context *ctx; @@ -230,7 +231,32 @@ dwarf2_evaluate_loc_desc (struct symbol dwarf_expr_eval (ctx, data, size); result = dwarf_expr_fetch (ctx, 0); - if (ctx->in_reg) + if (ctx->num_pieces > 0) + { + int i; + long offset = 0; + bfd_byte *contents; + + retval = allocate_value (SYMBOL_TYPE (var)); + contents = VALUE_CONTENTS_RAW (retval); + for (i = 0; i < ctx->num_pieces; i++) + { + struct dwarf_expr_piece *p = &ctx->pieces[i]; + if (p->in_reg) + { + bfd_byte regval[MAX_REGISTER_SIZE]; + int gdb_regnum = DWARF2_REG_TO_REGNUM (p->value); + get_frame_register (frame, gdb_regnum, regval); + memcpy (contents + offset, regval, p->size); + } + else /* In memory? */ + { + read_memory (p->value, contents + offset, p->size); + } + offset += p->size; + } + } + else if (ctx->in_reg) { int regnum = DWARF2_REG_TO_REGNUM (result); retval = value_from_register (SYMBOL_TYPE (var), regnum, frame); @@ -245,6 +271,8 @@ dwarf2_evaluate_loc_desc (struct symbol VALUE_ADDRESS (retval) = result; } + set_value_initialized (retval, ctx->initialized); + free_dwarf_expr_context (ctx); return retval; @@ -322,6 +350,17 @@ dwarf2_loc_desc_needs_frame (unsigned ch in_reg = ctx->in_reg; + if (ctx->num_pieces > 0) + { + int i; + + /* If the location has several pieces, and any of them are in + registers, then we will need a frame to fetch them from. */ + for (i = 0; i < ctx->num_pieces; i++) + if (ctx->pieces[i].in_reg) + in_reg = 1; + } + free_dwarf_expr_context (ctx); return baton.needs_frame || in_reg; Modified: projects/ci20_mips/contrib/gdb/gdb/dwarf2read.c ============================================================================== --- projects/ci20_mips/contrib/gdb/gdb/dwarf2read.c Sun May 17 16:14:48 2015 (r283030) +++ projects/ci20_mips/contrib/gdb/gdb/dwarf2read.c Sun May 17 16:17:15 2015 (r283031) @@ -7110,6 +7110,8 @@ dwarf_stack_op_name (unsigned op) /* GNU extensions. */ case DW_OP_GNU_push_tls_address: return "DW_OP_GNU_push_tls_address"; + case DW_OP_GNU_uninit: + return "DW_OP_GNU_uninit"; default: return "OP_<unknown>"; } @@ -7634,6 +7636,9 @@ decode_locdesc (struct dwarf_block *blk, dwarf2_complex_location_expr_complaint (); break; + case DW_OP_GNU_uninit: + break; + default: complaint (&symfile_complaints, "unsupported stack op: '%s'", dwarf_stack_op_name (op)); Modified: projects/ci20_mips/contrib/gdb/gdb/value.h ============================================================================== --- projects/ci20_mips/contrib/gdb/gdb/value.h Sun May 17 16:14:48 2015 (r283030) +++ projects/ci20_mips/contrib/gdb/gdb/value.h Sun May 17 16:17:15 2015 (r283031) @@ -165,6 +165,9 @@ struct value /* The BFD section associated with this value. */ asection *bfd_section; + /* If value is a variable, is it initialized or not. */ + int initialized; + /* Actual contents of the value. For use of this value; setting it uses the stuff above. Not valid if lazy is nonzero. Target byte-order. We force it to be aligned properly for any Modified: projects/ci20_mips/contrib/gdb/gdb/values.c ============================================================================== --- projects/ci20_mips/contrib/gdb/gdb/values.c Sun May 17 16:14:48 2015 (r283030) +++ projects/ci20_mips/contrib/gdb/gdb/values.c Sun May 17 16:17:15 2015 (r283031) @@ -101,6 +101,7 @@ allocate_value (struct type *type) VALUE_EMBEDDED_OFFSET (val) = 0; VALUE_POINTED_TO_OFFSET (val) = 0; val->modifiable = 1; + val->initialized = 1; /* Default to initialized. */ return val; } @@ -1311,6 +1312,22 @@ using_struct_return (struct type *value_ == RETURN_VALUE_STRUCT_CONVENTION); } +/* Set the initialized field in a value struct. */ + +void +set_value_initialized (struct value *val, int status) +{ + val->initialized = status; +} + +/* Return the initialized field in a value struct. */ + +int +value_initialized (struct value *val) +{ + return val->initialized; +} + void _initialize_values (void) { Modified: projects/ci20_mips/contrib/libarchive/libarchive/archive_read.c ============================================================================== --- projects/ci20_mips/contrib/libarchive/libarchive/archive_read.c Sun May 17 16:14:48 2015 (r283030) +++ projects/ci20_mips/contrib/libarchive/libarchive/archive_read.c Sun May 17 16:17:15 2015 (r283031) @@ -1395,6 +1395,8 @@ __archive_read_filter_consume(struct arc { int64_t skipped; + if (request < 0) + return ARCHIVE_FATAL; if (request == 0) return 0; Modified: projects/ci20_mips/contrib/libarchive/libarchive/archive_read_support_format_cpio.c ============================================================================== --- projects/ci20_mips/contrib/libarchive/libarchive/archive_read_support_format_cpio.c Sun May 17 16:14:48 2015 (r283030) +++ projects/ci20_mips/contrib/libarchive/libarchive/archive_read_support_format_cpio.c Sun May 17 16:17:15 2015 (r283031) @@ -198,7 +198,7 @@ static int archive_read_format_cpio_read static int archive_read_format_cpio_read_header(struct archive_read *, struct archive_entry *); static int archive_read_format_cpio_skip(struct archive_read *); -static int be4(const unsigned char *); +static int64_t be4(const unsigned char *); static int find_odc_header(struct archive_read *); static int find_newc_header(struct archive_read *); static int header_bin_be(struct archive_read *, struct cpio *, @@ -213,7 +213,7 @@ static int header_afiol(struct archive_r struct archive_entry *, size_t *, size_t *); static int is_octal(const char *, size_t); static int is_hex(const char *, size_t); -static int le4(const unsigned char *); +static int64_t le4(const unsigned char *); static int record_hardlink(struct archive_read *a, struct cpio *cpio, struct archive_entry *entry); @@ -864,8 +864,11 @@ header_bin_le(struct archive_read *a, st /* Read fixed-size portion of header. */ h = __archive_read_ahead(a, bin_header_size, NULL); - if (h == NULL) + if (h == NULL) { + archive_set_error(&a->archive, 0, + "End of file trying to read next cpio header"); return (ARCHIVE_FATAL); + } /* Parse out binary fields. */ header = (const unsigned char *)h; @@ -900,8 +903,11 @@ header_bin_be(struct archive_read *a, st /* Read fixed-size portion of header. */ h = __archive_read_ahead(a, bin_header_size, NULL); - if (h == NULL) + if (h == NULL) { + archive_set_error(&a->archive, 0, + "End of file trying to read next cpio header"); return (ARCHIVE_FATAL); + } /* Parse out binary fields. */ header = (const unsigned char *)h; @@ -944,17 +950,17 @@ archive_read_format_cpio_cleanup(struct return (ARCHIVE_OK); } -static int +static int64_t le4(const unsigned char *p) { - return ((p[0]<<16) + (p[1]<<24) + (p[2]<<0) + (p[3]<<8)); + return ((p[0] << 16) + (((int64_t)p[1]) << 24) + (p[2] << 0) + (p[3] << 8)); } -static int +static int64_t be4(const unsigned char *p) { - return ((p[0]<<24) + (p[1]<<16) + (p[2]<<8) + (p[3])); + return ((((int64_t)p[0]) << 24) + (p[1] << 16) + (p[2] << 8) + (p[3])); } /* Modified: projects/ci20_mips/gnu/lib/Makefile ============================================================================== --- projects/ci20_mips/gnu/lib/Makefile Sun May 17 16:14:48 2015 (r283030) +++ projects/ci20_mips/gnu/lib/Makefile Sun May 17 16:17:15 2015 (r283031) @@ -2,7 +2,11 @@ .include <src.opts.mk> -SUBDIR= csu libgcc libgcov libdialog libgomp libregex libreadline +SUBDIR= csu libgcc libgcov libdialog libregex libreadline + +.if ${MK_GCC} != "no" +SUBDIR+= libgomp +.endif .if ${MK_SSP} != "no" SUBDIR+= libssp Modified: projects/ci20_mips/include/stdlib.h ============================================================================== --- projects/ci20_mips/include/stdlib.h Sun May 17 16:14:48 2015 (r283030) +++ projects/ci20_mips/include/stdlib.h Sun May 17 16:17:15 2015 (r283031) @@ -156,7 +156,8 @@ _Noreturn void _Exit(int); * If we're in a mode greater than C99, expose C11 functions. */ #if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L -void * aligned_alloc(size_t, size_t) __malloc_like __alloc_size(2); +void * aligned_alloc(size_t, size_t) __malloc_like __alloc_align(1) + __alloc_size(2); int at_quick_exit(void (*)(void)); _Noreturn void quick_exit(int); @@ -171,7 +172,7 @@ char *realpath(const char * __restrict, int rand_r(unsigned *); /* (TSF) */ #endif #if __POSIX_VISIBLE >= 200112 -int posix_memalign(void **, size_t, size_t) __nonnull(1) +int posix_memalign(void **, size_t, size_t) __nonnull(1) __alloc_align(2) __alloc_size(3); /* (ADV) */ int setenv(const char *, const char *, int); int unsetenv(const char *); Modified: projects/ci20_mips/lib/libthr/thread/thr_spec.c ============================================================================== --- projects/ci20_mips/lib/libthr/thread/thr_spec.c Sun May 17 16:14:48 2015 (r283030) +++ projects/ci20_mips/lib/libthr/thread/thr_spec.c Sun May 17 16:17:15 2015 (r283031) @@ -30,6 +30,7 @@ */ #include "namespace.h" +#include <sys/mman.h> #include <signal.h> #include <stdlib.h> #include <string.h> @@ -40,7 +41,6 @@ #include "thr_private.h" -/* Static variables: */ struct pthread_key _thread_keytable[PTHREAD_KEYS_MAX]; __weak_reference(_pthread_key_create, pthread_key_create); @@ -50,7 +50,7 @@ __weak_reference(_pthread_setspecific, p int -_pthread_key_create(pthread_key_t *key, void (*destructor) (void *)) +_pthread_key_create(pthread_key_t *key, void (*destructor)(void *)) { struct pthread *curthread; int i; @@ -59,7 +59,6 @@ _pthread_key_create(pthread_key_t *key, curthread = _get_curthread(); - /* Lock the key table: */ THR_LOCK_ACQUIRE(curthread, &_keytable_lock); for (i = 0; i < PTHREAD_KEYS_MAX; i++) { @@ -68,14 +67,12 @@ _pthread_key_create(pthread_key_t *key, _thread_keytable[i].destructor = destructor; _thread_keytable[i].seqno++; - /* Unlock the key table: */ THR_LOCK_RELEASE(curthread, &_keytable_lock); *key = i + 1; return (0); } } - /* Unlock the key table: */ THR_LOCK_RELEASE(curthread, &_keytable_lock); return (EAGAIN); } @@ -83,44 +80,40 @@ _pthread_key_create(pthread_key_t *key, int _pthread_key_delete(pthread_key_t userkey) { - struct pthread *curthread = _get_curthread(); - int key = userkey - 1; - int ret = 0; - - if ((unsigned int)key < PTHREAD_KEYS_MAX) { - /* Lock the key table: */ - THR_LOCK_ACQUIRE(curthread, &_keytable_lock); - - if (_thread_keytable[key].allocated) - _thread_keytable[key].allocated = 0; - else - ret = EINVAL; - - /* Unlock the key table: */ - THR_LOCK_RELEASE(curthread, &_keytable_lock); - } else + struct pthread *curthread; + int key, ret; + + key = userkey - 1; + if ((unsigned int)key >= PTHREAD_KEYS_MAX) + return (EINVAL); + curthread = _get_curthread(); + THR_LOCK_ACQUIRE(curthread, &_keytable_lock); + if (_thread_keytable[key].allocated) { + _thread_keytable[key].allocated = 0; + ret = 0; + } else { ret = EINVAL; + } + THR_LOCK_RELEASE(curthread, &_keytable_lock); return (ret); } void _thread_cleanupspecific(void) { - struct pthread *curthread = _get_curthread(); - void (*destructor)( void *); - const void *data = NULL; - int key; - int i; + struct pthread *curthread; + void (*destructor)(void *); + const void *data; + int i, key; + curthread = _get_curthread(); if (curthread->specific == NULL) return; - - /* Lock the key table: */ THR_LOCK_ACQUIRE(curthread, &_keytable_lock); - for (i = 0; (i < PTHREAD_DESTRUCTOR_ITERATIONS) && - (curthread->specific_data_count > 0); i++) { - for (key = 0; (key < PTHREAD_KEYS_MAX) && - (curthread->specific_data_count > 0); key++) { + for (i = 0; i < PTHREAD_DESTRUCTOR_ITERATIONS && + curthread->specific_data_count > 0; i++) { + for (key = 0; key < PTHREAD_KEYS_MAX && + curthread->specific_data_count > 0; key++) { destructor = NULL; if (_thread_keytable[key].allocated && @@ -128,31 +121,29 @@ _thread_cleanupspecific(void) if (curthread->specific[key].seqno == _thread_keytable[key].seqno) { data = curthread->specific[key].data; - destructor = _thread_keytable[key].destructor; + destructor = _thread_keytable[key]. + destructor; } curthread->specific[key].data = NULL; curthread->specific_data_count--; - } - else if (curthread->specific[key].data != NULL) { + } else if (curthread->specific[key].data != NULL) { /* - * This can happen if the key is deleted via - * pthread_key_delete without first setting the value - * to NULL in all threads. POSIX says that the - * destructor is not invoked in this case. + * This can happen if the key is + * deleted via pthread_key_delete + * without first setting the value to + * NULL in all threads. POSIX says + * that the destructor is not invoked + * in this case. */ curthread->specific[key].data = NULL; curthread->specific_data_count--; } /* - * If there is a destructor, call it - * with the key table entry unlocked: + * If there is a destructor, call it with the + * key table entry unlocked. */ if (destructor != NULL) { - /* - * Don't hold the lock while calling the - * destructor: - */ THR_LOCK_RELEASE(curthread, &_keytable_lock); destructor(__DECONST(void *, data)); THR_LOCK_ACQUIRE(curthread, &_keytable_lock); @@ -160,102 +151,92 @@ _thread_cleanupspecific(void) } } THR_LOCK_RELEASE(curthread, &_keytable_lock); - free(curthread->specific); + munmap(curthread->specific, PTHREAD_KEYS_MAX * sizeof(struct + pthread_specific_elem)); curthread->specific = NULL; - if (curthread->specific_data_count > 0) + if (curthread->specific_data_count > 0) { stderr_debug("Thread %p has exited with leftover " "thread-specific data after %d destructor iterations\n", curthread, PTHREAD_DESTRUCTOR_ITERATIONS); -} - -static inline struct pthread_specific_elem * -pthread_key_allocate_data(void) -{ - struct pthread_specific_elem *new_data; - - new_data = (struct pthread_specific_elem *) - calloc(1, sizeof(struct pthread_specific_elem) * PTHREAD_KEYS_MAX); - return (new_data); + } } int _pthread_setspecific(pthread_key_t userkey, const void *value) { - struct pthread *pthread; - pthread_key_t key = userkey - 1; - int ret = 0; + struct pthread *pthread; + void *tmp; + pthread_key_t key; + + key = userkey - 1; + if ((unsigned int)key >= PTHREAD_KEYS_MAX || + !_thread_keytable[key].allocated) + return (EINVAL); - /* Point to the running thread: */ pthread = _get_curthread(); - - if ((pthread->specific) || - (pthread->specific = pthread_key_allocate_data())) { - if ((unsigned int)key < PTHREAD_KEYS_MAX) { - if (_thread_keytable[key].allocated) { - if (pthread->specific[key].data == NULL) { - if (value != NULL) - pthread->specific_data_count++; - } else if (value == NULL) - pthread->specific_data_count--; - pthread->specific[key].data = value; - pthread->specific[key].seqno = - _thread_keytable[key].seqno; - ret = 0; - } else - ret = EINVAL; - } else - ret = EINVAL; - } else - ret = ENOMEM; - return (ret); + if (pthread->specific == NULL) { + tmp = mmap(NULL, PTHREAD_KEYS_MAX * + sizeof(struct pthread_specific_elem), + PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); + if (tmp == MAP_FAILED) + return (ENOMEM); + pthread->specific = tmp; + } + if (pthread->specific[key].data == NULL) { + if (value != NULL) + pthread->specific_data_count++; + } else if (value == NULL) + pthread->specific_data_count--; + pthread->specific[key].data = value; + pthread->specific[key].seqno = _thread_keytable[key].seqno; + return (0); } void * _pthread_getspecific(pthread_key_t userkey) { - struct pthread *pthread; - pthread_key_t key = userkey - 1; - const void *data; + struct pthread *pthread; + const void *data; + pthread_key_t key; + + /* Check if there is specific data. */ + key = userkey - 1; + if ((unsigned int)key >= PTHREAD_KEYS_MAX) + return (NULL); - /* Point to the running thread: */ pthread = _get_curthread(); - - /* Check if there is specific data: */ - if (pthread->specific != NULL && (unsigned int)key < PTHREAD_KEYS_MAX) { - /* Check if this key has been used before: */ - if (_thread_keytable[key].allocated && - (pthread->specific[key].seqno == _thread_keytable[key].seqno)) { - /* Return the value: */ - data = pthread->specific[key].data; - } else { - /* - * This key has not been used before, so return NULL - * instead: - */ - data = NULL; - } - } else - /* No specific data has been created, so just return NULL: */ + /* Check if this key has been used before. */ + if (_thread_keytable[key].allocated && pthread->specific != NULL && + pthread->specific[key].seqno == _thread_keytable[key].seqno) { + /* Return the value: */ + data = pthread->specific[key].data; + } else { + /* + * This key has not been used before, so return NULL + * instead. + */ data = NULL; + } return (__DECONST(void *, data)); } void _thr_tsd_unload(struct dl_phdr_info *phdr_info) { - struct pthread *curthread = _get_curthread(); + struct pthread *curthread; void (*destructor)(void *); int key; + curthread = _get_curthread(); THR_LOCK_ACQUIRE(curthread, &_keytable_lock); for (key = 0; key < PTHREAD_KEYS_MAX; key++) { - if (_thread_keytable[key].allocated) { - destructor = _thread_keytable[key].destructor; - if (destructor != NULL) { - if (__elf_phdr_match_addr(phdr_info, destructor)) - _thread_keytable[key].destructor = NULL; - } - } + if (!_thread_keytable[key].allocated) + continue; *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505171617.t4HGHGaf068075>