From nobody Fri Jan 07 16:27:54 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 518E019340AE; Fri, 7 Jan 2022 16:27:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JVpY72KLFz3pVD; Fri, 7 Jan 2022 16:27:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB9AF6854; Fri, 7 Jan 2022 16:27:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 207GRsAr062056; Fri, 7 Jan 2022 16:27:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 207GRsGX062055; Fri, 7 Jan 2022 16:27:54 GMT (envelope-from git) Date: Fri, 7 Jan 2022 16:27:54 GMT Message-Id: <202201071627.207GRsGX062055@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: d6c0538dae8d - main - ddb: Remove SOFTWARE_SSTEP support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d6c0538dae8d138219dfd051994a44c50e741212 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641572875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eJuwFHaTMHyF5aBpFEGkj8bif1o56xqM1hMzMb9yCkk=; b=dB0lBHz1KfPaU7TrvXifqT25e2jCPkqfWaOKsoc4vK9oYwu7WUpqi9s9HRyXOACztrLXYr Hi688GkfW9LlEeBxQTQZgqXsoQQ09PkJpTd+Aq/XtFge/pXBCuPTfRZFGidd1o560Y/qwi qIWJaL/D7ZSCJr5dwJFZILmmt8aROQqIz5Yob4r+n80RWDaSSIubqIQuH+TuPZtHWy/QRG wlmQPehsOX0rg3pv4WzXgpph81WijBv6Z8hqHioSOsnlF5sbQDiUr011DfqhXB+lBsOntd OpkCZyEbeyfHGYePnYMOa04PWlu6uIAvgjeUBYotaVt4uPDueZrrK71OxTfb6w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641572875; a=rsa-sha256; cv=none; b=TSXkisJFHrYROzciD4JjKHqaDV5llRdchacEVwd7FxkwbxIiRgHr5hUYmYhT9IgPS1uZ+f tptpJa3kSi88MDyG+PIw0FaX7gNJrS0TPLsc1Cit6OU7Pn6ysca3wGViW6O9/m1RQHdAjA 6VJ9eGgc7rCcwT1Ivbj+JxBkllSoMSIDClc+l8tLEnn1tMKAKwCDVJ8AWb7U1gK/g8DC3B NyVezrlozkL0jfOCsSXKSWLDdFhoruAzO+YlXtcXzEplza57uyX4kgayPmGFFHUgHHiDks 4Bb5U1ETdUqkaEUAJq96iOwirD+jeKDfmA4HhIophqGs4KlHUvudZn+0jUrv0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d6c0538dae8d138219dfd051994a44c50e741212 commit d6c0538dae8d138219dfd051994a44c50e741212 Author: Warner Losh AuthorDate: 2022-01-07 16:25:33 +0000 Commit: Warner Losh CommitDate: 2022-01-07 16:25:33 +0000 ddb: Remove SOFTWARE_SSTEP support It was needed for mips only, and only kinda sorta worked for mips. It can be brought back if we grow another architecture that need it. Sponsored by: Netflix --- sys/ddb/db_break.c | 35 ----------------- sys/ddb/db_break.h | 6 --- sys/ddb/db_run.c | 108 ----------------------------------------------------- 3 files changed, 149 deletions(-) diff --git a/sys/ddb/db_break.c b/sys/ddb/db_break.c index 9da67238951b..d373d6be4318 100644 --- a/sys/ddb/db_break.c +++ b/sys/ddb/db_break.c @@ -204,41 +204,6 @@ db_clear_breakpoints(void) } } -#ifdef SOFTWARE_SSTEP -/* - * Set a temporary breakpoint. - * The instruction is changed immediately, - * so the breakpoint does not have to be on the breakpoint list. - */ -db_breakpoint_t -db_set_temp_breakpoint(db_addr_t addr) -{ - register db_breakpoint_t bkpt; - - bkpt = db_breakpoint_alloc(); - if (bkpt == 0) { - db_printf("Too many breakpoints.\n"); - return 0; - } - - bkpt->map = NULL; - bkpt->address = addr; - bkpt->flags = BKPT_TEMP; - bkpt->init_count = 1; - bkpt->count = 1; - - BKPT_WRITE(bkpt->address, &bkpt->bkpt_inst); - return bkpt; -} - -void -db_delete_temp_breakpoint(db_breakpoint_t bkpt) -{ - BKPT_CLEAR(bkpt->address, &bkpt->bkpt_inst); - db_breakpoint_free(bkpt); -} -#endif /* SOFTWARE_SSTEP */ - /* * List breakpoints. */ diff --git a/sys/ddb/db_break.h b/sys/ddb/db_break.h index 2d3283cc1529..70fc75abd5ae 100644 --- a/sys/ddb/db_break.h +++ b/sys/ddb/db_break.h @@ -57,13 +57,7 @@ struct db_breakpoint { typedef struct db_breakpoint *db_breakpoint_t; void db_clear_breakpoints(void); -#ifdef SOFTWARE_SSTEP -void db_delete_temp_breakpoint(db_breakpoint_t); -#endif db_breakpoint_t db_find_breakpoint_here(db_addr_t addr); void db_set_breakpoints(void); -#ifdef SOFTWARE_SSTEP -db_breakpoint_t db_set_temp_breakpoint(db_addr_t); -#endif #endif /* !_DDB_DB_BREAK_H_ */ diff --git a/sys/ddb/db_run.c b/sys/ddb/db_run.c index c9ea87fca79c..f003508f7736 100644 --- a/sys/ddb/db_run.c +++ b/sys/ddb/db_run.c @@ -70,30 +70,6 @@ int db_inst_count; int db_load_count; int db_store_count; -#ifdef SOFTWARE_SSTEP -db_breakpoint_t db_not_taken_bkpt = 0; -db_breakpoint_t db_taken_bkpt = 0; -#endif - -#ifndef db_set_single_step -void db_set_single_step(void); -#endif -#ifndef db_clear_single_step -void db_clear_single_step(void); -#endif -#ifndef db_pc_is_singlestep -static bool -db_pc_is_singlestep(db_addr_t pc) -{ -#ifdef SOFTWARE_SSTEP - if ((db_not_taken_bkpt != 0 && pc == db_not_taken_bkpt->address) - || (db_taken_bkpt != 0 && pc == db_taken_bkpt->address)) - return (true); -#endif - return (false); -} -#endif - bool db_stop_at_pc(int type, int code, bool *is_breakpoint, bool *is_watchpoint) { @@ -103,8 +79,6 @@ db_stop_at_pc(int type, int code, bool *is_breakpoint, bool *is_watchpoint) *is_breakpoint = IS_BREAKPOINT_TRAP(type, code); *is_watchpoint = IS_WATCHPOINT_TRAP(type, code); pc = PC_REGS(); - if (db_pc_is_singlestep(pc)) - *is_breakpoint = false; db_clear_single_step(); db_clear_breakpoints(); @@ -230,23 +204,10 @@ db_restart_at_pc(bool watchpt) * We are about to execute this instruction, * so count it now. */ -#ifdef SOFTWARE_SSTEP - db_expr_t ins = -#endif db_get_value(pc, sizeof(int), false); db_inst_count++; db_load_count += inst_load(ins); db_store_count += inst_store(ins); -#ifdef SOFTWARE_SSTEP - /* XXX works on mips, but... */ - if (inst_branch(ins) || inst_call(ins)) { - ins = db_get_value(next_instr_address(pc,1), - sizeof(int), false); - db_inst_count++; - db_load_count += inst_load(ins); - db_store_count += inst_store(ins); - } -#endif /* SOFTWARE_SSTEP */ } if (db_run_mode == STEP_CONTINUE) { @@ -265,75 +226,6 @@ db_restart_at_pc(bool watchpt) } } -#ifdef SOFTWARE_SSTEP -/* - * Software implementation of single-stepping. - * If your machine does not have a trace mode - * similar to the vax or sun ones you can use - * this implementation, done for the mips. - * Just define the above conditional and provide - * the functions/macros defined below. - * - * extern bool - * inst_branch(), returns true if the instruction might branch - * extern unsigned - * branch_taken(), return the address the instruction might - * branch to - * db_getreg_val(); return the value of a user register, - * as indicated in the hardware instruction - * encoding, e.g. 8 for r8 - * - * next_instr_address(pc,bd) returns the address of the first - * instruction following the one at "pc", - * which is either in the taken path of - * the branch (bd==1) or not. This is - * for machines (mips) with branch delays. - * - * A single-step may involve at most 2 breakpoints - - * one for branch-not-taken and one for branch taken. - * If one of these addresses does not already have a breakpoint, - * we allocate a breakpoint and save it here. - * These breakpoints are deleted on return. - */ - -void -db_set_single_step(void) -{ - db_addr_t pc = PC_REGS(), brpc; - unsigned inst; - - /* - * User was stopped at pc, e.g. the instruction - * at pc was not executed. - */ - inst = db_get_value(pc, sizeof(int), false); - if (inst_branch(inst) || inst_call(inst) || inst_return(inst)) { - brpc = branch_taken(inst, pc); - if (brpc != pc) { /* self-branches are hopeless */ - db_taken_bkpt = db_set_temp_breakpoint(brpc); - } - pc = next_instr_address(pc, 1); - } - pc = next_instr_address(pc, 0); - db_not_taken_bkpt = db_set_temp_breakpoint(pc); -} - -void -db_clear_single_step(void) -{ - - if (db_not_taken_bkpt != 0) { - db_delete_temp_breakpoint(db_not_taken_bkpt); - db_not_taken_bkpt = 0; - } - if (db_taken_bkpt != 0) { - db_delete_temp_breakpoint(db_taken_bkpt); - db_taken_bkpt = 0; - } -} - -#endif /* SOFTWARE_SSTEP */ - /* single-step */ /*ARGSUSED*/ void