aboutsummaryrefslogtreecommitdiff
path: root/gdb
AgeCommit message (Collapse)AuthorFilesLines
2012-03-23*** empty log message ***gdbadmin1-1/+1
2012-03-22 * sparc-linux-nat.c (_initialize_sparc_linux_nat): Fix prototype.Richard Henderson3-2/+7
* sparc-nat.c (sparc_xfer_wcookie): Make static.
2012-03-22 * jit.c (jit_read_code_entry): Compute alignment and offset ofRichard Henderson2-6/+12
int64_t member before computing entry_size.
2012-03-222012-03-14 Siva Chandra <sivachandra@google.com>Siva Chandra Reddy9-1/+233
Python scripting: Add new method Value.referenced_value to gdb.Value which can dereference pointer as well as reference values. * NEWS: Add entry under 'Python scripting' about the new method Value.referenced_value on gdb.Value objects. * python/py-value.c (valpy_referenced_value): New function defining a new method on gdb.Value objects which can dereference pointer and reference values. * testsuite/gdb.python/py-value.cc: Add test case for testing the methodology exposing C++ values to Python. * testsuite/gdb.python/py-value-cc.exp: Add tests testing the methodology exposing C++ values to Python. * testsuite/gdb.python/Makefile.in: Add py-value-cc to EXECUTABLES. * docs/gdb.texinfo (Python API/Values From Inferior): Add description about the new method Value.referenced_value. Add description on how Value.dereference is different (and similar) to Value.referenced_value.
2012-03-222012-03-22 Siva Chandra Reddy <sivachandra@google.com>Siva Chandra Reddy2-0/+5
* MAINTAINERS (Write After Approval): Add myself to the list.
2012-03-22*** empty log message ***gdbadmin1-1/+1
2012-03-21 * symtab.c (skip_prologue_sal): Change test to check for "main()"Kevin Buettner2-1/+6
in addition to "main".
2012-03-21SEGV during AX eval of OP_DOUBLE (unsupported)Joel Brobecker4-3/+10
To reproduce the problem, simply try the following with any program: (gdb) maintenance agent-eval 1.0 Critical error handler: process [...] terminated due to access violation (this is on Windows; on GNU/Linux, the libc copes better) The problem is quite simple: gen_expr is given an expression that contains an unrecognized operator (OP_DOUBLE in this case). When that happens, it tries to report an error with a string image of the operator in the error message. Conversion of the opcode into a string is done using op_string which, despite its name, probably is not what the author was looking for. This function returns NULL for a lot of the opcodes, thus triggering the crash. There is a function that corresponds to what we are looking for: expprint.c:op_name. It was static, though, so I made it non-static, and used it from ax-gdb.c:gen_expr. gdb/ChangeLog: * expression.h (op_name): Add declaration. * expprint.c (op_name): Remove declaration. Make non-static. * ax-gdb.c (gen_expr): Use op_name instead of op_string.
2012-03-21struct siginfo vs. siginfo_tThomas Schwinge13-28/+53
gdb/ * amd64-linux-nat.c (amd64_linux_siginfo_fixup): Use siginfo_t instead of struct siginfo. * arm-linux-nat.c (arm_linux_stopped_data_address): Likewise. * ia64-linux-nat.c (ia64_linux_stopped_data_address): Likewise. * linux-nat.c (linux_nat_siginfo_fixup, siginfo_fixup) (linux_xfer_siginfo, linux_nat_set_siginfo_fixup) (linux_nat_get_siginfo): Likewise. * linux-nat.h (struct lwp_info, linux_nat_set_siginfo_fixup) (linux_nat_get_siginfo): Likewise. * linux-tdep.c (linux_get_siginfo_type): Likewise. * ppc-linux-nat.c (ppc_linux_stopped_data_address): Likewise. * procfs.c (gdb_siginfo_t): Likewise. gdbserver/ * linux-arm-low.c (arm_stopped_by_watchpoint): Use siginfo_t instead of struct siginfo. * linux-low.c (siginfo_fixup, linux_xfer_siginfo): Likewise. * linux-x86-low.c (x86_siginfo_fixup): Likewise. * linux-low.h: Include <signal.h>. (struct siginfo): Remove forward declaration. (struct linux_target_ops) <siginfo_fixup>: Use siginfo_t instead of struct siginfo.
2012-03-21ChangeLog fixGary Benson1-1/+1
2012-03-21gdb: update gitignoreMike Frysinger2-0/+6
2012-03-21gdbserver: update gitignoreMike Frysinger2-0/+12
2012-03-21*** empty log message ***gdbadmin1-1/+1
2012-03-202012-03-20 Pedro Alves <palves@redhat.com>Pedro Alves2-0/+7
* remote.c (remote_start_remote): Clear `rs->starting_up' on early returns.
2012-03-20gdb/Yao Qi2-1/+6
* amd64-tdep.c (amd64_displaced_step_copy_insn): Complete missing "}" in comment.
2012-03-20*** empty log message ***gdbadmin1-1/+1
2012-03-19gdb/Jan Kratochvil6-211/+333
Code cleanupp: Use cu_offset and sect_offset compile time type checking. * dwarf2expr.c (add_piece, dwarf_get_base_type, execute_stack_op) (ctx_no_dwarf_call, ctx_no_get_base_type): Use cu_offset and sect_offset. * dwarf2expr.h (cu_offset, sect_offset): New types. (struct dwarf_expr_context_funcs) <dwarf_call> (struct dwarf_expr_context_funcs) <get_base_type>: Use cu_offset and sect_offset. (struct dwarf_expr_context) <len>: Improve the comment. (struct dwarf_expr_piece, ctx_no_dwarf_call, ctx_no_get_base_type): Use cu_offset and sect_offset. * dwarf2loc.c (per_cu_dwarf_call, dwarf_expr_dwarf_call) (dwarf_expr_get_base_type, needs_frame_dwarf_call) (dwarf2_compile_expr_to_ax, disassemble_dwarf_expression): Likewise. * dwarf2loc.h: Include dwarf2expr.h. (dwarf2_fetch_die_location_block, dwarf2_get_die_type): Use cu_offset and sect_offset. * dwarf2read.c (struct dwarf2_per_objfile) <debug_types_type_hash>: Improve the comment. (struct comp_unit_head, struct dwarf2_cu, struct dwarf2_per_cu_data) (struct signatured_type, struct line_header, struct partial_die_info) (struct die_info, find_partial_die, dwarf2_get_ref_die_offset) (lookup_signatured_type_at_offset, dwarf2_find_containing_comp_unit) (get_die_type_at_offset, create_cus_from_index) (create_signatured_type_table_from_index, dw2_get_file_names) (offset_in_cu_p, read_comp_unit_head, error_check_comp_unit_head) (read_and_check_comp_unit_head, read_and_check_type_unit_head) (create_debug_types_hash_table, process_psymtab_comp_unit) (load_partial_comp_unit, create_all_comp_units) (partial_die_parent_scope, partial_die_full_name, skip_one_die) (load_full_comp_unit, dwarf2_physname, read_import_statement) (inherit_abstract_dies, read_func_scope, read_call_site_scope) (dwarf2_add_member_fn, process_enumeration_scope, read_module_type) (read_typedef, die_hash, die_eq, read_full_die, dwarf2_read_abbrevs) (load_partial_dies, read_partial_die, find_partial_die_in_comp_unit) (find_partial_die, read_attribute_value, lookup_die_type) (dump_die_shallow, store_in_ref_table): Use cu_offset and sect_offset. (is_ref_attr): New function comment. (dwarf2_get_ref_die_offset): New function comment, new variable retval. Use cu_offset and sect_offset. (follow_die_offset, follow_die_ref, dwarf2_fetch_die_location_block) (dwarf2_get_die_type, follow_die_sig, lookup_signatured_type_at_offset) (load_full_type_unit, read_signatured_type, per_cu_header_read_in) (dwarf2_find_containing_comp_unit, struct dwarf2_offset_and_type) (offset_and_type_hash, offset_and_type_eq, set_die_type) (get_die_type_at_offset, partial_die_hash, partial_die_eq) (write_one_signatured_type, write_psymtabs_to_index): Use cu_offset and sect_offset.
2012-03-19gdb/testsuite/Jan Kratochvil3-2/+28
* gdb.base/auxv.c (func2): setrlimit to infinity to enable core dumps. * gdb.base/auxv.exp: Try to compile it with -DUSE_RLIMIT first. (generate native core dump): Make the test unsupported if core cannot be generated.
2012-03-19gdb/Jan Kratochvil2-3/+20
Code cleanup. * python/py-auto-load.c (source_section_scripts): New variable back_to. Turn fclose and xfree calls into make_cleanup_fclose and make_cleanup with xfree. (auto_load_objfile_script): Turn fclose into make_cleanup_fclose.
2012-03-19gdb/Jan Kratochvil7-20/+111
* NEWS: Describe new options --init-command=FILE, -ix and --init-eval-command=COMMAND, -iex. * main.c (struct cmdarg): New enum items CMDARG_INIT_FILE and CMDARG_INIT_COMMAND. (captured_main): New enum items OPT_IX and OPT_IEX. Add "init-command", "init-eval-command", "ix" and "iex" to the variable long_options. Handle OPT_IX and OPT_IEX. Process them from CMDARG_VEC. New comment for CMDARG_FILE and CMDARG_COMMAND processing. (print_gdb_help): Describe --init-command=FILE, -ix and --init-eval-command=COMMAND, -iex. gdb/doc/ * gdb.texinfo (File Options): Describe --init-command=FILE, -ix and --init-eval-command=COMMAND, -iex. (Startup): Describe -iex and -ix. Simplify the example for "set auto-load-scripts off". gdb/testsuite/ * gdb.gdb/selftest.exp (do_steps_and_nexts): New entry for cmdarg_vec = NULL. Remove entries for cmdsize = 1, cmdarg = and ncmd = 0. New entry for VEC_cleanup cmdarg_s.
2012-03-19gdb/Jan Kratochvil2-36/+52
Code cleanup. * main.c (struct cmdarg): Move it here from main. Add more comments. (cmdarg_s, VEC (cmdarg_s)): New. (main): Move struct cmdarg from here. New variables cmdarg_vec and cmdarg_p. Remove variables cmdsize and ncmd and their initialization. Install cleanup for cmdarg_vec. Update filling for options 'x' and 'X'. Replace cmdarg processing by cmdarg_vec processing. Remove xfree of CMDARG.
2012-03-19 * gnu-v3-abi.c (gnuv3_print_vtable): Initialize 'result_vec'.Tom Tromey2-1/+5
2012-03-192012-03-19 Pedro Alves <palves@redhat.com>Pedro Alves2-2/+30
Jan Kratochvil <jan.kratochvil@redhat.com> * server.c (cont_thread, general_thread): Add describing comments. (start_inferior): Clear `cont_thread'. (handle_v_cont): Don't set `cont_thread' if resuming all threads of a process.
2012-03-19gdb/testsuite/Jan Kratochvil2-1/+5
* gdb.base/cond-eval-mode.exp: Fix the anticipated warning string.
2012-03-19Fix spellings of filenames.Doug Evans1-2/+2
2012-03-19*** empty log message ***gdbadmin1-1/+1
2012-03-18 * dg-extract-results.sh: Handle KFAILs.Doug Evans2-2/+10
2012-03-18*** empty log message ***gdbadmin1-1/+1
2012-03-17*** empty log message ***gdbadmin1-1/+1
2012-03-16gdb/Jan Kratochvil4-3/+16
PR symtab/13777 * dwarf2read.c (process_full_comp_unit): Set LOCATIONS_VALID only for GCC >=4.5. gdb/testsuite/ PR symtab/13777 * gdb.dwarf2/dw2-skip-prologue.S (DW_AT_producer): Set it to 4.5.0.
2012-03-162012-03-16 Chris January <chris.january@allinea.com>Tom Tromey2-4/+12
* tui-tui.win.c (tui_resize_all): Use erase and clearok instead of clear.
2012-03-162012-03-16 Chris January <chris.january@allinea.com>Tom Tromey2-1/+6
* source.c (add_path): Use memmove instead of strcpy because the strings overlap.
2012-03-16[Ada] Crash when trying to set value of packed array elementJoel Brobecker9-8/+149
Consider the following declaration: type Small is new Integer range 0 .. 2 ** 4 - 1; type Simple_Array is array (1 .. 4) of Small; pragma Pack (Simple_Array); SA : Simple_Array := (1, 2, 3, 4); Trying to change the value of one of the elements in the packed array causes the debugger to crash: (gdb) set sa(3) := 9 [1] 4880 segmentation fault gdb -q foo The circumstances leading to the crash are as follow: . ada_evaluate_subexp creates a value corresponding to "sa(3)". . ada_evaluate_subexp then tries to assign 9 to this value, and for this calls value_assign (via ada_value_assign). . Because the array is packed, the destination value is 3 bits long, and as a result, value_assign uses the parent to determine that element byte address and offset: | if (value_bitsize (toval)) | { | struct value *parent = value_parent (toval); | | changed_addr = value_address (parent) + value_offset (toval); The destination value (corresponding to "sa(3)") was incorrectly created by ada-lang.c:ada_value_primitive_packed_val, because the "parent" was left as NULL. So, when we try to dereference it to get the parent address, GDB crashed. The first part of the fix therefore consists in setting that field. This required the addition of a new "setter" in value.[hc]. It fixes the crash, but is still not sufficient for the assignment to actually work. The second part of the problem came from the fact that value_assign seems to expect the "child"'s address to be equal to the parent's address, with the difference being the offset. Unfortunately, this requirement was not followed by ada_value_primitive_packed_val, so the second part of the fix consisted in fixing that. Still, this was not sufficient, because it caused a regression when trying to perform an aggregate assignment of a packed array of packed record. The key element here is the nesting of packed entities. Looking at the way ada_value_primitive_packed_val creates the value of each sub-component, one can see that the value's offset is set to the offset compared to the start of the parent. This was meant to match what value_primitive_field does as well. So, with our array of records, if the record offset was 2, and if the field we're interested in that record is at offset 1, the record value's offset would be set to 2, and the field value's offset would be set to 1. But the address for both values would be left to the array's address. This is where things start breaking down, because the value_address function for our field value would return the address of the array + 1, instead of + 3. This is what causes the final issue, here, because ada-lang.c's value_assign_to_component needs to compute the offset of the subcomponent compared to the top-level aggregate's start address (the array in our case). And it does so by subtracting the array's address from the sub-component's address. When you have two levels of packed components, and the mid-level component is at an offset of the top-level component, things didn't work, because the component's address was miscomputed (the parent's offset is missing). The fix consists is fixing value_address to match the work done by value_primitive_field (where we ignore the parent's offset). gdb/ChangeLog: * value.h (set_value_parent): Add declaration. * value.c (set_value_parent): New function. (value_address): If VALUE->PARENT is not NULL, then use it as the base address instead of VALUE->LOCATION.address. * ada-lang.c (ada_value_primitive_packed_val): Keep V's address the same as OBJ's address. Adjust V's offset accordingly. Set V's parent. gdb/testsuite/ChangeLog: * gdb.ada/set_pckd_arr_elt: New testcase.
2012-03-16gdb:Gary Benson16-28/+2240
PR breakpoints/10738 * dwarf2read.c (use_deprecated_index_sections): New global. (struct partial_die_info): New member may_be_inlined. (read_partial_die): Set may_be_inlined where appropriate. (add_partial_subprogram): Add partial symbols for partial DIEs that may be inlined. (new_symbol_full): Add inlined subroutines to the current scope. (write_psymtabs_to_index): Bump version number. (dwarf2_read_index): Read only version 6 indices unless use_deprecated_index_sections is set. * linespec.c (symbol_and_data_callback): New structure. (iterate_inline_only): New function. (iterate_over_all_matching_symtabs): New argument "include_inline". If nonzero, also call the callback for symbols representing inlined subroutines. (lookup_prefix_sym): Pass extra argument to the above. (find_function_symbols): Likewise. (add_matching_symbols_to_info): Likewise. * NEWS: Mention that GDB can now set breakpoints on inlined functions. gdb/doc: PR breakpoints/10738 * gdb.texinfo (Inline Functions): Remove the now-unnecessary @item stating that GDB cannot set breakpoints on inlined functions. (Mode Options): Document --use-deprecated-index-sections. (Index Section Format): Document new index section version format. gdb/testsuite: PR breakpoints/10738 * gdb.opt/inline-break.exp: New file. * gdb.opt/inline-break.c: Likewise. * gdb.dwarf2/inline-break.exp: Likewise. * gdb.dwarf2/inline-break.S: Likewise. * gdb.base/annota1.exp: Cope with old .gdb_index warnings. * gdb.base/async-shell.exp: Likewise. * lib/mi-support.exp (library_loaded_re): Likewise.
2012-03-16 * p-typeprint.c (pascal_type_print_method_args):Pierre Muller2-2/+6
Fix display of parameter of methods.
2012-03-16 * amd64-windows-nat.c (_initialize_amd64_windows_nat):Pierre Muller2-0/+8
Add missing prototype.
2012-03-16gdb/Jan Kratochvil2-1/+8
Fix false compilation warning. * gnu-v3-abi.c (print_one_vtable): Initialize ADDR.
2012-03-16*** empty log message ***gdbadmin1-1/+1
2012-03-15 * arm-tdep.c: Include "remote.h" and "features/arm-with-m-fpa-layout.c".Jonathan Larmour4-1/+142
(arm_register_g_packet_guesses): New function. (arm_gdbarch_init): Don't force a target description with registers when the executable is detected as M-profile. Instead set gdbarch->tdep->is_m. Register `g' packet guesses. (_initialize_arm_tdep): Initialize the new target description. * features/arm-with-m-fpa-layout.xml: New description. * features/arm-with-m-fpa-layout.c: New, generated.
2012-03-15Problem after hitting breakpoint on Windows (with GDBserver)Joel Brobecker4-9/+43
When debugging on Windows with GDBserver, the debugger starts failing after hitting a breakpoint. For instance: (gdb) b foo Breakpoint 1 at 0x40177e: file foo.adb, line 5. (gdb) cont Continuing. Breakpoint 1, foo () at foo.adb:5 5 Put_Line ("Hello World."); -- STOP (gdb) n Program received signal SIGSEGV, Segmentation fault. 0x00401782 in foo () at foo.adb:5 5 Put_Line ("Hello World."); -- STOP There are two issues: 1. While trying to re-insert a breakpoint that is still inserted in memory, insert_bp_location wipes out the breakpoint location's shadow_contents. As a consequence, we cannot restore the proper instruction when removing the breakpoint anymore. That's why the inferior's behavior changes when trying to resume after the breakpoint was hit. 2. mem-break.c:default_memory_insert_breakpoint passes a breakpoint location's shadow_contents as the buffer for a memory read. This reveals a limitation of the various memory-read target functions. This patch documents this limitation and adjust the two calls that seem to hit that limitation. gdb/ChangeLog: * breakpoint.c (breakpoint_xfer_memory): Add assertion. Update function description. (insert_bp_location): Do not wipe bl->target_info out. * mem-break.c: #include "gdb_string.h". (default_memory_insert_breakpoint): Do not call target_read_memory with a pointer to the breakpoint's shadow_contents buffer. Use a local buffer instead. * m32r-tdep.c (m32r_memory_insert_breakpoint): Ditto.
2012-03-15 * NEWS: Mention "info vtbl", not "info vtable".Tom Tromey3-3/+9
* cp-support.c (info_vtbl_command): Fix comment. (_initialize_cp_support): Fix text.
2012-03-15 * cp-valprint.c (cp_print_value_fields): UseTom Tromey9-7/+33
print_function_pointer_address for vtable slot. gdb/testsuite * gdb.cp/virtfunc2.exp: Update expected output. * gdb.cp/pr9631.exp: Update expected output. * gdb.cp/member-ptr.exp: Update expected output. * gdb.cp/inherit.exp (test_print_mvi_classes): Update expected output. * gdb.cp/casts.exp: Update expected output.
2012-03-15 * gnu-v3-abi.c (struct value_and_voffset): New.Tom Tromey11-0/+359
(hash_value_and_voffset, eq_value_and_voffset) (compare_value_and_voffset, compute_vtable_size) (print_one_vtable, gnuv3_print_vtable): New functions. (init_gnuv3_ops): Initialize 'print_vtable' field. * cp-support.c (info_vtbl_command): New function. (_initialize_cp_support): Add "info vtbl". * cp-abi.h (cplus_print_vtable): Declare. (struct cp_abi_ops) <print_vtable>: New field. * cp-abi.c (cplus_print_vtable): New function. * NEWS: Update. gdb/testsuite * gdb.cp/virtfunc.exp (make_one_vtable_result): New proc. (test_info_vtbl): Likewise. (do_tests): Call test_info_vtbl. * gdb.cp/virtfunc.cc (va): New global. gdb/doc * gdb.texinfo (Debugging C Plus Plus): Document "info vtbl".
2012-03-15 * d-lang.c (d_language_defn) <la_iterate_over_symbols>: Set toTom Tromey2-1/+6
iterate_over_symbols.
2012-03-15gdb/gdbserver/Yao Qi2-25/+42
* tracepoint.c (install_tracepoint): Move duplicated tracepoint handling to ... (cmd_qtdp): ... here.
2012-03-15gdb/gdbserver/Yao Qi2-48/+114
* tracepoint.c (struct tracepoint_action_ops): New. (struct tracepoint_action) [!IN_PROCESS_AGENT] <ops>: New field. (m_tracepoint_action_download): New. (r_tracepoint_action_download): New. (x_tracepoint_action_download): New. (l_tracepoint_action_download): New. (add_tracepoint_action): Install `action->ops' according type. (download_tracepoint_1): Move code `download' function pointer of various tracepoint_action_ops.
2012-03-15gdb/testsuite/Thomas Schwinge14-169/+186
* gdb.dwarf2/dw2-ada-ffffffff.S: Use .4byte instead of .long for describing DWARF data structures. * gdb.dwarf2/dw2-bad-parameter-type.S: Likewise. * gdb.dwarf2/dw2-double-set-die-type.S: Likewise. * gdb.dwarf2/dw2-empty-pc-range.S: Likewise. * gdb.dwarf2/dw2-entry-value.S: Likewise. * gdb.dwarf2/dw2-modula2-self-type.S: Likewise. * gdb.dwarf2/dw2-param-error.S: Likewise. * gdb.dwarf2/dw2-skip-prologue.S: Likewise. * gdb.dwarf2/dw2-stack-boundary.S: Likewise. * gdb.dwarf2/dw4-sig-type-unused.S: Likewise. * gdb.dwarf2/implptr-optimized-out.S: Likewise. * gdb.dwarf2/member-ptr-forwardref.S: Likewise. * gdb.dwarf2/pr11465.S: Likewise.
2012-03-15 * dwarf2read.c (dwarf_stack_op_name): Add DW_OP_GNU_encoded_addr,Doug Evans2-0/+9
DW_OP_GNU_parameter_ref.
2012-03-15*** empty log message ***gdbadmin1-1/+1
2012-03-14gdb/Jan Kratochvil5-4/+64
Fix double prompt of 'interpreter-exec mi'. * mi/mi-interp.c (mi_execute_command_input_handler): New prototype. (mi_interpreter_resume): use it. (mi_execute_command_input_handler): New function. * mi/mi-main.c (mi_execute_command): Move prompt printing to mi_execute_command_input_handler. gdb/testsuite/ * gdb.mi/mi2-prompt.exp: New file.