aboutsummaryrefslogtreecommitdiff
path: root/gdb
AgeCommit message (Collapse)AuthorFilesLines
2013-12-05Minor coding-style fixes in ada-lex.l:find_dot_all.Joel Brobecker2-13/+18
gdb/ChangeLog: * ada-lex.l (find_dot_all): Fix coding style violations.
2013-12-04Fix the manual more thoroughly.Eli Zaretskii1-6/+6
2013-12-04doc/gdb.texinfo (i386): Fix yesterday's commit.Eli Zaretskii2-1/+5
2013-12-03add @kindex for catchpointsTom Tromey2-0/+19
I wanted to find the docs for "catch load" the other day, and I found out that this isn't in the index. It seems to me that each command ought to be in the index for quick reference like this, so this patch adds an @kindex (chosen because it seems to be what the rest of the manual does) for each "catch" subcommand. 2013-12-03 Tom Tromey <tromey@redhat.com> * gdb.texinfo (Set Catchpoints): Add @kindex for each command documented here.
2013-12-03add "dir" menu item for gdbserverTom Tromey2-0/+5
I happened to notice that the gdbserver program doesn't appear in the top-level "dir" file. This adds an entry for it to the gdb manual. 2013-12-03 Tom Tromey <tromey@redhat.com> * gdb.texinfo (@direntry): Add menu item for gdbserver.
2013-12-03Documentation for MPX.Walfred Tedeschi4-0/+57
2013-11-20 Walfred Tedeschi <walfred.tedeschi@intel.com> * NEWS: Add section for Intel(R) Architecture Instructions Extesions mentioning MPX. doc/ * gdb.texinfo (i386 Features): Add MPX feature registers. (x86 Specific featuresx86 Architecture-specific Issues): Adds a subsubsection for MPX and describes the display of the boundary registers. Signed-off-by: Walfred Tedeschi <walfred.tedeschi@intel.com>
2013-12-03Fixed typo in date in testsuite/ChangeLog entryJose E. Marchesi1-1/+1
2013-12-03testsuite: handle SIGLOST/SIGPWR conflict in sparc64-*-linux-gnu targets.Jose E. Marchesi3-4/+20
2013-10-03 Jose E. Marchesi <jose.marchesi@oracle.com> * gdb.base/sigall.exp (test_one_sig): gdb identifies SIGLOST as a SIGPWR in sparc64. * gdb.base/sigall.c (main): In some targets SIGLOST and SIGPWR have the same signal number. Handle this situation.
2013-12-03Ada: Reserved word "all" should not need to be spelled in lowercase.Joel Brobecker7-1/+113
Consider the following code: type Ptr is access all Integer; IP : Ptr := new Integer'(123); IP is the Ada exception of a pointer to an integer. To dereference the pointer and get its value, the user uses the reserved word "all" as follow: (gdb) p ip.all $1 = 123 Ada being a case-insensitive language, the casing should not matter. Unfortunately, for the reserved word "all", things don't work. For instance: (gdb) p ip.ALL Type integer is not a structure or union type This patch fixes the problem. gdb/ChangeLog: * ada-lex.l (find_dot_all): Use strncasecmp instead of strncmp. gdb/testsuite/ChangeLog: * gdb.ada/dot_all: New testcase.
2013-12-03crash evaluating bogus exception condition expression (sparc-solaris)Joel Brobecker2-3/+17
With a program raising an exception, trying to debug that program in GDB/MI mode can yield a crash: % gdb -i=mi foo (gdb) -catch-exception -e "Program_Error" ^done,bkptno="2",bkpt={number="2",type="breakpoint",[...] (gdb) -exec-continue ^running *running,thread-id="all" (gdb) =library-loaded,id=[...] &"warning: failed to reevaluate internal exception condition for catchpoint 2: Error in expression, near `'.\n" zsh: 22956 bus error (core dumped) gdb -q -i=mi foo The problem is triggered by a problem in the compiler which causes EXP in the following TRY_CATCH block to change unexpectedly when parse_exp_1 throws an error : | TRY_CATCH (e, RETURN_MASK_ERROR) | { | exp = parse_exp_1 (&s, bl->address, | block_for_pc (bl->address), 0); | } In ada-lang.c:create_excep_cond_exprs, EXP is initialized to NULL, and is expected to remain NULL if parse_exp_1 throws. Instead, its value gets changed to something invalid. This later crashes the debugger, when trying to evaluate the bogus expression. This patch works around the issue by simply forcing EXP back to NULL when an exception was thrown. A comment explaining why, and the sort of timeline we're looking at for a fix, is also added. gdb/ChangeLog: * ada-lang.c (create_excep_cond_exprs): Force EXP to NULL when parse_exp_1 threw an error. Add comment.
2013-12-03NEWS: Extend documentation of the new GDB/MI --language option.Joel Brobecker2-0/+7
This patch extends a bit the news entry we added which documents general support of the --language option, to add a small reference to the associated entry which was also added to the "-list-features" command output. gdb/ChangeLog: * NEWS: Mention "-list-features" in the entry documenting the support for the "--language" option.
2013-12-03Resurrect gdb-add-index as a contrib scriptSamuel Bronson3-0/+81
This includes changes made in Fedora's gdb packaging[1], Doug's robustness patch[2] from before gdb-add-index was dropped, some corrections, and some more changes Doug accumulated in the meantime[3]. [1]: http://pkgs.fedoraproject.org/cgit/gdb.git/log/gdb-gdb-add-index-script.patch?id=fe74423b0812bae6d7bb027584e401a2ac37d24d [2]: https://sourceware.org/ml/gdb-patches/2010-09/msg00130.html [3]: https://sourceware.org/ml/gdb-patches/2013-11/msg00297.html It would be a good idea to mention the existance of this script in (info "(gdb) Index Files"), but I'm boycotting invariant sections/cover texts because non-free docs are a PITA, so somebody else would need to do that. Summary of previous activity: 97924a9 Actual removal c29c521 Attempted removal (accidentally left gdb-add-index.sh in place) c2bbed2 Addition
2013-12-03MAINTAINERS (Write After Approval): Add myself to the list.Samuel Bronson2-0/+5
2013-12-03Remove "ada-exceptions" from -list-features output.Joel Brobecker4-5/+9
Now that the -info-gdb-mi-command is available, there is no need for this entry. The entry and associated new commands were added recently enough that no front-end out there should be depending on it yet. gdb/ChangeLog: * mi/mi-main.c (mi_cmd_list_features): Remove "ada-exceptions". gdb/doc/ChangeLog: * gdb.texinfo (GDB/MI Miscellaneous Commands): Remove the documentation of the "ada-exceptions" entry.
2013-12-03Remove all trailing spaces in mi/mi-main.c.Joel Brobecker2-32/+36
No code change, just a mechanical cleanup. gdb/ChangeLog: * mi/mi-main.c: Remove trailing spaces throughout.
2013-12-03Add "undefined-command" error code at end of ^error result...Joel Brobecker9-5/+97
... when trying to execute an undefined GDB/MI command. When trying to execute a GDB/MI command which does not exist, the current error result record looks like this: -unsupported ^error,msg="Undefined MI command: unsupported" The only indication that the command does not exist is the error message. It would be a little fragile for a consumer to rely solely on the contents of the error message in order to determine whether a command exists or not. This patch improves the situation by adding concept of error code, starting with one well-defined error code ("undefined-command") identifying errors due to a non-existant command. Here is the new output: -unsupported ^error,msg="Undefined MI command: unsupported",code="undefined-command" This error code is only displayed when the corresponding error condition is met. Otherwise, the error record remains unchanged. For instance: -symbol-list-lines foo.adb ^error,msg="-symbol-list-lines: Unknown source file name." For frontends to be able to know whether they can rely on this variable, a new entry "undefined-command-error-code" has been added to the "-list-features" command. Another option would be to always generate an error="..." variable (for the default case, we could decide for instance that the error code is the empty string). But it seems more efficient to provide that info in "-list-features" and then only add the error code when meaningful. gdb/ChangeLog: (from Pedro Alves <palves@redhat.com>) (from Joel Brobecker <brobecker@adacore.com>) * exceptions.h (enum_errors) <UNDEFINED_COMMAND_ERROR>: New enum. * mi/mi-parse.c (mi_parse): Throw UNDEFINED_COMMAND_ERROR instead of a regular error when the GDB/MI command does not exist. * mi/mi-main.c (mi_cmd_list_features): Add "undefined-command-error-code". (mi_print_exception): Print an "undefined-command" error code if EXCEPTION.ERROR is UNDEFINED_COMMAND_ERROR. * NEWS: Add entry documenting the new "code" variable in "^error" result records. gdb/doc/ChangeLog: * gdb.texinfo (GDB/MI Result Records): Fix the syntax of the "^error" result record concerning the error message. Document the error code that may also be part of that result record. (GDB/MI Miscellaneous Commands): Document the "undefined-command-error-code" element in the output of the "-list-features" GDB/MI command. gdb/testsuite/ChangeLog: * gdb.mi/mi-undefined-cmd.exp: New testcase.
2013-12-03New GDB/MI command "-info-gdb-mi-command"Joel Brobecker10-0/+155
This patch adds a new GDB/MI command meant for graphical frontends trying to determine whether a given GDB/MI command exists or not. Examples: -info-gdb-mi-command unsupported-command ^done,command={exists="false"} (gdb) -info-gdb-mi-command symbol-list-lines ^done,command={exists="true"} (gdb) At the moment, this is the only piece of information that this command returns. Eventually, and if needed, we can extend it to provide command-specific pieces of information, such as updates to the command's syntax since inception. This could become, for instance: -info-gdb-mi-command symbol-list-lines ^done,command={exists="true",features=[]} (gdb) -info-gdb-mi-command catch-assert ^done,command={exists="true",features=["conditions"]} In the first case, it would mean that no extra features, while in the second, it announces that the -catch-assert command in this version of the debugger supports a feature called "condition" - exact semantics to be documented with combined with the rest of the queried command's documentation. But for now, we start small, and only worry about existance. And to bootstrap the process, I have added an entry in the output of the -list-features command as well ("info-gdb-mi-command"), allowing the graphical frontends to go through the following process: 1. Send -list-features, collect info from there as before; 2. Check if the output contains "info-gdb-mi-command". If it does, then support for various commands can be queried though -info-gdb-mi-command. Newer commands will be expected to always be checked via this new -info-gdb-mi-command. gdb/ChangeLog: * mi/mi-cmds.h (mi_cmd_info_gdb_mi_command): Declare. * mi/mi-cmd-info.c (mi_cmd_info_gdb_mi_command): New function. * mi/mi-cmds.c (mi_cmds): Add -info-gdb-mi-command command. * mi/mi-main.c (mi_cmd_list_features): Add "info-gdb-mi-command" field to output of "-list-features". * NEWS: Add entry for new -info-gdb-mi-command. gdb/doc/ChangeLog: * gdb.texinfo (GDB/MI Miscellaneous Commands): Document the new -info-gdb-mi-command GDB/MI command. Document the meaning of "-info-gdb-mi-command" in the output of -list-features. gdb/testsuite/ChangeLog: * gdb.mi/mi-i-cmd.exp: New file.
2013-12-02Record objfile->original_name as an absolute pathJan Kratochvil9-26/+94
gdb/ 2013-12-02 Doug Evans <dje@google.com> Jan Kratochvil <jan.kratochvil@redhat.com> * objfiles.c (allocate_objfile): Save original_name as an absolute path. * objfiles.h (struct objfile): Expand comment on original_name. * source.c (openp): Call gdb_abspath. * utils.c (gdb_abspath): New function. * utils.h (gdb_abspath): Declare. gdb/testsuite/ 2013-12-02 Doug Evans <dje@google.com> * gdb.dwarf/dwp-symlink.c: Fake out gdb to not load debug info at start. * gdb.dwarf/dwp-symlink.exp: Test trying to load dwp when the binary has been specified with a relative path and we have chdir'd before accessing the debug info.
2013-12-02Add new target_read_raw_memory function, and consolidate comments.Pedro Alves4-16/+41
Tested on x86_64 Fedora 17. gdb/ 2013-12-02 Pedro Alves <palves@redhat.com> * dcache.c (dcache_read_line): Use target_read_raw_memory. * target.c (target_read_raw_memory): New function. (target_read_stack, target_write_memory, target_write_raw_memory): Update comment. (target_read_code): Add comment. * target.h (target_read_raw_memory): Declare.
2013-12-02gnulib's sys/stat.h always defines S_IRGRP, S_IXGRP, S_IXOTH.Pedro Alves2-12/+6
Confirmed that cross building a mingw gdb still works, and also made sure it was gnulib's sys/stat.h that was defining the values, by hacking the header with #errors where the macros are defined. gdb/ 2013-12-02 Pedro Alves <palves@redhat.com> * ctf.c (ctf_start): Use S_IRGRP, S_IXGRP, S_IXOTH unconditionally.
2013-12-02Handle 'k' packet TARGET_CLOSE_ERROR gracefully.Pedro Alves2-12/+35
Remote servers may cut the connection abruptly since they are not required to reply to a 'k' (Kill) packet sent from GDB. This patch addresses any issues arising from such scenario, which leads to a GDB internal error due to an attempt to pop the target more than once. With the patch, this failure is handled gracefully. Here's the GDB backtrace Maciej got running the testsuite against QEMU. Full paths edited out for brevity. #0 0x55573430 in __kernel_vsyscall () #1 0x557a2951 in raise () from /lib32/libc.so.6 #2 0x557a5d82 in abort () from /lib32/libc.so.6 #3 0x0826e2e4 in dump_core () at .../gdb/utils.c:635 #4 0x0826e5b6 in internal_vproblem (problem=0x85200c0, file=0x8416be8 ".../gdb/target.c", line=2861, fmt=0x84174ac "could not find a target to follow mourn inferior", ap=0xffa4796c "\f") at .../gdb/utils.c:804 #5 0x0826e5fb in internal_verror ( file=0x8416be8 ".../gdb/target.c", line=2861, fmt=0x84174ac "could not find a target to follow mourn inferior", ap=0xffa4796c "\f") at .../gdb/utils.c:820 #6 0x0826e633 in internal_error ( file=0x8416be8 ".../gdb/target.c", line=2861, string=0x84174ac "could not find a target to follow mourn inferior") at .../gdb/utils.c:830 #7 0x081b4ad0 in target_mourn_inferior () at .../gdb/target.c:2861 #8 0x08082283 in remote_kill (ops=0x85245e0) at .../gdb/remote.c:7840 #9 0x081b06d1 in target_kill () at .../gdb/target.c:486 #10 0x081b42f6 in dispose_inferior (inf=0xa501c60, args=0x0) at .../gdb/target.c:2570 #11 0x08290cfc in iterate_over_inferiors ( callback=0x81b42af <dispose_inferior>, data=0x0) at .../gdb/inferior.c:396 #12 0x081b435a in target_preopen (from_tty=1) at .../gdb/target.c:2591 #13 0x0807c2c6 in remote_open_1 (name=0xa5538b6 "localhost:1237", from_tty=1, target=0x85245e0, extended_p=0) at .../gdb/remote.c:4292 #14 0x0807b7a8 in remote_open (name=0xa5538b6 "localhost:1237", from_tty=1) at .../gdb/remote.c:3655 #15 0x080a23d4 in do_cfunc (c=0xa464f30, args=0xa5538b6 "localhost:1237", from_tty=1) at .../gdb/cli/cli-decode.c:107 #16 0x080a4c3b in cmd_func (cmd=0xa464f30, args=0xa5538b6 "localhost:1237", from_tty=1) at .../gdb/cli/cli-decode.c:1882 #17 0x0826bebf in execute_command (p=0xa5538c3 "7", from_tty=1) at .../gdb/top.c:467 #18 0x08193f2d in command_handler (command=0xa5538a8 "") at .../gdb/event-top.c:435 #19 0x08194463 in command_line_handler ( rl=0xa778198 "target remote localhost:1237") at .../gdb/event-top.c:633 #20 0x082ba92b in rl_callback_read_char () at .../readline/callback.c:220 #21 0x08193adf in rl_callback_read_char_wrapper (client_data=0x0) at .../gdb/event-top.c:164 #22 0x08193e57 in stdin_event_handler (error=0, client_data=0x0) at .../gdb/event-top.c:375 #23 0x08192f29 in handle_file_event (data=...) at .../gdb/event-loop.c:768 #24 0x0819266a in process_event () at .../gdb/event-loop.c:342 #25 0x08192708 in gdb_do_one_event () at .../gdb/event-loop.c:394 #26 0x08192781 in start_event_loop () at .../gdb/event-loop.c:431 #27 0x08193b08 in cli_command_loop (data=0x0) at .../gdb/event-top.c:179 #28 0x0818bc26 in current_interp_command_loop () at .../gdb/interps.c:327 #29 0x0818c4e5 in captured_command_loop (data=0x0) at .../gdb/main.c:267 #30 0x0818a37f in catch_errors (func=0x818c4d0 <captured_command_loop>, func_args=0x0, errstring=0x8402108 "", mask=RETURN_MASK_ALL) at .../gdb/exceptions.c:524 #31 0x0818d736 in captured_main (data=0xffa47f10) at .../gdb/main.c:1067 #32 0x0818a37f in catch_errors (func=0x818c723 <captured_main>, func_args=0xffa47f10, errstring=0x8402108 "", mask=RETURN_MASK_ALL) at .../gdb/exceptions.c:524 #33 0x0818d76c in gdb_main (args=0xffa47f10) at .../gdb/main.c:1076 #34 0x0804dd1b in main (argc=5, argv=0xffa47fd4) at .../gdb/gdb.c:34 The corresponding gdb.log excerpt: (gdb) PASS: gdb.base/bitfields.exp: bitfield uniqueness (u9) cont Continuing. Breakpoint 1, break1 () at .../gdb/testsuite/gdb.base/bitfields.c:44 44 } (gdb) PASS: gdb.base/bitfields.exp: continuing to break1 #9 print flags $10 = {uc = 0 '\000', s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 1 '\001'} (gdb) PASS: gdb.base/bitfields.exp: bitfield uniqueness (sc) delete breakpoints Delete all breakpoints? (y or n) y (gdb) info breakpoints No breakpoints or watchpoints. (gdb) delete breakpoints (gdb) info breakpoints No breakpoints or watchpoints. (gdb) break break2 Breakpoint 2 at 0x85f8: file .../gdb/testsuite/gdb.base/bitfields.c, line 48. (gdb) entering gdb_reload target remote localhost:1235 A program is being debugged already. Kill it? (y or n) y Remote connection closed .../gdb/target.c:2861: internal-error: could not find a target to follow mourn inferior A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) ^Ccontinue Please answer y or n. .../gdb/target.c:2861: internal-error: could not find a target to follow mourn inferior A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) Resyncing due to internal error. n .../gdb/target.c:2861: internal-error: could not find a target to follow mourn inferior A problem internal to GDB has been detected, further debugging may prove unreliable. Create a core file of GDB? (y or n) y Command aborted. (gdb) print/x flags $11 = {uc = 0x0, s1 = 0x0, u1 = 0x0, s2 = 0x0, u2 = 0x0, s3 = 0x0, u3 = 0x0, s9 = 0x0, u9 = 0x0, sc = 0x0} (gdb) FAIL: gdb.base/bitfields.exp: bitfield containment #1 cont The program is not being run. (gdb) FAIL: gdb.base/bitfields.exp: continuing to break2 (the program is no longer running) print/x flags $12 = {uc = 0x0, s1 = 0x0, u1 = 0x0, s2 = 0x0, u2 = 0x0, s3 = 0x0, u3 = 0x0, s9 = 0x0, u9 = 0x0, sc = 0x0} (gdb) FAIL: gdb.base/bitfields.exp: bitfield containment #2 delete breakpoints Delete all breakpoints? (y or n) y (gdb) info breakpoints No breakpoints or watchpoints. (gdb) delete breakpoints (gdb) info breakpoints No breakpoints or watchpoints. (gdb) break break3 Breakpoint 3 at 0x8604: file .../gdb/testsuite/gdb.base/bitfields.c, line 52. (gdb) entering gdb_reload target remote localhost:1236 Remote debugging using localhost:1236 Reading symbols from .../lib/ld-linux.so.3...done. Loaded symbols for .../lib/ld-linux.so.3 0x41001b80 in _start () from .../lib/ld-linux.so.3 (gdb) continue Continuing. Breakpoint 3, break3 () at .../gdb/testsuite/gdb.base/bitfields.c:52 52 } (gdb) print flags $13 = {uc = 0 '\000', s1 = 0, u1 = 1, s2 = 0, u2 = 3, s3 = 0, u3 = 7, s9 = 0, u9 = 511, sc = 0 '\000'} (gdb) PASS: gdb.base/bitfields.exp: unsigned bitfield ranges gdb/ 2013-12-02 Pedro Alves <pedro@codesourcery.com> Maciej W. Rozycki <macro@codesourcery.com> * remote.c (putpkt_for_catch_errors): Remove function. (remote_kill): Handle TARGET_CLOSE_ERROR from the kill packet gracefully.
2013-12-02Fix PR remote/15974Yao Qi2-6/+15
In remote-notif.c:handle_notification, we have a loop, for (i = 0; i < ARRAY_SIZE (notifs); i++) { nc = notifs[i]; if (strncmp (buf, nc->name, strlen (nc->name)) == 0 && buf[strlen (nc->name)] == ':') break; } /* We ignore notifications we don't recognize, for compatibility with newer stubs. */ if (nc == NULL) return; If the notification is not in the list 'notifs', the last entry is used, which is wrong. It should be NULL. This patch fixes it. gdb: 2013-12-02 Pedro Alves <palves@redhat.com> PR remote/15974 * remote-notif.c (handle_notification): Return early if no notification is found.
2013-12-02Fix filestuff.c build error if RLIMIT_NOFILE not defined.Joel Brobecker2-1/+6
Not all systems supporting getrlimit also support RLIMIT_NOFILE (Eg. All LynxOS systems appear to be lacking support for this). So check its existance before using it. gdb/ChangeLog: * common/filestuff.c (fdwalk): Add "defined(RLIMIT_NOFILE)" preprocessor check.
2013-12-02Makefile.in (HFILES_NO_SRCDIR): Remove "common/gdb_dirent.h".Joel Brobecker2-1/+5
This file no longer exists. gdb/ChangeLog: * Makefile.in (HFILES_NO_SRCDIR): Remove "common/gdb_dirent.h".
2013-12-02Remove last traces of gdb_stat.h.Joel Brobecker3-2/+7
This file no longer exists. gdb/ChangeLog: * Makefile.in (HFILES_NO_SRCDIR): Remove "common/gdb_stat.h". * ctf.c (ctf_start): Remove obsolete comment.
2013-12-02Makefile.in (HFILES_NO_SRCDIR): Remove "common/gdb_string.h".Joel Brobecker2-1/+5
This file no longer exists... gdb/ChangeLog: * Makefile.in (HFILES_NO_SRCDIR): Remove "common/gdb_string.h".
2013-11-29Move .debug_gdb_script processing to auto-load.c.Doug Evans5-204/+275
Simplify handling of auto-loaded objfile scripts. .debug_gdb_scripts was always intended to handle more than just python, thus the rightful home for the code that processes it is not in py-foo.c. This is just a cleanup to move the code to a better place. This also simplifies the handling of the ${objfile}-${suffix} auto-loaded scripts. There's no need for each of the the handlers to do is-safe-to-load checking, or call maybe_add_script. Doing it in the caller removes the duplication. * auto-load.h (script_language): New members name, auto_load_enabled. Add missing comments on struct members. (auto_load_objfile_script): Delete. * auto-load.c: #include "cli/cli-cmds.h". (auto_load_gdb_scripts_enabled): New function. (script_language_gdb): Update, add new members. (source_gdb_script_for_objfile): Simplify, auto-load safe-checking and call to maybe_add_script moved to caller. (auto_load_objfile_script_1): Auto-load safe-checking and call to maybe_add_script moved here. (auto_load_objfile_script): Make static. Early exit if support for scripting language hasn't been compiled in, or auto-loading has been disabled. (source_section_scripts): Argument "source_name" renamed to "section_name". All uses updated. Replace uses of AUTO_SECTION_NAME with section_name. Skip loading script if support for scripting language hasn't been compiled in, or auto-loading has been disabled. Call language->source_script_for_objfile instead of calling source_python_script_for_objfile directly. (load_auto_scripts_for_objfile): Update. * python/py-auto-load.c: Delete #include "cli/cli-cmds.h". (gdbpy_load_auto_script_for_objfile): Delete. (auto_load_python_scripts_enabled): New function. (script_language_python): Update, add new members. (gdbpy_script_language_defn): New function. * python/python.h (gdbpy_load_auto_scripts_for_objfile): Delete. (gdbpy_script_language_defn): Declare. * auto-load.c (AUTO_SECTION_NAME): Moved here and renamed from py-auto-load.c, GDBPY_AUTO_SECTION_NAME. (source_section_scripts): Moved here from py-auto-load.c. (auto_load_section_scripts): Ditto. * python/py-auto-load.c (GDBPY_AUTO_SECTION_NAME): Moved to auto-load.c, renamed AUTO_SECTION_NAME. (source_section_scripts, auto_load_section_scripts): Moved to auto-load.c.
2013-11-30Fix typo "checksm"Yao Qi2-1/+5
Fix typo "checksm". gdb: 2013-11-30 Yao Qi <yao@codesourcery.com> * remote.c (getpkt_or_notif_sane_1): Fix typo "checksm".
2013-11-29Remove gdb_string.h from gdbarch.shSergio Durigan Junior2-1/+6
This commit removes the "#include gdb_string.h" from gdbarch.sh, fixing a small nit caused by Tom's commit 0e9f083f4cb94a9dc861f38ba151aac06efce2b8. Checked-in as obvious. 2013-11-29 Sergio Durigan Junior <sergiodj@redhat.com> * gdbarch.sh: Remove include of "gdb_string.h", replace by <string.h>.
2013-11-29 * python/py-auto-load.c (source_section_scripts): Move comment toDoug Evans2-8/+11
more relevant location.
2013-11-29Remove trailing whitespace.Doug Evans17-106/+126
Whitespace cleanup. * python/py-breakpoint.c: Remove trailing whitespace. * python/py-cmd.c: Ditto. * python/py-evts.c: Ditto. * python/py-finishbreakpoint.c: Ditto. * python/py-frame.c: Ditto. * python/py-function.c: Ditto. * python/py-inferior.c: Ditto. * python/py-infthread.c: Ditto. * python/py-param.c: Ditto. * python/py-prettyprint.c: Ditto. * python/py-symbol.c: Ditto. * python/py-type.c: Ditto. * python/py-utils.c: Ditto. * python/py-value.c: Ditto. * python/python-internal.h: Ditto. * python/python.c: Ditto.
2013-11-29UNWIND_NULL_ID is no longer used anywhere. Update comments.Pedro Alves4-8/+15
Unfortunately, UNWIND_NULL_ID is exported to Python as gdb.FRAME_UNWIND_NULL_ID so we can't really eliminate it. (I'd assume scripts just check the result of Frame.unwind_stop_reason, and compare it to gdb.FRAME_UNWIND_NO_REASON. That at most, they'll pass the result of Frame.unwind_stop_reason to gdb.frame_stop_reason_string. I'd prefer to just get rid of it, but because we make an API promise, we get to keep this around for compatibility, in case a script does refer to gdb.FRAME_UNWIND_NULL_ID directly.) gdb/ 2013-11-29 Pedro Alves <palves@redhat.com> * unwind_stop_reasons.def (UNWIND_NULL_ID): Update comment. gdb/doc/ 2013-11-29 Pedro Alves <palves@redhat.com> * gdb.texinfo (Frames In Python) <gdb.FRAME_UNWIND_NULL_ID>: Update comment.
2013-11-29Plug target side conditions and commands leaks.Pedro Alves3-4/+19
The memory management of bp_location->target_info.conditions|tcommands is currently a little fragile. If the target reports support for target conditions or commands, and then target side breakpoint support is disabled, or some error is thrown before remote_add_target_side_XXX is called, we'll leak these lists. This patch makes us free these lists when the locations are deleted, and also, just before recreating the commands|conditions lists. Tested on x86_64 Fedora 17, native and gdbserver. gdb/ 2013-11-29 Pedro Alves <palves@redhat.com> * breakpoint.c (build_target_condition_list): Release previous conditions. (build_target_command_list): Release previous commands. (bp_location_dtor): Release target conditions and commands. * remote.c (remote_add_target_side_condition): Don't release conditions. (remote_add_target_side_commands): Don't release commands.
2013-11-29Delegate to target_ops->beneath for TARGET_OBJECT_RAW_MEMORYYao Qi3-32/+49
GDB on x86_64-linux is unable to disassemble on core-file target. $ ./gdb ./testsuite/gdb.base/corefile (gdb) core-file ./testsuite/gdb.base/corefile.core (gdb) disassemble main Dump of assembler code for function main: 0x0000000000400976 <+0>: Cannot access memory at address 0x400976 However, it works if we turn code-cache off. (gdb) set code-cache off (gdb) disassemble main,+4 Dump of assembler code from 0x400976 to 0x40097a: 0x0000000000400976 <main+0>: push %rbp 0x0000000000400977 <main+1>: mov %rsp,%rbp End of assembler dump. When code-cache is off, GDB will iterate target_ops from top to bottom and call to_xfer_partial. When current_target is "core", it will call to_xfer_partial of target "exec", which reads the contents for disassemble. However, dcache uses TARGET_OBJECT_RAW_MEMORY to read, but target_xfer_partial doesn't delegate requests to beneath for TARGET_OBJECT_RAW_MEMORY. This patch factors out the iteration from top to bottom to a new function, raw_memory_xfer_partial, and use it for TARGET_OBJECT_RAW_MEMORY. Regression tested on x86_64-linux. gdb: 2013-11-29 Yao Qi <yao@codesourcery.com> Pedro Alves <palves@redhat.com> * dcache.c (dcache_read_line): Use current_target.beneath instead of &current_target. * target.c (memory_xfer_partial_1): Factor code out to ... (raw_memory_xfer_partial): ... it. New function. (target_xfer_partial): Call raw_memory_xfer_partial if OBJECT is TARGET_OBJECT_RAW_MEMORY.
2013-11-28Rename breakpoint_object to gdbpy_breakpoint_object.Doug Evans7-50/+61
* breakpoint.h (gdbpy_breakpoint_object): Renamed from breakpoint_object. All uses updated. * python/python-internal.h (gdbpy_breakpoint_object): Renamed from breakpoint_object. All uses updated. * python.c (*): All uses of breakpoint_object updated. * python.h (*): All uses of breakpoint_object updated. * python/py-breakpoint.c (*): All uses of breakpoint_object updated. * python/py-finishbreakpoint.c (*): Ditto.
2013-11-28fix spelling in previous entryDoug Evans1-1/+1
2013-11-28 * configure.ac: Add comments delineating libpython and libmcheck.Doug Evans3-0/+21
* configure: Regenerate.
2013-11-28Print entirely unavailable struct/union values as a single <unavailable>.Andrew Burgess4-23/+41
When printing an entirely optimized out structure/class/union, we print a single <optimized out> instead of printing <optimized out> for each field. This patch makes an entirely unavailable structure/class/union be likewise displayed with a single "<unavailable>" rather than the whole object with all fields <unavailable>. This seems good because this way the user can quickly tell whether the whole value is unavailable, rather than having to skim all fields. Consistency with optimized out values also seems to be a good thing to have. A few updates to gdb.trace/unavailable.exp where required. Tested on x86_64 Fedora 17, native gdbserver. gdb/ 2013-11-28 Andrew Burgess <aburgess@broadcom.com> Pedro Alves <palves@redhat.com> * valprint.c (value_check_printable): If the value is entirely unavailable, print a single "<unavailable>" instead of printing all subfields. gdb/testsuite/ 2013-11-28 Andrew Burgess <aburgess@broadcom.com> * gdb.trace/unavailable.exp (gdb_collect_args_test): Update expected results. (gdb_collect_locals_test): Likewise. (gdb_collect_globals_test): Likewise.
2013-11-28get_prev_frame, stop_reason != UNWIND_NO_REASON, add frame debug output.Pedro Alves2-1/+38
The stop_reason != UNWIND_NO_REASON doesn't currently have "set debug frame" output. This patch makes it print the stop_reason enum value as a string. gdb/ 2013-11-28 Pedro Alves <palves@redhat.com> * frame.c (get_prev_frame_1) <stop_reason != UNWIND_NO_REASON>: Add "set debug frame" output. (frame_stop_reason_symbol_string): New function.
2013-11-28get_prev_frame, outer_frame_id and unwind->stop_reason checks are redundant.Pedro Alves3-18/+13
After the previous patch, it should be clear that the this_frame->unwind->stop_reason check is redundant with the outer_frame_id check just below. We can now move the frame_id_eq comparison to the default this_frame->unwind->stop_reason callback. Tested on x86_64 Fedora 17. gdb/ 2013-11-28 Pedro Alves <palves@redhat.com> * frame-unwind.c (default_frame_unwind_stop_reason): Return UNWIND_OUTERMOST if the frame's ID is outer_frame_id. * frame.c (get_prev_frame_1): Remove outer_frame_id check.
2013-11-28get_prev_frame, UNWIND_NULL_ID -> UNWIND_OUTERMOSTPedro Alves2-6/+11
- The UNWIND_NULL_ID check in get_prev_frame_1 used to really be against null_frame_id, back before we had outer_frame_id. We didn't have UNWIND_OUTERMOST when outer_frame_id was added, but we do now, and it's more accurate. - It used to be necessary to check for the sentinel frame explicitly because that uses null_frame_id for frame id. Since no other frame can have that id nowadays (it's asserted by compute_frame_id), we don't need that explicit check. Tested on x86_64 Fedora 17. gdb/ 2013-11-28 Pedro Alves <palves@redhat.com> * frame.c (get_prev_frame_1): If the frame id is outer_frame_id, set the unwind stop reason to UNWIND_OUTERMOST, not UNWIND_NULL_ID. Remove explicit check for sentinel frame.
2013-11-28register: "optimized out" -> "not saved".Pedro Alves2-1/+6
Another spot that missed the previous related text adjustments. Tested on x86_64 Fedora 17. gdb/ 2013-11-28 Pedro Alves <palves@redhat.com> * frame.c (frame_unwind_register): Say the register was "not saved" instead of "optimized out".
2013-11-28Fix PR 16152's ChangeLog entry.Pedro Alves1-2/+3
Mention PR 16152. Fix formatting. Make wording match commit log.
2013-11-28GDB perf test on disassembleYao Qi4-0/+127
This patch adds a test case to test the performance of GDB doing disassembly. gdb/testsuite/ 2013-11-28 Yao Qi <yao@codesourcery.com> * lib/gdb.exp (with_gdb_prompt): New proc. * gdb.perf/disassemble.exp: New. * gdb.perf/disassemble.py: New.
2013-11-27gdb: fix cygwin check in configure scriptSteffen Sledz3-2/+7
Avoid false positives if the search pattern "lose" is found in path descriptions in comments generated by the preprocessor. See <https://sourceware.org/bugzilla/show_bug.cgi?id=16152>. gdb/ 2013-11-27 Steffen Sledz <sledz@dresearch-fe.de> * configure.ac: Tighten Cygwin detection check. * configure: Rebuild.
2013-11-27Fix type of not saved registers.Pedro Alves2-1/+13
value_of_register_lazy uses the type of REGNUM in FRAME, but given multi-arch, the arch of FRAME might be different from the previous frame's arch, and therefore the type of register REGNUM should be retrieved from the unwound arch. This used to be correct before the previous change. Tested on x86_64 Fedora 17. gdb/ 2013-11-27 Pedro Alves <palves@redhat.com> * frame-unwind.c (frame_unwind_got_optimized): Use the type of the register in the previous frame's arch.
2013-11-27Make "set debug frame 1" output print <not saved> instead of <optimized out>.Pedro Alves2-3/+10
"set debug frame 1" is printing "<optimized out>" for not saved registers. That's because the unwinders are returning optimized out not_lval values instead of optimized out lval_register values. "<not saved>" is how val_print_optimized_out prints lval_register values. ... - { frame_unwind_register_value (frame=0,regnum=7(rsp),...) -> <optimized out> } + { frame_unwind_register_value (frame=0,regnum=7(rsp),...) -> <not saved> } ... Tested on x86_64 Fedora 17. 2013-11-27 Pedro Alves <palves@redhat.com> * frame-unwind.c (frame_unwind_got_optimized): Return an lval_register value instead of a not_lval value.
2013-11-27Make "set debug frame 1" use the standard print routine for optimized out ↵Andrew Burgess3-2/+15
values. ... - { frame_unwind_register_value (frame=0,regnum=7(rsp),...) -> optimized out } + { frame_unwind_register_value (frame=0,regnum=7(rsp),...) -> <optimized out> } ... Tested on x86_64 Fedora 17. 2013-11-27 Andrew Burgess <aburgess@broadcom.com> * frame.c: Include "valprint.h". (frame_unwind_register_value): Use value_optimized_out. * value.c (value_fetch_lazy): Likewise.
2013-11-27 * gdb.base/callfuncs.c (main): Assign malloc's return valueLuis Machado6-5/+21
and free it afterwards. * gdb.base/charset-malloc.c (malloc_stub): Likewise. * gdb.base/printcmds.c (main): Likewise. * gdb.base/randomize.c (main): Free "p" and change breakpoint marker position. * gdb.base/setvar.c (dummy): Assign malloc's return value and free it afterwards.
2013-11-26Tighten regexp in gdb.base/setshow.expAndrew Burgess2-2/+7
https://sourceware.org/ml/gdb-patches/2013-11/msg00817.html gdb/testsuite/ChangeLog * gdb.base/setshow.exp: Add $gdb_prompt to the patterns in gdb_test_multiple.