From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25058 invoked by alias); 31 Aug 2008 17:52:40 -0000 Received: (qmail 24451 invoked by uid 22791); 31 Aug 2008 17:52:34 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate2.de.ibm.com (HELO mtagate2.de.ibm.com) (195.212.17.162) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 31 Aug 2008 17:51:40 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate2.de.ibm.com (8.13.1/8.13.1) with ESMTP id m7VHpcx8013864 for ; Sun, 31 Aug 2008 17:51:38 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m7VHpbdx3100768 for ; Sun, 31 Aug 2008 19:51:37 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m7VHpbi0020255 for ; Sun, 31 Aug 2008 19:51:37 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m7VHpb0v020252 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 31 Aug 2008 19:51:37 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (localhost.localdomain [127.0.0.1]) by tuxmaker.boeblingen.de.ibm.com (8.13.8/8.13.8) with ESMTP id m7VHpb9Z003084 for ; Sun, 31 Aug 2008 19:51:37 +0200 Received: (from uweigand@localhost) by tuxmaker.boeblingen.de.ibm.com (8.13.8/8.13.8/Submit) id m7VHpaWw003083 for gdb-patches@sourceware.org; Sun, 31 Aug 2008 19:51:36 +0200 Message-Id: <20080831175136.834631000@de.ibm.com> References: <20080831175045.128504000@de.ibm.com> User-Agent: quilt/0.46-1 Date: Sun, 31 Aug 2008 17:52:00 -0000 From: uweigand@de.ibm.com To: gdb-patches@sourceware.org Subject: [rfc][30/37] Eliminate builtin_type_ macros: Remove gdbarch_name_of_malloc Content-Disposition: inline; filename=diff-type-malloc Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-08/txt/msg00679.txt.bz2 Hello, value_allocate_space_in_inferior needs current_gdbarch in order to find the name of the "malloc" function. However, no gdbarch actually even implement any non-default gdbarch_name_of_malloc routine, so this patch simply removes that infrastructure. Bye, Ulrich ChangeLog: * gdbarch.sh (name_of_malloc): Remove. * gdbarch.c, gdbarch.h: Re-generate. * valops.c (value_allocate_space_in_inferior): Do not call gdbarch_name_of_malloc. doc/ChangeLog: * gdbint.texinfo (Target Conditionals): Remove documentation for gdbarch_name_of_malloc. Index: gdb-head/gdb/doc/gdbint.texinfo =================================================================== --- gdb-head.orig/gdb/doc/gdbint.texinfo +++ gdb-head/gdb/doc/gdbint.texinfo @@ -4114,11 +4114,6 @@ not defined, it will default to @code{0x @item REMOTE_BPT_VECTOR Defaults to @code{1}. -@item const char *gdbarch_name_of_malloc (@var{gdbarch}) -@findex gdbarch_name_of_malloc -A string containing the name of the function to call in order to -allocate some memory in the inferior. The default value is "malloc". - @end ftable @node Adding a New Target Index: gdb-head/gdb/gdbarch.c =================================================================== --- gdb-head.orig/gdb/gdbarch.c +++ gdb-head/gdb/gdbarch.c @@ -215,7 +215,6 @@ struct gdbarch gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments; gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special; gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special; - const char * name_of_malloc; int cannot_step_breakpoint; int have_nonsteppable_watchpoint; gdbarch_address_class_type_flags_ftype *address_class_type_flags; @@ -347,7 +346,6 @@ struct gdbarch startup_gdbarch = construct_inferior_arguments, /* construct_inferior_arguments */ 0, /* elf_make_msymbol_special */ 0, /* coff_make_msymbol_special */ - "malloc", /* name_of_malloc */ 0, /* cannot_step_breakpoint */ 0, /* have_nonsteppable_watchpoint */ 0, /* address_class_type_flags */ @@ -451,7 +449,6 @@ gdbarch_alloc (const struct gdbarch_info gdbarch->construct_inferior_arguments = construct_inferior_arguments; gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special; gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special; - gdbarch->name_of_malloc = "malloc"; gdbarch->register_reggroup_p = default_register_reggroup_p; gdbarch->displaced_step_fixup = NULL; gdbarch->displaced_step_free_closure = NULL; @@ -600,7 +597,6 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of construct_inferior_arguments, invalid_p == 0 */ /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */ /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */ - /* Skip verify of name_of_malloc, invalid_p == 0 */ /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */ /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */ /* Skip verify of address_class_type_flags, has predicate */ @@ -881,9 +877,6 @@ gdbarch_dump (struct gdbarch *gdbarch, s "gdbarch_dump: memory_remove_breakpoint = <0x%lx>\n", (long) gdbarch->memory_remove_breakpoint); fprintf_unfiltered (file, - "gdbarch_dump: name_of_malloc = %s\n", - gdbarch->name_of_malloc); - fprintf_unfiltered (file, "gdbarch_dump: num_pseudo_regs = %s\n", paddr_d (gdbarch->num_pseudo_regs)); fprintf_unfiltered (file, @@ -2720,23 +2713,6 @@ set_gdbarch_coff_make_msymbol_special (s gdbarch->coff_make_msymbol_special = coff_make_msymbol_special; } -const char * -gdbarch_name_of_malloc (struct gdbarch *gdbarch) -{ - gdb_assert (gdbarch != NULL); - /* Skip verify of name_of_malloc, invalid_p == 0 */ - if (gdbarch_debug >= 2) - fprintf_unfiltered (gdb_stdlog, "gdbarch_name_of_malloc called\n"); - return gdbarch->name_of_malloc; -} - -void -set_gdbarch_name_of_malloc (struct gdbarch *gdbarch, - const char * name_of_malloc) -{ - gdbarch->name_of_malloc = name_of_malloc; -} - int gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch) { Index: gdb-head/gdb/gdbarch.h =================================================================== --- gdb-head.orig/gdb/gdbarch.h +++ gdb-head/gdb/gdbarch.h @@ -591,9 +591,6 @@ typedef void (gdbarch_coff_make_msymbol_ extern void gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym); extern void set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special); -extern const char * gdbarch_name_of_malloc (struct gdbarch *gdbarch); -extern void set_gdbarch_name_of_malloc (struct gdbarch *gdbarch, const char * name_of_malloc); - extern int gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch); extern void set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch, int cannot_step_breakpoint); Index: gdb-head/gdb/gdbarch.sh =================================================================== --- gdb-head.orig/gdb/gdbarch.sh +++ gdb-head/gdb/gdbarch.sh @@ -586,7 +586,6 @@ m:int:in_function_epilogue_p:CORE_ADDR a m:char *:construct_inferior_arguments:int argc, char **argv:argc, argv::construct_inferior_arguments::0 f:void:elf_make_msymbol_special:asymbol *sym, struct minimal_symbol *msym:sym, msym::default_elf_make_msymbol_special::0 f:void:coff_make_msymbol_special:int val, struct minimal_symbol *msym:val, msym::default_coff_make_msymbol_special::0 -v:const char *:name_of_malloc:::"malloc":"malloc"::0:gdbarch->name_of_malloc v:int:cannot_step_breakpoint:::0:0::0 v:int:have_nonsteppable_watchpoint:::0:0::0 F:int:address_class_type_flags:int byte_size, int dwarf2_addr_class:byte_size, dwarf2_addr_class Index: gdb-head/gdb/valops.c =================================================================== --- gdb-head.orig/gdb/valops.c +++ gdb-head/gdb/valops.c @@ -170,8 +170,7 @@ struct value * value_allocate_space_in_inferior (int len) { struct value *blocklen; - struct value *val = - find_function_in_inferior (gdbarch_name_of_malloc (current_gdbarch)); + struct value *val = find_function_in_inferior ("malloc"); blocklen = value_from_longest (builtin_type_int, (LONGEST) len); val = call_function_by_hand (val, 1, &blocklen); -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com