From e2d9c96609b6bd328bfa8bb6e8c0f0b259485a2f Mon Sep 17 00:00:00 2001 From: Flavio Cruz Date: Wed, 15 Mar 2023 02:08:08 -0400 Subject: Use c_string to define symtab_name_t. As mentioned in 5447f965, the c_string type correctly uses msgt_size/msgt_number, resulting in a more compact ABI that doesn't require mach_msg_type_long_t. I redefined host_load_symbol_table with a new Id since this is just a debug RPC and is not used anywhere. Message-Id: --- include/mach_debug/mach_debug.defs | 35 +++++++++++++++++--------------- include/mach_debug/mach_debug_types.defs | 2 +- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/include/mach_debug/mach_debug.defs b/include/mach_debug/mach_debug.defs index c8e8b1b4..8f3456dd 100644 --- a/include/mach_debug/mach_debug.defs +++ b/include/mach_debug/mach_debug.defs @@ -135,22 +135,8 @@ routine host_virtual_physical_table_info( skip; /* host_virtual_physical_table_info */ #endif /* !defined(MACH_VM_DEBUG) || MACH_VM_DEBUG */ -#if !defined(MACH_KDB) || MACH_KDB -/* - * Loads a symbol table for an external file into the kernel debugger. - * The symbol table data is an array of characters. It is assumed that - * the caller and the kernel debugger agree on its format. - */ - -routine host_load_symbol_table( - host : host_priv_t; - task : task_t; - name : symtab_name_t; - symtab : pointer_t); - -#else /* !defined(MACH_KDB) || MACH_KDB */ -skip; /* host_load_symbol_table */ -#endif /* !defined(MACH_KDB) || MACH_KDB */ +/* The old host_load_symbol_table with a different ABI for symtab_name_t */ +skip; #if !defined(MACH_IPC_DEBUG) || MACH_IPC_DEBUG @@ -214,3 +200,20 @@ routine host_slab_info( host : host_t; out info : cache_info_array_t, CountInOut, Dealloc); + +#if !defined(MACH_KDB) || MACH_KDB +/* + * Loads a symbol table for an external file into the kernel debugger. + * The symbol table data is an array of characters. It is assumed that + * the caller and the kernel debugger agree on its format. + */ + +routine host_load_symbol_table( + host : host_priv_t; + task : task_t; + name : symtab_name_t; + symtab : pointer_t); + +#else /* !defined(MACH_KDB) || MACH_KDB */ +skip; /* host_load_symbol_table */ +#endif /* !defined(MACH_KDB) || MACH_KDB */ diff --git a/include/mach_debug/mach_debug_types.defs b/include/mach_debug/mach_debug_types.defs index fd940384..3e38ccae 100644 --- a/include/mach_debug/mach_debug_types.defs +++ b/include/mach_debug/mach_debug_types.defs @@ -102,7 +102,7 @@ type vm_page_info_t = struct { }; type vm_page_info_array_t = array[] of vm_page_info_t; -type symtab_name_t = (MACH_MSG_TYPE_STRING_C, 8*32); +type symtab_name_t = c_string[32]; type kernel_debug_name_t = c_string[*: 64]; -- cgit v1.2.3