• R/O
  • HTTP
  • SSH
  • HTTPS

List of commits

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


users/pkoning/multi-target
RSS
修訂. 時間 作者
21b9235 users/pkoning/multi-target 2015-10-29 04:34:35 Paul Koning

turn remote into a to_xclose target

this turns the remote into a to_xclose target
it now subclasses target_ops and puts the remote state there

this isn't really complete unfortunately
I think remote_protocol_packets must be made per-remote
also perhaps the "notif" stuff -- I forget

2014-07-29 Tom Tromey <tromey@redhat.com>

* remote.c (remote_ops, extended_remote_ops): Move earlier.
(struct remote_ops_with_data): New.
(remote_state): Remove.
(REMOTE_TARGET_STRATUM): New define.
(get_remote_state_raw): Redefine.
(new_remote_state): Return void and take a remote_state as a
parameter. Update.
(destroy_remote_state): New function.
(get_remote_state): Return NULL if get_remote_state_raw does.
(init_remote_state, get_remote_packet_size, remote_threads_info)
(remote_threads_extra_info): Check for rs==NULL.
(remote_xclose): Rename from remote_close. Call
destroy_remote_state. Free "self".
(remote_unpush_target): Use REMOTE_TARGET_STRATUM.
(remote_open_1): Check for rs==NULL. Use TARGET_NEW.
(discard_pending_stop_replies): Check for rs==NULL.
(remote_mourn_1): Update comment.
(packet_command, remote_file_put, remote_file_get)
(remote_file_delete): Check for rs==NULL.
(init_remote_ops): Set to_xclose, not to_close. Use
REMOTE_TARGET_STRATUM.
(remote_new_objfile, set_range_stepping): Check for rs==NULL.
(_initialize_remote): Don't call new_remote_state.

1343336 2015-10-28 00:55:40 Paul Koning

turn linux-thread-db into a to_xclose target

2014-07-29 Tom Tromey <tromey@redhat.com>

* linux-thread-db.c (thread_db_xclose): New function.
(init_thread_db_ops): Set to_xclose.
(try_thread_db_load_1): Push a new instance of the target.

e0063bd 2015-10-27 04:53:37 Paul Koning

fix exec_close to be multi-target-aware

This changes exec_close so it doesn't close inferiors from other
targets.

2014-07-29 Tom Tromey <tromey@redhat.com>

* target.h (target_stack_decref_cleanup): Declare.
* exec.c (exec_xclose_1): Skip program spaces from other targets.
* target.c (target_stack_decref_cleanup): New function.

357d827 2015-10-27 04:26:16 Paul Koning

introduce the target stack

there's a huge hack in multi_target_compatible

2014-07-29 Tom Tromey <tromey@redhat.com>

* target-delegates.c: Rebuild.
* make-target-delegates (write_debugmethod): Update for change to
debug_target.
* progspace.c (add_program_space): Acquire a reference to the
target stack.
(release_program_space): Release reference to the program space.
(set_current_program_space): Set the target stack.
* progspace.h (struct program_space) <target_stack>: New field.
* target.c (target_ops_ptr): New typedef.
(struct target_stack): New.
(target_stack): Change type.
(current_target): Update comment.
(update_current_target): Update.
(multi_target_compatible, ensure_multi_target_ok): New functions.
(push_target): Update. Add multi-target check.
(unpush_target, pop_all_targets_above, target_is_pushed)
(target_info, target_require_runnable): Update.
(target_stack_set): New global.
(currently_multi_target, target_stack_incref, target_stack_decref)
(target_stack_set_current, new_target_stack): New functions.
(maintenance_print_target_stack): Update.
(initialize_targets): Initialize target_stack_set, target_stack.
Update.
(target_stack_id): New function.
(next_available_target_id): New global.
(print_one_target_stack): New function.
(maintenance_print_target_stack): Move earlier. Rewrite.
(debug_target): Remove.
(debug_to_open, setup_target_debug): Update.
* target.h (target_stack_incref, target_stack_decref)
(target_stack_set_current, new_target_stack, target_stack_id):
Declare.
* testsuite/gdb.base/auto-connect-native-target.exp: Update.

97bc1d4 2015-10-24 05:29:54 Paul Koning

Use target_gdbarch in corefile handling

This changes corelow.c to use target_gdbarch() -- i.e., the gdbarch
of the current inferior -- once the inferior has been set up. This
ensures that setup such as fetching processor option specific flags
carries over.

95ba86d 2015-10-20 04:16:46 Paul Koning

convert current_target to be a pointer

This converts current_target to be a pointer rather than a struct.
This is more efficient when we move to multi-target, because then we
can switch targets by simply changing the pointer.

I made this patch by running this:

perl -pi -e 's/&current_target/current_target/g; s/current_target\./current_target->/g;' *.[chyl] */*.[chyl]

... and then fixing up the result minorly:

* Updating the definition and declaration of current_target
* Fixing a "sizeof"
* Initializing current_target

Built and regtested on x86-64 Fedora 20.

2014-07-29 Tom Tromey <tromey@redhat.com>

* target.c (current_target): Now a pointer.
(update_current_target): Use size of target_ops, not
current_target.
(initialize_targets): Initialize current_target.
* target.h (current_target): Now a pointer.
* auxv.c: Update.
* avr-tdep.c: Update.
* breakpoint.c: Update.
* corefile.c: Update.
* elfread.c: Update.
* eval.c: Update.
* frame.c: Update.
* gnu-v3-abi.c: Update.
* ia64-hpux-tdep.c: Update.
* ia64-tdep.c: Update.
* ia64-vms-tdep.c: Update.
* infcall.c: Update.
* infcmd.c: Update.
* infrun.c: Update.
* linespec.c: Update.
* linux-nat.c: Update.
* linux-tdep.c: Update.
* linux-thread-db.c: Update.
* mi/mi-main.c: Update.
* minsyms.c: Update.
* parse.c: Update.
* ppc-linux-nat.c: Update.
* ppc-linux-tdep.c: Update.
* procfs.c: Update.
* remote-m32r-sdi.c: Update.
* remote.c: Update.
* s390-linux-nat.c: Update.
* s390-linux-tdep.c: Update.
* sol-thread.c: Update.
* solib-aix.c: Update.
* solib-darwin.c: Update.
* solib-dsbt.c: Update.
* solib-ia64-hpux.c: Update.
* solib-irix.c: Update.
* solib-osf.c: Update.
* solib-spu.c: Update.
* solib-svr4.c: Update.
* solib-target.c: Update.
* solib.c: Update.
* sparc-tdep.c: Update.
* spu-tdep.c: Update.
* symfile.c: Update.
* target-descriptions.c: Update.
* target-memory.c: Update.
* target.c: Update.
* target.h: Update.
* tracepoint.c: Update.
* valops.c: Update.
* valprint.c: Update.
* value.c: Update.
* windows-tdep.c: Update.

3101915 2015-10-17 03:52:29 Paul Koning

convert exec target to to_xclose

This converts the exec target to use to_xclose, to make it suitable
for multi-target.

2014-07-29 Tom Tromey <tromey@redhat.com>

* exec.c (exec_xclose_1): Rename from exec_close_1. Free "self".
(add_target_sections): Push a new target instance.
(section_table_read_available_memory): Don't refer to "exec_ops".
(set_section_command): Likewise.
(init_exec_ops): Set to_xclose, not to_close.

22855f3 2015-10-17 03:06:43 Paul Koning

remove to_data

There's no reason to have to_data.

On the one hand, a to_xclose target can readily subclass target_ops.
This is simple and clean.

On the other hand, a to_close target can't really use to_data in the
multi-target future, because such a target is inherently not
multi-capable.

So, this patch removes the field and fixes up its sole user.

2014-07-29 Tom Tromey <tromey@redhat.com>

* bfd-target.c (struct target_bfd_ops): Rename from
target_bfd_data. Add "base" field.
(target_bfd_xfer_partial, target_bfd_get_section_table)
(target_bfd_xclose, target_bfd_reopen): Update.
* target.h (struct target_ops) <to_data>: Remove.

f218947 2015-10-16 05:25:49 Paul Koning

convert corelow to to_xclose

This converts corelow to be a to_xclose target. It moves all the
corelow-related globals into a new subclass of target_ops and arranges
for core_open to push an instance of this.

This is preparatory work for multi-target. After this patch, corelow
doesn't rely on global state and multiple instances can readily be
instantiated.

2014-07-29 Tom Tromey <tromey@redhat.com>

* corelow.c (struct core_target_ops_with_data): New struct.
(core_vec, core_gdbarch, core_data): Remove. Now fields of
core_target_ops_with_data.
(sniff_core_bfd): Add core_gdbarch parameter.
(get_core_target_ops): New function.
(core_xclose): Rename from core_close. Update for
core_target_ops_with_data. Free the target.
(core_close_cleanup): Rename parameter. Update.
(core_open): Use TARGET_NEW. Update.
(get_core_register_section, get_core_registers, core_files_info)
(core_xfer_partial, core_read_description, core_pid_to_str): Use
get_core_target_ops. Update.
(init_core_ops): Set to_xclose, not to_close.
* target.c (allocate_target): New function.
* target.h (allocate_target): Declare.
(TARGET_NEW): New macro.

1f92c67 2015-10-15 05:03:09 Paul Koning

add to_identity

Right now a target_ops has an odd sense of identity.

Most times some identity is needed, a pointer to a static object is
passed in. For example, calls to unpush_target generally work like
this:

unpush_target (&exec_ops);

Conceptually this is a kind of "instanceof" checking.

Now, consider this with "to_xclose" targets. In this case the
target_ops is allocated on the heap and there's no good way to talk
about the identity. Code could remember the pointer, of course, but
this usually just begs the question.

For example in a to_open implementation it is reasonably normal to
check target_is_pushed and then do nothing if the target is pushed.
However, there's no reasonable way way to do this with a to_xclose
target.

This patch introduces a to_identity field that just points to the
"prototype" implementation of a target_ops. This lets us convert
targets to to_xclose without difficulty.

2014-07-29 Tom Tromey <tromey@redhat.com>

* bfd-target.c (target_bfd_reopen): Set to_identity.
* target.c (complete_target_initialization): Set to_identity.
(unpush_target): Check to_identity. Call target_close on the real
target.
(target_is_pushed): Check to_identity.
* target.h (struct target_ops) <to_identity>: New field.

41f0b53 2015-10-14 03:53:43 Paul Koning

move core_bfd to program space

This moves the core_bfd global to be a field of the program space. It
then replaces core_bfd with a macro to avoid a massive patch -- the
same approach taken for various other program space fields.

This patch is a basic transformation for eventual multi-target work.

2014-07-29 Tom Tromey <tromey@redhat.com>

* corefile.c (core_bfd): Remove.
* gdbcore.h (core_bfd): Now a macro.
* progspace.h (struct program_space) <cbfd>: New field.

c5bcd27 2015-10-09 23:12:22 Simon Marchi

i386: Fix type of gdbarch_tdep::register_reggroup_p

gdb/ChangeLog:

* i386-tdep.h (struct gdbarch_tdep): Change type of
register_reggroup_p to gdbarch_register_reggroup_p_ftype.

78c5b88 2015-10-09 23:12:21 Simon Marchi

cris: Use enum bfd_endian to represent endianness

gdb/ChangeLog:

* cris-tdep.c (struct instruction_environment): Change type of
byte_order to enum bfd_endian.

f9fa37b 2015-10-09 23:12:21 Simon Marchi

arm-linux-tdep: Add explicit cast for int to gdb_syscall conversion

This patch is taken from Pedro's branch.

gdb/ChangeLog:

* arm-linux-tdep.c (arm_canonicalize_syscall): Add
enum gdb_syscall casts.

7c543f7 2015-10-09 23:08:23 Simon Marchi

Change some void* to gdb_byte*

There are a bunch of places where a void* is implicitely casted into a
gdb_byte*. The auto-insert-casts script added explicit casts at those
places. However, in many cases, it makes more sense to just change the
void* to a gdb_byte*.

gdb/ChangeLog:

* aarch64-tdep.c (stack_item_t): Change type of data to gdb_byte*.
* arm-tdep.c (struct stack_item): Likewise.
(push_stack_item): Add gdb_byte* cast.
* avr-tdep.c (struct stack_item): Change type of data to gdb_byte*.
(push_stack_item): Add gdb_byte* cast.
* cli/cli-dump.c (dump_memory_to_file): Change type of buf to gdb_byte*
and add cast.
* cris-tdep.c (struct stack_item): Change type of data to gdb_byte*.
(push_stack_item): Add gdb_byte* cast.
* gcore.c (gcore_copy_callback): Change type of memhunk to gdb_byte* and
add cast.
* gdbtypes.h (print_scalar_formatted): Change type of first parameter to
gdb_byte*.
* h8300-tdep.c (h8300_extract_return_value): Change type of valbuf to
gdb_byte* and remove unnecessary cast.
(h8300h_extract_return_value): Likewise.
(h8300_store_return_value): Change type of valbuf to gdb_byte*.
(h8300h_store_return_value): Likewise.
* iq2000-tdep.c (iq2000_extract_return_value): Change type of valbuf to
gdb_byte* and remove unnecessary cast.
* jit.c (jit_reader_try_read_symtab): Change type of gdb_mem to gdb_byte*
and add cast.
* m32r-tdep.c (m32r_store_return_value): Change type of valbuf to
gdb_byte* and remove unnecessary cast.
(m32r_extract_return_value): Change type of dst to gdb_byte* and remove
valbuf.
* mep-tdep.c (mep_pseudo_cr32_read): Change type of buf to gdb_byte*.
(mep_pseudo_cr64_read): Likewise.
(mep_pseudo_csr_write): Likewise.
(mep_pseudo_cr32_write): Likewise.
(mep_pseudo_cr64_write): Likewise.
* mi/mi-main.c (mi_cmd_data_write_memory): Change type of buffer to
gdb_byte* and add cast.
* moxie-tdep.c (moxie_store_return_value): Change type of valbuf to
gdb_byte* and remove unnecessary cast.
(moxie_extract_return_value): Change type of dst to gdb_byte* and remove
valbuf.
* p-valprint.c (print_scalar_formatted): Change type of valaddr to
gdb_byte*.
* printcmd.c (void): Likewise.
* python/py-inferior.c (infpy_read_memory): Change type of buffer to
gdb_byte* and add cast.
(infpy_write_memory): Likewise.
(infpy_search_memory): Likewise.
* regcache.c (regcache_raw_write_signed): Change type of buf to gdb_byte*
and add cast.
(regcache_raw_write_unsigned): Likewise.
(regcache_cooked_write_signed): Likewise.
(regcache_cooked_write_unsigned): Likewise.
* sh64-tdep.c (h64_extract_return_value): Change type of valbuf to
gdb_byte*.

7567e11 2015-10-09 22:41:30 Simon Marchi

Add two callback data casts

gdb/ChangeLog:

* fbsd-tdep.c (fbsd_collect_regset_section_cb): Add cast.
* linux-tdep.c (linux_collect_regset_section_cb_data): Likewise.

f9acce4 2015-10-09 22:21:08 Eli Zaretskii

Fix typos in comments

gdb/

2015-10-09 Eli Zaretskii <eliz@gnu.org>

* stack.c (print_stack_frame):
* utils.c (printchar): Fix typos in commentary.

abcef95 2015-10-09 21:29:41 Markus Metzger

btrace, test: avoid gdb.btrace/vdso.exp fail

The vdso.exp test checks that we can access the VDSO memory when replaying.

Depending on the line information generated by the compiler, runto_main may run
to the line marked with bp.1 or stop before that line. The test incorrectly
assumes that it will always run to the marked line and fails if it doesn't.

The test does not really care about what is traced. It does care that GDB is
replaying when capturing the second disassemble output.

Reflect that in the test by ignoring the output of the stepping and record goto
begin commands and by checking that GDB is actually replaying.

testsuite/
* gdb.btrace/vdso.c (main): Remove breakpoint markers.
* gdb.btrace/vdso.exp: Change stepping command to "next" and ignore
its output. Ignore the output of "record goto begin" and instead
check that GDB is replaying.

145e3dd 2015-10-09 20:56:26 Pedro Alves

Fix gdb.base/a2-run.exp race

This patch fixes this racy failure, with the native-extended-gdbserver
board:

(gdb) run
Starting program: build/gdb/testsuite/outputs/gdb.base/a2-run/a2-run
Remote debugging from host 127.0.0.1
Process build/gdb/testsuite/outputs/gdb.base/a2-run/a2-run created; pid = 23832
Reading /lib64/ld-linux-x86-64.so.2 from remote target...
warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.
Reading /lib64/ld-linux-x86-64.so.2 from remote target...
Reading /lib64/libm.so.6 from remote target...
Reading /lib64/libc.so.6 from remote target...
[Inferior 1 (process 23832) exited with code 01]
(gdb) FAIL: gdb.base/a2-run.exp: run "a2-run" with no args
PASS: gdb.base/a2-run.exp: no spurious messages at program exit
run 5
Starting program: build/gdb/testsuite/outputs/gdb.base/a2-run/a2-run 5
Reading /lib64/ld-linux-x86-64.so.2 from remote target...
usage: factorial <number>

Child exited with status 1

Note that the output is correct; it's just that inferior output
appeared after gdb's output, and the test doesn't handle that
correctly.

This comment isn't really correct, unfortunately:

# waiting. If we had already seen the status wrapper exit,
# gdb_test_multiple/expect has no spawn ids left, and thus
# returns.

That's true of expect in general, but I had missed / forgot that
gdb_test_multiple internally has extra matches using "-i
$gdb_spawn_id", so even if the caller clears all the indirect spawn id
lists, gdb_test_multiple will continue waiting.

So do a conditional exp_continue manually instead.

gdb/testsuite/ChangeLog:
2015-10-09 Pedro Alves <palves@redhat.com>

* gdb.base/a2-run.exp (maybe_exp_continue): New procedure.
(top level): Use it in the run with no args test.

bc04c45 2015-10-09 09:00:08 GDB Administrator

Automatic date update in version.in

d5d8c4e 2015-10-09 04:42:36 Iain Buclaw

[D] Support D style sizeof and typeof expressions.

gdb/ChangeLog:

* d-exp.y: (UnaryExpression): Support `type.sizeof' expressions.
(PostfixExpression): Support `expr.sizeof' expressions.
(PrimaryExpression): Support `typeof(expr)' expressions.

gdb/testsuite/ChangeLog:

* gdb.dlang/properties.exp: New file.

4e7de15 2015-10-09 02:57:56 Maciej W. Rozycki

MAINTAINERS: Update my email address

gdb/
* MAINTAINERS: Update my email address.

3f94e60 2015-10-08 20:34:13 Nick Clifton

Fix compile time warning compiling ARC port.

04c4fe8 2015-10-08 16:00:57 Markus Metzger

btrace: fix void return

record_btrace_resume returns the void return from the to_resume method of the
target beneath. Split this into calling to_resume and return.

gdb/
* record-btrace.c (record_btrace_resume): Fix void return.

8c5b385 2015-10-08 09:00:08 GDB Administrator

Automatic date update in version.in

875880c 2015-10-07 23:22:47 Yao Qi

Avoid using 'template' C++ keyword

'template' is used in include/opcode/aarch64.h as below,

typedef struct
{
const char *template;
uint32_t value;
int has_xt;
} aarch64_sys_ins_reg;

and it triggers compilation errors when GDB is built in C++ mode.

In file included from git/gdb/aarch64-tdep.c:62:0:
git/gdb/../include/opcode/aarch64.h:651:15: error: expected unqualified-id before 'template'
const char *template;

This patch is to rename field template to name.

gas/

* config/tc-aarch64.c (md_begin): Access field 'name' rather
than 'template'.

include/opcode/

* aarch64.h (aarch64_sys_ins_reg) <template>: Removed.
<name>: New field.

opcodes/

* aarch64-dis.c (aarch64_ext_sysins_op): Access field
'name' rather than 'template'.
* aarch64-opc.c (aarch64_print_operand): Likewise.

d3e12b2 2015-10-07 23:07:14 Yao Qi

Wrap include/opcode/aarch64.h in extern "C" for C++

This is sufficient to link an aarch64 GDB built in C++ mode. Pedro
did something similar in Feb
https://sourceware.org/ml/binutils/2015-02/msg00176.html

include/opcode/

2015-10-07 Yao Qi <yao.qi@linaro.org>

* aarch64.h [__cplusplus]: Wrap in extern "C".

886a250 2015-10-07 22:20:19 Nick Clifton

New ARC implementation.

bfd * archures.c: Remove support for older ARC. Added support for new
ARC cpus (ARC600, ARC601, ARC700, ARCV2).
* bfd-in2.h: Likewise.
* config.bfd: Likewise.
* cpu-arc.c: Likewise.
* elf32-arc.c: Totally changed file with a refactored
inplementation of the ARC port.
* libbfd.h: Added ARC specific relocation types.
* reloc.c: Likewise.

gas * config/tc-arc.c: Revamped file for ARC support.
* config/tc-arc.h: Likewise.
* doc/as.texinfo: Add new ARC options.
* doc/c-arc.texi: Likewise.

ld * configure.tgt: Added target arc-*-elf* and arc*-*-linux-uclibc*.
* emulparams/arcebelf_prof.sh: New file
* emulparams/arcebelf.sh: Likewise.
* emulparams/arceblinux_prof.sh: Likewise.
* emulparams/arceblinux.sh: Likewise.
* emulparams/arcelf_prof.sh: Likewise.
* emulparams/arcelf.sh: Likewise.
* emulparams/arclinux_prof.sh: Likewise.
* emulparams/arclinux.sh: Likewise.
* emulparams/arcv2elfx.sh: Likewise.
* emulparams/arcv2elf.sh: Likewise.
* emultempl/arclinux.em: Likewise.
* scripttempl/arclinux.sc: Likewise.
* scripttempl/elfarc.sc: Likewise.
* scripttempl/elfarcv2.sc: Likewise
* Makefile.am: Add new ARC emulations.
* Makefile.in: Regenerate.
* NEWS: Mention the new feature.

opcodes * arc-dis.c: Revamped file for ARC support
* arc-dis.h: Likewise.
* arc-ext.c: Likewise.
* arc-ext.h: Likewise.
* arc-opc.c: Likewise.
* arc-fxi.h: New file.
* arc-regs.h: Likewise.
* arc-tbl.h: Likewise.

binutils * readelf.c (get_machine_name): Remove A5 reference. Add ARCompact
and ARCv2.
(get_machine_flags): Handle EM_ARCV2 and EM_ARCOMPACT.
(guess_is_rela): Likewise.
(dump_relocations): Likewise.
(is_32bit_abs_reloc): Likewise.
(is_16bit_abs_reloc): Likewise.
(is_none_reloc): Likewise.
* NEWS: Mention the new feature.

include * dis-asm.h (arc_get_disassembler): Correct declaration.
* arc-reloc.def: Macro file with definition of all relocation
types.
* arc.h: Changed macros for the newly supported ARC cpus. Altered
enum defining the supported relocations.
* common.h: Changed EM_ARC_A5 definition to EM_ARC_COMPACT. Added
macro for EM_ARC_COMPACT2.
* arc-func.h: New file.
* arc.h: Likewise.

3b0357d 2015-10-07 17:57:37 Andreas Schwab

gold: fix ABI pagesize for aarch64

* aarch64.cc (aarch64_info): Set abi_pagesize to 64K.

f77ee80 2015-10-07 17:52:46 Yao Qi

[aarch64] use aarch64_decode_insn to decode instructions in GDB

In this patch, we start to use aarch64_decode_insn to decode instructions
in aarch64_software_single_step.

gdb:

2015-10-07 Yao Qi <yao.qi@linaro.org>

* aarch64-tdep.c: Include opcode/aarch64.h.
(submask): Move it above.
(bit): Likewise.
(bits): Likewise.
(aarch64_software_single_step): Call aarch64_decode_insn.
Decode instruction by aarch64_inst instead of using
aarch64_decode_bcond and decode_masked_match.