PR gdb/15165
* breakpoint.c (dprintf_print_recreate): New.
(save_breakpoints): Let it not save dprintf commands.
(initialize_breakpoint_ops): Set dprintf_print_recreate.
2013-04-23 Hui Zhu <hui@codesourcery.com>
PR gdb/15165
* gdb.base/save-bp.exp: Add test for dprintf.
* ctf.c (_initialize_ctf): Include "completer.h".
Call add_target_with_completer instead of add_target.
gdb/testsuite/
* gdb.base/completion.exp: Test completion of command
'target ctf' if target ctf is supported.
Currently, several commands take "0" or "-1" to mean "unlimited".
"show" knows when to print "unlimited":
(gdb) show height
Number of lines gdb thinks are in a page is 45.
(gdb) set height 0
(gdb) show height
Number of lines gdb thinks are in a page is unlimited.
However, the user can't herself specify "unlimited" directly:
(gdb) set height unlimited
No symbol table is loaded. Use the "file" command.
(gdb)
This patch addresses that, by adjusting the set handler for all
integer/uinteger/zuinteger_unlimited commands to accept literal
"unlimited". It also installs a completer. Presently, we complete on
symbols by default, and at
<http://sourceware.org/ml/gdb-patches/2013-03/msg00864.html> I've
shown a WIP prototype that tried to keep that half working in these
commands. In the end, it turned out to be more complicated than
justifiable, IMO. It's super rare to want to pass the value of a
variable/symbol in the program to a GDB set/show knob. That'll still
work, it's just that we won't assist with completion anymore. This
patch just sticks with the simple, and completes on "unlimited", and
nothing else. This simplification means that
"set he<tab><tab>"
is all it takes to get to:
"set height unlimited"
The patch then goes through all integer/uinteger/zuinteger_unlimited
commands in the tree, and updates both the online help and the manual
to mention that "unlimited" is accepted in addition to 0/-1. In the
cases where the command had no online help text at all, this adds it.
I've tried to make the texts read in a way that "unlimited" is
suggested before "0" or "-1" is.
Tested on x86_64 Fedora 17.
gdb/
2013-04-10 Pedro Alves <palves@redhat.com>
* cli/cli-decode.c (integer_unlimited_completer): New function.
(add_setshow_integer_cmd, add_setshow_uinteger_cmd)
(add_setshow_zuinteger_unlimited_cmd): Install the "unlimited"
completer.
* cli/cli-setshow.c: Include "cli/cli-utils.h".
(is_unlimited_literal): New function.
(do_set_command): Handle literal "unlimited" arguments.
* frame.c (_initialize_frame) <set backtrace limit>: Document
"unlimited".
* printcmd.c (_initialize_printcmd) <set print
max-symbolic-offset>: Add help text.
* record-full.c (_initialize_record_full) <set record full
insn-number-max>: Likewise.
* record.c (_initialize_record) <set record
instruction-history-size, set record function-call-history-size>:
Add help text.
* ser-tcp.c (_initialize_ser_tcp) <set tcp connect-timeout>: Add
help text.
* tracepoint.c (_initialize_tracepoint) <set trace-buffer-size>:
Likewise.
* source.c (_initialize_source) <set listsize>: Add help text.
* utils.c (initialize_utils) <set height, set width>: Likewise.
<set pagination>: Mention "set height unlimited".
* valprint.c (_initialize_valprint) <set print elements, set print
repeats>: Document "unlimited".
gdb/doc/
2013-04-10 Pedro Alves <palves@redhat.com>
* gdb.texinfo (Process Record and Replay): Document that "set
record full insn-number-max", "set record
instruction-history-size" and "set record
function-call-history-size" accept "unlimited".
(Backtrace): Document that "set backtrace limit" accepts
"unlimited".
(List): Document that "set listsize" accepts "unlimited".
(Print Settings)" Document that "set print max-symbolic-offset",
"set print elements" and "set print repeats" accept "unlimited".
(Starting and Stopping Trace Experiments): Document that "set
trace-buffer-size" accepts "unlimited".
(Remote Configuration): Document that "set tcp connect-timeout"
accepts "unlimited".
(Command History): Document that "set history size" accepts
"unlimited".
(Screen Size): Document that "set height" and "set width" accepts
"unlimited". Adjust "set pagination"'s description to suggest
"set height unlimited" instead of "set height 0".
gdb/testsuite/
2013-04-10 Pedro Alves <palves@redhat.com>
* gdb.base/completion.exp: Test "set height", "set listsize" and
"set trace-buffer-size" completion.
* gdb.base/setshow.exp: Test "set height unlimited".
* gdb.trace/trace-buffer-size.exp: Test "set trace-buffer-size
unlimited".
2013-03-29 Yao Qi <yao@codesourcery.com>
* corelow.c: Include "completer.h".
(_initialize_corelow): Call add_target_with_completer with
argument 'filename_completer'.
* tracepoint.c: Likewise.
* exec.c (_initialize_exec): Likewise.
* target.c (add_target): Rename to ...
(add_target_with_completer): ... this. Call set_cmd_completer
if parameter completer is not NULL.
(add_target): New.
* target.h: Include "command.h".
(add_target_with_completer): Declare it.
gdb/testsuite:
2013-03-29 Yao Qi <yao@codesourcery.com>
* gdb.base/completion.exp: Test completion of commands
"target core", "target tfile" and "target exec".
* gdb.trace/tfile.exp: Test completion of command
"target tfile".
Currently, "set listsize -1" is supposed to mean "unlimited" source
lines, but, alas, it doesn't actually work:
(gdb) set listsize -1
(gdb) show listsize
Number of source lines gdb will list by default is unlimited.
(gdb) list 1
(gdb) list 1
(gdb) list 1
(gdb) set listsize 10
(gdb) list 1
1 /* Main function for CLI gdb.
2 Copyright (C) 2002-2013 Free Software Foundation, Inc.
3
4 This file is part of GDB.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
10
Before this patch:
http://sourceware.org/ml/gdb-patches/2012-08/msg00367.html
was applied, the "set listsize" command was a var_integer command, and
"unlimited" was set with 0. Internally, var_integer maps 0 to INT_MAX
case var_integer:
{
...
if (val == 0 && c->var_type == var_integer)
val = INT_MAX;
The change in that patch to zuinteger_unlimited command, meant that -1
is left as -1 in the command's control variable (lines_to_list), and
the code in source.c isn't expecting that -- it only expects positive
numbers.
I previously suggested fixing the code and keeping the new behavior,
but I found that "set listsize 0" is currently used in the wild, and
we do have a bunch of other commands where "0" means unlimited, so I'm
thinking that changing this command alone in isolation is not a good
idea.
So I now strongly prefer reverting back the behavior in 7.6 to the
same behavior the command has had since 2006 (0==unlimited, -1=error).
Before that, set listsize -1 would be accepted as unlimited as well.
After 7.6 is out, in mainline, we can get back to reconsidering
changing this command's behavior, if there's a real need for being
able to suppress output. For now, let's play it safe.
The "list line 1 with unlimited listsize" test in list.exp was
originally written years and years ago expecting 0 to mean "no
output", but GDB never actually worked that way, even when the tests
were written, so the tests had been xfailed then. This patch now
adjusts the test to the new behavior, so that the test actually
passes, and the xfail is removed.
gdb/
2013-03-28 Pedro Alves <palves@redhat.com>
PR gdb/15294
* source.c (_initialize_source): Change back "set listsize" to an
integer command.
gdb/testsuite/
2013-03-28 Pedro Alves <palves@redhat.com>
PR gdb/15294
* gdb.base/list.exp (set_listsize): Adjust to accept $arg == 0 to
mean unlimited instead of $arg < 0.
(test_listsize): Remove "listsize of 0 suppresses output" test.
Test that "set listsize 0" ends up with an unlimited listsize.
gdb/doc/
2013-03-28 Pedro Alves <palves@redhat.com>
PR gdb/15294
* gdb.texinfo (List) <set listsize>: Adjust to document that
listsize 0 means no limit, and remove mention of -1.
The previous patch actually wasn't the first time I had to update line
numbers in this file.
This avoids hard coding line numbers, hopefully making the next time a
little easier.
Tested on x86_64 Fedora 17.
gdb/testsuite/
2013-03-28 Pedro Alves <palves@redhat.com>
* gdb.base/list.exp (last_line): New global.
(last_line_re): New global.
(test_listsize, test_list_function, test_list_forward)
(test_repeat_list_command, test_list_range)
(test_list_filename_and_function): Use them.
* gdb.base/list0.c: Comment the last line of the file with "last
line".
The "set listsize -1" test in list.exp can't work correct anymore
nowadays, because the test's source files grew over time, and this
particular test was never updated.
This fixes it in the obvious way.
gdb/testsuite/
2013-03-28 Pedro Alves <palves@redhat.com>
* gdb.base/list.exp (test_listsize): Adjust test to make sure we
list the whole file.
Before the changes starting at
<http://sourceware.org/ml/gdb-patches/2012-08/msg00020.html>, the 'set
listsize' command only accepted "0" as special value, meaning
"unlimited". The testsuite actually tried "set listsize -1" and
expected that to mean unlimited too.
If you tried testing list.exp at the time of that patch above,
you'd get:
(gdb) PASS: gdb.base/list.exp: list line 10 with listsize 100
set listsize 0
(gdb) PASS: gdb.base/list.exp: setting listsize to 0 #6
show listsize
Number of source lines gdb will list by default is unlimited.
(gdb) PASS: gdb.base/list.exp: show listsize unlimited #6
list 1
1 #include "list0.h"
2
...
42 /* Not used for anything */
43 }
(gdb) PASS: gdb.base/list.exp: listsize of 0 suppresses output
set listsize -1
integer 4294967295 out of range
(gdb) PASS: gdb.base/list.exp: setting listsize to -1 #7
show listsize
Number of source lines gdb will list by default is unlimited.
(gdb) PASS: gdb.base/list.exp: show listsize unlimited #7
list 1
1 #include "list0.h"
Notice that "set listsize -1" actually failed with "integer 4294967295
out of range", but we issued a PASS anyway.
(and notice how the "listsize of 0 suppresses output" test passes bogusly too.)
This patch fixes that testsuite problem in the obvious way.
gdb/testsuite/
2013-03-28 Pedro Alves <palves@redhat.com>
* gdb.base/list.exp (set_listsize): Use gdb_test_no_output for
"set listsize".
* NEWS: Add entry.
* event-top.c: #include "maint.h".
* main.c: #include "maint.h".
* maint.c: #include <sys/time.h>, <time.h>, block.h, top.h,
timeval-utils.h, maint.h, cli/cli-setshow.h.
(per_command_time, per_command_space): New static globals.
(per_command_symtab): New static global.
(per_command_setlist, per_command_showlist): New static globals.
(struct cmd_stats): Move here from utils.c.
(set_per_command_time): Renamed from set_display_time in utils.c
and moved here. All callers updated.
(set_per_command_space): Renamed from set_display_space in utils.c
and moved here. All callers updated.
(count_symtabs_and_blocks): New function.
(report_command_stats): Moved here from utils.c. Add support for
printing symtab stats. Only print data if enabled before command
executed.
(make_command_stats_cleanup): Ditto.
(sert_per_command_cmd, show_per_command_cmd): New functions.
(_initialize_maint_cmds): Add new commands
mt set per-command {space,time,symtab} {on,off}.
* maint.h: New file.
* top.c: #include "maint.h".
* utils.c (reset_prompt_for_continue_wait_time): New function.
(get_prompt_for_continue_wait_time): New function.
* utils.h (reset_prompt_for_continue_wait_time): Declare
(get_prompt_for_continue_wait_time): Declare.
(make_command_stats_cleanup): Moved to maint.h.
(set_display_time, set_display_space): Moved to maint.h and renamed
to set_per_command_time, set_per_command_space.
* cli/cli-setshow.c (parse_cli_boolean_value): Renamed from
parse_binary_operation and made non-static. Don't call error,
just return an error marker. All callers updated.
* cli/cli-setshow.h (parse_cli_boolean_value): Declare.
doc/
* gdb.texinfo (Maintenance Commands): Add docs for
"mt set per-command {space,time,symtab} {on,off}".
testsuite/
* gdb.base/maint.exp: Update tests for per-command stats.
This is a regression from 7.5, introduced/exposed by:
http://sourceware.org/ml/gdb-patches/2012-07/msg00259.html
There are a series of issues with this code.
It does:
unsigned int val = parse_and_eval_long (arg);
^^^^^^^^^^^^
(unsigned, usually 32-bit) while parse_and_eval_long returns a LONGEST
(usually 64-bit), so we lose precision without noticing:
(gdb) set remote hardware-watchpoint-limit 0x100000000
(gdb) show remote hardware-watchpoint-limit 0x100000000
The maximum number of target hardware watchpoints is 0.
While at it, print the invalid number with plongest, so the user sees
what GDB thought the number was:
(gdb) set remote hardware-watchpoint-limit 0x100000000
integer 4294967296 out of range
So with "set remote hardware-watchpoint-limit -1", val ends converted
to 0xffffffff, which then fails the
else if (val >= INT_MAX)
error (_("integer %u out of range"), val);
test.
Looking at that INT_MAX check, we forbid INT_MAX itself, but we
shouldn't, as that does fit in 'int' -- we want to forbid values
_greater_ than INT_MAX (and less than INT_MIN, while at it):
(gdb) set remote hardware-watchpoint-limit 2147483647
integer 2147483647 out of range
The same problem is in the new var_zuinteger_unlimited code, which
also uses "int" for variable.
Also, when printing a 'signed int', we should use %d, not %u.
This adds a couple regression tests. Not completely thorough in checking
all kinds of invalid input; I'm saving more exaustive testing around
zXXinteger commands for something like new test-assisting commands
like "maint test cmd-zinteger -1", where testing would focus on the
command types, and thus be independent of particular user commands of
particular GDB features.
Tested on x86_64 Fedora 17.
gdb/
2013-03-20 Pedro Alves <palves@redhat.com>
PR gdb/15289
* cli/cli-setshow.c (do_set_command)
<var_uinteger, var_zuinteger>: Use LONGEST for variable holding
the result of parsing the command argument. Throw error if the
value is greater than UINT_MAX. Print the invalid value with
plongest.
<var_integer, var_zinteger>: Use LONGEST for variable holding the
result of parsing the command argument. Throw error if the value
is greater than INT_MAX, not greater or equal. Also throw error
if the value is less than INT_MIN. Print the invalid value with
plongest.
<var_zuinteger_unlimited>: Throw error if the value is greater
than INT_MAX, not greater or equal.
(do_show_command) <var_integer, var_zinteger,
var_zuinteger_unlimited>: Use %d for printing int, not %u.
gdb/testsuite/
2013-03-20 Pedro Alves <palves@redhat.com>
PR gdb/15289
* gdb.base/remote.exp: Test
"set remote hardware-watchpoint-limit -1",
"set remote hardware-breakpoint-limit -1",
"set remote hardware-watchpoint-limit 2147483647" and
"set remote hardware-breakpoint-limit 2147483647".
Some files managed to get in the tree with outdated copyright years.
This fixes it. Applied.
gdb/
2013-02-12 Pedro Alves <palves@redhat.com>
* break-catch-sig.c: Update copyright years.
gdb/testsuite/
2013-02-12 Pedro Alves <palves@redhat.com>
* gdb.base/catch-signal.c: Update copyright years.
* gdb.base/catch-signal.exp: Update copyright years.
* gdb.dwarf2/dw2-dir-file-name.c: Update copyright years.
* gdb.dwarf2/dw2-dir-file-name.exp: Update copyright years.
* gdb.dwarf2/dw2-empty-pc-range.S: Update copyright years.
* gdb.dwarf2/dw2-error.S: Update copyright years.
* gdb.dwarf2/dw2-error.c: Update copyright years.
* gdb.dwarf2/dw2-restrict.S: Update copyright years.
* gdb.dwarf2/dw2-restrict.c: Update copyright years.
* gdb.dwarf2/dw2-restrict.exp: Update copyright years.
(printf_decfloat): New function. Broken out from ui_printf.
Remove unnecessary code to shift the entire format string down.
(printf_pointer): New function.
(ui_printf): Code to print C strings, wide C strings, decfloats,
and pointers moved to separate functions.
* dwarf2read.c (dw2_expand_symtabs_matching): Add basenames parameter
to the file_matcher parameter. Pass 0 to it.
(dwarf2_create_include_psymtab): Copy also DIRNAME.
* psymtab.c (partial_map_symtabs_matching_filename): Drop handling of
NULL psymtab_to_fullname result.
(psymtab_to_fullname): Remove variable r. Never return NULL, assemble
an expected filename instead.
(expand_symtabs_matching_via_partial): Add basenames parameter to the
file_matcher parameter. Call also psymtab_to_fullname, after newly
considering BASENAMES_MAY_DIFFER.
* source.c (rewrite_source_path): Remove static.
* source.h (rewrite_source_path): New declaration.
* symfile.h (struct quick_symbol_functions): Add basenames parameter to
the expand_symtabs_matching field. Comment it.
* symtab.c (file_matches): New function comment. Add parameter
basenames, implement it.
(search_symbols_file_matches): Add basenames parameter. Update the
file_matches caller.
(search_symbols): Match FILES also against symtab_to_fullname.
Optimize it for BASENAMES_MAY_DIFFER.
gdb/testsuite/
* gdb.base/fullpath-expand-func.c: New file.
* gdb.base/fullpath-expand.c: New file.
* gdb.base/fullpath-expand.exp: New file.
* gdb.base/realname-expand-real.c: New file.
* gdb.base/realname-expand.c: New file.
* gdb.base/realname-expand.exp: New file.
* elfread.c (elf_symfile_read): Limit separate debug info additions to
files with no separate debug info.
* objfiles.c (add_separate_debug_objfile): Add gdb_assert calls.
* symfile.c (read_symbols): Call find_separate_debug_file_in_section
only for files with no separate debug info.
gdb/testsuite/
* gdb.base/gnu-debugdata.exp): Create ${binfile}.debug,
${binfile}.mini_debuginfo-debuglink, add -k to xz, use now
${binfile}.mini_debuginfo-debuglink and
${binfile}.mini_debuginfo-debuglink.xz.
* jit.c (struct jit_inferior_data) <cached_code_address,
jit_breakpoint>: New fields.
(jit_breakpoint_re_set_internal): Fix logging. Only create
breakpoint if cached address has changed.
(jit_update_inferior_cache, jit_breakpoint_deleted): New
functions.
(_initialize_jit): Register breakpoint deleted observer.
gdb/testsuite
* gdb.base/jit.exp (compile_jit_test): New proc.
Add PIE tests.
Code cleanup.
* gdb.base/restore.exp: Replace gdb_compile, gdb_exit, gdb_start,
gdb_reinitialize_dir and gdb_load by standard_testfile, set executable
and prepare_for_testing.
* gdb.base/store.exp: Likewise.
gdb/ChangeLog
* valarith.c (value_vector_widen): New function for replicating a
scalar into a vector.
(value_binop): Use value_vector_widen to widen scalar to vector
rather than casting, this better matches gcc C behaviour.
* valops.c (value_casst): Update logic for casting between vector
types, and for casting from scalar to vector, try to match gcc C
behaviour.
* value.h (value_vector_widen): Declare.
* opencl-lang.c (opencl_value_cast): New opencl specific casting
function, handle special case for casting scalar to vector.
(opencl_relop): Use opencl_value_cast.
(evaluate_subexp_opencl): Use opencl_value_cast instead of
value_cast, and handle BINOP_ASSIGN, UNOP_CAST, and UNOP_CAST_TYPE
in order to use opencl_value_cast.
gdb/testsuite/ChangeLog
* gdb.base/gnu_vector.c: New variable for use in tests.
* gdb.base/gnu_vector.exp: Update and extend tests to reflect
changes in scalar to vector casting and widening.
* gdb.python/py-type.c: New variables for use in tests.
* gdb.python/py-type.exp: Update vector related tests to reflect
changes in scalar to vector casting and widening.
* symtab.c (skip_prologue_using_sal): Consider a file
change the same as an increased line number
gdb/testsuite/
* gdb.base/prologue-include.c: New file.
* gdb.base/prologue-include.exp: New file.
* gdb.base/prologue-include.h: New file.
bothering the frontend about it... This is the exact same check MI
does.
I also smoke tested Emacs 23 in gud-gdb mode, both annotations=2
and annotations=3. I didn't notice anything break.
gdb/
2013-01-22 Pedro Alves <palves@redhat.com>
* annotate.c (breakpoint_changed): Skip if breakpoint is not
user-visible.
gdb/testsuite/
2013-01-22 Pedro Alves <palves@redhat.com>
* gdb.base/annota1.exp (signal sent): No longer expect
breakpoints-invalid.
* gdb.cp/annota2.exp (continue until exit)
(watch triggered on a.x): Ditto.
observer_notify_breakpoints_changed calls. All, except the
init_raw_breakpoint one. But that one is actually wrong. The
breakpoint is being constructed at that point, and hasn't been placed
on the breakpoint chain yet. It would be better placed in
install_breakpoint, and I actually started out that way. But once the
annotate_breakpoints_changed are parallel to the observer calls, we
can fully move annotations to observers too.
One issue is that this changes the order of annotations a bit.
Before, we'd emit the annotation, and after call "mention()" on the
breakpoint (which prints the breakpoint number, etc.). But, we call
the observers _after_ mention is called, so the annotation output will
change a little:
void
install_breakpoint (int internal, struct breakpoint *b, int update_gll)
{
add_to_breakpoint_chain (b);
set_breakpoint_number (internal, b);
if (is_tracepoint (b))
set_tracepoint_count (breakpoint_count);
if (!internal)
mention (b);
observer_notify_breakpoint_created (b);
if (update_gll)
update_global_location_list (1);
}
I believe this order doesn't really matter (the frontend needs to wait
for the prompt anyway), so I just adjust the expected output in the
tests. Emacs in annotations mode doesn't seem to complain. Couple
that with the previous patch that suppressed duplicated annotations,
and, the fact that some annotations calls were actually missing (were
we do have observer calls), more changes to the tests are needed
anyway.
Tested on x86_64 Fedora 17.
gdb/
2013-01-22 Pedro Alves <palves@redhat.com>
* annotate.c (annotate_breakpoints_changed): Rename to ...
(annotate_breakpoints_invalid): ... this. Make static.
(breakpoint_changed): Adjust.
(_initialize_annotate): Always install the observers. Install a
"breakpoint_created" observer.
* annotate.h (annotate_breakpoints_changed): Delete declaration.
* breakpoint.c (set_breakpoint_condition)
(breakpoint_set_commands, do_map_commands_command)
(init_raw_breakpoint, clear_command, set_ignore_count)
(enable_breakpoint_disp): No longer call
annotate_breakpoints_changed.
gdb/testsuite/
2013-01-22 Pedro Alves <palves@redhat.com>
* gdb.base/annota1.exp (breakpoints_invalid): New variable.
Adjust tests to breakpoints-invalid changes.
* gdb.cp/annota2.exp (breakpoints_invalid, frames_invalid): New
variables.
Adjust tests to breakpoints-invalid changes.
suppress multiple breakpoints-invalid annotations when the ignore
count of a breakpoint changes, up until the target actually stops.
But, the code is bogus:
void
annotate_breakpoints_changed (void)
{
if (annotation_level == 2)
{
target_terminal_ours ();
printf_unfiltered (("\n\032\032breakpoints-invalid\n"));
if (ignore_count_changed)
ignore_count_changed = 0; /* Avoid multiple break annotations. */
}
}
The "ignore_count_changed" flag isn't actually guarding the output of
the annotation at all. It would have been better written something
like:
void
annotate_breakpoints_changed (void)
{
if (annotation_level == 2 && !ignore_count_changed)
{
target_terminal_ours ();
printf_unfiltered (("\n\032\032breakpoints-invalid\n"));
ignore_count_changed = 0; /* Avoid multiple break annotations. */
}
}
but, it wasn't. AFAICS, that goes all the way back to the original
patch'es submission and check in, at
<http://sourceware.org/ml/gdb-patches/1999-q4/msg00106.html>. I
looked a tar of HP's wdb from 1999, and even though that contains
local changes in the annotate code, this suppression seems borked
there too to me.
The original patch added a test to supposedly exercise this
suppression, but, it actually doesn't. It merely tests that
"breakpoints-invalid" is output after "stopped", but doesn't check
whether the duplicates supression actually works (IOW, check that only
_one_ annotation is seen). I was going to simply delete the tests
too, but a following patch will eliminate the duplicates in a
different way (which I needed for a different reason), so instead, I'm
making the tests actually fail if a duplicate annotation is seen.
Worry not, the test doesn't actually fail! The reason is that
breakpoint.c does:
else if (b->ignore_count > 0)
{
b->ignore_count--;
annotate_ignore_count_change ();
bs->stop = 0;
/* Increase the hit count even though we don't stop. */
++(b->hit_count);
observer_notify_breakpoint_modified (b);
}
where the annotate_ignore_count_change call is meant to inform the
"breakpoint_modified" annotation observer to ignore the notification.
All sounds good. But, the trouble is that nowadays annotate.c only
installs the observers if GDB is started with annotations enabled with
a command line option (gdb --annotate=2):
void
_initialize_annotate (void)
{
if (annotation_level == 2)
{
observer_attach_breakpoint_deleted (breakpoint_changed);
observer_attach_breakpoint_modified (breakpoint_changed);
}
}
and annota1.exp, to enable annotations, starts GDB normally, and
afterwards does "set annotate 2", so the observers aren't installed
when annota1.exp is run, and therefore changing the ignore count isn't
triggering any annotation at all...
gdb/
2013-01-22 Pedro Alves <palves@redhat.com>
* annotate.c (ignore_count_changed): Delete.
(annotate_breakpoints_changed): Don't clear ignore_count_changed.
(annotate_ignore_count_change): Delete.
(annotate_stopped): Don't emit a delayed breakpoints-changed
annotation.
* annotate.h (annotate_ignore_count_change): Delete.
* breakpoint.c (bpstat_check_breakpoint_conditions): Don't call
annotate_ignore_count_change.
gdb/testsuite/
2013-01-22 Pedro Alves <palves@redhat.com>
* gdb.base/annota1.exp (annotate ignore count change): Add
expected output for failure case.
* gdb.base/dprintf.exp: Check the output of 'info breakpoints'
for dprintf.
* gdb.mi/mi-breakpoint-changed.exp (test_insert_delete_modify):
Check the fields in "=breakpoint-created" for dprintf.
Two modifications:
1. The addition of 2013 to the copyright year range for every file;
2. The use of a single year range, instead of potentially multiple
year ranges, as approved by the FSF.
* breakpoint.c (breakpoint_re_set): Remove the skip_re_set call.
* infrun.c (handle_inferior_event): Rename the called function to
function_name_is_marked_for_skip, pass it TMP_SAL.
* skip.c (struct skiplist_entry): Update function_name comment. Remove
fields pc, gdbarch and pending.
(skip_function_pc): Rename this forward declaration to ...
(skip_function): ... here.
(skip_file_command): Remove variable pending and its use, remove
initialization of E fields pending and gdbarch. Do not use SYMTAB
filename, use the specified one.
(skip_function_command): Remove variable func_pc, do not set it.
Update the caller of skip_function. Replace decode_line_1 call by
a lookup_symbol call. Remove variables orig_arg, decode_exception and
sals. Update the caller of skip_function.
(skip_info): Remove variable address_width and its use. Do not print
address (PC). Renumber column 5 to 4.
(skip_function_pc): Rename to ...
(skip_function): ... here and remove its parameters pc, arch and
pending. Update the function comment and no longer use those
parameters.
(function_pc_is_marked_for_skip): Rename to ...
(function_name_is_marked_for_skip): ... here, update function comment
just to a skip.h reference, replace pc parameter by function_name and
function_sal. No longer use E field pending and pc. Remove variables
searched_for_sal, sal and filename. Call compare_filenames_for_search
instead of just strcmp.
(skip_re_set): Remove the function.
* skip.h (struct symtab_and_line): New declaration.
(function_pc_is_marked_for_skip): Rename to ...
(function_name_is_marked_for_skip): ... here, replace pc parameter by
function_name and function_sal, update the function comment.
gdb/testsuite/
* gdb.base/skip-solib.exp (info skip with pending file): Update the
expected output.
(info skip with pending file): Remove.
(ignoring function in solib, info skip for function multiply): Update
the expected output.
* gdb.base/skip.ex (skip (main), skip function baz, info skip)
(info skip (delete 1), info skip after disabling all)
(info skip after enabling all, info skip after disabling 4 2-3)
(info skip after enabling 2-3, info skip 2-3)
(info skip after deleting 2 3): Update the expected output.
* gdb.linespec/base/two/thefile.cc (n): New variable v, split the
statement to its initialization and return.
* gdb.linespec/skip-two.exp: New file.
* gdb.base/charset.exp: Change print syntax for Python 3
compatibility.
* gdb.python/py-block.exp: Ditto.
* gdb.python/py-breakpoint.exp: Ditto.
* gdb.python/py-cmd.exp: Ditto.
* gdb.python/py-events.py: Ditto.
* gdb.python/py-finish-breakpoint.py: Ditto.
* gdb.python/py-finish-breakpoint2.exp: Ditto.
* gdb.python/py-finish-breakpoint2.py: Ditto.
* gdb.python/py-frame-inline.exp: Ditto.
* gdb.python/py-frame.exp: Ditto.
* gdb.python/py-infthread.exp: Ditto.
* gdb.python/py-objfile.exp: Ditto.
* gdb.python/py-parameter.exp: Ditto.
* gdb.python/py-progspace.exp: Ditto.
* gdb.python/py-prompt.exp: Ditto.
* gdb.python/py-symbol.exp: Ditto.
* gdb.python/py-symtab.exp: Ditto.
* gdb.python/py-template.exp: Ditto.
* gdb.python/py-value-cc.exp: Ditto.
* gdb.python/python.exp: Ditto.
* gdb.python/source2.py: Ditto.
* gdb.python/lib-types.exp: Change print syntax for Python 3
compatibility.
Use sorted() function rather than sort() method.
Accept either int or long values for enum values.
* gdb.python/py-events.exp: Use exec(open(...).read()) instead of
execfile for Python 3 compatibility.
* gdb.python/py-evsignal.exp: Ditto.
* gdb.python/py-evthreads.exp: Ditto.
* gdb.python/py-mi.exp: Ditto.
* gdb.python/py-pp-maint.exp: Ditto.
* gdb.python/py-prettyprint.exp: Ditto.
* gdb.python/py-finish-breakpoint.exp: Change print syntax for
Python 3 compatibility.
Skip tests for Python 2.4.
* gdb.python/py-inferior.exp: Change print syntax for
Python 3 compatibility.
Use byte string rather than character string in memory write test
if Python 3.
* gdb.python/py-pp-maint.py: Change class declarations to "new
class" syntax.
* gdb.python/py-prettyprint.py: Change iterator class to generator
function for Python 3 compatibility.
Make all classes "new style".
Fix indentation issue and stray semicolon.
* gdb.python/py-shared.expChange print syntax for Python 3
compatibility.
Define "long" if Python 3.
* gdb.python/py-type.exp: Change print syntax for Python 3
compatibility.
Accept either int or long values for enum values.
* gdb.python/py-value.exp: Change print syntax for Python 3
compatibility.
Skip "long" and "unicode" tests if Python 3.
Accept either "type" or "class" in type checks.
* lib/gdb.exp (gdb_py_is_py3k): New flag set if Python 3.
(gdb_py_is_py24): New flag set if Python 2.4 or 2.5.
% gdb -q ''
... or ...
% gdb -q
(gdb) file ''
... both cause GDB to crash with an invalid free. This is because
exec_file_attach is attempting to free a string that has not been
allocated. The string is only allocated if openp is successful.
But in the case of this obviously invalid filename, openp fails,
and leaves scratch_pathname uninitialized, thus causing the xfree
to fail.
The fix is to enable the associated cleanup after we have verified
that openp was successful.
gdb/ChangeLog (By Keith Seitz <keiths@redhat.com>):
* exec.c (exec_file_attach): Move cleanup after verifying that
memory has in fact been allocated.
gdb/testsuite/ChangeLog:
* gdb.base/empty_exe.exp: New testcase.
There are a bunch of aliases that get used with help, but the current
command completion logic does not include those when doing completions.
Since the framework is already mostly in place, extend complete_on_cmdlist
slightly to pass down the ignore_help_classes flag like is done with the
existing lookup command logic.
Now you can do:
(gdb) help use<tab>
and get back:
(gdb) help user-defined
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* data-directory/Makefile.in (PYTHON_FILES): Add
type_printers.py.
* python/lib/gdb/command/type_printers.py: New file.
* python/lib/gdb/command/types.py (TypePrinter): New class.
(_get_some_type_recognizers, get_type_recognizers,
apply_type_recognizers, register_type_printer): New
functions.
* python/py-objfile.c (objfile_object) <type_printers>: New
field.
(objfpy_dealloc): Decref new field.
(objfpy_new): Set new field.
(objfpy_get_type_printers, objfpy_set_type_printers): New
functions.
(objfile_to_objfile_object): Set new field.
(objfile_getset): Add "type_printers".
* python/py-progspace.c (pspace_object) <type_printers>: New
field.
(pspy_dealloc): Decref new field.
(pspy_new): Set new field.
(pspy_get_type_printers, pspy_set_type_printers): New functions.
(pspace_to_pspace_object): Set new field.
(pspace_getset): Add "type_printers".
* python/python.c (start_type_printers, apply_type_printers,
free_type_printers): New functions.
(_initialize_python): Set gdb.type_printers.
* python/python.h (start_type_printers, apply_type_printers,
free_type_printers): Declare.
* typeprint.c (type_print_raw_options, default_ptype_flags):
Update for new fields.
(do_free_global_table, create_global_typedef_table,
find_global_typedef): New functions.
(find_typedef_in_hash): Use find_global_typedef.
(whatis_exp): Use create_global_typedef_table. Change cleanup
handling.
* typeprint.h (struct type_print_options) <global_typedefs,
global_printers>: New fields.
doc
* gdb.texinfo (Symbols): Document "info type-printers",
"enable type-printer" and "disable type-printer".
(Python API): Add new node to menu.
(Type Printing API): New node.
(Progspaces In Python): Document type_printers field.
(Objfiles In Python): Likewise.
(gdb.types) <get_type_recognizers, apply_type_recognizers,
register_type_printer, TypePrinter>: Document.
testsuite
* gdb.base/completion.exp: Update for "info type-printers".
* gdb.python/py-typeprint.cc: New file.
* gdb.python/py-typeprint.exp: New file.
* gdb.python/py-typeprint.py: New file.
* c-valprint.c (c_val_print): For character arrays
with "print null" option on, print ellipses if
the output is truncated and the next character is not \000.
* valprint.c (MAX_WCHARS): Define.
(WCHAR_BUFLEN): Likewise.
(WCHAR_BUFLEN_MAX): Likewise.
(struct converted_character): New structure.
(count_next_character): New function.
(print_converted_chars_to_obstack): New function.
(generic_printstr): Rewrite using count_next_character
and print_converted_chars_to_obstack.
* gdb.base/printcmds.c: Add invalid_XXX globals
for repeated byte tests.
* gdb.base/printcmds.exp (test_repeat_bytes): New procedure.
* gdb.base/wchar.c (main): Add and construct a wchar_t
array with repeated characters.
* gdb.base/wchar.exp: Add repeated character tests.
* linux-tdep.c (linux_make_siginfo_note): New function.
(linux_make_corefile_notes): Use it.
* corelow.c (get_core_siginfo): New function.
(core_xfer_partial) <TARGET_OBJECT_SIGNAL_INFO>: New case.
gdb/testsuite
* gdb.base/siginfo-obj.exp: Create core file. Test siginfo from
core files, if possible.
* gdb.base/siginfo-thread.c: New file
* gdb.base/siginfo-thread.exp: New file
bfd
* elf.c (elfcore_grok_note) <NT_SIGINFO>: New case; make
pseudosection.
* gdb.python/py-strfns.exp (test_strfns_core_file): Use
gdb_gcore_cmd.
* gdb.cell/gcore.exp: Use gdb_gcore_cmd.
* gdb.base/gcore.exp: Use gdb_gcore_cmd.
* gdb.base/gcore-relro.exp: Use gdb_gcore_cmd.
* gdb.base/gcore-buffer-overflow.exp: Use gdb_gcore_cmd.
* gdb.base/auxv.exp: Use gdb_gcore_cmd.
* gdb.arch/vsx-regs.exp: Use gdb_gcore_cmd.
* gdb.arch/system-gcore.exp: Use gdb_gcore_cmd.
* gdb.arch/pa-nullify.exp (test_core_bt): Use gdb_gcore_cmd.
* lib/gdb.exp (gdb_gcore_cmd): New proc.
2012-11-05 Pedro Alves <palves@redhat.com>
* inferior.c (exit_inferior_1): Clear 'vfork_parent' in the vfork
child. Clear 'pending_detach'.
* infrun.c (handle_vfork_child_exec_or_exit): Clear
'pending_detach' in the vfork parent.
gdb/testsuite/
2012-11-05 Pedro Alves <palves@redhat.com>
* gdb.base/foll-vfork.exp (vfork_relations_in_info_inferiors): New
procedure.
(do_vfork_and_follow_child_tests_exec)
(do_vfork_and_follow_child_tests_exit): Call it.
2012-11-02 Pedro Alves <palves@redhat.com>
PR gdb/14766
* infrun.c (handle_inferior_event)
<TARGET_WAITKIND_EXITED/TARGET_WAITKIND_SIGNALLED>: Switch to
null_ptid before handling a vfork child exec or exit. Switch to
the event ptid afterwards.
gdb/testsuite/
2012-11-02 Pedro Alves <palves@redhat.com>
PR gdb/14766
* gdb.base/foll-vfork.exp (vfork_child_follow_to_exit): Remove
setup_kfail.
(tcatch_vfork_then_child_follow_exit): No longer expect "Couldn't
get registers".
* gdb.base/foll-vfork-exit.c: New file.
* gdb.base/foll-vfork.exp (top level): New file-describing
comment.
(vfork_child_follow_to_exit): New procedure.
(tcatch_vfork_then_child_follow): Rename as ...
(tcatch_vfork_then_child_follow_exec): ... this.
(tcatch_vfork_then_child_follow_exit): New procedure.
(do_vfork_and_follow_parent_tests): New procedure, factored out
from do_vfork_and_exec_tests.
(do_vfork_and_follow_child_tests_exec): Ditto.
(do_vfork_and_exec_tests): Delete.
(do_vfork_and_follow_child_tests_exit): New procedure.
(top level): Run tests with both the program that has the vfork
child execing, and the program has the vfork child exiting.
* gdb.base/foll-vfork.exp (setup_gdb): New procedure.
(check_vfork_catchpoints, vfork_parent_follow_through_step)
(vfork_parent_follow_to_bp): Call it.
(kill_child): Delete.
(vfork_and_exec_child_follow_to_main_bp)
(vfork_and_exec_child_follow_through_step): Call setup_gdb. No
longer call kill_child.
(tcatch_vfork_then_parent_follow): Call setup_gdb.
(do_vfork_and_exec_tests): Don't runto_main before calling each
test procedure.
(top level): Don't clean restart and set verbose before running
each test procedure.
* gdb.base/foll-vfork.exp
(vfork_and_exec_child_follow_through_step): Don't skip on
non-HP/UX targets. Expect the next to only step one line on
non-HP/UX targets, rather than stopping only after the exec.
Don't hard code line numbers.
* gdb.base/foll-vfork.exp (vfork_parent_follow_through_step):
Expect text from the sources instead of a line number.
(vfork_parent_follow_to_bp)
(vfork_and_exec_child_follow_to_main_bp)
(vfork_and_exec_child_follow_through_step)
(tcatch_vfork_then_parent_follow, tcatch_vfork_then_child_follow):
Use gdb_get_line_number.
Modernize.
* gdb.base/foll-vfork.exp: Use standard_testfile and
build_executable. Pass descriptive string to untested.
(vfork_parent_follow_through_step, vfork_parent_follow_to_bp)
(vfork_and_exec_child_follow_to_main_bp)
(vfork_and_exec_child_follow_through_step)
(tcatch_vfork_then_parent_follow, tcatch_vfork_then_child_follow)
(do_vfork_and_exec_tests): Use gdb_test/gdb_test_multiple instead
of send_gdb/gdb_expect.
(kill_child): New procedure.
(vfork_and_exec_child_follow_to_main_bp)
(vfork_and_exec_child_follow_through_step): Use it.
gdb/ChangeLog
PR cli/14772
* c-typeprint.c (c_print_type): Don't print a space for vector
types, this is handled within the suffix.
(c_type_print_varspec_suffix): Add a space to vector suffix
gdb/testsuite/ChangeLog
PR cli/14772
* gdb.base/gnu_vector.c (union_with_vector_1)
(struct_with_vector_1): Add new struct and union for testing
ptype.
* gdb.base/gnu_vector.exp: Add testing of ptype on vectors, and
structs / unions containing vectors.
That was an attempt at handling the targets where sizeof(long double)
is less than 8, but the way it was implement allows the bug that
this testcase verifies to come back without being noticed.
gdb/testsuite/ChangeLog:
* gdb.base/ldbl_e308.exp: Remove "inf" from possible expected
output for "print inp" test.
Assuming the following variable definition:
long double inp = 2.0;
On platforms where "long double" is a double precision IEEE flaoting
point, GDB currently behaves as follow:
(gdb) set variable inp = 1.6e+308l
(gdb) p inp
$2 = inf <<<<---- !!!!
Instead, the value of "inp" should be printed as:
(gdb) p inp
$1 = 1.6e+308
The problem is due to a small error in the comparison of the exponent
versus the maximum value this exponent can take, causing us to think
that the value was too big to fit. But it isn't.
gdb/ChangeLog:
* doublest.c (convert_doublest_to_floatformat): Fix comparison
against maximum exponent value.
gdb/testsuite/ChangeLog:
* gdb.base/ldbl_e308.c, gdb.base/ldbl_e308.exp: New files.
Fix crash during stepping on ppc32.
* ppc-linux-tdep.c (powerpc_linux_in_dynsym_resolve_code): Test NULL
SYM.
gdb/testsuite/
Fix crash during stepping on ppc32.
* gdb.base/step-symless.c: New file.
* gdb.base/step-symless.exp: New file.
gdb/ChangeLog
* target.c (simple_search_memory): Include access length in
warning message.
gdb/gdbserver/ChangeLog
* server.c (handle_search_memory_1): Include access length in
warning message.
gdb/testsuite/ChangeLog
Test find command on unmapped memory.
* gdb.base/find-unmapped.c: New file.
* gdb.base/find-unmapped.exp: New file.
gdb/ChangeLog
* breakpoint.c (update_global_location_list): Ignore previous
duplicate status of a breakpoint when starting a new scan for
duplicate breakpoints.
gdb/testsuite/ChangeLog
* gdb.base/duplicate-bp.c: New file.
* gdb.base/duplicate-bp.exp: New file.
* c-typeprint.c (c_type_print_varspec_suffix): Remove cast and
use plongest to print the array size.
testsuite/ChangeLog:
* gdb.base/longest-types.c: New test case.
* gdb.base/longest-types.exp: New test case.
* cli/cli-decode.c (add_setshow_zuinteger_unlimited_cmd): New.
Update comment to add_setshow_integer_cmd.
* cli/cli-setshow.c (do_set_command): Handle case
'var_zuinteger_unlimited'.
(do_show_command): Likewise.
* cli/cli-cmds.c (init_cmds): Call add_setshow_zuinteger_unlimited_cmd
for command 'remotetimeout'.
* command.h (enum var_types): New zuinteger_unlimited. Update comment
to var_integer.
* source.c (_initialize_source): Call add_setshow_zuinteger_unlimited_cmd
for command 'set listsize'.
gdb/doc/
* gdb.texinfo (List): Describe the meaning of 0 and -1 in
'set listsize'.
gdb/testsuite/
* gdb.base/list.exp (set_listsize): Don't set arg to "unlimited"
when it is less than 0.
gdb/ChangeLog:
* c-typeprint.c (c_type_print_varspec_prefix): Pass through the
passed_a_ptr flag when displaying typedef types.
gdb/testsuite/ChangeLog:
* gdb.base/ptype.exp: Test ptype on a pointer to a typedef.
PR gdb/14428
gdb/
* infcmd.c (default_print_one_register_info): New, factored out
from default_print_registers_info.
(default_print_registers_info): Use it. Mark value unavailable if
necessary.
(registers_info): Print user registers with
default_print_one_register_info.
gdb/testsuite/
* gdb.base/pc-fp.exp: Adjust expected output of 'info registers pc fp'.
* breakpoint.c (parse_breakpoint_sals) <(*address) == NULL>: New
variable pc. Call find_pc_line instead of find_pc_overlay, restore
original PC for it.
gdb/testsuite/
* gdb.base/break-caller-line.c: New file.
* gdb.base/break-caller-line.exp: New file.
gdb/
* infrun.c (_initialize_infrun) <handle command help text>:
Mention that multiple signals are supported.
gdb/testsuite/
* gdb.base/help.exp: Adjust to "handle" help text change.
(_initialize_values): Mention convenience functions in the help text
for "show convenience".
doc/
* gdb.texinfo (Convenience Vars): Update text for "show convenience"
to include functions.
testsuite/
* gdb.base/default.exp: Update expected output of "show convenience".
The command line completion has spoiled me. Thus the lack of completion with
the "handle" command annoys me. Patch!
This does a few things:
- adds a VEC_merge helper
- adds a generic signal completer
- adds a completion handler for the "handle" command
- sets the completion handler for the "signal" command
URL: http://sourceware.org/bugzilla/show_bug.cgi?id=10436
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
UNOP_MEMVAL_TYPE.
* expprint.c (print_subexp_standard, case OP_TYPE): New.
(print_subexp_standard, case UNOP_CAST_TYPE): Don't increment pos.
(print_subexp_standard, case UNOP_DYNAMIC_CAST): Ditto.
(print_subexp_standard, case UNOP_REINTERPRET_CAST): Ditto.
(print_subexp_standard, case UNOP_MEMVAL_TYPE): Ditto.
(dump_subexp_body_standard, case UNOP_DYNAMIC_CAST): Don't increment
elt.
(dump_subexp_body_standard, case UNOP_REINTERPRET_CAST): Ditto.
(dump_subexp_body_standard, case UNOP_CAST_TYPE): Ditto.
(dump_subexp_body_standard, case UNOP_MEMVAL_TYPE): Ditto.
(dump_prefix_expression): Handle OP_TYPE.
testsuite/
* gdb.base/debug-expr.c: New file.
* gdb.base/debug-expr.exp: New file.
* gdb.base/exprs.exp: Test {type} casts.
* gdb.cp/debug-expr.exp: New file.
* gdb.base/valgrind-infcall.exp (continue #$continue_count): Use
global variable loop, not a 'break'. Add loop count limit to 100.
Add new fail case for terminated vgdb.
PR 11804
* defs.h (find_memory_region_ftype): New comment. New arg modified.
* fbsd-nat.c (fbsd_find_memory_regions): Add the passed modified value.
* gcore.c (gcore_create_callback): New function comment. Add modified
parameter. Only write modified regions. Set SEC_READONLY exactly
according to MODIFIED.
(objfile_find_memory_regions): Ignore separate debug info files. Ass
the passed modified value to FUNC.
* gnu-nat.c (gnu_find_memory_regions): Add the passed modified value.
* linux-tdep.c (linux_find_memory_regions): Try to reads smaps file
first. New variables modified and has_anonymous. Parse the lines of
smaps file. Add the passed MODIFIED value to FUNC.
* procfs.c (find_memory_regions_callback): Add the passed modified
value.
gdb/testsuite/
PR 11804
* gdb.base/gcore-relro.exp: New file.
* gdb.base/gcore-relro-main.c: New file.
* gdb.base/gcore-relro-lib.c: New file.
when starting up the program.
* gdb.python/py-value.exp (test_value_numeric_ops): Pointers may
show a symbolic value as well.
* gdb.server/server-exec-info.exp: Skip test when skipping
gdbserver test and/or when skipping shared library tests.
* gdb.threads/linux-dp.exp: Unset "seen" when done with it to
avoid name conflicts with other tests.
marker comment at the beginning (after intialization).
* gdb.base/watchpoint.exp (test_complex_watchpoint): Set func2
breakpoint on marker comment instead of function begin.
(test_wide_location_1): Do not expect HW watchpoints on 32-bit
PowerPC.
(test_wide_location_2): Do not expect HW watchpoints on 32-bit
or 64-bit PowerPC.
(do_tests): Consistently set can-use-hw-watchpoints to 0 if
gdb,no_hardware_watchpoints flag is set.
(initialize): Remove now redundant can-use-hw-watchpoints change.
* linux-arm-low.c (arm_linux_hw_point_initialize): Distinguish
between unsupported TYPE and unimplementable ADDR/LEN combination.
(arm_insert_point): Act on new return value.
testsuite/ChangeLog:
* gdb.base/watchpoint.exp (test_wide_location_1): Expect software
watchpoints on ARM. When expecting software watchpoints, tolerate
(remote) targets that report unsupported hardware watchpoint only
at continue time.
(test_wide_location_2): Likewise.
* infcall.c (call_function_by_hand): Move BP_ADDR comment to
AT_ENTRY_POINT.
(call_function_by_hand) <ON_STACK>: Call write_memory with
gdbarch_breakpoint_from_pc, if possible.
(call_function_by_hand) <AT_ENTRY_POINT>: The BP_ADDR comment is moved
here.
gdb/testsuite/
* gdb.base/valgrind-infcall.c: New file.
* gdb.base/valgrind-infcall.exp: New file.
Fix testsuite regression after --use-deprecated-index-sections removal.
* gdb.base/annota1.exp (run until main breakpoint): Update the expect
string.
* gdb.base/async-shell.exp (gdbindex_warning_re): Likewise.
* gdb.base/sigall.exp (signals): New list.
<top level>: Loop over signals in the $signals list instead of
calling a test function once per signal.
* gdb.reverse/sigall-precsave.exp (signals): New list.
<top level>: Loop over signals in the $signals list instead of
calling a test function once per signal.
* gdb.reverse/sigall-reverse.exp (signals): New list.
<top level>: Loop over signals in the $signals list instead of
calling a test function once per signal.
and case 'var_optional_filename' together.
* infcmd.c (_initialize_infcmd): Call add_setshow_string_noescape_cmd
instead of add_setshow_optional_filename_cmd for setshow command
'args'. Set completer for 'set args'.
gdb/testsuite:
* gdb.base/setshow.exp: Test 'set args ~'.
* gdb.base/store.exp (check_set): Import gdb_prompt.
(continue to wack_${t}): Make it to conditional gdb_test_multiple.
(${prefix}; next ${t}): Hide its name, handle it conditionally now.
Fix XFAIL compatibility with old i386 systems.
* gdb.base/stale-infcall.exp (test system longjmp tracking support):
Check also 'Cannot insert breakpoint 0'.
PR 14321
* findcmd.c (parse_find_args): New variable pattern_buf_size_need.
Increase buffer sizes to 2x we need, not just 2x of the previous size.
gdb/testsuite/
PR 14321
* gdb.base/find.exp
(find int64_search_buf, +64/8*100, int64_search_buf): New test.
2012-07-02 Sergio Durigan Junior <sergiodj@redhat.com>
* gdb.base/help.exp (help b, help br, help bre, help brea, help
break): Include help message for the new `-probe' and `-probe-stap'
options.
* gdb.base/stale-infcall.c (infcall): New label test-next.
(main): New labels test-pass and test-fail.
* gdb.base/stale-infcall.exp: Continue to test-next. Put breakpoint
$test_fail_bpnum to test-fail.
(test system longjmp tracking support): New test.
Delete $test_fail_bpnum.
* lib/gdb.exp (gdb_continue_to_breakpoint): Accept also Temporary
breakpoint.
* elfread.c (elf_symtab_read): Set created_by_gdb for @plt minsym
created by gdb.
* symtab.c (lookup_symbol_in_objfile_from_linkage_name): New function.
(search_symbols): Call it instead of lookup_symbol.
Skip symbols created by gdb. Only scan minsyms if nfiles == 0.
testsuite:
* gdb.base/info-fun.exp: New file.
* gdb.base/info-fun.c: New file.
* gdb.base/info-fun-solib.c: New file.
Remove stale dummy frames.
* breakpoint.c: Include dummy-frame.h.
(longjmp_breakpoint_ops): New variable.
(update_breakpoints_after_exec, breakpoint_init_inferior): Delete also
bp_longjmp_call_dummy.
(bpstat_what, bptype_string, print_one_breakpoint_location)
(init_bp_location): Support bp_longjmp_call_dummy.
(set_longjmp_breakpoint): Use longjmp_breakpoint_ops. Comment why.
(set_longjmp_breakpoint_for_call_dummy)
(check_longjmp_breakpoint_for_call_dummy, longjmp_bkpt_dtor): New
functions.
(initialize_breakpoint_ops): Initialize longjmp_breakpoint_ops.
* breakpoint.h (enum bptype): New item bp_longjmp_call_dummy. Delete
FIXME comment and extend the other comment for bp_call_dummy.
(set_longjmp_breakpoint_for_call_dummy)
(check_longjmp_breakpoint_for_call_dummy): New declarations.
* dummy-frame.c: Include gdbthread.h.
(pop_dummy_frame_bpt): New function.
(pop_dummy_frame): Call pop_dummy_frame_bpt.
(dummy_frame_discard): New function.
(cleanup_dummy_frames): Update the comment about longjmps.
* dummy-frame.h (dummy_frame_discard): New declaration.
* gdbthread.h (struct thread_info): Extend initiating_frame comment.
* infcall.c (call_function_by_hand): New variable longjmp_b. Call
set_longjmp_breakpoint_for_call_dummy. Chain its breakpoints with BPT.
* infrun.c (handle_inferior_event) <BPSTAT_WHAT_CLEAR_LONGJMP_RESUME>:
Add case 4 comment. Call check_longjmp_breakpoint_for_call_dummy and
keep_going if IS_LONGJMP and there is no other reason to stop.
gdb/testsuite/
Remove stale dummy frames.
* gdb.base/call-signal-resume.exp (maintenance print dummy-frames)
(maintenance info breakpoints): New tests.
* gdb.base/stale-infcall.c: New file.
* gdb.base/stale-infcall.exp: New file.
(_initialize_breakpoint): Use it.
* value.c (complete_internalvar): New function.
* value.h (complete_internalvar): Declare.
testsuite
* gdb.base/condbreak.exp: Add tests for "condition" completion.
Fix regression by the "ambiguous linespec" series.
* breakpoint.c (parse_breakpoint_sals): New variable cursal. Use
get_last_displayed_symtab and get_last_displayed_line and depending
on CURSAL.
gdb/testsuite/
Fix regression by the "ambiguous linespec" series.
* gdb.base/break.exp (list marker1, break lineno, delete $bpnum): New
tests.