aboutsummaryrefslogtreecommitdiff
path: root/gnu/usr.bin/gdb
Commit message (Collapse)AuthorAgeFilesLines
...
* FreeBSD/mips gdb build suspport. From the mips2-jnpr branch.Warner Losh2008-04-263-0/+794
| | | | Notes: svn path=/head/; revision=178583
* Change kgdb_parse() to use wrapped versions of parse_expression() andJohn Baldwin2008-03-291-6/+9
| | | | | | | | | | | | | evaluate_expression() so that any errors are caught and cause the function to return to 0. Otherwise the errors posted an exception (via longjmp()) that aborted the current operation. This fixes the kld handling for older kernels (6.x and 7.x) that don't have the full pathname stored in the kernel linker. MFC after: 3 days Notes: svn path=/head/; revision=177715
* Initialize the head pointer in kld_current_sos() to NULL to avoid returningJohn Baldwin2008-03-291-0/+1
| | | | | | | | | | | a junk pointer and possibly causing a seg fault if we don't have any non-kernel klds (or are unable to walk the list due to core / kernel mismatch). MFC after: 1 week Notes: svn path=/head/; revision=177701
* Remove a stale prototype I missed when converting the kld support over toJohn Baldwin2008-02-251-1/+0
| | | | | | | hooking into gdb's shared library infrastructure. Notes: svn path=/head/; revision=176568
* - Rework the kld support to hook into GDB's shared library support.John Baldwin2008-01-293-81/+165
| | | | | | | | | | | | | | | | | | kgdb(8) now treats kld's as shared libraries relative to the kernel "binary". Thus, you can use 'info sharedlibrary' to list the kld's along with 'sharedlibrary' and 'nosharedlibrary' to manage symbol loading and unloading. Note that there isn't an easy way to force GDB to use a specific path for a shared library. However, you can use 'nosharedlibrary' to unload all the klds and then use 'sharedlibrary' to load specific klds where it gets the kld correct and use 'add-kld' for the kld's where the default open behavior doesn't work. klds opened via 'sharedlibrary' (and during startup) do have their sections listed in 'info files'. - Change the 'add-kld' command to use filename completion to complete its argument. Notes: svn path=/head/; revision=175809
* Don't close the kernel bfd object during startup. Instead, leave it openJohn Baldwin2008-01-293-7/+13
| | | | | | | | | and build a section table from the kernel file so that 'info files' output for kgdb now matches the usage of gdb on a regular file with the exception that we don't list sections for memory in the crash dump. Notes: svn path=/head/; revision=175808
* Use target_read_memory() and extract_unsigned_integer() instead of directJohn Baldwin2008-01-291-19/+6
| | | | | | | KVM access to read kernel pointers. Notes: svn path=/head/; revision=175807
* Don't look for "foo.ko.symbols" files. GDB is smart enough to open theJohn Baldwin2008-01-291-1/+0
| | | | | | | | ".symbols" file automatically when you tell it to load "foo.ko" because of the debug link. Notes: svn path=/head/; revision=175806
* Use a for loop in find_kld_address() as in kgdb_auto_load_klds() andJohn Baldwin2008-01-281-7/+4
| | | | | | | replace the remaining goto's with continues as a result. Notes: svn path=/head/; revision=175775
* Add support for automatically loading symbols for kld's on startup:John Baldwin2008-01-283-140/+248
| | | | | | | | | | | | | | | | | | | | | | | | | | - Add a new 'kgdb_auto_load_klds()' routine which is invoked during startup that walks the list of linker files and tries to find a matching kld on disk for each non-kernel kld. If a kld file is found, then it is added as if the 'add-kld' command is invoked. One change from 'add-kld' is that this method attempts to use the 'pathname' from the linker_file structure first to try to load the file. If that fails it then looks in the kernel directory followed by the directories in the module path. - Move the kld file suffix handling into a separate routine so that it can be called standalone and to reduce duplicate code in find_kld_path(). - Cache the offsets of members of 'struct linker_file' during startup instead of computing them for each 'add-kld'. - Use GDB's target_read_string() instead of direct KVM access. - Add all resident sections from a kld by using bfd_map_over_sections() to build the section list rather than just adding symbols for ".text", ".data", ".bss", and ".rodata". - Change the 'add-kld' command to do a y/n prompt before adding the symbols when run interactively to match 'add-symbol-file'. MFC after: 1 week Notes: svn path=/head/; revision=175774
* Remove the warnx() from kgdb_lookup() so that we don't emit a warning aboutJohn Baldwin2008-01-282-6/+10
| | | | | | | | | optional symbols that are missing (e.g. kgdb complains about _stoppcbs and _stopped_cpus on UP kernels). Instead, callers that really want their symbols to be present now do explicitly warnx() about the missing symbol. Notes: svn path=/head/; revision=175771
* If the quiet flag is specified (-q), don't dump the unread portion ofJohn Baldwin2008-01-281-1/+4
| | | | | | | the message buffer on startup. Notes: svn path=/head/; revision=175770
* Move the code for working with kld's out into its own file.John Baldwin2008-01-244-269/+306
| | | | Notes: svn path=/head/; revision=175645
* Include the thread name (in addition to the proc name) in "info threads."Ed Maste2008-01-181-3/+13
| | | | Notes: svn path=/head/; revision=175452
* Add a new 'add-kld <kld>' command to kgdb to make it easier to analyzeJohn Baldwin2008-01-173-2/+275
| | | | | | | | | | | | | | | | | | | | | | | | | crash dumps with kernel modules. The command is basically a wrapper around add-symbol-file except that it uses the kernel linker data structures and the ELF section headers of the kld to calculate the section addresses add-symbol-file needs. The 'kld' parameter may either be an absolute path or a relative path. kgdb looks for the kld in several locations checking for variants with ".symbols" or ".debug" suffixes in each location. The first location it tries is just opening the specified path (this handles absolute paths and looks for the kld relative to the current directory otherwise). Next it tries to find the module in the same directory of the kernel image being used. If that fails it extracts the kern.module_path from the kernel being debugged and looks in each of those paths. The upshot is that for the common cases of debugging /boot/kernel/kernel where the module is in either /boot/kernel or /boot/modules one can merely do 'add-kld foo.ko'. MFC after: 1 week Notes: svn path=/head/; revision=175416
* Add thread support for arm.Olivier Houchard2007-11-174-5/+40
| | | | | | | MFC After: 1 week Notes: svn path=/head/; revision=173705
* There's no reason why we couldn't attach to a live process on arm.Olivier Houchard2007-11-171-0/+3
| | | | | | | MFC After: 1 week Notes: svn path=/head/; revision=173700
* Teach kgdb how to handle double fault frames on i386:John Baldwin2007-11-163-1/+154
| | | | | | | | | | | | | | | | - Save td_oncpu in 'struct kthr' so the i386 target code can see which CPU a thread is running on. - Add a new frame unwinder for double fault frames. This unwinder is used when "dblfault_handler" is encountered in the stack. It uses the CPU of the current thread to lookup the base address of the TSS used for the double fault from the GDT. It then fetches the various registers out of the TSS similar to how the current trapframe unwinder fetches registers out of the trapframe. MFC after: 3 days Notes: svn path=/head/; revision=173681
* NMIs now come from 'nmi_calltrap' rather than 'calltrap', so teach 'kgdb'John Baldwin2007-08-221-0/+1
| | | | | | | | | | to treat the frame under 'nmi_calltrap' as a trapframe. MFC after: 3 days Approved by: re (bmah) Notes: svn path=/head/; revision=171924
* Remove extern int verbose declaration. It is declared static in theAlexander Kabaev2007-05-191-1/+0
| | | | | | | only file it is used in. Notes: svn path=/head/; revision=169714
* Fix static/extern mismatch by patching corresponding tdep filesAlexander Kabaev2007-05-192-2/+11
| | | | | | | in-place. Notes: svn path=/head/; revision=169713
* Add threading support.Marcel Moolenaar2007-05-012-1/+3
| | | | Notes: svn path=/head/; revision=169188
* Unbreak the kgdb stepping over the special frames on i386 after rev. 1.117 ofKonstantin Belousov2007-03-011-1/+22
| | | | | | | | | i386/i386/exception.s. No objections from: marcel Notes: svn path=/head/; revision=167143
* Rename lookup() to kgdb_lookup() and make it global (for use in trgt_i386.c).Konstantin Belousov2007-03-012-7/+9
| | | | | | | No objections from: marcel Notes: svn path=/head/; revision=167142
* Avoid writing uninitialized stack data into a thread's MMX/SSE state byEd Maste2007-02-201-7/+12
| | | | | | | | | | | | | | | | first getting the current state with td_thr_getxmmregs_p. Without this, debugging a threaded app that uses libthr resulted in kernel panics or spurious SIGFPEs for me. (As of revision 1.6, sys/i386/i386/ptrace_machdep.c masks off the reserved bits in the mxcsr register, which prevents the kernel panics.) Architectures without PT_GETXMMREGS are not affected. MFC after: 1 week Notes: svn path=/head/; revision=166851
* Try to avoid a possible infinite loop when parsing an invalid kernel dump file.Craig Rodrigues2007-01-251-2/+7
| | | | | | | | | | PR: 108229 Submitted by: Jessica Han <jessicah juniper net> Reviewed by: marcel MFC after: 1 week Notes: svn path=/head/; revision=166214
* Bump document date for the previous change.Ruslan Ermilov2006-10-211-1/+2
| | | | Notes: svn path=/head/; revision=163583
* Turn on gdbserver for the arch that supports it..John-Mark Gurney2006-10-211-0/+4
| | | | Notes: svn path=/head/; revision=163582
* Trim trailing whitespace.John Baldwin2006-10-163-7/+7
| | | | Notes: svn path=/head/; revision=163440
* Restore the 'proc' and 'tid' commands which allow one to switch to theJohn Baldwin2006-10-161-0/+89
| | | | | | | | | | | first thread in a process or to a specific thread via PIDs and TIDs, respectively. Submitted by: kan Approved by: marcel Notes: svn path=/head/; revision=163439
* Document '-w' from main.c rev. 1.11.David E. O'Brien2006-10-111-0/+8
| | | | Notes: svn path=/head/; revision=163245
* Add cross debug support to arm.Warner Losh2006-09-141-1/+37
| | | | | | | Submitted by: cognet@ Notes: svn path=/head/; revision=162303
* Architecture specific portions of gdb for arm.Warner Losh2006-09-148-0/+1477
| | | | | | | Submitted by: cognet@ Notes: svn path=/head/; revision=162298
* Use the pcb in stoppcbs[] if it is present for threads that were runningJohn Baldwin2006-08-251-2/+19
| | | | | | | | | | | on other CPUs in system when a dump is written. Submitted by: ups Reviewed by: marcel MFC after: 3 days Notes: svn path=/head/; revision=161621
* Add initial support for kgdb(1) on PowerPC.Marcel Moolenaar2006-08-242-5/+186
| | | | Notes: svn path=/head/; revision=161589
* Add basic support for PowerPC. This excludes kgdb(1).Marcel Moolenaar2006-08-244-1/+800
| | | | Notes: svn path=/head/; revision=161564
* Remove special handling for PC == 0. With this, kgdb can now properlyJohn Baldwin2006-08-231-6/+1
| | | | | | | | | | | unwind across a page fault due to a null function pointer. It does a better job than ddb now in fact. Reviewed by: marcel MFC after: 3 days Notes: svn path=/head/; revision=161555
* Remove alpha-specific stuff.Ruslan Ermilov2006-08-234-977/+0
| | | | | | | Approved by: marcel Notes: svn path=/head/; revision=161548
* Add initial platform support.David E. O'Brien2006-07-221-0/+196
| | | | | | | Submitted by: cognet Notes: svn path=/head/; revision=160581
* Clean the product of patch(1).Ruslan Ermilov2006-04-101-0/+2
| | | | Notes: svn path=/head/; revision=157626
* bring in the necessary changes to make gdbserver compile and work (atJohn-Mark Gurney2006-04-065-316/+210
| | | | | | | | | | | least on i386)... fbsd-* changes started out as s/linux/fbsd/g and then additional changes to handle different ptrace defines among other things.. (use vfork to eliminate a race for progress group creation) reg-i386.c is generated by regdat.sh.. Notes: svn path=/head/; revision=157574
* import gdbserver Linux files renamed to fbsd... I have made gdbserverJohn-Mark Gurney2006-04-063-0/+1754
| | | | | | | | | work w/ minor modifications to these files, so keep the history... These are stock files from GDB 6.1.1 w/ only the filename s/linux/fbsd/g Notes: svn path=/vendor/misc-GNU/dist1/; revision=157571
* Introduce a new proc service routine ps_linfo() to get LWP info.David Xu2006-02-071-0/+14
| | | | Notes: svn path=/head/; revision=155412
* 1. Eliminate compile warnings.David Xu2006-02-061-8/+60
| | | | | | | | 2. Add command 'thread signal' to print out current thread's signal mask and pending signals. Notes: svn path=/head/; revision=155379
* Add -w parameter which tells kgdb to open kmem-based targets in read-writeAlexander Kabaev2006-01-041-3/+8
| | | | | | | | | | | mode. This allows one to use kgdb on /dev/mem and be able to patch memory on a live system. This is identical to what -wcore used to do in previous gdb versions for FreeBSD. Requested by: wpaul Notes: svn path=/head/; revision=154043
* Fix dump of the unread portion of the kernel message buffer.Marcel Moolenaar2005-10-261-0/+4
| | | | | | | | PR: bin/87964 Submitted by: Frank Mayhar frank at exit dot com Notes: svn path=/head/; revision=151683
* Unbreak - remove leftover reference to pcb_rflags.Peter Wemm2005-09-281-1/+0
| | | | Notes: svn path=/head/; revision=150668
* Claim frames corresponding to tl(0|1)_intr and tl0_trap as well. IMarcel Moolenaar2005-09-111-1/+4
| | | | | | | | | | think that's the lot, but it's hard to understand the exception code by mere glancing at it. MFC after: 1 week Notes: svn path=/head/; revision=149977
* Unwind across intrframes as well. While here, better handle bottom ofMarcel Moolenaar2005-09-111-2/+8
| | | | | | | | | | stack by claiming the frame when the IP is 0. It's a bit of a kluge, but avoids screens full of bogus frames. MFC after: 1 week Notes: svn path=/head/; revision=149976
* Unwind across intrframes as well.Marcel Moolenaar2005-09-111-3/+8
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=149975