From owner-svn-src-all@freebsd.org Sun Mar 4 13:27:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80F24F32FD6; Sun, 4 Mar 2018 13:27:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 379337AD33; Sun, 4 Mar 2018 13:27:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DFAA15F22; Sun, 4 Mar 2018 13:27:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w24DRM6r040715; Sun, 4 Mar 2018 13:27:22 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24DRMBI040714; Sun, 4 Mar 2018 13:27:22 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201803041327.w24DRMBI040714@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sun, 4 Mar 2018 13:27:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330374 - head/sys/ddb X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/ddb X-SVN-Commit-Revision: 330374 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2018 13:27:22 -0000 Author: avg Date: Sun Mar 4 13:27:21 2018 New Revision: 330374 URL: https://svnweb.freebsd.org/changeset/base/330374 Log: db_script_exec: use a saved script name when reporting commands executed Before executing a command in a ddb script ddb prints an information line of the form: db:1:my-script> command where 1 is the script's depth level, "my-script" is the scipt's name, and "command" is the current command in the script. db_script_exec() uses its 'scriptname' parameter to produce that string. In the case when db_script_exec() is called from db_run_cmd() the argument points to db_tok_string that is a global variable used for command parsing. So, its value changes with every command executed. This commit changes the code to use the script's name stored in ds_scriptname to print the line. MFC after: 2 weeks Modified: head/sys/ddb/db_script.c Modified: head/sys/ddb/db_script.c ============================================================================== --- head/sys/ddb/db_script.c Sun Mar 4 08:00:07 2018 (r330373) +++ head/sys/ddb/db_script.c Sun Mar 4 13:27:21 2018 (r330374) @@ -296,7 +296,7 @@ db_script_exec(const char *scriptname, int warnifnotfo buffer = drd->drd_buffer; strcpy(buffer, dsp->ds_script); while ((command = strsep(&buffer, ";")) != NULL) { - db_printf("db:%d:%s> %s\n", db_recursion, scriptname, + db_printf("db:%d:%s> %s\n", db_recursion, dsp->ds_scriptname, command); db_command_trim(&command); prev_jb = kdb_jmpbuf(jb);