summaryrefslogtreecommitdiffstats
path: root/gdbstub.c
Commit message (Collapse)AuthorAgeFilesLines
* gdbstub: Set gdb_set_stop_cpu() argument to CPUStateAndreas Färber2013-06-281-1/+3
| | | | | | | | | Use CPUState::env_ptr for now. Prepares for changing cpu_handle_guest_debug() argument to CPUState. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Change cpu_exit() argument to CPUStateAndreas Färber2013-06-281-1/+1
| | | | | | | | It no longer depends on CPUArchState, so move it to qom/cpu.c. Prepares for changing GDBState::c_cpu to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de>
* kvm: Change cpu_synchronize_state() argument to CPUStateAndreas Färber2013-06-281-4/+4
| | | | | | | | Change Monitor::mon_cpu to CPUState as well. Reviewed-by: liguang <lig.fnst@cn.fujitsu.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* gdbstub: Simplify find_cpu()Andreas Färber2013-06-281-8/+4
| | | | | | | Use qemu_get_cpu() and CPUState::env_ptr. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
* gdbstub: let the debugger resume from guest panicked statePaolo Bonzini2013-06-101-0/+3
| | | | | | | | | | | | While in general we forbid a "continue" from the guest panicked state, it makes sense to have an exception for that when continuing in the debugger. Perhaps the guest entered that state due to a bug, for example, and we want to continue no matter what. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com> Message-id: 1370272015-9659-3-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* gdbstub: fix for commit 87f25c12bfeaaa0c41fb857713bbc7e8a9b757dcPaolo Bonzini2013-06-101-1/+1
| | | | | | | | | | | | | | This commit used the wrong check to prevent an assertion failure. After this commit, you need to start a guest in the monitor, you cannot use anymore the "c" command in the debugger. This is undesirable. The commit's aim was to prevent a restart after a KVM internal error or something like that; use runstate_needs_reset() for that. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com> Message-id: 1370272015-9659-2-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* gdbstub: do not restart crashed guestPaolo Bonzini2013-05-301-1/+3
| | | | | | | | | | | If a guest has crashed with an internal error or similar, detaching gdb (or any other debugger action) should not restart it. Cc: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-id: 1369912840-18577-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* sysemu: avoid proliferation of include/ subdirectoriesPaolo Bonzini2013-04-151-1/+1
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* hw: move headers to include/Paolo Bonzini2013-04-081-1/+1
| | | | | | | | | Many of these should be cleaned up with proper qdev-/QOM-ification. Right now there are many catch-all headers in include/hw/ARCH depending on cpu.h, and this makes it necessary to compile these files per-target. However, fixing this does not belong in these patches. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qemu-char: Call fe_claim / fe_release when not using qdev chr propertiesHans de Goede2013-04-041-0/+1
| | | | | | | | | | | | | | | | | | chardev-frontends need to explictly check, increase and decrement the avail_connections "property" of the chardev when they are not using a qdev-chardev-property for the chardev. This fixes things like: qemu-kvm -chardev stdio,id=foo -device isa-serial,chardev=foo \ -mon chardev=foo Working, where they should fail. Most of the changes here are due to old hardware emulation code which is using serial_hds directly rather then a qdev-chardev-property. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Message-id: 1364412581-3672-3-git-send-email-hdegoede@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge branch 'ppc-for-upstream' of git://github.com/agraf/qemuAurelien Jarno2013-03-221-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'ppc-for-upstream' of git://github.com/agraf/qemu: (58 commits) target-ppc: Use NARROW_MODE macro for tlbie target-ppc: Use NARROW_MODE macro for addresses target-ppc: Use NARROW_MODE macro for comparisons target-ppc: Use NARROW_MODE macro for branches target-ppc: Fix add and subf carry generation in narrow mode target-ppc: Use QOM method dispatch for MMU fault handling target-ppc: Move ppc tlb_fill implementation into mmu_helper.c target-ppc: Split user only code out of mmu_helper.c mmu-hash64: Implement Virtual Page Class Key Protection mmu-hash*: Merge translate and fault handling functions mmu-hash*: Don't use full ppc_hash{32, 64}_translate() path for get_phys_page_debug() mmu-hash*: Correctly mask RPN from hash PTE mmu-hash*: Clean up real address calculation mmu-hash*: Clean up PTE flags update mmu-hash64: Factor SLB N bit into permissions bits mmu-hash*: Clean up permission checking mmu-hash32: Remove nx from context structure mmu-hash*: Don't update PTE flags when permission is denied mmu-hash32: Don't look up page tables on BAT permission error mmu-hash32: Cleanup BAT lookup ...
| * PPC/GDB: handle read and write of fpscrFabien Chouteau2013-03-221-1/+2
| | | | | | | | | | | | | | | | Although the support of this register may be uncomplete, there are no reason to prevent the debugger from reading or writing it. Signed-off-by: Fabien Chouteau <chouteau@adacore.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* | MinGW: Replace setsockopt by qemu_setsocketoptStefan Weil2013-03-221-1/+1
|/ | | | | | | | | Instead of adding missing type casts which are needed by MinGW for the 4th argument, the patch uses qemu_setsockopt which was invented for this purpose. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* cpu: Move halted and interrupt_request fields to CPUStateAndreas Färber2013-03-121-1/+1
| | | | | | | | | | Both fields are used in VMState, thus need to be moved together. Explicitly zero them on reset since they were located before breakpoints. Pass PowerPCCPU to kvmppc_handle_halt(). Signed-off-by: Andreas Färber <afaerber@suse.de>
* move socket_set_nodelay to osdep.cMORITA Kazutaka2013-03-041-3/+2
| | | | | Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* cpu: Move host_tid field to CPUStateAndreas Färber2013-02-161-5/+9
| | | | | | | Change gdbstub's cpu_index() argument to CPUState now that CPUArchState is no longer used. Signed-off-by: Andreas Färber <afaerber@suse.de>
* cpu: Move cpu_index field to CPUStateAndreas Färber2013-01-151-1/+2
| | | | | | | | | | | | | Note that target-alpha accesses this field from TCG, now using a negative offset. Therefore the field is placed last in CPUState. Pass PowerPCCPU to [kvm]ppc_fixup_cpu() to facilitate this change. Move common parts of mips cpu_state_reset() to mips_cpu_reset(). Acked-by: Richard Henderson <rth@twiddle.net> (for alpha) [AF: Rebased onto ppc CPU subclasses and openpic changes] Signed-off-by: Andreas Färber <afaerber@suse.de>
* target-s390: Fix gdbstubRichard Henderson2013-01-051-30/+48
| | | | | | | | | | | | The real gdb protocol doesn't split out pc or cc as real registers. Those are pseudos that are extracted as needed from the PSW. Don't modify env->cc_op during read -- that way lies heisenbugs. Fill in the XXX for the fp registers. Remove duplicated defines in cpu.h. Signed-off-by: Richard Henderson <rth@twiddle.net>
* softmmu: move remaining include files to include/ subdirectoriesPaolo Bonzini2012-12-191-1/+1
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* softmmu: move include files to include/sysemu/Paolo Bonzini2012-12-191-2/+2
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* misc: move include files to include/qemu/Paolo Bonzini2012-12-191-1/+1
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* monitor: move include files to include/monitor/Paolo Bonzini2012-12-191-1/+1
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* exec: move include files to include/exec/Paolo Bonzini2012-12-191-1/+1
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* target-xtensa: add FP registersMax Filippov2012-09-221-0/+8
| | | | | | | | | | There are 16 32-bit FP registers (f0 - f15), control and status user registers (fcr, fsr). See ISA, 4.3.10 for more details. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* gdbstub/sh4: fix build with USE_SOFTFLOAT_STRUCT_TYPESAurelien Jarno2012-09-211-54/+90
| | | | | | | | | | | We have to use different type to access float values when USE_SOFTFLOAT_STRUCT_TYPES is defined. Rework SH4 version of cpu_gdb_{read,write}_register() using a single case, and fixing the coding style. Use ldll_p() and stfl_p() to access float values. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* target-or32: Add gdb stub supportJia Liu2012-07-271-0/+64
| | | | | | | Add OpenRISC gdb stub support. Signed-off-by: Jia Liu <proljc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* make gdb_id() generally avialable and rename it to cpu_index()Wen Congyang2012-06-041-14/+5
| | | | | | | | | The following patch also needs this API, so make it generally avialable. The function gdb_id() will not be used in gdbstub.c now, so its name is not suitable, and rename it to cpu_index() Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* gdbstub: Synchronize CPU state unconditionally in gdb_set_cpu_pcPeter Maydell2012-04-211-2/+1
| | | | | | | | | | | | | | | | | | | | | Synchronize the CPU state via cpu_sychronize_state() unconditionally in gdb_set_cpu_pc() rather than only in some of the target ifdef ladder cases. We can divide the CPUs into three categories: * non-KVM targets: no change of behaviour since we will use the kvm-stub.c no-op function. * i386 and s390: no change of behaviour since they were already calling this function * PPC (in KVM mode): this fixes an error: failing to synchronise was accidental and probably a bug. This also paves the way for other targets (specifically ARM) which can add KVM support in future without having to add another target specific change to this bit of code. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* gdbserver: Don't send a GDB syscall until the system CPU is stoppedMeador Inge2012-03-241-15/+27
| | | | | | | | | | | | | | Fix an issue where the GDB server implementation was sending GDB syscall requests while the system CPU was still running. Syscall requests must be sent while the CPU is stopped otherwise replies from the GDB client might get dropped and the GDB server might be incorrectly transitioned into a 'RUN_STATE_PAUSED' state. Signed-off-by: Meador Inge <meadori@codesourcery.com> [PMM: trivial rebase, reinstated comma after last item in RSState enum] Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Rename CPUState -> CPUArchStateAndreas Färber2012-03-141-22/+22
| | | | | | | | | | | | | Scripted conversion: for file in *.[hc] hw/*.[hc] hw/kvm/*.[hc] linux-user/*.[hc] linux-user/m68k/*.[hc] bsd-user/*.[hc] darwin-user/*.[hc] tcg/*/*.[hc] target-*/cpu.h; do sed -i "s/CPUState/CPUArchState/g" $file done All occurrences of CPUArchState are expected to be replaced by QOM CPUState, once all targets are QOM'ified and common fields have been extracted. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
* monitor: Avoid CPUState in read/write functionsAndreas Färber2012-03-141-28/+28
| | | | | Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
* gdbstub: Do not kill target in system emulation modeJan Kiszka2012-03-111-0/+2
| | | | | | | | | | | | | | | | | Too many VM kittens were killed since 7d03f82f81. Another one just died under my fat fingers. When you quit a kgdb session, does the Linux kernel power off? Or when you terminate gdb attached to a hardware debugger, does your board vanish in space? No. So let's stop terminating QEMU when the gdbstub receives a kill commando in system emulation mode. Real termination can still be achieved via "monitor quit". We keep the behavior for user mode emulation which is arguably more like a gdbserver scenario. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* gdbstub: Fix fd leak in gdbserver_open() error pathPeter Maydell2012-01-061-0/+2
| | | | | | | | Fix a leak of a file descriptor in error exit paths in gdbserver_open(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* Fix spelling in comments, documentation and messagesStefan Weil2011-12-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | accidently->accidentally annother->another choosen->chosen consideres->considers decriptor->descriptor developement->development paramter->parameter preceed->precede preceeding->preceding priviledge->privilege propogation->propagation substraction->subtraction throught->through upto->up to usefull->useful Fix also grammar in posix-aio-compat.c Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* gdbstub: Fix memory leakStefan Weil2011-11-191-6/+8
| | | | | | | | | | | | | cppcheck report: gdbstub.c:1781: error: Memory leak: s Rearranging of the code avoids the leak. v2: Replace the g_malloc0() by g_new0() (suggested by Stuart Brady). Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* target-sparc: Change fpr representation to doubles.Richard Henderson2011-10-261-11/+24
| | | | | | | | This allows a more efficient representation for 64-bit hosts. It should be about the same for 32-bit hosts, as we can still access the individual pieces of the double. Signed-off-by: Richard Henderson <rth@twiddle.net>
* Merge remote-tracking branch 'qmp/queue/qmp' into stagingAnthony Liguori2011-10-101-13/+13
|\
| * RunState: Rename enum values as generated by the QAPILuiz Capitulino2011-10-041-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Next commit will convert the query-status command to use the RunState type as generated by the QAPI. In order to "transparently" replace the current enum by the QAPI one, we have to make some changes to some enum values. As the changes are simple renames, I'll do them in one shot. The changes are: - Rename the prefix from RSTATE_ to RUN_STATE_ - RUN_STATE_SAVEVM to RUN_STATE_SAVE_VM - RUN_STATE_IN_MIGRATE to RUN_STATE_INMIGRATE - RUN_STATE_PANICKED to RUN_STATE_INTERNAL_ERROR - RUN_STATE_POST_MIGRATE to RUN_STATE_POSTMIGRATE - RUN_STATE_PRE_LAUNCH to RUN_STATE_PRELAUNCH - RUN_STATE_PRE_MIGRATE to RUN_STATE_PREMIGRATE - RUN_STATE_RESTORE to RUN_STATE_RESTORE_VM - RUN_STATE_PRE_MIGRATE to RUN_STATE_FINISH_MIGRATE Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* | Gdbstub: handle read of fpscrFabien Chouteau2011-10-061-1/+1
|/ | | | | Signed-off-by: Fabien Chouteau <chouteau@adacore.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* Drop the vm_running global variableLuiz Capitulino2011-09-151-2/+2
| | | | | | Use runstate_is_running() instead, which is introduced by this commit. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* Replace the VMSTOP macros with a proper state typeLuiz Capitulino2011-09-151-15/+15
| | | | | | | | | | | | | | | Today, when notifying a VM state change with vm_state_notify(), we pass a VMSTOP macro as the 'reason' argument. This is not ideal because the VMSTOP macros tell why qemu stopped and not exactly what the current VM state is. One example to demonstrate this problem is that vm_start() calls vm_state_notify() with reason=0, which turns out to be VMSTOP_USER. This commit fixes that by replacing the VMSTOP macros with a proper state type called RunState. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* Gdbstub: Fix back-trace on SPARC32Fabien Chouteau2011-09-101-3/+13
| | | | | | | | | | Gdb expects all registers windows to be flushed in ram, which is not the case in Qemu. Therefore the back-trace generation doesn't work. This patch adds a function to handle reads (and only read) in stack frames as if windows were flushed. Signed-off-by: Fabien Chouteau <chouteau@adacore.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* target-xtensa: add gdb supportMax Filippov2011-09-101-0/+96
| | | | | | | | | | | | | | Specific xtensa processor overlay for GDB contains register map in the gdb/xtensa-config.c. This description is used by the GDB to e.g. parse 'g' response packets and it may be reused in the qemu's gdbstub (only XTREG definitions for non-pseudoregisters are needed). Currently mainline GDB does not support operations with privileged SRs (see http://sourceware.org/ml/gdb/2011-07/msg00075.html). This support may be enabled, see NUM_CORE_REGS comment in the gdbstub.c Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* char: rename qemu_chr_close() -> qemu_chr_delete()Anthony Liguori2011-08-221-2/+2
| | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* char: rename qemu_chr_open() -> qemu_chr_new()Anthony Liguori2011-08-221-1/+1
| | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* char: rename qemu_chr_read() -> qemu_chr_be_write()Anthony Liguori2011-08-221-1/+1
| | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* char: rename qemu_chr_write() -> qemu_chr_fe_write()Anthony Liguori2011-08-221-1/+1
| | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Use glib memory allocation and free functionsAnthony Liguori2011-08-201-4/+4
| | | | | | qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Wrap recv to avoid warningsBlue Swirl2011-07-251-1/+1
| | | | | | | | | | | | | Avoid warnings like these by wrapping recv(): CC slirp/ip_icmp.o /src/qemu/slirp/ip_icmp.c: In function 'icmp_receive': /src/qemu/slirp/ip_icmp.c:418:5: error: passing argument 2 of 'recv' from incompatible pointer type [-Werror] /usr/local/lib/gcc/i686-mingw32msvc/4.6.0/../../../../i686-mingw32msvc/include/winsock2.h:547:32: note: expected 'char *' but argument is of type 'struct icmp *' Remove also casts used to avoid warnings. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Remove exec-all.h include directivesBlue Swirl2011-06-261-1/+1
| | | | | | Most exec-all.h include directives are now useless, remove them. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
OpenPOWER on IntegriCloud