diff mbox series

[v2,38/38] gdbserver: remove fallback breakpoint support in put_mem

Message ID 20220329154931.493851-39-npiggin@gmail.com
State New
Headers show
Series gdbserver multi-threaded debugging and POWER9/10 support | expand

Checks

Context Check Description
snowpatch_ozlabs/github-CI fail Build failed at step Install dependencies.
snowpatch_ozlabs/github-build_and_test fail build failed at step Build pdbg.

Commit Message

Nicholas Piggin March 29, 2022, 3:49 p.m. UTC
With breakpoint ops implemented, gdb does not need to write its
break op directly, which allows that hackly logic to be removed.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 src/pdbgproxy.c | 34 ----------------------------------
 1 file changed, 34 deletions(-)
diff mbox series

Patch

diff --git a/src/pdbgproxy.c b/src/pdbgproxy.c
index c257361..f4b592e 100644
--- a/src/pdbgproxy.c
+++ b/src/pdbgproxy.c
@@ -603,8 +603,6 @@  static void put_mem(uint64_t *stack, void *priv)
 {
 	uint64_t addr, len;
 	uint8_t *data;
-	uint8_t attn_opcode[] = {0x00, 0x00, 0x02, 0x00};
-	uint8_t gdb_break_opcode[] = {0x7d, 0x82, 0x10, 0x08};
 	int err = 0;
 
 	addr = stack[0];
@@ -618,38 +616,6 @@  static void put_mem(uint64_t *stack, void *priv)
 		goto out;
 	}
 
-	if (len == 4 && !memcmp(data, gdb_break_opcode, 4)) {
-		uint64_t msr;
-
-		/* Check endianess in MSR */
-		err = thread_getmsr(thread_target, &msr);
-		if (err) {
-			PR_ERROR("Couldn't read the MSR. Are all threads on this chiplet quiesced?\n");
-			goto out;
-		}
-		if (msr & 1) { /* little endian */
-			attn_opcode[1] = 0x02;
-			attn_opcode[2] = 0x00;
-		}
-
-		/* According to linux-ppc-low.c gdb only uses this
-		 * op-code for sw break points so we replace it with
-		 * the correct attn opcode which is what we need for
-		 * breakpoints.
-		 *
-		 * TODO: Upstream a patch to gdb so that it uses the
-		 * right opcode for baremetal debug. */
-
-		PR_INFO("Breakpoint opcode detected, replacing with attn\n");
-		data = attn_opcode;
-
-		/* Need to enable the attn instruction in HID0 */
-		if (set_attn(true)) {
-			err = 2;
-			goto out;
-		}
-	}
-
 	if (write_memory(addr, len, data, 8)) {
 		PR_ERROR("Unable to write memory\n");
 		err = 3;