* top.c (print_gdb_configuration): New function, displays the
details about GDB configure-time parameters.
(print_gdb_version): Mention "show configuration".
* cli/cli-cmds.c (show_configuration): New function.
(_initialize_cli_cmds): Add the "show configuration" command.
* main.c (captured_main) <print_configuration>: New static var.
<long_options>: Use it.
If --configuration was given, call print_gdb_configuration.
* doc/gdb.texinfo (Mode Options): Document '-configuration'.
(Help): Document "show configuration".
(Bug Reporting): Add requirements to include the configuration
details in bug reports.
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-04-10 Hui Zhu <hui@codesourcery.com>
Yao Qi <yao@codesourcery.com>
* configure.ac: Check libbabeltrace is installed.
* config.in: Regenerate.
* configure: Regenerate.
* Makefile.in (LIBBABELTRACE): New.
(CLIBS): Add LIBBABELTRACE.
* ctf.c: Include "exec.h".
(CTF_EVENT_ID_STATUS, CTF_EVENT_ID_TSV_DEF): New macros.
(CTF_EVENT_ID_TP_DEF, ctf_save_write_int32): New macros.
(ctf_save_metadata_header): Define new type aliases in
metadata.
(ctf_write_header): Define event type "tsv_def" and "tp_def"
in metadata. Start a new faked packet for trace status.
(ctf_write_status): Write trace status to CTF.
(ctf_write_uploaded_tsv): Write TSV to CTF.
(ctf_write_uploaded_tp): Write tracepoint definition to CTF.
(ctf_write_definition_end): End the faked packet.
(ctx, ctf_iter, trace_dirname): New.
(start_pos): New variable.
(ctf_destroy, ctf_open_dir, ctf_open): New.
(SET_INT32_FIELD, SET_ARRAY_FIELD, SET_STRING_FIELD): New
macros.
(ctf_read_tsv, ctf_read_tp, ctf_close, ctf_files_info): New.
(ctf_fetch_registers, ctf_xfer_partial): New.
(ctf_get_trace_state_variable_value): New.
(ctf_get_tpnum_from_frame_event): New.
(ctf_get_traceframe_address): New.
(ctf_trace_find, ctf_has_stack): New.
(ctf_has_registers, ctf_traceframe_info, init_ctf_ops): New.
(ctf_get_trace_status, ctf_read_status): New.
(_initialize_ctf): New.
* tracepoint.c (get_tracepoint_number): New
(get_uploaded_tsv): Remove 'static'.
(struct traceframe_info, trace_regblock_size): Move it to ...
* tracepoint.h: ... here.
(get_tracepoint_number): Declare it.
(get_uploaded_tsv): Declare it.
* NEWS: Mention new configure option.
gdb/doc/
2013-04-10 Yao Qi <yao@codesourcery.com>
* gdb.texinfo (Trace Files): Add "target ctf".
gdb/testsuite/
2013-04-10 Yao Qi <yao@codesourcery.com>
* gdb.trace/actions.exp: Save trace data to CTF.
Change to ctf target if GDB supports, read CTF data in ctf
target, and check the actions of tracepoints.
* gdb.trace/while-stepping.exp: Likewise.
* gdb.trace/report.exp: Test GDB saves trace data to CTF
format and read CTF trace file if GDB supports.
* gdb.trace/tstatus.exp: Save trace data to CTF. If ctf
target is supported, change to ctf target, read trace data and
check output of command "tstatus".
* gdb.trace/tsv.exp: Save trace frame to CTF. If GDB supports,
read CTF data by target ctf and call check_tsv.
* gdb.texinfo (gdbserver man): Rename tty to comm. Swap --attach
parameters order. Remove "On some targets" for --attach. Document the
--multi parameter and extended-remote command. Document all the
options.
I hacked "apropos" to dump the whole set of commands (just make it
accept the entry string as regex), and then diffed the output of 7.5
vs 7.6, --enable-targets=all builds. That allowed then checking
whether some commands had not been mentioned in NEWS or the manual.
These are what I found missing. We've been a bit negligent in
requiring documentation bits for debug commands.
gdb/
2013-04-02 Pedro Alves <palves@redhat.com>
* NEWS: Mention "set/show debug aarch64", "set/show debug
coff-pe-read" and "set/show debug mach-o".
gdb/doc/
2013-04-02 Pedro Alves <palves@redhat.com>
* gdb.texinfo (Debugging Output): Document "set/show debug
aarch64", "set/show debug coff-pe-read" and "set/show debug
mach-o".
GDB currently sends a qTStatus even if the target previously replied
an empty packet to a previous qTStatus. If the target doesn't
recognize the packet, there's no point in trying again.
The machinery we have in place is packet_ok, which has the nice side
effect of forcing one to install a configuration command/knob for the
packet in question, which is often handy when you need to debug
things, and/or emulate a target that doesn't support the packet, or even,
it can be used as workaround for the old broken kgdb's that return error
to qTSTatus instead of an empty packet.
gdb/
2013-03-28 Pedro Alves <palves@redhat.com>
* NEWS (New options): New section.
(New options): Mention set/show remote trace-status-packet.
* remote.c (PACKET_qTStatus): New enumeration value.
(remote_get_trace_status): Skip sending qTStatus if the packet is
disabled. Use packet_ok.
(_initialize_remote): Register a configuration command for
qTStatus packet.
gdb/doc/
2013-03-28 Pedro Alves <palves@redhat.com>
* gdb.texinfo (Remote Configuration) <set remote @var{name}-packet
table>: Add entry for "trace-status".
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.
* 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.
record-full.
Document two new record sub-commands "record instruction-history" and
"record function-call-history" and two associated set/show commands
"set record instruction-history-size" and "set record
function-call-history-size".
Add this to NEWS.
gdb/
* NEWS: Add record changes.
doc/
* gdb.texinfo (Process Record and Replay): Document record
changes.
Hafiz Abid Qadeer <abidh@codesourcery.com>
gdb/
* NEWS: Mention set and show trace-buffer-size commands.
Mention new packet.
* target.h (struct target_ops): New method
to_set_trace_buffer_size.
(target_set_trace_buffer_size): New macro.
* target.c (update_current_target): Set up new method.
* tracepoint.c (trace_buffer_size): New global.
(start_tracing): Send it to the target.
(set_trace_buffer_size): New function.
(_initialize_tracepoint): Add new setshow for trace-buffer-size.
* remote.c (remote_set_trace_buffer_size): New function.
(_initialize_remote): Use it.
(QTBuffer:size) New remote command.
(PACKET_QTBuffer_size): New enum.
(remote_protocol_features): Add an entry for
PACKET_QTBuffer_size.
gdb/gdbserver/
* tracepoint.c (trace_buffer_size): New global.
(DEFAULT_TRACE_BUFFER_SIZE): New define.
(init_trace_buffer): Change to one-argument function. Allocate
trace buffer memory.
(handle_tracepoint_general_set): Call cmd_bigqtbuffer_size to
handle QTBuffer:size packet.
(cmd_bigqtbuffer_size): New function.
(initialize_tracepoint): Call init_trace_buffer with
DEFAULT_TRACE_BUFFER_SIZE.
* server.c (handle_query): Add QTBuffer:size in the
supported packets.
gdb/doc/
* gdb.texinfo (Starting and Stopping Trace Experiments): Document
trace-buffer-size set and show commands.
(Tracepoint Packets): Document QTBuffer:size.
(General Query Packets): Document QTBuffer:size.
gdb/testsuite/
* gdb.trace/trace-buffer-size.exp: New file.
* gdb.trace/trace-buffer-size.c: New file.
(Values From Inferior, Types In Python, Inferiors In Python)
(Events In Python, Threads In Python, Frames In Python, Blocks In
Python, Symbols In Python, Symbol Tables In Python): Remove
@tables.
(Packets, General Query Packets, Tracepoint Packets)
(Host I/O Packets): Use @w{} for empty @item.
* python/py-arch.c (archpy_disassmble): Implementation of the
new method gdb.Architecture.disassemble.
(arch_object_methods): Add entry for the new method.
* doc/gdb.texinfo (Architectures In Python): Add description
about the new method gdb.Architecture.disassemble.
* testsuite/gdb.python/py-arch.c: New test case
* testsuite/gdb.python/py-arch.exp: New tests to test
gdb.Architecture.disassemble
* testsuite/gdb.python/Makefile.in: Add py-arch to the list of
EXECUTABLES.
Hafiz Abid Qadeer <abidh@codesourcery.com>
gdb/
* NEWS: Mention new field "trace-file".
* tracepoint.c (trace_status_mi): Output "trace-file" field.
(tfile_open): Record the trace file's filename in the trace
status.
(tfile_files_info): Mention the name of the trace file.
Check the "filename" field explicitely.
(trace_status_command): Explicitely check "filename" field.
(trace_find_command): Ditto.
(trace_find_pc_command): Ditto.
(trace_find_tracepoint_command): Ditto.
(trace_find_line_command): Ditto.
(trace_find_range_command): Ditto.
(trace_find_outside_command): Ditto.
* tracepoint.h (struct trace_status) <from_file>: Rename it
to "filename" and make it hold the trace file's filename
instead of a boolean.
* remote.c (remote_get_trace_status): Initialize "filename"
field with NULL instead of 0.
gdb/doc/
* gdb.texinfo (GDB/MI Tracepoint Commands) <-trace-status>:
Document the "trace-file" field.
gdb/testsuite/
* gdb.trace/tfile.exp: Add test for -trace-status command.
2013-02-06 Yao Qi <yao@codesourcery.com>
* gdb.texinfo (GDB/MI Async Records): Document new MI
notification "=tsv-modified". Update the document of MI
notification "=tsv-created".
* observer.texi (GDB Observers): New observer tsv_modified.
Update observer tsv_created and tsv_deleted.
gdb:
2013-02-06 Yao Qi <yao@codesourcery.com>
* mi/mi-interp.c: Include "tracepoint.h".
(mi_tsv_modified): Declare.
(mi_tsv_created, mi_tsv_deleted): Update declaration.
(mi_interpreter_init): Call observer_attach_tsv_modified.
(mi_tsv_modified): New.
(mi_tsv_created, mi_tsv_deleted): Update.
* tracepoint.c (trace_variable_command): Call
observer_notify_tsv_modified if the initial value of tsv is
changed.
(delete_trace_state_variable): Call
observer_notify_tsv_deleted earlier.
(trace_variable_command): Caller update.
(create_tsv_from_upload): Likewise.
* observer.sh: Declare "struct trace_state_variable".
* NEWS: Mention the new MI notification "=tsv-modified".
gdb/testsuite:
2013-02-06 Yao Qi <yao@codesourcery.com>
* gdb.trace/mi-tsv-changed.exp (test_create_delete_tsv): Rename
to ...
(test_create_delete_modify_tsv): ... here. New test on modifying
the initial value of a tsv.
2013-02-05 Yufeng Zhang <yufeng.zhang@arm.com>
* gdb.texinfo (AArch64 Features): New section; document
org.gnu.gdb.aarch64.core and org.gnu.gdb.aarch64.fpu.
(Architectures): Add new AArch64 section to document AArch64
architecture specific commands.
(ABI): Add description of the new OS ABI "Newlib" and its influence
on the longjmp handling.
Add a new variable that controls a way in which filenames are
displayed.
* NEWS (set filename-display): New entry.
* source.c (filename_display_basename, filename_display_relative)
(filename_display_absolute, filename_display_kind_names)
(filename_display_string, show_filename_display_string)
(symtab_to_filename_for_display): New.
(_initialize_source): Added initialization of 'filename-display'
variable.
* source.h (symtab_to_filename_for_display): Added declaration.
* stack.c (print_frame): Added new variable and calling of a new
function and condition with this variable. Changed third argument of
calling of a function.
gdb/doc/
* gdb.texinfo (Backtrace): Added description of 'filename-display'
variable in 'set/show backtrace' section.
gdb/testsuite/
* gdb.dwarf2/dw2-dir-file-name.exp: New file.
* gdb.dwarf2/dw2-dir-file-name.c: New file.
internal representation of architecture via GDB Python API.
* Makefile.in: Add entries corresponding to the new file
python/py-arch.c.
* NEWS (Python Scripting): Add entries for the new class
gdb.Architecture and the new method gdb.Frame.architecture.
* python/py-arch.c: Implement gdb.Architecture class.
* python/py-frame.c (frapy_arch): Implement the method
gdb.Frame.architecture().
(frame_object_methods): Add 'architecture' to the method table.
* python/python-internal.h: Add declarations of new utility
functions.
* python/python.c (_initialize_python): Initialize
gdb.Architecture class.
* doc/gdb.texinfo (Architectures In Python): New sub-sub-section
describing the gdb.Architecture class.
(Frames In Python): Add description about the new method
gdb.Frame.architecture().
* testsuite/gdb.python/frame.exp: Add a test for
gdb.Frame.architecture() method.
* dwarf2read.c (dwarf2_per_cu_data): Split imported_symtabs and
type_unit_group out of union s. All uses updated.
(read_index_from_section): Watch for index version 8.
(follow_die_sig): If using .gdb_index version <= 7, record the TU as
an imported symtab.
(write_psymtabs_to_index): Increment version number to 8.
doc/
* gdb.texinfo (Index Section Format): Document .gdb_index version 8.
* breakpoint.c (print_one_breakpoint_location): Add MI
field 'thread-groups' when printing a breakpoint.
(output_thread_groups): New function.
2013-01-21 Marc Khouzam <marc.khouzam@ericsson.com>
* gdb.texinfo (GDB/MI Breakpoint Commands): Document new
'thread-groups' field when printing a breakpoint in MI.
2013-01-21 Marc Khouzam <marc.khouzam@ericsson.com>
* gdb.mi/mi-break.exp: Expect new 'thread-groups' field.
* gdb.mi/mi-nsmoribund.exp: Expect new 'thread-groups' field.
Also handle 'thread' field.
* gdb.mi/mi-simplerun.exp: Expect new 'thread-groups' field.
* gdb.mi/mi-watch.exp: Ditto.
* lib/mi-support.exp: Ditto.
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.
* gdb.texinfo (Remote Non-Stop): Move paragraphs to ...
(Packets): Move "vStopped" packet to ...
(Notification Packets): ... here. Describe the components
of notification. Add a table of supported notifications.
Add an example on the process of he async notification.
* breakpoint.c (print_one_breakpoint_location): Display the
state of 'installed' of each non-pending location of a tracepoint
in both CLI and MI.
(download_tracepoint_locations): Notify 'breakpoint-modified'
observer if any tracepoint location is downloaded.
* tracepoint.c (start_tracing): Likewise.
(merge_uploaded_tracepoints): Record all modified
tracepoints and notify 'breakpoint-modified' observer for them.
* NEWS: Mention the change for CLI and MI.
gdb/doc:
2012-12-15 Yao Qi <yao@codesourcery.com>
* gdb.texinfo (Listing Tracepoints): New item and example about
'installed on target' output.
Add more in the example about 'installed on target'.
(GDB/MI Breakpoint Commands): Doc about 'installed field.
gdb/testsuite:
2012-12-15 Yao Qi <yao@codesourcery.com>
* gdb.trace/mi-tracepoint-changed.exp (test_pending_resolved): Check
'installed' field in '=breakpoint-modified'.
(test_reconnect): Check 'installed' field in
'=breakpoint-modified' and '=breakpoint-created'.
* gdb.trace/actions.exp: Update test for 'installed' field.
* gdb.trace/change-loc.exp (tracepoint_change_loc_1):
(tracepoint_change_loc_2): Likewise.
Check 'info tracepoint' display nothing else.
* gdb.trace/deltrace.exp: Likewise.
* gdb.trace/infotrace.exp: Likewise.
* gdb.trace/mi-traceframe-changed.exp (test_tfind_remote):
Likewise.
* gdb.trace/passcount.exp: Likewise.
* gdb.trace/tracecmd.exp: Likewise.
* gdb.trace/while-stepping.exp: Likewise.