aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-03-11Add the gdb remote target operations for branch tracing.Markus Metzger13-2/+489
We define the following packets: Qbtrace:bts enable branch tracing for the current thread returns "OK" or "Enn" Qbtrace:off disable branch tracing for the current thread returns "OK" or "Enn" qXfer:btrace:read read the full branch trace data for the current thread gdb/ * target.h (enum target_object): Add TARGET_OBJECT_BTRACE. * remote.c: Include btrace.h. (struct btrace_target_info): New struct. (remote_supports_btrace): New function. (send_Qbtrace): New function. (remote_enable_btrace): New function. (remote_disable_btrace): New function. (remote_teardown_btrace): New function. (remote_read_btrace): New function. (init_remote_ops): Add btrace ops. (enum <unnamed>): Add btrace packets. (struct protocol_feature remote_protocol_features[]): Add btrace packets. (_initialize_remote): Add packet configuration for branch tracing. gdbserver/ * target.h (struct target_ops): Add btrace ops. (target_supports_btrace): New macro. (target_enable_btrace): New macro. (target_disable_btrace): New macro. (target_read_btrace): New macro. * gdbthread.h (struct thread_info): Add btrace field. * server.c: Include btrace-common.h. (handle_btrace_general_set): New function. (handle_btrace_enable): New function. (handle_btrace_disable): New function. (handle_general_set): Call handle_btrace_general_set. (handle_qxfer_btrace): New function. (struct qxfer qxfer_packets[]): Add btrace entry. * inferiors.c (remove_thread): Disable btrace. * linux-low: Include linux-btrace.h. (linux_low_enable_btrace): New function. (linux_low_read_btrace): New function. (linux_target_ops): Add btrace ops. * configure.srv (i[34567]86-*-linux*): Add linux-btrace.o. Add srv_linux_btrace=yes. (x86_64-*-linux*): Add linux-btrace.o. Add srv_linux_btrace=yes. * configure.ac: Define HAVE_LINUX_BTRACE. * config.in: Regenerated. * configure: Regenerated.
2013-03-11Preserve a verbose error message of xfer functions if they return -3.Markus Metzger2-4/+18
gdbserver/ * server.c (handle_qxfer): Preserve error message if -3 is returned. (qxfer): Document the -3 return value.
2013-03-11Define the xml document style for transferring branch trace data.Markus Metzger5-1/+124
Add a function to parse a btrace xml document into a vector of branch trace blocks. gdb/ * features/btrace.dtd: New file. * Makefile.in (XMLFILES): Add btrace.dtd. * btrace.h (parse_xml_btrace): New declaration. * btrace.c: Include xml-support.h. (parse_xml_btrace): New function. (parse_xml_btrace_block): New function. (block_attributes): New struct. (btrace_attributes): New struct. (btrace_children): New struct. (btrace_elements): New struct.
2013-03-11Install the btrace target ops for i386-linux-nat and amd64-linux-nat.Markus Metzger5-2/+120
gdb/ * amd64-linux-nat.c: Include btrace.h and linux-btrace.h. (amd64_linux_enable_btrace): New. (amd64_linux_disable_btrace): New. (amd64_linux_teardown_btrace): New. (_initialize_amd64_linux_nat): Initialize btrace ops. * i386-linux.nat.c: Include btrace.h and linux-btrace.h. (i386_linux_enable_btrace): New. (i386_linux_disable_btrace): New. (i386_linux_teardown_btrace): New. (_initialize_i386_linux_nat): Initialize btrace ops. * config/i386/linux.mh: Add linux-btrace.o. * config/i386/linux64.mh: Add linux-btrace.o.
2013-03-11Implement branch tracing on Linux based on perf_event such that it can be sharedMarkus Metzger6-2/+528
between gdb and gdbserver. gdb/ * common/linux_btrace.h: New file. * common/linux_btrace.c: New file. * Makefile.in (SFILES): Add btrace.c. (HFILES_NO_SRCDIR): Add common/linux-btrace.h. (COMMON_OBS): Add btrace.o. (linux-btrace.o): New rule. gdbserver/ * Makefile.in (SFILES): Add $(srcdir)/common/linux-btrace.c. (linux_btrace_h): New variable. (linux-btrace.o): New rule.
2013-03-11Fix ChangeLog date.Markus Metzger1-1/+1
2013-03-11Add branch trace information to struct thread_info.Markus Metzger9-3/+801
Add functions to enable, disable, clear, and fetch a thread's branch trace. gdb/ * target.h: Include btrace.h. (struct target_ops) <to_supports_btrace, to_enable_btrace, to_disable_btrace, to_teardown_btrace, to_read_btrace>: New. * target.c (target_supports_btrace): New function. (target_enable_btrace): New function. (target_disable_btrace): New function. (target_teardown_btrace): New function. (target_read_btrace): New function. * btrace.h: New file. * btrace.c: New file. * Makefile.in: Add btrace.c. * gdbthread.h: Include btrace.h. (struct thread_info): Add btrace field. * thread.c: Include btrace.h. (clear_thread_inferior_resources): Call target_teardown_btrace. * common/btrace-common.h: New file.
2013-03-11*** empty log message ***gdbadmin1-1/+1
2013-03-10 * gold.cc (queue_middle_tasks): Move detect_odr_violations..Alan Modra9-38/+342
* layout.cc (Layout_task_runner::run): ..to here. * symtab.h (struct Symbol_location): Extract from.. (class Symbol_table): ..here. * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location. * target.h (class Target): Add function_location and do_function_location functions. (class Sized_target): Add do_function_location. * object.h (class Sized_relobj_file): Move find_shdr.. (class Object): ..to here. * object.cc: Likewise. Update to suit. Instantiate. (Sized_relobj_file::find_eh_frame): Update find_shdr call. * powerpc.cc (class Powerpc_dynobj): New. (Target_powerpc::do_function_location): New function. (Powerpc_relobj::do_find_special_sections): Update find_shdr call. (Powerpc_dynobj::do_read_symbols): New function. (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
2013-03-10daily updateAlan Modra1-1/+1
2013-03-10gdb/Jan Kratochvil2-23/+21
* common/linux-ptrace.c (linux_ptrace_test_ret_to_nx): Call also kill for CHILD, ignore PTRACE_KILL errors, move the inner block variable kill_status to outer block.
2013-03-10gdb/Jan Kratochvil6-1/+792
Fix entry-values if the callee called a noreturn function. * dwarf2-frame-tailcall.c (dwarf2_tailcall_sniffer_first): Use get_frame_address_in_block. Add new comment. gdb/testsuite/ Fix entry-values if the callee called a noreturn function. * gdb.arch/amd64-tailcall-noret.S: New file. * gdb.arch/amd64-tailcall-noret.c: New file. * gdb.arch/amd64-tailcall-noret.exp: New file.
2013-03-10gdb/Jan Kratochvil9-4/+768
Fix entry-values in C++ across CUs. * dwarf2loc.c (call_site_to_target_addr) <FIELD_LOC_KIND_PHYSNAME>: Use lookup_minimal_symbol. Add a comment. * dwarf2read.c (read_call_site_scope) <is_ref_attr> <die_is_declaration>: Prefer DW_AT_linkage_name. gdb/testsuite/ Fix entry-values in C++ across CUs. * gdb.arch/amd64-tailcall-cxx.exp: New file. * gdb.arch/amd64-tailcall-cxx1.S: New file. * gdb.arch/amd64-tailcall-cxx1.cc: New file. * gdb.arch/amd64-tailcall-cxx2.S: New file. * gdb.arch/amd64-tailcall-cxx2.cc: New file.
2013-03-10*** empty log message ***gdbadmin1-1/+1
2013-03-09daily updateAlan Modra1-1/+1
2013-03-092013-03-09 Hafiz Abid Qadeer <abidh@codesourcery.com>Hafiz Abid Qadeer4-5/+5
Fixed year number in Changelog files.
2013-03-09Fix last commit.Eli Zaretskii2-3/+8
doc/gdb.texinfo (General Query Packets, Tracepoint Packets): Don't use colons in @anchor and @cindex entries.
2013-03-092012-03-09 Hafiz Abid Qadeer <abidh@codesourcery.com>Hafiz Abid Qadeer2-0/+6
* gdb.texinfo (QTBuffer:size): Add cindex and anchor.
2013-03-09*** empty log message ***gdbadmin1-1/+1
2013-03-08daily updateAlan Modra1-1/+1
2013-03-08 * options.cc (General_options::string_to_object_format): AcceptIan Lance Taylor2-1/+6
"default".
2013-03-08 * elf64-aarch64.c (elf_backend_can_gc_sections): EnableNick Clifton4-21/+161
gc-section support. (elf64_aarch64_gc_sweep_hook): Handle GOT, TLS and PLT related relocs. * lib/ld-lib.exp (check_gc_sections_available): Remove aarch64 from list of targets that don't support gc-section.
2013-03-08 PR binutils/15241Nick Clifton4-3/+20
* lm32.cpu (Control and status registers): Add CFG2, PSW, TLBVADDR, TLBPADDR and TLBBADVADDR. * lm32-desc.c: Regenerate.
2013-03-08 * elf-bfd.h (elfcore_write_s390_tdb): Add prototype.Nick Clifton7-11/+52
* elf.c (elfcore_write_s390_tdb): New function. (elfcore_write_register_note): Call it. (elfcore_grok_s390_tdb): New function. (elfcore_grok_note): Call it. * readelf.c (get_note_type): Add NT_S390_TDB.
2013-03-08gdb/Yao Qi2-3/+7
* tracepoint.c (_initialize_tracepoint): Indent the code.
2013-03-08find command, fix -Wpoint-signPedro Alves2-5/+11
From: Pedro Alves <palves@redhat.com> The find command's patter/buffer that is passed to the target is a binary blob, not a string. $ make WERROR_CFLAGS="-Wpointer-sign -Werror" findcmd.o -k 2>&1 1>/dev/null ../../src/gdb/findcmd.c: In function ‘find_command’: ../../src/gdb/findcmd.c:278:6: error: pointer targets in passing argument 3 of ‘target_search_memory’ differ in signedness [-Werror=pointer-sign] In file included from ../../src/gdb/findcmd.c:26:0: ../../src/gdb/target.h:1582:12: note: expected ‘const gdb_byte *’ but argument is of type ‘char *’ gdb/ 2013-03-08 Pedro Alves <palves@redhat.com> * findcmd.c (put_bits): Change type of parameter to 'gdb_byte *'. (parse_find_args, find_command): Change type of pattern buffer locals to 'gdb_byte *'.
2013-03-082012-03-08 Stan Shebs <stan@codesourcery.com>Hafiz Abid Qadeer14-6/+360
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.
2013-03-08 * remote-m32r-sdi.c (m32r_load): Call skip_spaces on correctTom Tromey2-1/+6
variable.
2013-03-08 * elfxx-mips.c (mips_elf_allocate_lazy_stub): Correct data type.Maciej W. Rozycki2-1/+5
2013-03-082013-03-08 Chung-Lin Tang <cltang@codesourcery.com>Chung-Lin Tang5-4/+25
* write.h (struct fix): Add fx_dot_frag field. (dot_frag): Declare. * write.c (dot_frag): New variable. (fix_new_internal): Set fx_dot_frag field with dot_frag. (fixup_segment): Base calculation of fx_offset with fx_dot_frag. * expr.c (expr): Save value of frag_now in dot_frag when setting dot_value. * read.c (emit_expr): Likewise. Delete comments.
2013-03-08*** empty log message ***gdbadmin1-1/+1
2013-03-07target.c: fix -Wpointer-signPedro Alves2-6/+13
$ make WERROR_CFLAGS="-Wpointer-sign -Werror" target.o -k 2>&1 1>/dev/null ../../src/gdb/target.c: In function ‘target_read_stralloc’: ../../src/gdb/target.c:2376:3: error: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Werror=pointer-sign] In file included from build-gnulib/import/string.h:27:0, from ../../src/gdb/common/gdb_string.h:24, from ../../src/gdb/target.c:24: /usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘gdb_byte *’ ... This is about the same as the previous patch. Functions that take or return ascii-ish string arguments usually use char* for parameters/return. That means that at points we call into target methods that work with binary blobs, we need casts to/from gdb_byte*/char*. To choose which type for the variables, I usually go based on which requires the fewer casts, and what the contents of the variable are supposed to hold, which often gives the same answer. gdb/ 2013-03-07 Pedro Alves <palves@redhat.com> * target.c (target_read_stralloc, target_fileio_read_alloc): *Cast pointer to 'gdb_byte *' in target call.
2013-03-07corefile.c: fix -Wpointer-signPedro Alves2-1/+6
$ make WERROR_CFLAGS="-Wpointer-sign -Werror" corefile.o -k 2>&1 1>/dev/null ../../src/gdb/corefile.c: In function ‘read_memory_string’: ../../src/gdb/corefile.c:334:7: error: pointer targets in passing argument 2 of ‘read_memory’ differ in signedness [-Werror=pointer-sign] ../../src/gdb/corefile.c:217:1: note: expected ‘gdb_byte *’ but argument is of type ‘char *’ Functions that take or return ascii-ish string arguments usually use char* for parameters/return. That means that at points we call into target methods that work with binary blobs, we need casts to gdb_byte*. gdb/ 2013-03-07 Pedro Alves <palves@redhat.com> * corefile.c (read_memory_string): Cast pointer to gdb_byte* in call.
2013-03-07 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather thanAlan Modra3-24/+27
pointer to Post_fde. (struct Post_fde): Move definition to here.. * ehframe.cc (struct Post_fde): ..from here. (Cie::write): Don't alloc Post_fde. (Eh_frame::do_sized_write): Update. Don't free Post_fde.
2013-03-07daily updateAlan Modra1-1/+1
2013-03-07 * breakpoint.c (catch_syscall_split_args): Use skip_spaces.Keith Seitz21-131/+134
(trace_pass_command): Likewise. * cli/cli-cmds.c: Include cli/cli-utils.h. (source_command): Use skip-spaces. (disassemble_command): Likewise. * findcmd.c: Include cli/cli-utils.h. (parse_find_args): Use skip_spaces. * go32-nat.c: Include cli/cli-utils.h. (go32_sldt): Use skip_spaces. (go32_sgdt): Likewise. (go32_sidt): Likewise. (go32_pde): Likewise. (go32_pte): Likewise. (go32_pte_for_address): Likewise. * infcmd.c: Include cli/cli-utils.h. (registers_info): Use skip_spaces. * linux-tdep.c (read_mapping): Use skip_spaces_const. (linux_info_proc): Likewise. * linux-thread-db.c: Include cli/cli-utils.h. (info_auto_load_libthread_db): Use skip_spaces_const. * m32r-rom.c: Include cli/cli-utils.h. (m32r_upload_command): Use skip_spaces. * maint.c: Include cli/cli-utils.h. (maintenance_translate_address): Use skip_spaces. * mi/mi-parse.c: Include cli/cli-utils.h. (mi_parse_argv): Use skip_spaces. (mi_parse): Likewise. * minsyms.c: Include cli/cli-utils.h. (msymbol_hash_iw): Use skip_spaces_const. * objc-lang.c: Include cli/cli-utils.h. (parse_selector): Use skip_spaces. (parse_method): Likewise. * python/python.c: Include cli/cli-utils.h. (python_interactive_command)[HAVE_PYTHON]: Use skip_spaces. (python_command)[HAVE_PYTHON]: Likewise. (python_interactive_command)[!HAVE_PYTHON]: Likewise. * remote-m32r-sdi.c: Include cli/cli-utils.h. (m32r_load): Use skip_spaces. * serial.c: Include cli/cli-utils.h. (serial_open): Use skip_spaces_const. * stack.c: Include cli/cli-utils.h. (parse_frame_specification_1): Use skip_spaces_const. * symfile.c: Include cli/cli-utils.h. (set_ext_lang_command): Use skip_spaces. * symtab.c: Include cli/cli-utils.h. (rbreak_command): Use skip_spaces. * thread.c (thread_name_command): Use skip_spaces. * tracepoint.c (validate_actionline): Use skip_spaces. (encode_actions_1): Likewise. (trace_find_range_command): Likewise. (trace_find_outside_command): Likewise. (trace_dump_actions): Likewise.
2013-03-07Rewrote i386_index_checkH.J. Lu2-121/+111
* config/tc-i386.c (flag_code_names): Removed. (i386_index_check): Rewrote.
2013-03-07Fix -Wpointer-sign around strings/encoding conversions.Pedro Alves6-9/+21
Trimmed for brevity: $ make WERROR_CFLAGS="-Wpointer-sign -Werror" c-lang.o expprint.o utils.o valprint.o varobj.o -k 2>&1 1>/dev/null ../../src/gdb/c-lang.c: In function ‘parse_one_string’: ../../src/gdb/c-lang.c:540:8: error: pointer targets in passing argument 3 of ‘convert_between_encodings’ differ in signedness [-Werror=pointer-sign] In file included from ../../src/gdb/c-lang.c:30:0: ../../src/gdb/charset.h:64:6: note: expected ‘const gdb_byte *’ but argument is of type ‘char *’ ../../src/gdb/expprint.c: In function ‘print_subexp_standard’: ../../src/gdb/expprint.c:205:2: error: pointer targets in passing argument 3 of ‘current_language->la_printstr’ differ in signedness [-Werror=pointer-sign] ../../src/gdb/expprint.c:205:2: note: expected ‘const gdb_byte *’ but argument is of type ‘char *’ cc1: all warnings being treated as errors make: *** [expprint.o] Error 1 ../../src/gdb/utils.c: In function ‘host_char_to_target’: ../../src/gdb/utils.c:1474:9: error: pointer targets in passing argument 3 of ‘convert_between_encodings’ differ in signedness [-Werror=pointer-sign] ../../src/gdb/varobj.c: In function ‘value_get_print_value’: ../../src/gdb/varobj.c:2934:8: error: pointer targets in return differ in signedness [-Werror=pointer-sign] ../../src/gdb/varobj.c:2968:12: error: pointer targets in assignment differ in signedness [-Werror=pointer-sign] ../../src/gdb/varobj.c:2971:3: error: pointer targets in return differ in signedness [-Werror=pointer-sign] cc1: all warnings being treated as errors make: *** [varobj.o] Error 1 As with the previous patch, the encoding conversion code works with gdb_byte arrays as the generic buffers that hold strings of any encoding/width. This patch adds casts where appropriate. gdb/ 2013-03-07 Pedro Alves <palves@redhat.com> * c-lang.c (parse_one_string): Cast argument to gdb_byte *. * expprint.c (print_subexp_standard): Likewise. * utils.c (host_char_to_target): Likewise. * valprint.c (generic_emit_char, generic_printstr): Likewise. * varobj.c (value_get_print_value): Change type of local to char*. Cast it gdb_byte * in call to language printer.
2013-03-07charset.c: fix -Wpointer-signPedro Alves2-3/+10
$ make WERROR_CFLAGS="-Wpointer-sign -Werror" charset.o 2>&1 1>/dev/null ../../src/gdb/charset.c: In function ‘wchar_iterate’: ../../src/gdb/charset.c:665:13: error: pointer targets in assignment differ in signedness [-Werror=pointer-sign] ../../src/gdb/charset.c:691:13: error: pointer targets in assignment differ in signedness [-Werror=pointer-sign] ../../src/gdb/charset.c:706:12: error: pointer targets in assignment differ in signedness [-Werror=pointer-sign] The encoding conversion code works with gdb_byte arrays as the generic buffers that hold strings of any encoding/width. Changing the type of this field to gdb_byte* removes the need for one cast, and makes everything work with the same types. That's good -- WRT to strings, "char *" is (almost) consistently throughout GDB only used for ascii-ish strings. gdb/ 2013-03-07 Pedro Alves <palves@redhat.com> * charset.c (struct wchar_iterator) <input>: Change type to 'const gdb_byte *'. (make_wchar_iterator): Remove cast to char*. (wchar_iterate): Change type of local.
2013-03-07regcache.c: fix -Wpointer-signPedro Alves2-2/+7
$ make WERROR_CFLAGS="-Wpointer-sign -Werror" regcache.o 2>&1 1>/dev/null ../../src/gdb/regcache.c: In function ‘regcache_xmalloc_1’: ../../src/gdb/regcache.c:228:2: error: pointer targets in assignment differ in signedness [-Werror=pointer-sign] ../../src/gdb/regcache.c:235:2: error: pointer targets in assignment differ in signedness [-Werror=pointer-sign] cc1: all warnings being treated as errors regcache->register_status is "signed char". gdb/ 2013-03-07 Pedro Alves <palves@redhat.com> * regcache.c (regcache_xmalloc_1): Call XCALLOC with signed char for 'regcache->register_status'.
2013-03-07Fix typo.Pedro Alves1-1/+1
2013-03-07breakpoint.c: fix -Wpointer-signPedro Alves2-1/+6
$ make WERROR_CFLAGS="-Wpointer-sign -Werror" breakpoint.o 2>&1 1>/dev/null ../../src/gdb/breakpoint.c: In function ‘breakpoint_xfer_memory’: ../../src/gdb/breakpoint.c:1578:2: error: pointer targets in passing argument 3 of ‘gdbarch_breakpoint_from_pc’ differ in signedness [-Werror=pointer-sign] In file included from ../../src/gdb/defs.h:644:0, from ../../src/gdb/breakpoint.c:20: ../../src/gdb/gdbarch.h:495:25: note: expected ‘int *’ but argument is of type ‘unsigned int *’ target_info.placed_size is an 'int', and gdbarch_breakpoint_from_pc takes an int too. gdb/ 2013-03-07 Pedro Alves <palves@redhat.com> * breakpoint.c.c (breakpoint_xfer_memory): Change type of local to int.
2013-03-07stap-probe.c: fix -Wpointer-signPedro Alves2-1/+5
$ make WERROR_CFLAGS="-Wpointer-sign -Werror" stap-probe.o 2>&1 1>/dev/null ../../src/gdb/stap-probe.c: In function ‘handle_stap_probe’: ../../src/gdb/stap-probe.c:1306:19: error: pointer targets in assignment differ in signedness [-Werror=pointer-sign] cc1: all warnings being treated as errors make: *** [stap-probe.o] Error 1 provider is a string, so it's rightfully a char*. 'data' holds raw bytes (bfd_byte), so a cast is the right thing to do. gdb/ 2013-03-07 Pedro Alves <palves@redhat.com> * stap-probe.c (handle_stap_probe): Add cast to char*.
2013-03-07linux-record.c:record_linux_system_call: fix -Wpointer-signPedro Alves2-3/+10
$ make WERROR_CFLAGS="-Wpointer-sign -Werror" linux-record.o 2>&1 1>/dev/null ... ../../src/gdb/linux-record.c: In function ‘record_linux_system_call’: ../../src/gdb/linux-record.c:1152:9: error: pointer targets in passing argument 3 of ‘regcache_raw_read_signed’ differ in signedness [-Werror=pointer-sign] In file included from ../../src/gdb/linux-record.c:23:0: ../../src/gdb/regcache.h:76:3: note: expected ‘long int *’ but argument is of type ‘long unsigned int *’ ../../src/gdb/linux-record.c:1186:13: error: pointer targets in passing argument 3 of ‘regcache_raw_read_signed’ differ in signedness [-Werror=pointer-sign] In file included from ../../src/gdb/linux-record.c:23:0: ../../src/gdb/regcache.h:76:3: note: expected ‘long int *’ but argument is of type ‘long unsigned int *’ I believe the read_signed calls are correct, and the variables are in the wrong. Tested on x86_64 Fedora 17. gdb/ 2013-03-07 Pedro Alves <palves@redhat.com> * linux-record.c (record_linux_system_call) <gdb_sys_msgrcv, RECORD_MSGRCV>: Pass a signed variable to regcache_raw_read_signed, instead of an unsigned one.
2013-03-07remote-notif.[h|c]:notif_debug: Change type to int.Pedro Alves3-2/+7
notif_debug is installed as variable of a "signed" command: add_setshow_boolean_cmd ("notification", no_class, &notif_debug, _("\ and: command.h:extern void add_setshow_boolean_cmd (char *name, command.h- enum command_class class, command.h- int *var, 2013-03-07 Pedro Alves <palves@redhat.com> * remote-notif.c (notif_debug): Change type to int. * remote-notif.h (notif_debug): Likewise.
2013-03-07ser-tcp.c:tcp_retry_limit: Change type to unsigned int.Pedro Alves2-1/+5
tcp_retry_limit is installed as variable of an unsigned command: add_setshow_uinteger_cmd ("connect-timeout", class_obscure, &tcp_retry_limit, _("\ and I found no uses of the variable treating it as signed (like < 0 checks or some such). 2013-03-07 Pedro Alves <palves@redhat.com> * ser-tcp.c (tcp_retry_limit): Change type to unsigned int.
2013-03-07hex2bin, bin2hex: move declarations to header.Pedro Alves4-7/+10
Move the declarations to a header, rather than declaring them in (multiple) .c files. gdb/ 2013-03-07 Pedro Alves <palves@redhat.com> * remote.c (hex2bin, bin2hex): Move extern declarations to ... * remote.h (hex2bin, bin2hex): ... here. * tracepoint.c (hex2bin, bin2hex): Remove extern declarations.
2013-03-07gdb/gdbserver/Yao Qi2-8/+16
* tracepoint.c (cur_action, cur_step_action): Make them unsigned. (cmd_qtfp): Initialize cur_action and cur_step_action 0 instead of -1. (cmd_qtsp): Adjust condition. Do post increment. Set cur_action and cur_step_action back to 0.
2013-03-07 * utils.c (initialize_utils): Improve doc strings of "set/showEli Zaretskii2-7/+19
width", "set/show height", and "set/show pagination".
2013-03-07PR gdb/15236: gdbserver write to linux memory with zero length corrupts stackPedro Alves2-1/+13
PROBLEM: The function linux_write_memory () in linux-low.c allocates a buffer on the stack to hold a copy of the data to be written. register PTRACE_XFER_TYPE *buffer = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE)); "count" is the number of bytes to be written, rounded up to the nearest multiple of sizeof (PTRACE_XFER_TYPE) and allowing for not being an aligned address. The function later uses buffer[0] = ptrace (PTRACE_PEEKTEXT, pid, (PTRACE_ARG3_TYPE) (uintptr_t) addr, 0); The problem is that this function can be called to write zero bytes on an aligned address, for example when receiving an X packet of length 0 (used to test if 8-bit write is supported). Under these circumstances, count can be zero. Since in this case, buffer[0] may never have been allocated, the stack is corrupted and gdbserver may crash. SOLUTION: Writing zero bytes should always succeed. The patch below returns successfully early if the length is zero, so avoiding the stack corruption. Verified on the ARC GDB 7.5.1 port. 2013-03-07 Jeremy Bennett <jeremy.bennett@embecosm.com> PR server/15236 * linux-low.c (linux_write_memory): Return early success if LEN is zero.