Skip to content

Instantly share code, notes, and snippets.

@warewolf
Created July 16, 2015 22:14
Show Gist options
  • Select an option

  • Save warewolf/f8a16e46e7d8eb3078c5 to your computer and use it in GitHub Desktop.

Select an option

Save warewolf/f8a16e46e7d8eb3078c5 to your computer and use it in GitHub Desktop.
Hacks to make IDA Pro happy w/ OpenOCD's GDB stub - applies against against 79fdeb37f486f74658f1eaf658abac8efb3eba6a
diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c
index 4a33a30..aa6ef53 100644
--- a/src/server/gdb_server.c
+++ b/src/server/gdb_server.c
@@ -2196,7 +2196,8 @@ static int gdb_get_target_description_chunk(struct target *target, struct target
else
transfer_type = 'l';
- *chunk = malloc(length + 2);
+ // *chunk = malloc(length + 2);
+ *chunk = malloc(tdesc_length + 2);
if (*chunk == NULL) {
LOG_ERROR("Unable to allocate memory");
return ERROR_FAIL;
@@ -2741,7 +2742,7 @@ static int gdb_input_inner(struct connection *connection)
* sent by GDB first to OpenOCD, thus defeating the check to
* make only the single stepping have the sync feature...
*/
- nostep = true;
+ // nostep = true;
LOG_WARNING("stepi ignored. GDB will now fetch the register state " \
"from the target.");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment