Loading gdbstub.c +14 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" #ifdef CONFIG_USER_ONLY #include <stdlib.h> #include <stdio.h> Loading @@ -24,6 +25,7 @@ #include <string.h> #include <errno.h> #include <unistd.h> #include <fcntl.h> #include "qemu.h" #else Loading Loading @@ -680,6 +682,18 @@ static int gdb_handle_packet(GDBState *s, CPUState *env, const char *line_buf) goto breakpoint_error; } break; #ifdef CONFIG_USER_ONLY case 'q': if (strncmp(p, "Offsets", 7) == 0) { TaskState *ts = env->opaque; sprintf(buf, "Text=%x;Data=%x;Bss=%x", ts->info->code_offset, ts->info->data_offset, ts->info->data_offset); put_packet(s, buf); break; } /* Fall through. */ #endif default: // unknown_command: /* put empty packet */ Loading linux-user/flatload.c +3 −0 Original line number Diff line number Diff line Loading @@ -783,6 +783,9 @@ int load_flt_binary(struct linux_binprm * bprm, struct target_pt_regs * regs, info->start_brk = libinfo[0].start_brk; info->start_stack = sp; info->entry = start_addr; info->code_offset = info->start_code; info->data_offset = info->start_data - libinfo[0].text_len; DBG_FLT("start_thread(entry=0x%x, start_stack=0x%x)\n", (int)info->entry, (int)info->start_stack); Loading linux-user/main.c +1 −0 Original line number Diff line number Diff line Loading @@ -1541,6 +1541,7 @@ int main(int argc, char **argv) memset(ts, 0, sizeof(TaskState)); env->opaque = ts; ts->used = 1; ts->info = info; env->user_mode_only = 1; #if defined(TARGET_I386) Loading linux-user/qemu.h +3 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ struct image_info { unsigned long rss; unsigned long start_stack; unsigned long entry; target_ulong code_offset; target_ulong data_offset; int personality; }; Loading Loading @@ -73,6 +75,7 @@ typedef struct TaskState { uint32_t v86mask; #endif int used; /* non zero if used */ struct image_info *info; uint8_t stack[0]; } __attribute__((aligned(16))) TaskState; Loading Loading
gdbstub.c +14 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" #ifdef CONFIG_USER_ONLY #include <stdlib.h> #include <stdio.h> Loading @@ -24,6 +25,7 @@ #include <string.h> #include <errno.h> #include <unistd.h> #include <fcntl.h> #include "qemu.h" #else Loading Loading @@ -680,6 +682,18 @@ static int gdb_handle_packet(GDBState *s, CPUState *env, const char *line_buf) goto breakpoint_error; } break; #ifdef CONFIG_USER_ONLY case 'q': if (strncmp(p, "Offsets", 7) == 0) { TaskState *ts = env->opaque; sprintf(buf, "Text=%x;Data=%x;Bss=%x", ts->info->code_offset, ts->info->data_offset, ts->info->data_offset); put_packet(s, buf); break; } /* Fall through. */ #endif default: // unknown_command: /* put empty packet */ Loading
linux-user/flatload.c +3 −0 Original line number Diff line number Diff line Loading @@ -783,6 +783,9 @@ int load_flt_binary(struct linux_binprm * bprm, struct target_pt_regs * regs, info->start_brk = libinfo[0].start_brk; info->start_stack = sp; info->entry = start_addr; info->code_offset = info->start_code; info->data_offset = info->start_data - libinfo[0].text_len; DBG_FLT("start_thread(entry=0x%x, start_stack=0x%x)\n", (int)info->entry, (int)info->start_stack); Loading
linux-user/main.c +1 −0 Original line number Diff line number Diff line Loading @@ -1541,6 +1541,7 @@ int main(int argc, char **argv) memset(ts, 0, sizeof(TaskState)); env->opaque = ts; ts->used = 1; ts->info = info; env->user_mode_only = 1; #if defined(TARGET_I386) Loading
linux-user/qemu.h +3 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ struct image_info { unsigned long rss; unsigned long start_stack; unsigned long entry; target_ulong code_offset; target_ulong data_offset; int personality; }; Loading Loading @@ -73,6 +75,7 @@ typedef struct TaskState { uint32_t v86mask; #endif int used; /* non zero if used */ struct image_info *info; uint8_t stack[0]; } __attribute__((aligned(16))) TaskState; Loading