gdb: For macOS, s/thread_info/struct thread_info/
authorPedro Alves <palves@redhat.com>
Mon, 25 Jun 2018 16:18:18 +0000 (17:18 +0100)
committerPedro Alves <palves@redhat.com>
Mon, 25 Jun 2018 16:43:14 +0000 (17:43 +0100)
commit75cbc781e371279f4403045be93b07fd8fe7fde5
treea1db05b4ab9639d2184e348135eecb7cd2c95c19
parentb7a08269ca53323c5fe190370da281358dfee6b2
gdb: For macOS, s/thread_info/struct thread_info/

The macOS build currently fails with several instances of this problem:

  In file included from ../../src/gdb/darwin-nat.h:22:0,
   from ../../src/gdb/i386-darwin-nat.c:37:
  ../../src/gdb/gdbthread.h:376:59: error: type/value mismatch at argument 1 in template parameter list for 'template<class T, class Policy> class gdb::ref_ptr'
     = gdb::ref_ptr<thread_info, refcounted_object_ref_policy>;
     ^
  ../../src/gdb/gdbthread.h:376:59: note:   expected a type, got 'thread_info'
  ../../src/gdb/gdbthread.h:396:28: error: variable or field 'delete_thread' declared void
   extern void delete_thread (thread_info *thread);
      ^
(...)

This is because there's a thread_info function in the Darwin/XNU/mach API:

 http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/thread_info.html

Fix this in the same way it had been fixed in commit 7aabaf9d4ad5
("Create private_thread_info hierarchy"), by adding an explicit
"struct" keyword.

gdb/ChangeLog:
2018-06-25  Pedro Alves  <palves@redhat.com>

* gdbthread.h (thread_info_ref, delete_thread)
(delete_thread_silent, first_thread_of_inferior)
(any_thread_of_inferior, switch_to_thread)
(enable_thread_stack_temporaries)
(thread_stack_temporaries_enabled_p, push_thread_stack_temporary)
(get_last_thread_stack_temporary)
(value_in_thread_stack_temporaries, can_access_registers_thread):
Spell out "struct thread_info" instead of just "thread_info".
* inferior.h (notice_new_inferior): Likewise.
gdb/ChangeLog
gdb/gdbthread.h
gdb/inferior.h