summaryrefslogtreecommitdiffstats
path: root/gdbstub.c
Commit message (Collapse)AuthorAgeFilesLines
* Add 'static' to avoid a sparse warningblueswir12009-04-181-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7175 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix ppc-softmmu warnings on OpenBSD hostblueswir12009-04-131-5/+5
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7099 c046a42c-6fe2-441c-8c8c-71466251a162
* factor out setting pc in gdbstubaurel322009-04-081-38/+25
| | | | | | | | | | | The code for handling the c and s packets both contain code for setting the pc. Move that code out to a common function. Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Acked-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7039 c046a42c-6fe2-441c-8c8c-71466251a162
* gdbstub: Rework configuration via command line and monitor (Jan Kiszka)aliguori2009-04-051-14/+27
| | | | | | | | | | | | | | | | | | | | | | | Introduce a more canonical gdbstub configuration (system emulation only) via the new switch '-gdb dev'. Keep '-s' as shorthand for '-gdb tcp::1234'. Use the same syntax also for the corresponding monitor command 'gdbserver'. Its default remains to listen on TCP port 1234. Changes in v4: - Rebased over new command line switches meta file Changes in v3: - Fix documentation Changes in v2: - Support for pipe-based like to gdb (target remote | qemu -gdb stdio) - Properly update the qemu-doc Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6992 c046a42c-6fe2-441c-8c8c-71466251a162
* gdbstub: Allow re-instantiation (Jan Kiszka)aliguori2009-03-281-21/+36
| | | | | | | | | | | | | | [ Note: depends on char closing fixes ] Properly clean up the gdbstub when the user tries to re-open it (possibly under a different address). Moreover, allow to shut it down from the monitor via 'gdbserver none'. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6913 c046a42c-6fe2-441c-8c8c-71466251a162
* gdbstub: Drop redundant memset after qemu_mallocz (Jan Kiszka)aliguori2009-03-281-2/+0
| | | | | | | | Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6897 c046a42c-6fe2-441c-8c8c-71466251a162
* Guest debugging support for KVM (Jan Kiszka)aliguori2009-03-121-7/+17
| | | | | | | | | | | | | | | | | | | | | | | This is a backport of the guest debugging support for the KVM accelerator that is now part of the KVM tree. It implements the reworked KVM kernel API for guest debugging (KVM_CAP_SET_GUEST_DEBUG) which is not yet part of any mainline kernel but will probably be 2.6.30 stuff. So far supported is x86, but PPC is expected to catch up soon. Core features are: - unlimited soft-breakpoints via code patching - hardware-assisted x86 breakpoints and watchpoints Changes in this version: - use generic hook cpu_synchronize_state to transfer registers between user space and kvm - push kvm_sw_breakpoints into KVMState Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6825 c046a42c-6fe2-441c-8c8c-71466251a162
* Use a dedicated function to request exit from execution loopaurel322009-03-071-1/+1
| | | | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6762 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix BSD userblueswir12009-03-071-3/+3
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6734 c046a42c-6fe2-441c-8c8c-71466251a162
* monitor: Pass-through for gdbstub (Jan Kiszka)aliguori2009-03-051-1/+53
| | | | | | | | | | | | | Create a monitor terminal and pass it through the gdbstub. This allows to use gdb's monitor command to access the QEMU monitor. Works for all commands except for non-detached migration and password retrieval (user will receive error messages instead). Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6718 c046a42c-6fe2-441c-8c8c-71466251a162
* toplevel: remove error handling from qemu_malloc() callers (Avi Kivity)aliguori2009-02-051-8/+0
| | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6531 c046a42c-6fe2-441c-8c8c-71466251a162
* target-ppc: Change core powerpc gdbstub bits to be XML-awareaurel322009-01-241-1/+22
| | | | | | | | | | | | | | | | | Define GDB_CORE_XML and hack things similarly to ARM so that despite the FP registers coming in between the GPRs and some status registers, everything works out OK no matter which kind of GDB we're communicating with. It matters whether we're built to target 64-bit or 32-bit cores. I think there are still problems if we are debugging 32-bit programs on a built-for-64-bit QEMU (QEMU will always send 64-bit registers), but I don't know if there's a good way around that at the time being. Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6421 c046a42c-6fe2-441c-8c8c-71466251a162
* Rework vm_state_change notifiers (Jan Kiszka)aliguori2009-01-221-6/+5
| | | | | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6402 c046a42c-6fe2-441c-8c8c-71466251a162
* add an init function parameter to qemu_chr_open()aurel322009-01-181-1/+1
| | | | | | | | | And use it for the malta emulation. Fix segfault introduced in revision 6352. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6365 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix bsd-user buildblueswir12009-01-151-0/+6
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6312 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix gdbserver number of registers (Tristan Gingold)blueswir12009-01-131-2/+2
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6280 c046a42c-6fe2-441c-8c8c-71466251a162
* gdbstub: fix gdbserver_forkedgar_igl2009-01-071-1/+1
| | | | | | | | | | | | | As reported by Martin Mohring fork doesn't work with NPTL. A fix is attached that makes the also attached test run (tested with ARM CodeSourcery 2008q3 on an x86_64 Fedora Core with kernel 2.6.23). Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com> Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6195 c046a42c-6fe2-441c-8c8c-71466251a162
* Update FSF address in GPL/LGPL boilerplateaurel322009-01-041-1/+1
| | | | | | | | | | The attached patch updates the FSF address in the GPL/LGPL boilerplate in most GPL/LGPLed files, and also in COPYING.LIB. Signed-off-by: Stuart Brady <stuart.brady@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6162 c046a42c-6fe2-441c-8c8c-71466251a162
* User-mode GDB stub improvements - handle signalsaurel322008-12-181-15/+239
| | | | | | | | | | | | | Handle signals in the user-mode GDB stub. Report them to GDB, and allow it to change or cancel them. Also correct the protocol numbering; it happens to match Linux numbering for SIGINT and SIGTRAP, but that's just good fortune. Signed-off-by: Daniel Jacobowitz <dan@codesourcery.com> Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6096 c046a42c-6fe2-441c-8c8c-71466251a162
* User-mode GDB stub improvements - handle forkaurel322008-12-181-0/+12
| | | | | | | | | | Close gdbserver in child processes, so that only one stub tries to talk to GDB at a time. Updated from an earlier patch by Paul Brook. Signed-off-by: Daniel Jacobowitz <dan@codesourcery.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6095 c046a42c-6fe2-441c-8c8c-71466251a162
* target-alpha: gdb-stub supportaurel322008-12-071-0/+54
| | | | | | (Vince Weaver) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5945 c046a42c-6fe2-441c-8c8c-71466251a162
* gdbstub: kill a warningaurel322008-12-071-1/+1
| | | | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5943 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix some new warnings introduced after r5022blueswir12008-12-071-2/+0
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5933 c046a42c-6fe2-441c-8c8c-71466251a162
* gdbstub: Fix access to PPC FPRsaurel322008-11-301-2/+2
| | | | | | | | | | Obviously, someone forgot to rebase the index before accessing one of the 32 FPRs. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5821 c046a42c-6fe2-441c-8c8c-71466251a162
* gdbstub: manage CPUs as threads (Jan Kiszka)aliguori2008-11-181-82/+194
| | | | | | | | | | | | | | | | | | | | This patch enhances QEMU's built-in debugger for SMP guest debugging. Using the thread support of the gdb remote protocol, each VCPU is mapped on a pseudo thread and exposed to the gdb frontend. This way you can easy switch the focus of gdb between the VCPUs and observe their states. On breakpoint hit, the focus is automatically adjusted just as for normal multi-threaded application under gdb control. Furthermore, the patch propagates breakpoint and watchpoint insertions or removals to all CPUs, not just the current one as it was the case so far. Without this, SMP guest debugging was practically unfeasible. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5743 c046a42c-6fe2-441c-8c8c-71466251a162
* Refactor and enhance break/watchpoint API (Jan Kiszka)aliguori2008-11-181-60/+77
| | | | | | | | | | | | | | | | | | | | | This patch prepares the QEMU cpu_watchpoint/breakpoint API to allow the succeeding enhancements this series comes with. First of all, it overcomes MAX_BREAKPOINTS/MAX_WATCHPOINTS by switching to dynamically allocated data structures that are kept in linked lists. This also allows to return a stable reference to the related objects, required for later introduced x86 debug register support. Breakpoints and watchpoints are stored with their full information set and an additional flag field that makes them easily extensible for use beyond pure guest debugging. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5738 c046a42c-6fe2-441c-8c8c-71466251a162
* gdbstub: Return appropriate watch message to gdb (Jan Kiszka)aliguori2008-11-181-2/+15
| | | | | | | | | | | | Return the appropriate type prefix (r, a, none) when reporting watchpoint hits to the gdb front-end. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5737 c046a42c-6fe2-441c-8c8c-71466251a162
* Implement "info chardev" command. (Gerd Hoffmann)aliguori2008-10-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes qemu keep track of the character devices in use and implements a "info chardev" monitor command to print a list. qemu_chr_open() sticks the devices into a linked list now. It got a new argument (label), so there is a name for each device. It also assigns a filename to each character device. By default it just copyes the filename passed in. Individual drivers can fill in something else though. qemu_chr_open_pty() sets the filename to name of the pseudo tty allocated. Output looks like this: (qemu) info chardev monitor: filename=unix:/tmp/run.sh-26827/monitor,server,nowait serial0: filename=unix:/tmp/run.sh-26827/console,server serial1: filename=pty:/dev/pts/5 parallel0: filename=vc:640x480 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5575 c046a42c-6fe2-441c-8c8c-71466251a162
* Use snprintf to please OpenBSD linkerblueswir12008-10-251-9/+9
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5529 c046a42c-6fe2-441c-8c8c-71466251a162
* target-ppc: Convert XER accesses to TCGaurel322008-10-211-3/+3
| | | | | | | | | | Define XER bits as a single register and access them individually to avoid defining 5 32-bit registers (TCG doesn't permit to map 8-bit registers). Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5500 c046a42c-6fe2-441c-8c8c-71466251a162
* gdbstub: remove unused local variableaurel322008-10-141-2/+0
| | | | | | | Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5489 c046a42c-6fe2-441c-8c8c-71466251a162
* CRIS: Handle GDB writes to pregs.edgar_igl2008-10-111-2/+6
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5461 c046a42c-6fe2-441c-8c8c-71466251a162
* Add GDB XML register description support.pbrook2008-10-111-602/+872
| | | | | | | Signed-off-by: Paul Brook <paul@codesourcery.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5459 c046a42c-6fe2-441c-8c8c-71466251a162
* Move the active FPU registers into env again, and use more TCG registersths2008-09-181-8/+8
| | | | | | | | | to access them. Signed-off-by: Thiemo Seufer <ths@networkno.de> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5252 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix warnings that would be caused by gcc flag -Wwrite-stringsblueswir12008-09-141-2/+2
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5206 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix OpenBSD linker warningsblueswir12008-08-211-14/+15
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5044 c046a42c-6fe2-441c-8c8c-71466251a162
* More efficient target register / TC accesses.ths2008-06-271-10/+10
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4794 c046a42c-6fe2-441c-8c8c-71466251a162
* Clean up MMIO TLB handling.pbrook2008-06-091-8/+24
| | | | | | | | | | The IO index is now stored in its own field, instead of being wedged into the vaddr field. This eliminates the ROMD and watchpoint host pointer weirdness. The IO index space is expanded by 1 bit, and several additional bits are made available in the TLB vaddr field. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4704 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix Sparc32plus GDBstub supportblueswir12008-06-071-25/+39
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4689 c046a42c-6fe2-441c-8c8c-71466251a162
* Support signal reception in user-mode. Handle when the peer terminates or ↵edgar_igl2008-05-171-6/+19
| | | | | | aborts the connection. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4483 c046a42c-6fe2-441c-8c8c-71466251a162
* Add support for the 'k' (kill) and 'D' (detach) packets (Jason Wessel).edgar_igl2008-05-171-0/+17
| | | | | | | | | | | | | | | | | | | | Implement the 'k' gdbserial packet which kills the qemu instance via the debugger stub. Implement the 'D' detach packet for the gdb stub such that you can disconnect gdb with the "detach" command. This required implementing a cpu_breakpoint_remove_all() and a cpu_watchpoint_remove_all() function to cleanup all the breakpoints and watchpoints prior to leaving the gdb stub else simulation can stop with no debugger attached. On a '?' packet remove all the breakpoints and watchpoints. This is considered more of a safety net in case you force killed gdb or it crashed and you are reconnecting. The identical behavior exists for kgdb in the linux kernel. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4478 c046a42c-6fe2-441c-8c8c-71466251a162
* x86_64 and better i386 supportbellard2008-05-091-86/+147
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4394 c046a42c-6fe2-441c-8c8c-71466251a162
* Remove x86-64 specific reg fillers.edgar_igl2008-05-091-134/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4392 c046a42c-6fe2-441c-8c8c-71466251a162
* Debugger single step without interrupts (Jason Wessel).edgar_igl2008-05-091-5/+34
| | | | | | | | This patch allows the qemu backend debugger to single step an instruction without running the hardware interrupts. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4391 c046a42c-6fe2-441c-8c8c-71466251a162
* Add x86_64 gdb stub for qemu (Jason Wessel).edgar_igl2008-05-091-1/+133
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4390 c046a42c-6fe2-441c-8c8c-71466251a162
* Improve readability by moving the continue operation into aseparate function.edgar_igl2008-03-141-15/+13
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4059 c046a42c-6fe2-441c-8c8c-71466251a162
* More consistent naming for CRIS register-number macros.edgar_igl2008-02-281-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3996 c046a42c-6fe2-441c-8c8c-71466251a162
* Make MIPS MT implementation more cache friendly.ths2008-02-121-6/+6
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3981 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix char* signedness, by Andre Przywara.ths2007-12-161-2/+2
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3816 c046a42c-6fe2-441c-8c8c-71466251a162
* Fix wrong signedness, by Andre Przywara.ths2007-12-161-7/+7
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3815 c046a42c-6fe2-441c-8c8c-71466251a162
OpenPOWER on IntegriCloud