From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id MSY0C4ROT2d52QIAWB0awg (envelope-from ) for ; Tue, 03 Dec 2024 13:31:32 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=METvyqgf; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 1DD2A1E0BB; Tue, 3 Dec 2024 13:31:32 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.0 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 1DE4B1E05C for ; Tue, 3 Dec 2024 13:31:28 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9D25D3858C52 for ; Tue, 3 Dec 2024 18:31:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9D25D3858C52 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=METvyqgf Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by sourceware.org (Postfix) with ESMTPS id B18D03858C54 for ; Tue, 3 Dec 2024 18:30:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B18D03858C54 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B18D03858C54 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1733250633; cv=none; b=UGTnSIfkJwT5eh4M0kr/6vLY2Uum/+27d1vnwZGEHu7Wod4Mv5zlkhCmWM8XFqoOqd7tqX9zN2JWBPJsI3C3qYRh6iqf10mTbjfjK54VPmdS78+YqDJBIHp7vwc6JbaTmxoqbIR/wg4rFbBYm3lImFJcPj+BvuuEqnDtwGrZr9w= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1733250633; c=relaxed/simple; bh=JWs3uRMoTgHffrh2ms/kxg+r3x/kXiB/hgrTUaauh3M=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=ew2hLQhcdGqsP6dzask5mPLMatDQyjg6LSv4luHwhAiGJ5jD8a6yMHy6HslO0WGTHU+e65B5vHS+Fmqg3ga3ezMv5LirexZlmS5LSyHdL6PHdu8AuywBS38QaiMiW0hshg3iR6X/VhySNsrgVFP36thrs0CUnCzwDWAza02K1x8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B18D03858C54 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-53e1c3dfbb0so74111e87.3 for ; Tue, 03 Dec 2024 10:30:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733250631; x=1733855431; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tlM1/iE/YpRPgxTVihw0nGU157UhFEK9yaZ8N59YTfY=; b=METvyqgfH3uCTzbaU3WUatFBbliQnKc3Dfa39Xua9TLWU7zPtDYWglrSSarAnloWj8 U4a7jSQIwLESjr1eKGh/yaHrDIw6eurcGaSowubIIwaZh3WWJQBz33u3bvfyBW2c1VgK 13HIZkEfiRp6sKC/d0ca3a5J/DeMhYda0L3Smqz1AMZRdooXMOtiUm7vaYpe+4k3Cd+q euB+4rBLAUPYGitMgkUj4D2CjJBybPGnOacXLvmTLdnSrISXnQRamBSj136ktCFO63KY kRuF8YmijI+XVnQlyqsmWnxckYfMBScXWhruPDx1OCLnazWs65EAwO+6IfEp+b8Vf0pU e+ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733250631; x=1733855431; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tlM1/iE/YpRPgxTVihw0nGU157UhFEK9yaZ8N59YTfY=; b=jBFdZBMpdeO23unF6oK6ky52J3OeLQwo0wVAzC1k5B/VExEepRQCr8tj3zF3P+6X2t 727Hv9a18aPYQHmH00G8RhkORNmMQpuDSW7xrPrnzct5W/vvAHyQnrqNO55+2qBtMBsi N+kOB5H/JPR+6y5UMfAa+vGmB1s5St0NvYzyqceMYJlUkZD91x6WbjkU0/6qcIuZDgAm dOko2hcZgLWVfVlKizlBnpEJo2h1i/llDNmQeLcHpplN9jSWCLvEXr6Iz3vAyr9/Ym/+ 6plZwddSG1XKnKQieq8ESgB/ICFnxn0i9FhYm8cPZTxVtwPejw7UJ0kLq7WmGW2XR81N TeaQ== X-Gm-Message-State: AOJu0YzxZyJVqqHbg8ZiFrOY5LTyj9F/ifHosrNF/jyqhcbf1BbXz6cz qOGhGpADRsLfOrwNH3cMIHDUyQaVBrR/TI2u3wqC9Utqq7Nl1+liAdfZItLN X-Gm-Gg: ASbGncuKWo6zzn6Nhv+GR6VR6RgxDWemPLxkUcc8WJs7cavU6tVQrYa6urU1Twh4iPj PHiwAkv7Z0wuK5Vrg3BpY+ZZpEl/4Y35olb0qllMH7wCyC9nRZFYoY78S+iWJ2qZsLRfE+01WnP hVLubM4Itu9gtIIKeFIW9SXETLxgLk9weBHf5z9f9sr6mYqhW9Pw1Vlx4Zg+fJCVN5ZEE8xWXbP ciIBWJ0mVlH6Tcl7cUlnouX8twVjEtYmY2tO6e2P8gg0z+vEz0vIsaVWqAy7jQKNul1a6Mw19wV kQX8W7Awl7jg7uw4vRc092hDeTJWrF8rgMojC359k2ue X-Google-Smtp-Source: AGHT+IEmguIESqZtJCGS7mumRbdCJdec51P0y1fA3vxMDiutoA8k9KjK6TooRWXFFk0/cM+xieufxQ== X-Received: by 2002:a05:6512:3082:b0:53d:a4d7:1a8b with SMTP id 2adb3069b0e04-53e129fe064mr2519650e87.24.1733250629484; Tue, 03 Dec 2024 10:30:29 -0800 (PST) Received: from timur-HP-ProBook-440-14-inch-G9-Notebook-PC.yadro.com (avpn01.yadro.com. [89.207.88.243]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53df644298bsm1906034e87.59.2024.12.03.10.30.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2024 10:30:28 -0800 (PST) From: Timur To: gdb-patches@sourceware.org Cc: Timur Subject: [PATCH v3] gdb/riscv: Add record support for rv64gc instructions Date: Tue, 3 Dec 2024 21:30:25 +0300 Message-Id: <20241203183025.144232-1-timurgol007@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org This commit adds record full support for rv64gc instrcution. It includes changes to the following files: - gdb/riscv-linux-tdep.c, gdb/riscv-linux-tdep.h: adds facilities to record syscalls. - gdb/riscv-tdep.c, gdb/riscv-tdep.h: adds facilities to record execution of rv64gc instructions. - gdb/configure.tgt: adds new files for compilation. - gdb/testsuite/lib/gdb.exp: enables testing of full record mode for RISC-V targets. - gdb/syscalls/riscv-canonicalize-syscall-gen.py: a script to generate func= tion that canonicalizes RISC-V syscall. This script can simply support for sysca= lls on rv32 system. To use this script you need to pass a path to a file with syscalls description from riscv-glibc (example is in the help message). The script produces a mapping from syscall names to gdb_syscall enum. - gdb/riscv-canonicalize-syscall.c: the file generated by the previous scri= pt. Timur Golubovich timurgol007@gmail.com Hi! > >> + switch (syscall) > >> + { > >> + case 0: // #define __NR_io_setup 0 > >> > >> All comments should be in the form /* */, rather than // > >> >>> I would also prefer if this followed what other architectures do, >>> defining an enum to relate syscall numbers in a RISCV system to their >>> names, and then this function returning the gdb_sys enum numbers, >>> however I don't expect to be working on RISCV in the near future, so >>> feel free to ignore this comment if the other RISCV maintainers are ok >>> with this style. This would make it so no #define comment is necessary >> Decided to make a script generating function that canonicalizes RISC-V s= yscall. >> This solution will simplify adding record support for rv32 system. I als= o left >> place for corner cases in generating script as they always may exist. Al= so >> removed this #define comment from generating script. > > I see. This makes sense. > > I would like to see this explanation on the commit message, so that it > is recorded why Risc-V works different to all other arches. Could you please double-check the commit message? I tried to make it more detailed. Do you think I need to provide additional information? >>> + >>> + if (m_length =3D=3D 2) >>> + return record_insn_len2 (ival, regcache, gdbarch); >>> + >>> + /* 6 bytes or more. If the instruction is longer than 8 bytes, we= don't >>> +have full instruction bits in ival. At least, such long instructions >>> +are not defined yet, so just ignore it. */ >>> Again, the indentation here is incorrect. Lines should start in the sam= e column as the number 6. >> Addressed >> >> Best wishes, >> Timur Golubovich >> >> Timur Golubovich timurgol007@gmail.com > > As I mentioned in the first review, please add some commit message > explaining a bit of what your patch is doing. I would recommend > explaining the inspiration for how riscv-tdep handles the recording (I > guess aarch64) and why you changed it; plus explaining the idea behind > the python script.c Added this information to the commit message. >> /* The following value is derived from __NR_rt_sigreturn in >> from the Linux source tree. */ >> @@ -173,6 +178,250 @@ riscv_linux_syscall_next_pc (const frame_info_ptr = &frame) >> return pc + 4 /* Length of the ECALL insn. */; >> } >> >> +/* RISC-V process record-replay constructs: syscall, signal etc. */ >> + >> +static linux_record_tdep riscv_linux_record_tdep; >> + >> +/* Record all registers but PC register for process-record. */ >> + >> +using regnum_type =3D int; >> + >> +static bool >> +save_registers (struct regcache *regcache, regnum_type fir, regnum_type= last) > > Please fully type the variable names (fir -> first). Even if this makes > you need to use multiple lines for the function, I think this makes the > function easier to understand in the future. > > Sorry about not mentioning this before, I missed it in my first pass. Addressed >> + if (syscall_gdb =3D=3D gdb_sys_sigreturn || syscall_gdb =3D=3D gdb_sy= s_rt_sigreturn) >> + { >> + if (!riscv_all_but_pc_registers_record (regcache)) >> + return -1; >> + return 0; >> + } >> + >> + auto ret =3D record_linux_system_call (syscall_gdb, regcache, >> + &riscv_linux_record_tdep); >> + if (ret !=3D 0) >> + return ret; >> + >> + /* Record the return value of the system call. */ >> + if (record_full_arch_list_add_reg (regcache, RISCV_A0_REGNUM)) >> + return -1; >> + >> + return 0; >> +} >> + >> +/* Initialize the riscv64_linux_record_tdep. */ >> +/* These values are the size of the type that will be used in a system >> + call. They are obtained from Linux Kernel source. */ >> +static void >> +riscv64_linux_record_tdep_init ( >> + struct gdbarch *gdbarch, struct linux_record_tdep &riscv_linux_reco= rd_tdep) > > Oops, also missed this one on the first pass. > > The preferred way to do multi-line arguments is: > > static void > riscv64_linux_record_tdep_init (struct gdbarch *gdbarch, > struct > linux_record_tdep &riscv_linux_record_tdep) > { > > (with the "struct" keywords being aligned) Addressed >> + { >> + gdb_assert (regcache); >> + >> + if (!try_read (regcache, reg, addr)) >> + { >> + return set_error (); >> + } >> + return true; >> + } >> + >> + bool >> + save_reg (regnum_type regnum) noexcept >> + { >> + try >> + { >> + m_regs.emplace_back (regnum); > > Similar to my thoughts on Loongarch, I don't think this approach is the > best. > > In short, recording is already considered very slow. The strategy this > patch uses is to first collect all the data to be recorded (which > demands dynamic allocations to std::vector), and then call > record_full_arch_list_add_reg or record_full_arch_list_add_mem, which > will do their own dynamic allocations. This seems wasteful to me. > > I believe it would be better if, instead, the save_reg and save_mem > methods would directly call the correct record_full_arch_list_add > function, so that only one allocation is needed per unit of data that > needs recording. > > Since aarch64 already uses the strategy in this patch I won't block > merging based on this feedback, if you're set on this idea, but I think > direct calls would be better. I think that this overhead is negligeble, since the number of allocation because most instructions affect only 1 register. Moreover, I feel that the suggested approach simplifies error handling, since I can decouple decoding procedure from the actual error detection. If you don't mind, I would sugge= st to leave it as it is. >> + if (is_ebreak_insn (ival)) >> + { >> + m_record_type =3D record_type::EBREAK; >> + return true; >> + } >> + >> + if (try_save_pc (ival) || try_save_pc_rd (ival) || try_save_pc_fprd= (ival) >> + || try_save_pc_rd_csr (ival) || try_save_pc_mem (ival, regcache) >> + || try_save_pc_rd_mem (ival, regcache) >> + || try_save_pc_rs2_rd_mem (ival, regcache)) >> + { >> + return !has_error (); >> + } > Minor nit, but I noticed around here that this (and some lines later, > maybe some before) don't need the braces. Addressed >> + if (!try_read (regcache, RISCV_A7_REGNUM, reg_val)) >> + { >> + return -1; >> + } >> + return tdep->riscv_syscall_record (regcache, reg_val); >> + } >> + >> + case riscv_recorded_insn::record_type::EBREAK: >> + break; >> + >> + default: >> + return -1; >> + } >> + return 0; >> +} >> + >> +int >> +riscv_process_record (struct gdbarch *gdbarch, struct regcache *regcach= e, >> + CORE_ADDR addr) >> +{ >> + gdb_assert (gdbarch && regcache); > null pointer checks should be explicit, ie, gdb_assert (gdbarch !=3D > nullptr && regcache !=3D nullptr) Addressed. Best wishes, Timur Golubovich --- gdb/config.lt | 1484 ++++++++++++++++++++++++++ gdb/riscv-canonicalize-syscall-gen.c | 338 ++++++ gdb/riscv-linux-tdep.c | 22 +- gdb/riscv-tdep.c | 141 +-- 4 files changed, 1888 insertions(+), 97 deletions(-) create mode 100755 gdb/config.lt create mode 100644 gdb/riscv-canonicalize-syscall-gen.c diff --git a/gdb/config.lt b/gdb/config.lt new file mode 100755 index 00000000000..96851a9bfaf --- /dev/null +++ b/gdb/config.lt @@ -0,0 +1,1484 @@ +#! /bin/bash +# Generated by configure. +# Run this file to recreate a libtool stub with the current configuration. +SHELL=3D${CONFIG_SHELL-/bin/bash} +export SHELL +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=3D1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=3D: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'=3D'"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=3D' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo=3D'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\= \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=3D$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=3D$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" =3D "X$as_echo") 2>/dev/null; then + as_echo=3D'print -r --' + as_echo_n=3D'print -rn --' +elif (test "X`printf %s $as_echo`" =3D "X$as_echo") 2>/dev/null; then + as_echo=3D'printf %s\n' + as_echo_n=3D'printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" =3D "X-n $as_ech= o"; then + as_echo_body=3D'eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n=3D'/usr/ucb/echo -n' + else + as_echo_body=3D'eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body=3D'eval + arg=3D$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=3D`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n=3D'sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo=3D'sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" !=3D set; then + PATH_SEPARATOR=3D: + (PATH=3D'/bin;/bin'; FPATH=3D$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH=3D'/bin:/bin'; FPATH=3D$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=3D';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=3D" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself=3D +case $0 in #(( + *[\\/]* ) as_myself=3D$0 ;; + *) as_save_IFS=3D$IFS; IFS=3D$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=3D$as_save_IFS + test -z "$as_dir" && as_dir=3D. + test -r "$as_dir/$0" && as_myself=3D$as_dir/$0 && break + done +IFS=3D$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" =3D x; then + as_myself=3D$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute = file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} =3D xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1=3D'$ ' +PS2=3D'> ' +PS4=3D'+ ' + +# NLS nuisances. +LC_ALL=3DC +export LC_ALL +LANGUAGE=3DC +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit= the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=3D$1; test $as_status -eq 0 && as_status=3D1 + if test "$4"; then + as_lineno=3D${as_lineno-"$3"} as_lineno_stack=3Das_lineno_stack=3D$as_= lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=3D; unset $1;} +} +as_unset=3Das_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. = Take +# advantage of any shell optimizations that allow amortized linear growth = over +# repeated appends, instead of the typical quadratic growth present in nai= ve +# implementations. +if (eval "as_var=3D1; as_var+=3D2; test x\$as_var =3D x12") 2>/dev/null; t= hen : + eval 'as_fn_append () + { + eval $1+=3D\$2 + }' +else + as_fn_append () + { + eval $1=3D\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The argum= ents +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) =3D 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=3D$(( $* )) + }' +else + as_fn_arith () + { + as_val=3D`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" =3D X001; then + as_expr=3Dexpr +else + as_expr=3Dfalse +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" =3D "X/= "; then + as_basename=3Dbasename +else + as_basename=3Dfalse +fi + +if (as_dir=3D`dirname -- /` && test "X$as_dir" =3D X/) >/dev/null 2>&1; th= en + as_dirname=3Ddirname +else + as_dirname=3Dfalse +fi + +as_me=3D`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters=3D'abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS=3D'ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=3D$as_cr_letters$as_cr_LETTERS +as_cr_digits=3D'0123456789' +as_cr_alnum=3D$as_cr_Letters$as_cr_digits + +ECHO_C=3D ECHO_N=3D ECHO_T=3D +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=3D' ';; # ECHO_T is single tab character. + xy) ECHO_C=3D'\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=3D' ';; + esac;; +*) + ECHO_N=3D'-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s=3D'ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executabl= e. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s=3D'cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=3Dln + else + as_ln_s=3D'cp -pR' + fi +else + as_ln_s=3D'cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=3D./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs=3D + while :; do + case $as_dir in #( + *\'*) as_qdir=3D`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=3D$as_dir;; + esac + as_dirs=3D"'$as_qdir' $as_dirs" + as_dir=3D`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_di= r" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p=3D'mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=3Dfalse +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x=3D'test -x' +as_executable_p=3Das_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp=3D"eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnu= m]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh=3D"eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## --------------------------------- ## +## Main body of "$CONFIG_LT" script. ## +## --------------------------------- ## +lt_cl_silent=3Dfalse +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 + +lt_cl_help=3D"\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $0 [OPTIONS] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version=3D"\ +config.lt +configured by $0, generated by GNU Autoconf 2.69. + +Copyright (C) 2009 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $# !=3D 0 +do + case $1 in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=3D: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=3D: ;; + + -*) as_fn_error $? "unrecognized option: $1 +Try \`$0 --help' for more information." "$LINENO" 5 ;; + + *) as_fn_error $? "unrecognized argument: $1 +Try \`$0 --help' for more information." "$LINENO" 5 ;; + esac + shift +done + +if $lt_cl_silent; then + exec 6>/dev/null +fi + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst=3D's/\(["`$\\]\)/\\\1/g' +double_quote_subst=3D's/\(["`\\]\)/\\\1/g' +delay_variable_subst=3D's/\\\\\\\\\\\$/\\\\\\$/g' +macro_version=3D'2.2.7a' +macro_revision=3D'1.3134' +enable_shared=3D'yes' +enable_static=3D'yes' +pic_mode=3D'default' +enable_fast_install=3D'needless' +SHELL=3D'/bin/bash' +ECHO=3D'printf %s\n' +host_alias=3D'x86_64-pc-linux-gnu' +host=3D'x86_64-pc-linux-gnu' +host_os=3D'linux-gnu' +build_alias=3D'x86_64-pc-linux-gnu' +build=3D'x86_64-pc-linux-gnu' +build_os=3D'linux-gnu' +SED=3D'/usr/bin/sed' +Xsed=3D'/usr/bin/sed -e 1s/^X//' +GREP=3D'/usr/bin/grep' +EGREP=3D'/usr/bin/grep -E' +FGREP=3D'/usr/bin/grep -F' +LD=3D'ld -m elf_x86_64' +NM=3D'/usr/bin/nm -B' +LN_S=3D'ln -s' +max_cmd_len=3D'1572864' +ac_objext=3D'o' +exeext=3D'' +lt_unset=3D'unset' +lt_SP2NL=3D'tr \040 \012' +lt_NL2SP=3D'tr \015\012 \040\040' +reload_flag=3D' -r' +reload_cmds=3D'$LD$reload_flag -o $output$reload_objs' +OBJDUMP=3D'objdump' +deplibs_check_method=3D'pass_all' +file_magic_cmd=3D'$MAGIC_CMD' +AR=3D'ar --plugin /usr/lib/gcc/x86_64-linux-gnu/11/liblto_plugin.so --plug= in /usr/lib/gcc/x86_64-linux-gnu/11/liblto_plugin.so' +AR_FLAGS=3D'rc' +STRIP=3D'strip' +RANLIB=3D'ranlib --plugin /usr/lib/gcc/x86_64-linux-gnu/11/liblto_plugin.s= o --plugin /usr/lib/gcc/x86_64-linux-gnu/11/liblto_plugin.so' +old_postinstall_cmds=3D'chmod 644 $oldlib~$RANLIB $oldlib' +old_postuninstall_cmds=3D'' +old_archive_cmds=3D'$AR $AR_FLAGS $oldlib$oldobjs~$RANLIB $oldlib' +lock_old_archive_extraction=3D'no' +CC=3D'gcc' +CFLAGS=3D'-g -O2 ' +compiler=3D'g++' +GCC=3D'yes' +lt_cv_sys_global_symbol_pipe=3D'sed -n -e '\''s/^.*[ ]\([ABCDGIRSTW][ABCD= GIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p'\''' +lt_cv_sys_global_symbol_to_cdecl=3D'sed -n -e '\''s/^T .* \(.*\)$/extern i= nt \1();/p'\'' -e '\''s/^[ABCDGIRSTW]* .* \(.*\)$/extern char \1;/p'\''' +lt_cv_sys_global_symbol_to_c_name_address=3D'sed -n -e '\''s/^: \([^ ]*\) = $/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)= $/ {"\2", (void *) \&\2},/p'\''' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix=3D'sed -n -e '\''s/^:= \([^ ]*\) $/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\= ) \(lib[^ ]*\)$/ {"\2", (void *) \&\2},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^= ]*\) \([^ ]*\)$/ {"lib\2", (void *) \&\2},/p'\''' +objdir=3D'.libs' +MAGIC_CMD=3D'file' +lt_prog_compiler_no_builtin_flag=3D' -fno-builtin' +lt_prog_compiler_wl=3D'-Wl,' +lt_prog_compiler_pic=3D' -fPIC -DPIC' +lt_prog_compiler_static=3D'-static' +lt_cv_prog_compiler_c_o=3D'yes' +need_locks=3D'no' +DSYMUTIL=3D'dsymutil' +NMEDIT=3D'' +LIPO=3D'lipo' +OTOOL=3D'otool' +OTOOL64=3D'' +libext=3D'a' +shrext_cmds=3D'.so' +extract_expsyms_cmds=3D'' +archive_cmds_need_lc=3D'no' +enable_shared_with_static_runtimes=3D'no' +export_dynamic_flag_spec=3D'${wl}--export-dynamic' +whole_archive_flag_spec=3D'${wl}--whole-archive$convenience ${wl}--no-whol= e-archive' +compiler_needs_object=3D'no' +old_archive_from_new_cmds=3D'' +old_archive_from_expsyms_cmds=3D'' +archive_cmds=3D'$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${= wl}-soname $wl$soname -o $lib' +archive_expsym_cmds=3D'echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libna= me.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname = $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' +module_cmds=3D'' +module_expsym_cmds=3D'' +with_gnu_ld=3D'yes' +allow_undefined_flag=3D'' +no_undefined_flag=3D'' +hardcode_libdir_flag_spec=3D'${wl}-rpath ${wl}$libdir' +hardcode_libdir_flag_spec_ld=3D'' +hardcode_libdir_separator=3D'' +hardcode_direct=3D'no' +hardcode_direct_absolute=3D'no' +hardcode_minus_L=3D'no' +hardcode_shlibpath_var=3D'unsupported' +hardcode_automatic=3D'no' +inherit_rpath=3D'no' +link_all_deplibs=3D'unknown' +fix_srcfile_path=3D'' +always_export_symbols=3D'no' +export_symbols_cmds=3D'$NM $libobjs $convenience | $global_symbol_pipe | $= SED '\''s/.* //'\'' | sort | uniq > $export_symbols' +exclude_expsyms=3D'_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' +include_expsyms=3D'' +prelink_cmds=3D'' +file_list_spec=3D'' +variables_saved_for_relink=3D'PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PR= EFIX COMPILER_PATH LIBRARY_PATH' +need_lib_prefix=3D'no' +need_version=3D'no' +version_type=3D'linux' +runpath_var=3D'LD_RUN_PATH' +shlibpath_var=3D'LD_LIBRARY_PATH' +shlibpath_overrides_runpath=3D'yes' +libname_spec=3D'lib$name' +library_names_spec=3D'${libname}${release}${shared_ext}$versuffix ${libnam= e}${release}${shared_ext}$major $libname${shared_ext}' +soname_spec=3D'${libname}${release}${shared_ext}$major' +install_override_mode=3D'' +postinstall_cmds=3D'' +postuninstall_cmds=3D'' +finish_cmds=3D'PATH=3D"\$PATH:/sbin" ldconfig -n $libdir' +finish_eval=3D'' +hardcode_into_libs=3D'yes' +sys_lib_search_path_spec=3D'/usr/lib/gcc/x86_64-linux-gnu/11 /usr/lib/x86_= 64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib ' +sys_lib_dlsearch_path_spec=3D'/lib /usr/lib /usr/lib/x86_64-linux-gnu/libf= akeroot /usr/local/lib /usr/local/lib/x86_64-linux-gnu /lib/x86_64-linux-gn= u /usr/lib/x86_64-linux-gnu /lib32 /usr/lib32 ' +hardcode_action=3D'immediate' +enable_dlopen=3D'unknown' +enable_dlopen_self=3D'unknown' +enable_dlopen_self_static=3D'unknown' +old_striplib=3D'strip --strip-debug' +striplib=3D'strip --strip-unneeded' +compiler_lib_search_dirs=3D'' +predep_objects=3D'' +postdep_objects=3D'' +predeps=3D'' +postdeps=3D'' +compiler_lib_search_path=3D'' +LD_CXX=3D'ld -m elf_x86_64' +reload_flag_CXX=3D' -r' +reload_cmds_CXX=3D'$LD$reload_flag -o $output$reload_objs' +old_archive_cmds_CXX=3D'$AR $AR_FLAGS $oldlib$oldobjs~$RANLIB $oldlib' +compiler_CXX=3D'g++' +GCC_CXX=3D'yes' +lt_prog_compiler_no_builtin_flag_CXX=3D' -fno-builtin' +lt_prog_compiler_wl_CXX=3D'-Wl,' +lt_prog_compiler_pic_CXX=3D' -fPIC -DPIC' +lt_prog_compiler_static_CXX=3D'-static' +lt_cv_prog_compiler_c_o_CXX=3D'yes' +archive_cmds_need_lc_CXX=3D'no' +enable_shared_with_static_runtimes_CXX=3D'no' +export_dynamic_flag_spec_CXX=3D'${wl}--export-dynamic' +whole_archive_flag_spec_CXX=3D'${wl}--whole-archive$convenience ${wl}--no-= whole-archive' +compiler_needs_object_CXX=3D'no' +old_archive_from_new_cmds_CXX=3D'' +old_archive_from_expsyms_cmds_CXX=3D'' +archive_cmds_CXX=3D'$CC $pic_flag -shared -nostdlib $predep_objects $libob= js $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $li= b' +archive_expsym_cmds_CXX=3D'$CC $pic_flag -shared -nostdlib $predep_objects= $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname= ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +module_cmds_CXX=3D'' +module_expsym_cmds_CXX=3D'' +with_gnu_ld_CXX=3D'yes' +allow_undefined_flag_CXX=3D'' +no_undefined_flag_CXX=3D'' +hardcode_libdir_flag_spec_CXX=3D'${wl}-rpath ${wl}$libdir' +hardcode_libdir_flag_spec_ld_CXX=3D'' +hardcode_libdir_separator_CXX=3D'' +hardcode_direct_CXX=3D'no' +hardcode_direct_absolute_CXX=3D'no' +hardcode_minus_L_CXX=3D'no' +hardcode_shlibpath_var_CXX=3D'unsupported' +hardcode_automatic_CXX=3D'no' +inherit_rpath_CXX=3D'no' +link_all_deplibs_CXX=3D'unknown' +fix_srcfile_path_CXX=3D'' +always_export_symbols_CXX=3D'no' +export_symbols_cmds_CXX=3D'$NM $libobjs $convenience | $global_symbol_pipe= | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' +exclude_expsyms_CXX=3D'_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' +include_expsyms_CXX=3D'' +prelink_cmds_CXX=3D'' +file_list_spec_CXX=3D'' +hardcode_action_CXX=3D'immediate' +compiler_lib_search_dirs_CXX=3D'/usr/lib/gcc/x86_64-linux-gnu/11 /usr/lib/= gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu /usr/lib/gcc/x86_64-linux= -gnu/11/../../../../lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-l= inux-gnu /usr/lib/../lib /usr/lib/gcc/x86_64-linux-gnu/11/../../..' +predep_objects_CXX=3D'/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-lin= ux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/11/crtbeginS.o' +postdep_objects_CXX=3D'/usr/lib/gcc/x86_64-linux-gnu/11/crtendS.o /usr/lib= /gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/crtn.o' +predeps_CXX=3D'' +postdeps_CXX=3D'-lstdc++ -lm -lgcc_s -lc -lgcc_s' +compiler_lib_search_path_CXX=3D'-L/usr/lib/gcc/x86_64-linux-gnu/11 -L/usr/= lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64= -linux-gnu/11/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/= lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/11/.= ./../..' + +LTCC=3D'gcc' +LTCFLAGS=3D'-g -O2 ' +compiler=3D'gcc' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in SHELL ECHO SED GREP EGREP FGREP LD NM LN_S lt_SP2NL lt_NL2SP re= load_flag OBJDUMP deplibs_check_method file_magic_cmd AR AR_FLAGS STRIP RAN= LIB CC CFLAGS compiler lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol= _to_cdecl lt_cv_sys_global_symbol_to_c_name_address lt_cv_sys_global_symbol= _to_c_name_address_lib_prefix lt_prog_compiler_no_builtin_flag lt_prog_comp= iler_wl lt_prog_compiler_pic lt_prog_compiler_static lt_cv_prog_compiler_c_= o need_locks DSYMUTIL NMEDIT LIPO OTOOL OTOOL64 shrext_cmds export_dynamic_= flag_spec whole_archive_flag_spec compiler_needs_object with_gnu_ld allow_u= ndefined_flag no_undefined_flag hardcode_libdir_flag_spec hardcode_libdir_f= lag_spec_ld hardcode_libdir_separator fix_srcfile_path exclude_expsyms incl= ude_expsyms file_list_spec variables_saved_for_relink libname_spec library_= names_spec soname_spec install_override_mode finish_eval old_striplib strip= lib compiler_lib_search_dirs predep_objects postdep_objects predeps postdep= s compiler_lib_search_path LD_CXX reload_flag_CXX compiler_CXX lt_prog_comp= iler_no_builtin_flag_CXX lt_prog_compiler_wl_CXX lt_prog_compiler_pic_CXX l= t_prog_compiler_static_CXX lt_cv_prog_compiler_c_o_CXX export_dynamic_flag_= spec_CXX whole_archive_flag_spec_CXX compiler_needs_object_CXX with_gnu_ld_= CXX allow_undefined_flag_CXX no_undefined_flag_CXX hardcode_libdir_flag_spe= c_CXX hardcode_libdir_flag_spec_ld_CXX hardcode_libdir_separator_CXX fix_sr= cfile_path_CXX exclude_expsyms_CXX include_expsyms_CXX file_list_spec_CXX c= ompiler_lib_search_dirs_CXX predep_objects_CXX postdep_objects_CXX predeps_= CXX postdeps_CXX compiler_lib_search_path_CXX; do + case `eval \\$ECHO \\""\\$$var"\\"` in + *[\\\`\"\$]*) + eval "lt_$var=3D\\\"\`\$ECHO \"\$$var\" | \$SED \"\$sed_quote_subst\= "\`\\\"" + ;; + *) + eval "lt_$var=3D\\\"\$$var\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds old_postinstall_cmds old_postuninstall_cmds old_arc= hive_cmds extract_expsyms_cmds old_archive_from_new_cmds old_archive_from_e= xpsyms_cmds archive_cmds archive_expsym_cmds module_cmds module_expsym_cmds= export_symbols_cmds prelink_cmds postinstall_cmds postuninstall_cmds finis= h_cmds sys_lib_search_path_spec sys_lib_dlsearch_path_spec reload_cmds_CXX = old_archive_cmds_CXX old_archive_from_new_cmds_CXX old_archive_from_expsyms= _cmds_CXX archive_cmds_CXX archive_expsym_cmds_CXX module_cmds_CXX module_e= xpsym_cmds_CXX export_symbols_cmds_CXX prelink_cmds_CXX; do + case `eval \\$ECHO \\""\\$$var"\\"` in + *[\\\`\"\$]*) + eval "lt_$var=3D\\\"\`\$ECHO \"\$$var\" | \$SED -e \"\$double_quote_= subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=3D\\\"\$$var\\\"" + ;; + esac +done + +ac_aux_dir=3D'..' +xsi_shell=3D'yes' +lt_shell_append=3D'yes' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE=3D'' + VERSION=3D'' + TIMESTAMP=3D'' + RM=3D'rm -f' + ofile=3D'libtool' + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $ofile" >&5 +$as_echo "$as_me: creating $ofile" >&6;} + + + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile=3D"${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building= support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed= 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags=3D"CXX " + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=3D$macro_version +macro_revision=3D$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=3D$enable_shared + +# Whether or not to build static libraries. +build_old_libs=3D$enable_static + +# What type of objects to build. +pic_mode=3D$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=3D$enable_fast_install + +# Shell to use when invoking shell scripts. +SHELL=3D$lt_SHELL + +# An echo program that protects backslashes. +ECHO=3D$lt_ECHO + +# The host system. +host_alias=3D$host_alias +host=3D$host +host_os=3D$host_os + +# The build system. +build_alias=3D$build_alias +build=3D$build +build_os=3D$build_os + +# A sed program that does not truncate output. +SED=3D$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed=3D"\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=3D$lt_GREP + +# An ERE matcher. +EGREP=3D$lt_EGREP + +# A literal string matcher. +FGREP=3D$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=3D$lt_NM + +# Whether we need soft or hard links. +LN_S=3D$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=3D$max_cmd_len + +# Object file suffix (normally "o"). +objext=3D$ac_objext + +# Executable file suffix (normally ""). +exeext=3D$exeext + +# whether the shell understands "unset". +lt_unset=3D$lt_unset + +# turn spaces into newlines. +SP2NL=3D$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=3D$lt_lt_NL2SP + +# An object symbol dumper. +OBJDUMP=3D$lt_OBJDUMP + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=3D$lt_deplibs_check_method + +# Command to use when deplibs_check_method =3D=3D "file_magic". +file_magic_cmd=3D$lt_file_magic_cmd + +# The archiver. +AR=3D$lt_AR +AR_FLAGS=3D$lt_AR_FLAGS + +# A symbol stripping program. +STRIP=3D$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=3D$lt_RANLIB +old_postinstall_cmds=3D$lt_old_postinstall_cmds +old_postuninstall_cmds=3D$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=3D$lock_old_archive_extraction + +# A C compiler. +LTCC=3D$lt_CC + +# LTCC compiler flags. +LTCFLAGS=3D$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=3D$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=3D$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=3D$lt_lt_cv_sys_global_symbol_to_c_name_ad= dress + +# Transform the output of nm in a C name address pair when lib prefix is n= eeded. +global_symbol_to_c_name_address_lib_prefix=3D$lt_lt_cv_sys_global_symbol_t= o_c_name_address_lib_prefix + +# The name of the directory that contains temporary libtool files. +objdir=3D$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=3D$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=3D$lt_need_locks + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=3D$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=3D$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=3D$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=3D$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=3D$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=3D$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=3D$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=3D$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=3D$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=3D$need_lib_prefix + +# Do we need a version for libraries? +need_version=3D$need_version + +# Library versioning type. +version_type=3D$version_type + +# Shared library runtime path variable. +runpath_var=3D$runpath_var + +# Shared library path variable. +shlibpath_var=3D$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=3D$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=3D$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=3D$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=3D$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=3D$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=3D$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=3D$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=3D$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=3D$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=3D$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=3D$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=3D$lt_sys_lib_dlsearch_path_spec + +# Whether dlopen is supported. +dlopen_support=3D$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=3D$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=3D$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=3D$lt_old_striplib +striplib=3D$lt_striplib + + +# The linker used to build libraries. +LD=3D$lt_LD + +# How to create reloadable object files. +reload_flag=3D$lt_reload_flag +reload_cmds=3D$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=3D$lt_old_archive_cmds + +# A language specific compiler. +CC=3D$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=3D$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=3D$lt_lt_prog_compiler_no_builtin_flag + +# How to pass a linker flag through the compiler. +wl=3D$lt_lt_prog_compiler_wl + +# Additional compiler flags for building library objects. +pic_flag=3D$lt_lt_prog_compiler_pic + +# Compiler flag to prevent dynamic linking. +link_static_flag=3D$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=3D$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=3D$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=3D$enable_shared_with_static_runti= mes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=3D$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=3D$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=3D$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=3D$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=3D$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=3D$lt_archive_cmds +archive_expsym_cmds=3D$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=3D$lt_module_cmds +module_expsym_cmds=3D$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=3D$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=3D$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=3D$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=3D$lt_hardcode_libdir_flag_spec + +# If ld is used when linking, flag to hardcode \$libdir into a binary +# during linking. This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec_ld=3D$lt_hardcode_libdir_flag_spec_ld + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=3D$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=3D$hardcode_direct + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=3D$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=3D$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=3DDIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=3D$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=3D$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=3D$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=3D$link_all_deplibs + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=3D$lt_fix_srcfile_path + +# Set to "yes" if exported symbols are required. +always_export_symbols=3D$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=3D$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=3D$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=3D$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templat= es. +prelink_cmds=3D$lt_prelink_cmds + +# Specify filename containing input files. +file_list_spec=3D$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=3D$hardcode_action + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=3D$lt_compiler_lib_search_dirs + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=3D$lt_predep_objects +postdep_objects=3D$lt_postdep_objects +predeps=3D$lt_predeps +postdeps=3D$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=3D$lt_compiler_lib_search_path + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" !=3D Xset; then + COLLECT_NAMES=3D + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain=3D"$ac_aux_dir/ltmain.sh" + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfi= le" \ + || (rm -f "$cfgfile"; exit 1) + + case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result=3D"${1%/*}${2}" ;; + * ) func_dirname_result=3D"${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result=3D"${1##*/}" +} + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result=3D"${1%/*}${2}" ;; + * ) func_dirname_result=3D"${3}" ;; + esac + func_basename_result=3D"${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=3D${3} + func_stripname_result=3D${func_stripname_result#"${1}"} + func_stripname_result=3D${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=3D${1%%=3D*} + func_opt_split_arg=3D${1#*=3D} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=3D${1%.lo}.${objext} ;; + *) func_lo2o_result=3D${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=3D${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=3D$(( $* )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=3D${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=3D`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" =3D "X${1}"; then + func_dirname_result=3D"${3}" + else + func_dirname_result=3D"$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=3D`$ECHO "${1}" | $SED "$basename"` +} + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=3D`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2= }\$%%"`;; + *) func_stripname_result=3D`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%= %"`;; + esac +} + +# sed scripts: +my_sed_long_opt=3D'1s/^\(-[^=3D]*\)=3D.*/\1/;q' +my_sed_long_arg=3D'1s/^-[^=3D]*=3D//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=3D`$ECHO "${1}" | $SED "$my_sed_long_opt"` + func_opt_split_arg=3D`$ECHO "${1}" | $SED "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=3D`$ECHO "${1}" | $SED "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=3D`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=3D`expr "$@"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=3D`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1+=3D\$2" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1=3D\$$1\$2" +} + +_LT_EOF + ;; + esac + + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$= cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + + cat <<_LT_EOF >> "$ofile" + +# ### BEGIN LIBTOOL TAG CONFIG: CXX + +# The linker used to build libraries. +LD=3D$lt_LD_CXX + +# How to create reloadable object files. +reload_flag=3D$lt_reload_flag_CXX +reload_cmds=3D$lt_reload_cmds_CXX + +# Commands used to build an old-style archive. +old_archive_cmds=3D$lt_old_archive_cmds_CXX + +# A language specific compiler. +CC=3D$lt_compiler_CXX + +# Is the compiler the GNU compiler? +with_gcc=3D$GCC_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=3D$lt_lt_prog_compiler_no_builtin_flag_CXX + +# How to pass a linker flag through the compiler. +wl=3D$lt_lt_prog_compiler_wl_CXX + +# Additional compiler flags for building library objects. +pic_flag=3D$lt_lt_prog_compiler_pic_CXX + +# Compiler flag to prevent dynamic linking. +link_static_flag=3D$lt_lt_prog_compiler_static_CXX + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=3D$lt_lt_cv_prog_compiler_c_o_CXX + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=3D$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=3D$enable_shared_with_static_runti= mes_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=3D$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=3D$lt_whole_archive_flag_spec_CXX + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=3D$lt_compiler_needs_object_CXX + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=3D$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=3D$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build a shared archive. +archive_cmds=3D$lt_archive_cmds_CXX +archive_expsym_cmds=3D$lt_archive_expsym_cmds_CXX + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=3D$lt_module_cmds_CXX +module_expsym_cmds=3D$lt_module_expsym_cmds_CXX + +# Whether we are building with GNU ld or not. +with_gnu_ld=3D$lt_with_gnu_ld_CXX + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=3D$lt_allow_undefined_flag_CXX + +# Flag that enforces no undefined symbols. +no_undefined_flag=3D$lt_no_undefined_flag_CXX + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=3D$lt_hardcode_libdir_flag_spec_CXX + +# If ld is used when linking, flag to hardcode \$libdir into a binary +# during linking. This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec_ld=3D$lt_hardcode_libdir_flag_spec_ld_CXX + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=3D$lt_hardcode_libdir_separator_CXX + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=3D$hardcode_direct_CXX + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=3D$hardcode_direct_absolute_CXX + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=3D$hardcode_minus_L_CXX + +# Set to "yes" if using SHLIBPATH_VAR=3DDIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=3D$hardcode_shlibpath_var_CXX + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=3D$hardcode_automatic_CXX + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=3D$inherit_rpath_CXX + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=3D$link_all_deplibs_CXX + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=3D$lt_fix_srcfile_path_CXX + +# Set to "yes" if exported symbols are required. +always_export_symbols=3D$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=3D$lt_export_symbols_cmds_CXX + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=3D$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=3D$lt_include_expsyms_CXX + +# Commands necessary for linking programs (against libraries) with templat= es. +prelink_cmds=3D$lt_prelink_cmds_CXX + +# Specify filename containing input files. +file_list_spec=3D$lt_file_list_spec_CXX + +# How to hardcode a shared library path into an executable. +hardcode_action=3D$hardcode_action_CXX + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=3D$lt_compiler_lib_search_dirs_CXX + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=3D$lt_predep_objects_CXX +postdep_objects=3D$lt_postdep_objects_CXX +predeps=3D$lt_predeps_CXX +postdeps=3D$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=3D$lt_compiler_lib_search_path_CXX + +# ### END LIBTOOL TAG CONFIG: CXX +_LT_EOF + + +as_fn_exit 0 diff --git a/gdb/riscv-canonicalize-syscall-gen.c b/gdb/riscv-canonicalize-= syscall-gen.c new file mode 100644 index 00000000000..60d80aae0a6 --- /dev/null +++ b/gdb/riscv-canonicalize-syscall-gen.c @@ -0,0 +1,338 @@ +/* DO NOT EDIT: Autogenerated by riscv-canonicalize-syscall-gen.py + + Copyright (C) 2024 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . = */ + +#include "defs.h" +#include "riscv-linux-tdep.h" + +enum gdb_syscall +riscv64_canonicalize_syscall (int syscall) +{ + switch (syscall) + { + case 0: return gdb_sys_io_setup; + case 1: return gdb_sys_io_destroy; + case 2: return gdb_sys_io_submit; + case 3: return gdb_sys_io_cancel; + case 4: return gdb_sys_io_getevents; + case 5: return gdb_sys_setxattr; + case 6: return gdb_sys_lsetxattr; + case 7: return gdb_sys_fsetxattr; + case 8: return gdb_sys_getxattr; + case 9: return gdb_sys_lgetxattr; + case 10: return gdb_sys_fgetxattr; + case 11: return gdb_sys_listxattr; + case 12: return gdb_sys_llistxattr; + case 13: return gdb_sys_flistxattr; + case 14: return gdb_sys_removexattr; + case 15: return gdb_sys_lremovexattr; + case 16: return gdb_sys_fremovexattr; + case 17: return gdb_sys_getcwd; + case 18: return gdb_sys_lookup_dcookie; + case 19: return gdb_sys_eventfd2; + case 20: return gdb_sys_epoll_create1; + case 21: return gdb_sys_epoll_ctl; + case 22: return gdb_sys_epoll_pwait; + case 23: return gdb_sys_dup; + case 24: return gdb_sys_dup3; + case 25: return gdb_sys_fcntl; + case 26: return gdb_sys_inotify_init1; + case 27: return gdb_sys_inotify_add_watch; + case 28: return gdb_sys_inotify_rm_watch; + case 29: return gdb_sys_ioctl; + case 30: return gdb_sys_ioprio_set; + case 31: return gdb_sys_ioprio_get; + case 32: return gdb_sys_flock; + case 33: return gdb_sys_mknodat; + case 34: return gdb_sys_mkdirat; + case 35: return gdb_sys_unlinkat; + case 36: return gdb_sys_symlinkat; + case 37: return gdb_sys_linkat; + /* case 39: return gdb_sys_umount2; */ + case 40: return gdb_sys_mount; + case 41: return gdb_sys_pivot_root; + case 42: return gdb_sys_nfsservctl; + case 43: return gdb_sys_statfs; + case 44: return gdb_sys_fstatfs; + case 45: return gdb_sys_truncate; + case 46: return gdb_sys_ftruncate; + case 47: return gdb_sys_fallocate; + case 48: return gdb_sys_faccessat; + case 49: return gdb_sys_chdir; + case 50: return gdb_sys_fchdir; + case 51: return gdb_sys_chroot; + case 52: return gdb_sys_fchmod; + case 53: return gdb_sys_fchmodat; + case 54: return gdb_sys_fchownat; + case 55: return gdb_sys_fchown; + case 56: return gdb_sys_openat; + case 57: return gdb_sys_close; + case 58: return gdb_sys_vhangup; + case 59: return gdb_sys_pipe2; + case 60: return gdb_sys_quotactl; + case 61: return gdb_sys_getdents64; + case 62: return gdb_sys_lseek; + case 63: return gdb_sys_read; + case 64: return gdb_sys_write; + case 65: return gdb_sys_readv; + case 66: return gdb_sys_writev; + case 67: return gdb_sys_pread64; + case 68: return gdb_sys_pwrite64; + /* case 69: return gdb_sys_preadv; */ + /* case 70: return gdb_sys_pwritev; */ + case 71: return gdb_sys_sendfile; + case 72: return gdb_sys_pselect6; + case 73: return gdb_sys_ppoll; + /* case 74: return gdb_sys_signalfd4; */ + case 75: return gdb_sys_vmsplice; + case 76: return gdb_sys_splice; + case 77: return gdb_sys_tee; + case 78: return gdb_sys_readlinkat; + case 79: return gdb_sys_newfstatat; + case 80: return gdb_sys_fstat; + case 81: return gdb_sys_sync; + case 82: return gdb_sys_fsync; + case 83: return gdb_sys_fdatasync; + case 84: return gdb_sys_sync_file_range; + /* case 85: return gdb_sys_timerfd_create; */ + /* case 86: return gdb_sys_timerfd_settime; */ + /* case 87: return gdb_sys_timerfd_gettime; */ + /* case 88: return gdb_sys_utimensat; */ + case 89: return gdb_sys_acct; + case 90: return gdb_sys_capget; + case 91: return gdb_sys_capset; + case 92: return gdb_sys_personality; + case 93: return gdb_sys_exit; + case 94: return gdb_sys_exit_group; + case 95: return gdb_sys_waitid; + case 96: return gdb_sys_set_tid_address; + case 97: return gdb_sys_unshare; + case 98: return gdb_sys_futex; + case 99: return gdb_sys_set_robust_list; + case 100: return gdb_sys_get_robust_list; + case 101: return gdb_sys_nanosleep; + case 102: return gdb_sys_getitimer; + case 103: return gdb_sys_setitimer; + case 104: return gdb_sys_kexec_load; + case 105: return gdb_sys_init_module; + case 106: return gdb_sys_delete_module; + case 107: return gdb_sys_timer_create; + case 108: return gdb_sys_timer_gettime; + case 109: return gdb_sys_timer_getoverrun; + case 110: return gdb_sys_timer_settime; + case 111: return gdb_sys_timer_delete; + case 112: return gdb_sys_clock_settime; + case 113: return gdb_sys_clock_gettime; + case 114: return gdb_sys_clock_getres; + case 115: return gdb_sys_clock_nanosleep; + case 116: return gdb_sys_syslog; + case 117: return gdb_sys_ptrace; + case 118: return gdb_sys_sched_setparam; + case 119: return gdb_sys_sched_setscheduler; + case 120: return gdb_sys_sched_getscheduler; + case 121: return gdb_sys_sched_getparam; + case 122: return gdb_sys_sched_setaffinity; + case 123: return gdb_sys_sched_getaffinity; + case 124: return gdb_sys_sched_yield; + case 125: return gdb_sys_sched_get_priority_max; + case 126: return gdb_sys_sched_get_priority_min; + case 127: return gdb_sys_sched_rr_get_interval; + case 128: return gdb_sys_restart_syscall; + case 129: return gdb_sys_kill; + case 130: return gdb_sys_tkill; + case 131: return gdb_sys_tgkill; + case 132: return gdb_sys_sigaltstack; + case 133: return gdb_sys_rt_sigsuspend; + case 134: return gdb_sys_rt_sigaction; + case 135: return gdb_sys_rt_sigprocmask; + case 136: return gdb_sys_rt_sigpending; + case 137: return gdb_sys_rt_sigtimedwait; + case 138: return gdb_sys_rt_sigqueueinfo; + case 139: return gdb_sys_rt_sigreturn; + case 140: return gdb_sys_setpriority; + case 141: return gdb_sys_getpriority; + case 142: return gdb_sys_reboot; + case 143: return gdb_sys_setregid; + case 144: return gdb_sys_setgid; + case 145: return gdb_sys_setreuid; + case 146: return gdb_sys_setuid; + case 147: return gdb_sys_setresuid; + case 148: return gdb_sys_getresuid; + case 149: return gdb_sys_setresgid; + case 150: return gdb_sys_getresgid; + case 151: return gdb_sys_setfsuid; + case 152: return gdb_sys_setfsgid; + case 153: return gdb_sys_times; + case 154: return gdb_sys_setpgid; + case 155: return gdb_sys_getpgid; + case 156: return gdb_sys_getsid; + case 157: return gdb_sys_setsid; + case 158: return gdb_sys_getgroups; + case 159: return gdb_sys_setgroups; + case 160: return gdb_sys_uname; + case 161: return gdb_sys_sethostname; + case 162: return gdb_sys_setdomainname; + case 163: return gdb_sys_getrlimit; + case 164: return gdb_sys_setrlimit; + case 165: return gdb_sys_getrusage; + case 166: return gdb_sys_umask; + case 167: return gdb_sys_prctl; + case 168: return gdb_sys_getcpu; + case 169: return gdb_sys_gettimeofday; + case 170: return gdb_sys_settimeofday; + case 171: return gdb_sys_adjtimex; + case 172: return gdb_sys_getpid; + case 173: return gdb_sys_getppid; + case 174: return gdb_sys_getuid; + case 175: return gdb_sys_geteuid; + case 176: return gdb_sys_getgid; + case 177: return gdb_sys_getegid; + case 178: return gdb_sys_gettid; + case 179: return gdb_sys_sysinfo; + case 180: return gdb_sys_mq_open; + case 181: return gdb_sys_mq_unlink; + case 182: return gdb_sys_mq_timedsend; + case 183: return gdb_sys_mq_timedreceive; + case 184: return gdb_sys_mq_notify; + case 185: return gdb_sys_mq_getsetattr; + case 186: return gdb_sys_msgget; + case 187: return gdb_sys_msgctl; + case 188: return gdb_sys_msgrcv; + case 189: return gdb_sys_msgsnd; + case 190: return gdb_sys_semget; + case 191: return gdb_sys_semctl; + case 192: return gdb_sys_semtimedop; + case 193: return gdb_sys_semop; + case 194: return gdb_sys_shmget; + case 195: return gdb_sys_shmctl; + case 196: return gdb_sys_shmat; + case 197: return gdb_sys_shmdt; + case 198: return gdb_sys_socket; + case 199: return gdb_sys_socketpair; + case 200: return gdb_sys_bind; + case 201: return gdb_sys_listen; + case 202: return gdb_sys_accept; + case 203: return gdb_sys_connect; + case 204: return gdb_sys_getsockname; + case 205: return gdb_sys_getpeername; + case 206: return gdb_sys_sendto; + case 207: return gdb_sys_recvfrom; + case 208: return gdb_sys_setsockopt; + case 209: return gdb_sys_getsockopt; + case 210: return gdb_sys_shutdown; + case 211: return gdb_sys_sendmsg; + case 212: return gdb_sys_recvmsg; + case 213: return gdb_sys_readahead; + case 214: return gdb_sys_brk; + case 215: return gdb_sys_munmap; + case 216: return gdb_sys_mremap; + case 217: return gdb_sys_add_key; + case 218: return gdb_sys_request_key; + case 219: return gdb_sys_keyctl; + case 220: return gdb_sys_clone; + case 221: return gdb_sys_execve; + case 222: return gdb_old_mmap; + case 223: return gdb_sys_fadvise64; + case 224: return gdb_sys_swapon; + case 225: return gdb_sys_swapoff; + case 226: return gdb_sys_mprotect; + case 227: return gdb_sys_msync; + case 228: return gdb_sys_mlock; + case 229: return gdb_sys_munlock; + case 230: return gdb_sys_mlockall; + case 231: return gdb_sys_munlockall; + case 232: return gdb_sys_mincore; + case 233: return gdb_sys_madvise; + case 234: return gdb_sys_remap_file_pages; + case 235: return gdb_sys_mbind; + case 236: return gdb_sys_get_mempolicy; + case 237: return gdb_sys_set_mempolicy; + case 238: return gdb_sys_migrate_pages; + case 239: return gdb_sys_move_pages; + /* case 240: return gdb_sys_rt_tgsigqueueinfo; */ + /* case 241: return gdb_sys_perf_event_open; */ + /* case 242: return gdb_sys_accept4; */ + /* case 243: return gdb_sys_recvmmsg; */ + /* case 258: return gdb_sys_riscv_hwprobe; */ + /* case 259: return gdb_sys_riscv_flush_icache; */ + case 260: return gdb_sys_wait4; + /* case 261: return gdb_sys_prlimit64; */ + /* case 262: return gdb_sys_fanotify_init; */ + /* case 263: return gdb_sys_fanotify_mark; */ + /* case 264: return gdb_sys_name_to_handle_at; */ + /* case 265: return gdb_sys_open_by_handle_at; */ + /* case 266: return gdb_sys_clock_adjtime; */ + /* case 267: return gdb_sys_syncfs; */ + /* case 268: return gdb_sys_setns; */ + /* case 269: return gdb_sys_sendmmsg; */ + /* case 270: return gdb_sys_process_vm_readv; */ + /* case 271: return gdb_sys_process_vm_writev; */ + /* case 272: return gdb_sys_kcmp; */ + /* case 273: return gdb_sys_finit_module; */ + /* case 274: return gdb_sys_sched_setattr; */ + /* case 275: return gdb_sys_sched_getattr; */ + /* case 276: return gdb_sys_renameat2; */ + /* case 277: return gdb_sys_seccomp; */ + case 278: return gdb_sys_getrandom; + /* case 279: return gdb_sys_memfd_create; */ + /* case 280: return gdb_sys_bpf; */ + /* case 281: return gdb_sys_execveat; */ + /* case 282: return gdb_sys_userfaultfd; */ + /* case 283: return gdb_sys_membarrier; */ + /* case 284: return gdb_sys_mlock2; */ + /* case 285: return gdb_sys_copy_file_range; */ + /* case 286: return gdb_sys_preadv2; */ + /* case 287: return gdb_sys_pwritev2; */ + /* case 288: return gdb_sys_pkey_mprotect; */ + /* case 289: return gdb_sys_pkey_alloc; */ + /* case 290: return gdb_sys_pkey_free; */ + case 291: return gdb_sys_statx; + /* case 292: return gdb_sys_io_pgetevents; */ + /* case 293: return gdb_sys_rseq; */ + /* case 294: return gdb_sys_kexec_file_load; */ + /* case 424: return gdb_sys_pidfd_send_signal; */ + /* case 425: return gdb_sys_io_uring_setup; */ + /* case 426: return gdb_sys_io_uring_enter; */ + /* case 427: return gdb_sys_io_uring_register; */ + /* case 428: return gdb_sys_open_tree; */ + /* case 429: return gdb_sys_move_mount; */ + /* case 430: return gdb_sys_fsopen; */ + /* case 431: return gdb_sys_fsconfig; */ + /* case 432: return gdb_sys_fsmount; */ + /* case 433: return gdb_sys_fspick; */ + /* case 434: return gdb_sys_pidfd_open; */ + /* case 435: return gdb_sys_clone3; */ + /* case 436: return gdb_sys_close_range; */ + /* case 437: return gdb_sys_openat2; */ + /* case 438: return gdb_sys_pidfd_getfd; */ + /* case 439: return gdb_sys_faccessat2; */ + /* case 440: return gdb_sys_process_madvise; */ + /* case 441: return gdb_sys_epoll_pwait2; */ + /* case 442: return gdb_sys_mount_setattr; */ + /* case 443: return gdb_sys_quotactl_fd; */ + /* case 444: return gdb_sys_landlock_create_ruleset; */ + /* case 445: return gdb_sys_landlock_add_rule; */ + /* case 446: return gdb_sys_landlock_restrict_self; */ + /* case 447: return gdb_sys_memfd_secret; */ + /* case 448: return gdb_sys_process_mrelease; */ + /* case 449: return gdb_sys_futex_waitv; */ + /* case 450: return gdb_sys_set_mempolicy_home_node; */ + default: + return gdb_sys_no_syscall; + } +} diff --git a/gdb/riscv-linux-tdep.c b/gdb/riscv-linux-tdep.c index 12cab06f276..ebaed9b4508 100644 --- a/gdb/riscv-linux-tdep.c +++ b/gdb/riscv-linux-tdep.c @@ -187,9 +187,11 @@ static linux_record_tdep riscv_linux_record_tdep; using regnum_type =3D int; static bool -save_registers (struct regcache *regcache, regnum_type fir, regnum_type la= st) +save_registers (struct regcache *regcache, regnum_type first, regnum_type = last) { - for (regnum_type i =3D fir; i !=3D last; ++i) + gdb_assert (regcache !=3D nullptr); + + for (regnum_type i =3D first; i !=3D last; ++i) if (record_full_arch_list_add_reg (regcache, i)) return false; return true; @@ -198,6 +200,8 @@ save_registers (struct regcache *regcache, regnum_type = fir, regnum_type last) static bool riscv_all_but_pc_registers_record (struct regcache *regcache) { + gdb_assert (regcache !=3D nullptr); + auto &&gdbarch =3D regcache->arch (); auto &&tdep =3D gdbarch_tdep (gdbarch); auto &&features =3D tdep->isa_features; @@ -219,12 +223,12 @@ static int riscv_linux_syscall_record (struct regcache *regcache, unsigned long svc_number) { + gdb_assert (regcache !=3D nullptr); + auto syscall_gdb =3D riscv64_canonicalize_syscall (svc_number); if (record_debug > 1) - { - gdb_printf (gdb_stdlog, "Made syscall %s.\n", plongest (svc_number)); - } + gdb_printf (gdb_stdlog, "Made syscall %s.\n", plongest (svc_number)); if (syscall_gdb =3D=3D gdb_sys_no_syscall) { @@ -258,9 +262,11 @@ riscv_linux_syscall_record (struct regcache *regcache, /* These values are the size of the type that will be used in a system call. They are obtained from Linux Kernel source. */ static void -riscv64_linux_record_tdep_init ( - struct gdbarch *gdbarch, struct linux_record_tdep &riscv_linux_record_= tdep) +riscv64_linux_record_tdep_init (struct gdbarch *gdbarch, + struct linux_record_tdep &riscv_linux_record_tdep) { + gdb_assert (gdbarch !=3D nullptr); + /* Initialize the riscv_linux_record_tdep. */ /* These values are the size of the type that will be used in a system call. They are obtained from Linux Kernel source. */ @@ -427,7 +433,7 @@ riscv64_linux_record_tdep_init ( static void riscv_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { - riscv_gdbarch_tdep *tdep =3D gdbarch_tdep (gdbarch); + auto tdep =3D gdbarch_tdep (gdbarch); linux_init_abi (info, gdbarch, 0); diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c index c6c7b7a63fd..37ec30fff91 100644 --- a/gdb/riscv-tdep.c +++ b/gdb/riscv-tdep.c @@ -4843,7 +4843,7 @@ this option can be used."), static bool try_read (struct regcache *regcache, int regnum, ULONGEST &addr) { - gdb_assert (regcache); + gdb_assert (regcache !=3D nullptr); if (regcache->raw_read (regnum, &addr) !=3D register_status::REG_VALID) @@ -4964,12 +4964,10 @@ class riscv_recorded_insn final read_reg (struct regcache *regcache, regnum_type reg, ULONGEST &addr) noexcept { - gdb_assert (regcache); + gdb_assert (regcache !=3D nullptr); if (!try_read (regcache, reg, addr)) - { - return set_error (); - } + return set_error (); return true; } @@ -5143,14 +5141,14 @@ class riscv_recorded_insn final bool try_save_pc_mem (ULONGEST ival, struct regcache *regcache) noexcept { - gdb_assert (regcache); + gdb_assert (regcache !=3D nullptr); - mem_addr addr =3D 0; + auto addr =3D mem_addr{}; auto len =3D need_save_pc_mem (ival); if (len <=3D 0) return false; - mem_len offset =3D EXTRACT_STYPE_IMM (ival); + auto offset =3D mem_len{EXTRACT_STYPE_IMM (ival)}; return !read_reg (regcache, decode_rs1 (ival), addr) || !save_mem (addr + offset, len) || set_ordinary_record_type (= ); } @@ -5178,10 +5176,10 @@ class riscv_recorded_insn final bool try_save_pc_rd_mem (ULONGEST ival, struct regcache *regcache) noexcept { - gdb_assert (regcache); + gdb_assert (regcache !=3D nullptr); auto len =3D need_save_pc_rd_mem (ival); - mem_addr addr =3D 0; + auto addr =3D mem_addr{}; if (len <=3D 0) return false; @@ -5205,9 +5203,9 @@ class riscv_recorded_insn final bool try_save_pc_rs2_rd_mem (ULONGEST ival, struct regcache *regcache) noexce= pt { - gdb_assert (regcache); + gdb_assert (regcache !=3D nullptr); - mem_addr addr =3D 0; + auto addr =3D mem_addr{}; auto len =3D need_save_pc_rs2_rd_mem (ival); if (len <=3D 0) return false; @@ -5222,7 +5220,7 @@ class riscv_recorded_insn final bool record_insn_len4 (ULONGEST ival, struct regcache *regcache) noexcept { - gdb_assert (regcache); + gdb_assert (regcache !=3D nullptr); if (is_ecall_insn (ival)) { @@ -5240,9 +5238,7 @@ class riscv_recorded_insn final || try_save_pc_rd_csr (ival) || try_save_pc_mem (ival, regcache) || try_save_pc_rd_mem (ival, regcache) || try_save_pc_rs2_rd_mem (ival, regcache)) - { - return !has_error (); - } + return !has_error (); warning (_ ("Currently this instruction with len 4(%lx) is unsupported= "), ival); @@ -5255,10 +5251,10 @@ class riscv_recorded_insn final record_insn_len2 (ULONGEST ival, struct regcache *regcache, struct gdbarch *gdbarch) noexcept { - gdb_assert (regcache); - gdb_assert (gdbarch); + gdb_assert (regcache !=3D nullptr); + gdb_assert (gdbarch !=3D nullptr); - mem_addr addr =3D 0; + auto addr =3D mem_addr{}; auto xlen =3D riscv_isa_xlen (gdbarch); /* The order here is very important, because @@ -5266,100 +5262,70 @@ class riscv_recorded_insn final if (is_c_addi4spn_insn (ival) || is_c_lw_insn (ival) || (xlen =3D=3D 8 && is_c_ld_insn (ival))) - { - return !save_reg (decode_crs2_short (ival)) - || set_ordinary_record_type (); - } + return !save_reg (decode_crs2_short (ival)) + || set_ordinary_record_type (); if (is_c_fld_insn (ival) || (xlen =3D=3D 4 && is_c_flw_insn (ival))) - { - return !save_reg (RISCV_FIRST_FP_REGNUM + decode_crs2_short (ival)) - || set_ordinary_record_type (); - } + return !save_reg (RISCV_FIRST_FP_REGNUM + decode_crs2_short (ival)) + || set_ordinary_record_type (); if (is_c_fsd_insn (ival) || (xlen =3D=3D 8 && is_c_sd_insn (ival))) { - int offset =3D EXTRACT_CLTYPE_LD_IMM (ival); + auto offset =3D int{EXTRACT_CLTYPE_LD_IMM (ival)}; return !read_reg (regcache, decode_crs1_short (ival), addr) || !save_mem (addr + offset, 8) || set_ordinary_record_type= (); } if ((xlen =3D=3D 4 && is_c_fsw_insn (ival)) || is_c_sw_insn (ival)) { - int offset =3D EXTRACT_CLTYPE_LW_IMM (ival); + auto offset =3D int{EXTRACT_CLTYPE_LW_IMM (ival)}; return !read_reg (regcache, decode_crs1_short (ival), addr) || !save_mem (addr + offset, 4) || set_ordinary_record_type= (); } if (is_c_nop_insn (ival)) - { - return set_ordinary_record_type (); - } + return set_ordinary_record_type (); if (is_c_addi_insn (ival)) - { - return !save_reg (decode_crs1 (ival)) || set_ordinary_record_type = (); - } + return !save_reg (decode_crs1 (ival)) || set_ordinary_record_type (); if (xlen =3D=3D 4 && is_c_jal_insn (ival)) - { - return !save_reg (RISCV_RA_REGNUM) || set_ordinary_record_type (); - } + return !save_reg (RISCV_RA_REGNUM) || set_ordinary_record_type (); if ((xlen =3D=3D 8 && is_c_addiw_insn (ival)) || is_c_li_insn (ival)) - { - return !save_reg (decode_crs1 (ival)) || set_ordinary_record_type = (); - } + return !save_reg (decode_crs1 (ival)) || set_ordinary_record_type (); if (is_c_addi16sp_insn (ival)) - { - return !save_reg (RISCV_SP_REGNUM) || set_ordinary_record_type (); - } + return !save_reg (RISCV_SP_REGNUM) || set_ordinary_record_type (); if (is_c_lui_insn (ival)) - { - return !save_reg (decode_crs1 (ival)) || set_ordinary_record_type = (); - } + return !save_reg (decode_crs1 (ival)) || set_ordinary_record_type (); if (is_c_srli_insn (ival) || is_c_srai_insn (ival) || is_c_andi_insn (= ival) || is_c_sub_insn (ival) || is_c_xor_insn (ival) || is_c_or_insn (i= val) || is_c_and_insn (ival) || (xlen =3D=3D 8 && is_c_subw_insn (ival)) || (xlen =3D=3D 8 && is_c_addw_insn (ival))) - { - return !save_reg (decode_crs1_short (ival)) - || set_ordinary_record_type (); - } + return !save_reg (decode_crs1_short (ival)) + || set_ordinary_record_type (); if (is_c_j_insn (ival) || is_c_beqz_insn (ival) || is_c_bnez_insn (iva= l)) - { - return set_ordinary_record_type (); - } + return set_ordinary_record_type (); if (is_c_slli_insn (ival)) - { - return !save_reg (decode_crs1 (ival)) || set_ordinary_record_type = (); - } + return !save_reg (decode_crs1 (ival)) || set_ordinary_record_type (); if (is_c_fldsp_insn (ival) || (xlen =3D=3D 4 && is_c_flwsp_insn (ival)= )) - { - return !save_reg (RISCV_FIRST_FP_REGNUM + decode_crs1 (ival)) - || set_ordinary_record_type (); - } + return !save_reg (RISCV_FIRST_FP_REGNUM + decode_crs1 (ival)) + || set_ordinary_record_type (); if (is_c_lwsp_insn (ival) || (xlen =3D=3D 8 && is_c_ldsp_insn (ival))) - { - return !save_reg (decode_crs1 (ival)) || set_ordinary_record_type = (); - } + return !save_reg (decode_crs1 (ival)) || set_ordinary_record_type (); if (is_c_jr_insn (ival)) - { - return set_ordinary_record_type (); - } + return set_ordinary_record_type (); if (is_c_mv_insn (ival)) - { - return !save_reg (decode_crs1 (ival)) || set_ordinary_record_type = (); - } + return !save_reg (decode_crs1 (ival)) || set_ordinary_record_type (); if (is_c_ebreak_insn (ival)) { @@ -5368,25 +5334,21 @@ class riscv_recorded_insn final } if (is_c_jalr_insn (ival)) - { - return !save_reg (RISCV_RA_REGNUM) || set_ordinary_record_type (); - } + return !save_reg (RISCV_RA_REGNUM) || set_ordinary_record_type (); if (is_c_add_insn (ival)) - { - return !save_reg (decode_crs1 (ival)) || set_ordinary_record_type = (); - } + return !save_reg (decode_crs1 (ival)) || set_ordinary_record_type (); if (is_c_fsdsp_insn (ival) || (xlen =3D=3D 8 && is_c_sdsp_insn (ival))) { - int offset =3D EXTRACT_CSSTYPE_SDSP_IMM (ival); + auto offset =3D int{EXTRACT_CSSTYPE_SDSP_IMM (ival)}; return !read_reg (regcache, RISCV_SP_REGNUM, addr) || !save_mem (addr + offset, 8) || set_ordinary_record_type= (); } if (is_c_swsp_insn (ival) || (xlen =3D=3D 4 && is_c_fswsp_insn (ival))) { - int offset =3D EXTRACT_CSSTYPE_SWSP_IMM (ival); + auto offset =3D int{EXTRACT_CSSTYPE_SWSP_IMM (ival)}; return !read_reg (regcache, RISCV_SP_REGNUM, addr) || !save_mem (addr + offset, 4) || set_ordinary_record_type= (); } @@ -5403,7 +5365,10 @@ class riscv_recorded_insn final bool record (gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr) noe= xcept { - int m_length =3D 0; + gdb_assert (gdbarch !=3D nullptr); + gdb_assert (regcache !=3D nullptr); + + auto m_length =3D int{}; auto ival =3D riscv_insn::fetch_instruction (gdbarch, addr, &m_length); if (!save_reg (RISCV_PC_REGNUM)) return false; @@ -5458,9 +5423,10 @@ static int riscv_make_record_process (struct gdbarch *gdbarch, struct regcache *regca= che, const riscv_recorded_insn &insn) { - gdb_assert (gdbarch && regcache); + gdb_assert (gdbarch !=3D nullptr); + gdb_assert (regcache !=3D nullptr); - riscv_gdbarch_tdep *tdep =3D gdbarch_tdep (gdbarch); + auto tdep =3D gdbarch_tdep (gdbarch); auto regs_begin =3D insn.regs_begin (); auto regs_end =3D insn.regs_end (); if (std::any_of (regs_begin, regs_end, [®cache] (auto &®_it) { @@ -5487,11 +5453,9 @@ riscv_make_record_process (struct gdbarch *gdbarch, = struct regcache *regcache, warning (_ ("Syscall record is not supported")); return -1; } - ULONGEST reg_val =3D 0; + auto reg_val =3D ULONGEST{}; if (!try_read (regcache, RISCV_A7_REGNUM, reg_val)) - { - return -1; - } + return -1; return tdep->riscv_syscall_record (regcache, reg_val); } @@ -5508,7 +5472,8 @@ int riscv_process_record (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr) { - gdb_assert (gdbarch && regcache); + gdb_assert (gdbarch !=3D nullptr); + gdb_assert (regcache !=3D nullptr); riscv_recorded_insn insn; if (!insn.record (gdbarch, regcache, addr)) @@ -5520,9 +5485,7 @@ riscv_process_record (struct gdbarch *gdbarch, struct= regcache *regcache, auto ret_val =3D riscv_make_record_process (gdbarch, regcache, insn); if (record_full_arch_list_add_end ()) - { - return -1; - } + return -1; return ret_val; } -- 2.34.1