• 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/palves/current-thread
RSS
修訂. 時間 作者
ae1caa9 users/palves/current-thread 2020-06-04 04:36:15 Pedro Alves

Decouple inferior_ptid/inferior_thread(); dup ptids in thread list (PR/25412)

In PR/25412, Simon noticed that after the multi-target series, the
tid-reuse.exp testcase manages to create a duplicate thread in the
thread list. Or rather, two threads with the same PTID.

add_thread_silent has code in place to detect the case of a new thread
reusing some older thread's ptid, but it doesn't work correctly
anymore when the old thread is NOT the current thread and it has a
refcount higher than 0. Either condition prevents a thread from being
deleted, but the refcount case wasn't being considered. I think the
reason that case wasn't considered is that that code predates
thread_info refcounting. Back when it was originally written,
delete_thread always deleted the thread.

That add_thread_silent code in question has some now-unnecessary
warts, BTW. For instance, this:

/* Make switch_to_thread not read from the thread. */
new_thr->state = THREAD_EXITED;

... used to be required because switch_to_thread would update
'stop_pc' otherwise. I.e., it would read registers from an exited
thread otherwise. switch_to_thread no longer reads the stop_pc, since:

commit f2ffa92bbce9dd5fbedc138ac2a3bc8a88327d09
Author: Pedro Alves <palves@redhat.com>
AuthorDate: Thu Jun 28 20:18:24 2018 +0100

gdb: Eliminate the 'stop_pc' global

Also, if the ptid of the now-gone current thread is reused, we
currently return from add_thread_silent with the current thread
pointing at the _new_ thread. Either pointing at the old thread, or
at no thread selected would be reasonable. But pointing at an
unrelated thread (the new thread that happens to reuse the ptid) is
just broken. Seems like I was the one who wrote it like that but I
have no clue why, FWIW.

Currently, an exited thread kept in the thread list still holds its
original ptid. The idea was that we need the ptid to be able to
temporarily switch to another thread and then switch back to the
original thread, because thread switching is really inferior_ptid
switching. Switching back to the original thread requires a ptid
lookup.

Now, in order to avoid exited threads with the same ptid as a live
thread in the same thread list, one thing I considered (and tried) was
to change an exited thread's ptid to minus_one_ptid. However, with
that, there's a case that we won't handle well, which is if we end up
with more than one exited thread in the list, since then all exited
threads will all have the same ptid. Since inferior_thread() relies
on inferior_ptid, may well return the wrong thread.

My next attempt to address this, was to switch an exited thread's ptid
to a globally unique "exited" ptid, which is a ptid with pid == -1 and
tid == 'the thread's global GDB thread number'. Note that GDB assumes
that the GDB global thread number is monotonically increasing and
doesn't wrap around. (We should probably make GDB thread numbers
64-bit to prevent that happening in practice; they're currently signed
32-bit.) This attempt went a long way, but still ran into a number of
issues. It was a major hack too, obviously.

My next attempt is the one that I'm proposing, which is to bite the
bullet and break the connection between inferior_ptid and
inferior_thread(), aka the current thread. I.e., make the current
thread be a global thread_info pointer that is written to directly by
switch_to_thread, etc., and making inferior_thread() return that
pointer, instead of having inferior_thread() lookup up the
inferior_ptid thread, by ptid_t. You can look at this as a
continuation of the effort of using more thread_info pointers instead
of ptids when possible.

By making the current thread a global thread_info pointer, we can make
switch_to_thread simply write to the global thread pointer, which
makes scoped_restore_current_thread able to restore back to an exited
thread without relying on unrelyable ptid look ups. I.e., this makes
it not a real problem to have more than one thread with the same ptid
in the thread list. There will always be only one live thread with a
given ptid, so code that looks up a live thread by ptid will always be
able to find the right one.

This change required auditing the whole codebase for places where we
were writing to inferior_ptid directly to change the current thread,
and change them to use switch_to_thread instead or one of its
siblings, because otherwise inferior_thread() would return a thread
unrelated to the changed-to inferior_ptid. That was all (hopefully)
done in previous patches.

After this, inferior_ptid is mainly used by target backend code. It
is also relied on by a number of target methods. E.g., the
target_resume interface and the memory reading routines -- we still
need it there because we need to be able to access memory off of
processes for which we don't have a corresponding inferior/thread
object, like when handling forks. Maybe we could pass down a context
explicitly to target_read_memory, etc.

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* gdbthread.h (delete_thread, delete_thread_silent)
(find_thread_ptid): Update comments.
* thread.c (current_thread_): New global.
(is_current_thread): Move higher, and reimplement.
(inferior_thread): Reimplement.
(set_thread_exited): Use bool. Add assertions.
(add_thread_silent): Simplify thread-reuse handling by always
calling delete_thread.
(delete_thread): Remove intro comment.
(find_thread_ptid): Skip exited threads.
(switch_to_thread_no_regs): Write to current_thread_.
(switch_to_no_thread): Check CURRENT_THREAD_ instead of
INFERIOR_PTID. Clear current_thread_.

ec8096a 2020-06-04 04:36:14 Pedro Alves

Don't write to inferior_ptid in aix-thread.c

There are other writes in the file, but they seem more harmless. This
one is changing the current thread permanently.

Untested.

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* aix-thread.c (pd_update): Use switch_to_thread.

5d0840f 2020-06-04 04:36:14 Pedro Alves

Don't write to inferior_ptid in ravenscar-thread.c

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* ravenscar-thread.c (ravenscar_thread_target): Update.
(ravenscar_thread_target::update_inferior_ptid): Rename to ...
(ravenscar_thread_target::add_active_thread): ... this. Don't
set m_base_ptid here. Update to avoid referencing inferior_ptid.
(ravenscar_thread_target::wait): Don't write to inferior_ptid.

dc74eec 2020-06-04 04:36:13 Pedro Alves

Fix Windows

a6092fb 2020-06-04 04:31:18 Pedro Alves

Don't write to inferior_ptid in windows-nat.c, part II

Writing to inferior_ptid in
windows_nat_target::get_windows_debug_event is just incorrect and not
necessary. We'll report the event to GDB's core, which then takes
care of switching inferior_ptid / current thread.

Related (see windows_nat_target::get_windows_debug_event), there's
also a "current_windows_thread" global that is just begging to get out
of sync with core GDB's current thread. This patch removes it.
gdbserver already does not have an equivalent global in win32-low.cc.

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* nat/windows-nat.c (current_windows_thread): Remove.
* nat/windows-nat.h (current_windows_thread): Remove.
* windows-nat.c (windows_nat_target::stopped_by_sw_breakpoint):
Adjust.
(display_selectors): Adjust to fetch the current
windows_thread_info based on inferior_ptid.
(fake_create_process): No longer write to current_windows_thread.
(windows_nat_target::get_windows_debug_event):
Don't set inferior_ptid or current_windows_thread.
(windows_nat_target::wait): Adjust to not rely on
current_windows_thread.
(windows_nat_target::detach): Use switch_to_no_thread instead of
writing to inferior_ptid directly.

2e88948 2020-06-04 04:31:17 Pedro Alves

Don't write to inferior_ptid in windows-nat.c, part I

The inferior_ptid hack in do_initial_win32_stuff, added back in 2008:

https://sourceware.org/ml/gdb-patches/2008-10/msg00012.html

with:

commit 9f9d052e600ed9436f9fd558d62a189c8cc3d43e
Author: Pierre Muller <muller@sourceware.org>
AuthorDate: Thu Oct 2 14:20:07 2008 +0000

* win32-nat.c (do_initial_win32_stuff): Set inferior_ptid.

is no longer needed. Back then, current_inferior looked like this:

struct inferior*
current_inferior (void)
{
struct inferior *inf = find_inferior_pid (ptid_get_pid (inferior_ptid));
gdb_assert (inf);
return inf;
}

Nowadays, current_inferior() just returns the global current_inferior_
pointer, which didn't exist back then.

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* windows-nat.c (do_initial_windows_stuff): No longer set inferior_ptid.

31a30c8 2020-06-04 04:31:16 Pedro Alves

Don't write to inferior_ptid in go32-nat.c

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* go32-nat.c (go32_nat_target::create_inferior): Switch to thread
after creating it, instead of writing to inferior_ptid. Don't
write to inferior_ptid.

d2bebd5 2020-06-04 04:31:16 Pedro Alves

Don't write to inferior_ptid in fork-child.c

This is no longer necessary. All targets that call fork_inferior now
also call switch_to_thread as soon as they add the main thread.

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* fork-child.c (postfork_hook): Don't write to inferior_ptid.

d5938d2 2020-06-04 04:31:16 Pedro Alves

Don't write to inferior_ptid in bsd-kvm.c

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* bsd-kvm.c (bsd_kvm_target_open): Switch to thread after adding
it, instead of writing to inferior_ptid.

4c29139 2020-06-04 04:31:16 Pedro Alves

Don't write to inferior_ptid in btrace_fetch

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* btrace.c (btrace_fetch): Use switch_to_thread instead of writing
to inferior_ptid.

8867ea4 2020-06-04 04:31:15 Pedro Alves

Don't write to inferior_ptid in bsd-kvm.c

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* bsd-kvm.c (bsd_kvm_target::close): Use switch_to_no_thread
instead of writing to inferior_ptid directly.

1454f20 2020-06-04 04:31:15 Pedro Alves

Don't write to inferior_ptid in corelow.c

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* corelow.c (core_target::close): Use switch_to_no_thread instead
of writing to inferior_ptid directly.
(add_to_thread_list, core_target_open): Use switch_to_thread
instead of writing to inferior_ptid directly.

cd0fd58 2020-06-04 04:31:15 Pedro Alves

Don't write to inferior_ptid in darwin-nat.c

Untested.

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* darwin-nat.c (darwin_nat_target::decode_message): Don't write to
inferior_ptid.
(darwin_nat_target::stop_inferior, darwin_nat_target::kill): Avoid
inferior_ptid.
(darwin_attach_pid): Use switch_to_no_thread instead of writing to
inferior_ptid directly.
(darwin_nat_target::init_thread_list): Switch to thread, instead
of writing to inferior_ptid.
(darwin_nat_target::attach): Don't write to inferior_ptid.
(darwin_nat_target::get_ada_task_ptid): Avoid inferior_ptid.

d915892 2020-06-04 04:19:13 Pedro Alves

Don't write to inferior_ptid in gnu-nat.c

Untested.

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* gnu-nat.c (gnu_nat_target::create_inferior): Switch to the added
thread.
(gnu_nat_target::attach): Don't write to inferior_ptid directly.
Instead use switch_to_thread.
(gnu_nat_target::detach): Use switch_to_no_thread
instead of writing to inferior_ptid directly. Used passed-in
inferior instead of looking up the inferior by pid.

18df9f5 2020-06-04 04:19:12 Pedro Alves

Don't write to inferior_ptid in go32-nat.c

generic_mourn_inferior already takes care of switching to no thread.

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* go32-nat.c (go32_nat_target::create_inferior): Don't write to
inferior_ptid.

49e3f3e 2020-06-04 04:19:11 Pedro Alves

Don't write to inferior_ptid in nto-procfs.c

A best effort patch, which fixes some bit rot and removes some
inferior_ptid references -- this port clearly hasn't been built in a
long while.

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* nto-procfs.c (nto_procfs_target::update_thread_list): Avoid
inferior_ptid.
(nto_procfs_target::attach): Avoid inferior_ptid. Switch to
thread.
(nto_procfs_target::detach): Avoid referencing
inferior_ptid. Use switch_to_no_thread instead of writing to
inferior_ptid directly.
(nto_procfs_target::mourn_inferior): Use switch_to_no_thread
instead of writing to inferior_ptid directly.
(nto_procfs_target::create_inferior): Avoid inferior_ptid. Switch
to thread.

f93eadd 2020-06-04 04:19:10 Pedro Alves

Don't write to inferior_ptid in remote-sim.c

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* remote-sim.c (gdbsim_target::create_inferior): Switch to thread
after creating it, instead of writing to inferior_ptid.
(gdbsim_target_open): Use switch_to_no_thread instead of writing
to inferior_ptid directly.
(gdbsim_target::wait): Don't write to inferior_ptid.

6bc7814 2020-06-04 04:19:10 Pedro Alves

Don't write to inferior_ptid in remote.c

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* remote.c (remote_target::remote_notice_new_inferior): Use
switch_to_thread instead of writing to inferior_ptid directly.
(remote_target::add_current_inferior_and_thread): Use
switch_to_no_thread instead of writing to inferior_ptid directly.
(extended_remote_target::attach): Use switch_to_inferior_no_thread
and switch_to_thread instead of using set_current_inferior or
writing to inferior_ptid directly.

b1db2e3 2020-06-04 04:19:09 Pedro Alves

Don't write to inferior_ptid in tracectf.c

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* tracectf.c (ctf_target_open): Switch to added thread instead of
writing to inferior_ptid directly.
(ctf_target::close): Use switch_to_no_thread instead of writing to
inferior_ptid directly.

0317262 2020-06-04 04:19:08 Pedro Alves

Don't write to inferior_ptid in tracefile-tfile.c

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* tracefile-tfile.c (tfile_target_open): Don't write to
inferior_ptid directly, instead switch to added thread.
(tfile_target::close): Use switch_to_no_thread instead of writing
to inferior_ptid directly.

adf7959 2020-06-04 04:19:07 Pedro Alves

Don't write to inferior_ptid in procfs.c

The inferior_ptid write in procfs_do_thread_registers should be
unnecessary because the target fetch_registers method should (and
does) extract the ptid from the regcache.

Not tested.

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* procfs.c (procfs_target::attach): Don't write to inferior_ptid.
(procfs_target::detach): Use switch_to_no_thread
instead of writing to inferior_ptid directly.
(do_attach): Change return type to void. Switch to the added
thread.
(procfs_target::create_inferior): Switch to the added thread.
(procfs_do_thread_registers): Don't write to inferior_ptid.

7fdeda6 2020-06-04 04:19:06 Pedro Alves

Don't write to inferior_ptid in infrun.c

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* infrun.c (generic_mourn_inferior): Use switch_to_thread instead
of writing to inferior_ptid.
(scoped_restore_exited_inferior): Delete.
(handle_vfork_child_exec_or_exit): Simplify using
scoped_restore_current_pspace_and_thread. Use switch_to_thread
instead of writing to inferior_ptid.
(THREAD_STOPPED_BY): Delete.
(thread_stopped_by_watchpoint, thread_stopped_by_sw_breakpoint)
(thread_stopped_by_hw_breakpoint): Delete.
(save_waitstatus): Use
scoped_restore_current_thread+switch_to_thread, and call
target_stopped_by_watchpoint instead of
thread_stopped_by_watchpoint, target_stopped_by_sw_breakpoint
instead of thread_stopped_by_sw_breakpoint, and
target_stopped_by_hw_breakpoint instead of
thread_stopped_by_hw_breakpoint.
(handle_inferior_event)
<TARGET_WAITKIND_EXITED/TARGET_WAITKIND_SIGNALLED>: Don't write to
inferior_ptid directly, nor
set_current_inferior/set_current_program_space. Use
switch_to_thread / switch_to_inferior_no_thread instead.

ee4f006 2020-06-04 04:19:05 Pedro Alves

Don't write to inferior_ptid in target.c

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* target.c (generic_mourn_inferior): Use switch_to_no_thread
instead of writing to inferior_ptid.

8f7674f 2020-06-04 04:19:04 Pedro Alves

Don't write to inferior_ptid in inf-ptrace.c

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* inf-ptrace.c (inf_ptrace_target::create_inferior): Switch to the
added thread.
(inf_ptrace_target::attach): Don't write to inferior_ptid. Switch
to the added thread.
(inf_ptrace_target::detach_success): Use switch_to_no_thread
instead of writing to inferior_ptid.

58367f7 2020-06-04 04:19:03 Pedro Alves

Don't write to inferior_ptid in gdbarch-selftests.c, mock address_space too

Use switch_to_thread instead of writing to inferior_ptid. This
requires a couple of improvements to the mocking environment. One is
to mock a pspace too, and assigning it to the inferior. In turn, this
requires heap-allocating the address space, so that the regular
program_space dtor destroys the address space correctly.

(Note that new the mock program_space is allocated on the stack, and
thus depends on the previous patch that eliminated
delete_program_space.)

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* gdbarch-selftests.c: Include "progspace-and-thread.h".
(register_to_value_test): Mock a program_space too. Heap-allocate
the address space. Don't write to inferior_ptid. Use
switch_to_thread instead.

8849154 2020-06-04 04:19:02 Pedro Alves

gcore, handle exited threads better

An early (and since discarded) version of this series tried to make
exited threads have distinct PTID between each other, and that change
exposed a problem in linux-tdep.c... This was exposed by the
gdb.threads/gcore-stale-thread.exp testcase, which is exactly about
calling gcore with an exited thread selected:

(gdb) [Thread 0x7ffff7fb6740 (LWP 31523) exited]
PASS: gdb.threads/gcore-stale-thread.exp: continue to breakpoint: break-here
gcore /home/pedro/gdb/binutils-gdb/build/gdb/testsuite/outputs/gdb.threads/gcore-stale-thread/gcore-stale-thread.core
/home/pedro/gdb/binutils-gdb/build/../src/gdb/inferior.c:66: internal-error: void set_current_inferior(inferior*): Assertion `inf != NULL' failed.
A problem internal to GDB has been detected,

That was find_inferior_ptid being called on the "exited" ptid, which
on that previous (and discarded attempt) had pid==-1. The problem is
that linux-tdep.c, where it looks for the signalled thread, isn't
considering exited threads. Also, while at it, that code isn't
considering multi-target either, since it is using
iterate_over_threads which iterates over all threads of all targets.
Fixed by switching to range-for iteration instead.

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* linux-tdep.c (find_signalled_thread(thread_info *,void *)):
Delete.
(find_signalled_thread()): New, factored out from
linux_make_corefile_notes and adjusted to handle exited threads.
(linux_make_corefile_notes): Adjust to use the new
find_signalled_thread.

122821b 2020-06-04 04:19:01 Pedro Alves

Don't write to inferior_ptid in linux_get_siginfo_data

gdb/ChangeLog:
yyyy-mm-dd Pedro Alves <palves@redhat.com>

* linux-tdep.c (btrace_fetch): Save/restore current thread instead
of saving/restoring inferior_ptid.

f6eee2d 2020-06-02 21:53:11 Andrew Burgess

gdb: Convert language skip_trampoline field to a method

This commit changes the language_data::skip_trampoline function
pointer member variable into a member function of language_defn.

There should be no user visible changes after this commit.

gdb/ChangeLog:

* ada-lang.c (ada_language_data): Delete skip_trampoline
initializer.
* c-lang.c (c_language_data): Likewise.
(cplus_language_data): Likewise.
(cplus_language::skip_trampoline): New member function.
(asm_language_data): Delete skip_trampoline initializer.
(minimal_language_data): Likewise.
* d-lang.c (d_language_data): Likewise.
* f-lang.c (f_language_data): Likewise.
* go-lang.c (go_language_data): Likewise.
* language.c (unk_lang_trampoline): Delete function.
(skip_language_trampoline): Update.
(unknown_language_data): Delete skip_trampoline initializer.
(auto_language_data): Likewise.
* language.h (language_data): Delete skip_trampoline field.
(language_defn::skip_trampoline): New function.
* m2-lang.c (m2_language_data): Delete skip_trampoline
initializer.
* objc-lang.c (objc_skip_trampoline): Delete function, move
implementation to objc_language::skip_trampoline.
(objc_language_data): Delete skip_trampoline initializer.
(objc_language::skip_trampoline): New member function with
implementation from objc_skip_trampoline.
* opencl-lang.c (opencl_language_data): Delete skip_trampoline
initializer.
* p-lang.c (pascal_language_data): Likewise.
* rust-lang.c (rust_language_data): Likewise.

0a50df5 2020-06-02 21:53:11 Andrew Burgess

gdb: Convert language la_demangle field to a method

This commit changes the language_data::la_demangle function pointer
member variable into a member function of language_defn.

The only slightly "weird" change in this commit is in f-lang.c, where
I have given the Fortran language a demangle method that is identical
to the default language_defn::demangle. The only reason for this is
to give me somewhere to copy the comment that was previously embedded
within the f_language_data structure.

There should be no user visible changes after this commit.

gdb/ChangeLog:

* ada-lang.c (ada_language_data): Delete la_demangle initializer.
(ada_language::demangle): New member function.
* c-lang.c (c_language_data): Delete la_demangle initializer.
(cplus_language_data): Delete la_demangle initializer.
(cplus_language::demangle): New member function.
(asm_language_data): Delete la_demangle initializer.
(minimal_language_data): Delete la_demangle initializer.
* d-lang.c (d_language_data): Delete la_demangle initializer.
(d_language::demangle): New member function.
* f-lang.c (f_language_data): Delete la_demangle initializer.
(f_language::demangle): New member function.
* go-lang.c (go_language_data): Delete la_demangle initializer.
(go_language::demangle): New member function.
* language.c (language_demangle): Update.
(unk_lang_demangle): Delete.
(unknown_language_data): Delete la_demangle initializer.
(unknown_language::demangle): New member function.
(auto_language_data): Delete la_demangle initializer.
(auto_language::demangle): New member function.
* language.h (language_data): Delete la_demangle field.
(language_defn::demangle): New function.
* m2-lang.c (m2_language_data): Delete la_demangle initializer.
* objc-lang.c (objc_language_data): Delete la_demangle
initializer.
(objc_language::demangle): New member function.
* opencl-lang.c (opencl_language_data): Delete la_demangle
initializer.
* p-lang.c (pascal_language_data): Likewise.
* rust-lang.c (rust_language_data): Likewise.
(rust_language::demangle): New member functi

fbfb0a4 2020-06-02 21:53:11 Andrew Burgess

gdb: Convert language la_print_type field to a method

This commit changes the language_data::la_print_type function pointer
member variable into a member function of language_defn.

There should be no user visible changes after this commit.

gdb/ChangeLog:

* ada-lang.c (ada_language_data): Delete la_print_type
initializer.
(ada_language::print_type): New member function.
* c-lang.c (c_language_data): Delete la_print_type initializer.
(c_language::print_type): New member function.
(cplus_language_data): Delete la_print_type initializer.
(cplus_language::print_type): New member function.
(asm_language_data): Delete la_print_type initializer.
(asm_language::print_type): New member function.
(minimal_language_data): Delete la_print_type initializer.
(minimal_language::print_type): New member function.
* d-lang.c (d_language_data): Delete la_print_type initializer.
(d_language::print_type): New member function.
* f-lang.c (f_language_data): Delete la_print_type initializer.
(f_language::print_type): New member function.
* go-lang.c (go_language_data): Delete la_print_type initializer.
(go_language::print_type): New member function.
* language.c (unk_lang_print_type): Delete.
(unknown_language_data): Delete la_print_type initializer.
(unknown_language::print_type): New member function.
(auto_language_data): Delete la_print_type initializer.
(auto_language::print_type): New member function.
* language.h (language_data): Delete la_print_type field.
(language_defn::print_type): New function.
(LA_PRINT_TYPE): Update.
* m2-lang.c (m2_language_data): Delete la_print_type initializer.
(m2_language::print_type): New member function.
* objc-lang.c (objc_language_data): Delete la_print_type
initializer.
(objc_language::print_type): New member function.
* opencl-lang.c (opencl_print_type): Delete, implementation moved
to opencl_language::print_type.
(opencl_language_data): Delete la_print_type initializer.
(opencl_language::print_type): New member function, implementation
from opencl_print_type.
* p-lang.c (pascal_language_data): Delete la_print_type
initializer.
(pascal_language::print_type): New member function.
* rust-lang.c (rust_print_type): Delete, implementation moved to
rust_language::print_type.
(rust_language_data): Delete la_print_type initializer.
(rust_language::print_type): New member function, implementation
from rust_print_type.