mirror of
git://sourceware.org/git/glibc.git
synced 2025-01-30 12:31:53 +08:00
Update.
2002-05-06 Jungshik Shin <jshin@mailaps.org> * charmaps/UTF-8: Fix wcwidth for Hangul Conjoining medial vowels and trailing consonant. * charmaps/GB18030: Likewise
This commit is contained in:
parent
b2bffca2e3
commit
30224e2bd3
@ -1,5 +1,5 @@
|
|||||||
/* Dump information generated by PC profiling.
|
/* Dump information generated by PC profiling.
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
Copyright (C) 1999, 2002 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
|
||||||
|
|
||||||
@ -18,7 +18,7 @@
|
|||||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||||
02111-1307 USA. */
|
02111-1307 USA. */
|
||||||
|
|
||||||
/* This is mainly and example. It shows how programs which want to use
|
/* This is mainly an example. It shows how programs which want to use
|
||||||
the information should read the file. */
|
the information should read the file. */
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
# include <config.h>
|
# include <config.h>
|
||||||
@ -49,6 +49,7 @@
|
|||||||
/* Definitions of arguments for argp functions. */
|
/* Definitions of arguments for argp functions. */
|
||||||
static const struct argp_option options[] =
|
static const struct argp_option options[] =
|
||||||
{
|
{
|
||||||
|
{ "unbuffered", 'u', NULL, 0, N_("Don't buffer output") },
|
||||||
{ NULL, 0, NULL, 0, NULL }
|
{ NULL, 0, NULL, 0, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -61,10 +62,13 @@ static const char args_doc[] = N_("[FILE]");
|
|||||||
/* Function to print some extra text in the help message. */
|
/* Function to print some extra text in the help message. */
|
||||||
static char *more_help (int key, const char *text, void *input);
|
static char *more_help (int key, const char *text, void *input);
|
||||||
|
|
||||||
|
/* Prototype for option handler. */
|
||||||
|
static error_t parse_opt (int key, char *arg, struct argp_state *state);
|
||||||
|
|
||||||
/* Data structure to communicate with argp functions. */
|
/* Data structure to communicate with argp functions. */
|
||||||
static struct argp argp =
|
static struct argp argp =
|
||||||
{
|
{
|
||||||
options, NULL, args_doc, doc, NULL, more_help
|
options, parse_opt, args_doc, doc, NULL, more_help
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -171,6 +175,20 @@ main (int argc, char *argv[])
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static error_t
|
||||||
|
parse_opt (int key, char *arg, struct argp_state *state)
|
||||||
|
{
|
||||||
|
switch (key)
|
||||||
|
{
|
||||||
|
case 'u':
|
||||||
|
setbuf (stdout, NULL);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return ARGP_ERR_UNKNOWN;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
more_help (int key, const char *text, void *input)
|
more_help (int key, const char *text, void *input)
|
||||||
{
|
{
|
||||||
|
@ -23,20 +23,26 @@ pcprofiledump=@BINDIR@/pcprofiledump
|
|||||||
|
|
||||||
# Print usage message.
|
# Print usage message.
|
||||||
do_usage() {
|
do_usage() {
|
||||||
echo >&2 $"Try \`xtrace --help' for more information."
|
printf $"Usage: xtrace [OPTION]... PROGRAM [PROGRAMOPTION]...\n"
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
# Refer to --help option.
|
||||||
|
help_info() {
|
||||||
|
printf >&2 $"Try \`xtrace --help' for more information.\n"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Message for missing argument.
|
# Message for missing argument.
|
||||||
do_missing_arg() {
|
do_missing_arg() {
|
||||||
echo >&2 $"xtrace: option \`$1' requires an argument"
|
printf >&2 $"xtrace: option \`$1' requires an argument.\n"
|
||||||
do_usage
|
help_info
|
||||||
}
|
}
|
||||||
|
|
||||||
# Print help message
|
# Print help message
|
||||||
do_help() {
|
do_help() {
|
||||||
echo $"Usage: xtrace [OPTION]... PROGRAM [PROGRAMOPTION]...
|
printf $"Usage: xtrace [OPTION]... PROGRAM [PROGRAMOPTION]...\n"
|
||||||
Trace execution of program by printing currently executed function.
|
printf $"Trace execution of program by printing currently executed function.
|
||||||
|
|
||||||
--data=FILE Don't run the program, just print the data from FILE.
|
--data=FILE Don't run the program, just print the data from FILE.
|
||||||
|
|
||||||
@ -47,7 +53,7 @@ Trace execution of program by printing currently executed function.
|
|||||||
Mandatory arguments to long options are also mandatory for any corresponding
|
Mandatory arguments to long options are also mandatory for any corresponding
|
||||||
short options.
|
short options.
|
||||||
|
|
||||||
Report bugs using the \`glibcbug' script to <bugs@gnu.org>."
|
Report bugs using the \`glibcbug' script to <bugs@gnu.org>.\n"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,7 +66,7 @@ Written by Ulrich Drepper."
|
|||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# Print out function name, file, and line number is a nice formatted way.
|
# Print out function name, file, and line number in a nicely formatted way.
|
||||||
format_line() {
|
format_line() {
|
||||||
fct=$1
|
fct=$1
|
||||||
file=${2%%:*}
|
file=${2%%:*}
|
||||||
@ -100,23 +106,20 @@ while test $# -gt 0; do
|
|||||||
-? | --h | --he | --hel | --help)
|
-? | --h | --he | --hel | --help)
|
||||||
do_help
|
do_help
|
||||||
;;
|
;;
|
||||||
--v | --ve | --ver | --vers | --versi | --versio | --version)
|
-V | --v | --ve | --ver | --vers | --versi | --versio | --version)
|
||||||
do_version
|
do_version
|
||||||
;;
|
;;
|
||||||
|
--u | --us | --usa | --usag | --usage)
|
||||||
|
do_usage
|
||||||
|
;;
|
||||||
--)
|
--)
|
||||||
# Stop processing arguments.
|
# Stop processing arguments.
|
||||||
shift
|
shift
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
--help)
|
|
||||||
do_help
|
|
||||||
;;
|
|
||||||
--version)
|
|
||||||
do_version
|
|
||||||
;;
|
|
||||||
--*)
|
--*)
|
||||||
echo >&2 $"xtrace: unrecognized option \`$1'"
|
printf >&2 $"xtrace: unrecognized option \`$1'\n"
|
||||||
do_usage
|
help_info
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# Unknown option. This means the rest is the program name and parameters.
|
# Unknown option. This means the rest is the program name and parameters.
|
||||||
@ -128,25 +131,25 @@ done
|
|||||||
|
|
||||||
# See whether any arguments are left.
|
# See whether any arguments are left.
|
||||||
if test $# -eq 0; then
|
if test $# -eq 0; then
|
||||||
echo >&2 $"No program name given"
|
printf >&2 $"No program name given\n"
|
||||||
do_usage
|
help_info
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Determine the program name and check whether it exists.
|
# Determine the program name and check whether it exists.
|
||||||
program=$1
|
program=$1
|
||||||
shift
|
shift
|
||||||
if test ! -f "$program"; then
|
if test ! -f "$program"; then
|
||||||
echo >2& $"executable \`$program' not found"
|
printf >2& $"executable \`$program' not found\n"
|
||||||
do_usage
|
help_info
|
||||||
fi
|
fi
|
||||||
if test ! -x "$program"; then
|
if test ! -x "$program"; then
|
||||||
echo >&2 $"\`$program' is no executable"
|
printf >&2 $"\`$program' is no executable\n"
|
||||||
do_usage
|
help_info
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# We have two modes. If a data file is given simply print the included data.
|
# We have two modes. If a data file is given simply print the included data.
|
||||||
printf "%-20s %-*s %6s\n" Function $(expr $COLUMNS - 30) File Line
|
printf "%-20s %-*s %6s\n" Function $(expr $COLUMNS - 30) File Line
|
||||||
for i in $(seq 1 $COLUMNS); do echo -n -; done; echo
|
for i in $(seq 1 $COLUMNS); do printf -; done; printf '\n'
|
||||||
if test -n "$data"; then
|
if test -n "$data"; then
|
||||||
$pcprofiledump "$data" |
|
$pcprofiledump "$data" |
|
||||||
sed 's/this = \([^,]*\).*/\1/' |
|
sed 's/this = \([^,]*\).*/\1/' |
|
||||||
@ -158,21 +161,26 @@ if test -n "$data"; then
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
fifo=$(mktemp -u ${TMPDIR:-/tmp}/xprof.XXXXXX)
|
fifo=$(mktemp -u ${TMPDIR:-/tmp}/xtrace.XXXXXX)
|
||||||
mkfifo -m 0600 $fifo || exit 1
|
mkfifo -m 0600 $fifo || exit 1
|
||||||
|
trap 'rm $fifo; exit 1' SIGINT SIGTERM SIGPIPE
|
||||||
|
|
||||||
# Now start the program and let it write to the FIFO.
|
# Now start the program and let it write to the FIFO.
|
||||||
$TERMINAL_PROG -T "xtrace - $program $*" -e /bin/sh -c "LD_PRELOAD=$pcprofileso PCPROFILE_OUTPUT=$fifo $program $*; read $fifo" &
|
$TERMINAL_PROG -T "xtrace - $program $*" -e /bin/sh -c "LD_PRELOAD=$pcprofileso PCPROFILE_OUTPUT=$fifo $program $*; read < $fifo" &
|
||||||
termpid=$!
|
termpid=$!
|
||||||
$pcprofiledump $fifo |
|
$pcprofiledump -u $fifo |
|
||||||
sed 's/this = \([^,]*\).*/\1/' |
|
while read line; do
|
||||||
addr2line -fC -e $program |
|
echo $line |
|
||||||
|
sed 's/this = \([^,]*\).*/\1/' |
|
||||||
|
addr2line -fC -e $program
|
||||||
|
done |
|
||||||
while read fct; do
|
while read fct; do
|
||||||
read file
|
read file
|
||||||
if test "$fct" != '??' -a "$file" != '??:0'; then
|
if test "$fct" != '??' -a "$file" != '??:0'; then
|
||||||
format_line $fct $file
|
format_line $fct $file
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
read -p "Press return to end the program."
|
read -p "Press return here to close $TERMINAL_PROG($program)."
|
||||||
echo > $fifo
|
echo > $fifo
|
||||||
rm $fifo
|
rm $fifo
|
||||||
fi
|
fi
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
2002-05-06 Jungshik Shin <jshin@mailaps.org>
|
||||||
|
|
||||||
|
* charmaps/UTF-8: Fix wcwidth for Hangul Conjoining medial vowels
|
||||||
|
and trailing consonant.
|
||||||
|
* charmaps/GB18030: Likewise
|
||||||
|
|
||||||
2002-04-21 Bruno Haible <bruno@clisp.org>
|
2002-04-21 Bruno Haible <bruno@clisp.org>
|
||||||
|
|
||||||
* charmaps/GB18030: Add Unicode planes 1 (scripts, symbols), 2 (CJK),
|
* charmaps/GB18030: Add Unicode planes 1 (scripts, symbols), 2 (CJK),
|
||||||
|
Loading…
Reference in New Issue
Block a user