From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 720 invoked by alias); 25 Feb 2006 00:12:03 -0000 Received: (qmail 708 invoked by uid 22791); 25 Feb 2006 00:12:02 -0000 X-Spam-Check-By: sourceware.org Received: from ip127.bb146.pacific.net.hk (HELO mailhub.stlglobal.com) (202.64.146.127) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 25 Feb 2006 00:11:57 +0000 Received: from localhost ([127.0.0.1]) by mailhub.stlglobal.com with esmtp (Exim 4.50) id 1FCn2O-0001ys-R1 for gdb-patches@sources.redhat.com; Sat, 25 Feb 2006 08:11:53 +0800 Message-ID: <43FFA0C9.9020007@tausq.org> Date: Sat, 25 Feb 2006 01:21:00 -0000 From: Randolph Chung User-Agent: Debian Thunderbird 1.0.2 (X11/20051002) MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [hppa64-hpux] Cleanup TM_FILE usage Content-Type: multipart/mixed; boundary="------------060007080606040006000300" Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-02/txt/msg00468.txt.bz2 This is a multi-part message in MIME format. --------------060007080606040006000300 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 287 tm-hppa64.h defines a GDB_TARGET_IS_HPPA_20W flag that needs to go. Most of the uses of this flag have been cleaned up already; there's only one left in hppa-hpux-tdep.c that is cleaned up by this patch. Once that is done, we can get rid of tm-hppa64.h Thoughts? Comments? randolph --------------060007080606040006000300 Content-Type: text/x-patch; name="hpux-cleanup.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="hpux-cleanup.diff" Content-length: 6009 2006-02-25 Randolph Chung * hppa-hpux-tdep.c (initialize_hp_cxx_exception_support): Use TDEP->is_elf to determine if we are working with a SOM binary. (null_symtab_and_line): Remove unused variable. * config/pa/hppa64.mt: Use tm-hppa.h. * config/pa/tm-hppa64.h: Remove file. Index: hppa-hpux-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/hppa-hpux-tdep.c,v retrieving revision 1.50 diff -u -p -r1.50 hppa-hpux-tdep.c --- hppa-hpux-tdep.c 24 Feb 2006 23:52:04 -0000 1.50 +++ hppa-hpux-tdep.c 24 Feb 2006 23:57:31 -0000 @@ -844,52 +844,54 @@ GDB will be unable to intercept exceptio return 0; } -#ifndef GDB_TARGET_IS_HPPA_20W - /* Check whether the executable is dynamically linked or archive bound */ - /* With an archive-bound executable we can use the raw addresses we find - for the callback function, etc. without modification. For an executable - with shared libraries, we have to do more work to find the plabel, which - can be the target of a call through $$dyncall from the aCC runtime support - library (libCsup) which is linked shared by default by aCC. */ - /* This test below was copied from somsolib.c/somread.c. It may not be a very - reliable one to test that an executable is linked shared. pai/1997-07-18 */ - shlib_info = bfd_get_section_by_name (symfile_objfile->obfd, "$SHLIB_INFO$"); - if (shlib_info && (bfd_section_size (symfile_objfile->obfd, shlib_info) != 0)) - { - /* The minsym we have has the local code address, but that's not - the plabel that can be used by an inter-load-module call. */ - /* Find solib handle for main image (which has end.o), and use - that and the min sym as arguments to __d_shl_get() (which - does the equivalent of shl_findsym()) to find the plabel. */ - - args_for_find_stub args; - static char message[] = "Error while finding exception callback hook:\n"; - - args.solib_handle = gdbarch_tdep (current_gdbarch)->solib_get_solib_by_pc (eh_notify_callback_addr); - args.msym = msym; - args.return_val = 0; - - recurse++; - catch_errors (cover_find_stub_with_shl_get, &args, message, - RETURN_MASK_ALL); - eh_notify_callback_addr = args.return_val; - recurse--; - - deprecated_exception_catchpoints_are_fragile = 1; - - if (!eh_notify_callback_addr) - { - /* We can get here either if there is no plabel in the export list - for the main image, or if something strange happened (?) */ - warning (_("\ + if (!gdbarch_tdep (current_gdbarch)->is_elf) + { + /* Check whether the executable is dynamically linked or archive bound */ + /* With an archive-bound executable we can use the raw addresses we find + for the callback function, etc. without modification. For an executable + with shared libraries, we have to do more work to find the plabel, which + can be the target of a call through $$dyncall from the aCC runtime + support library (libCsup) which is linked shared by default by aCC. */ + /* This test below was copied from somsolib.c/somread.c. It may not be a very + reliable one to test that an executable is linked shared. + pai/1997-07-18 */ + shlib_info = bfd_get_section_by_name (symfile_objfile->obfd, "$SHLIB_INFO$"); + if (shlib_info && (bfd_section_size (symfile_objfile->obfd, shlib_info) != 0)) + { + /* The minsym we have has the local code address, but that's not + the plabel that can be used by an inter-load-module call. */ + /* Find solib handle for main image (which has end.o), and use + that and the min sym as arguments to __d_shl_get() (which + does the equivalent of shl_findsym()) to find the plabel. */ + + args_for_find_stub args; + static char message[] = "Error while finding exception callback hook:\n"; + + args.solib_handle = gdbarch_tdep (current_gdbarch)->solib_get_solib_by_pc (eh_notify_callback_addr); + args.msym = msym; + args.return_val = 0; + + recurse++; + catch_errors (cover_find_stub_with_shl_get, &args, message, + RETURN_MASK_ALL); + eh_notify_callback_addr = args.return_val; + recurse--; + + deprecated_exception_catchpoints_are_fragile = 1; + + if (!eh_notify_callback_addr) + { + /* We can get here either if there is no plabel in the export list + for the main image, or if something strange happened (?) */ + warning (_("\ Couldn't find a plabel (indirect function label) for the exception callback.\n\ GDB will not be able to intercept exception events.")); - return 0; - } + return 0; + } + } + else + deprecated_exception_catchpoints_are_fragile = 0; } - else - deprecated_exception_catchpoints_are_fragile = 0; -#endif /* Now, look for the breakpointable routine in end.o */ /* This should also be available in the SOM symbol dict. if end.o linked in */ @@ -1063,9 +1065,6 @@ Interception of exception events may not /* Record some information about the current exception event */ static struct exception_event_record current_ex_event; -/* Convenience struct */ -static struct symtab_and_line null_symtab_and_line = -{NULL, 0, 0, 0}; /* Report current exception event. Returns a pointer to a record that describes the kind of the event, where it was thrown from, Index: config/pa/hppa64.mt =================================================================== RCS file: /cvs/src/src/gdb/config/pa/hppa64.mt,v retrieving revision 1.6 diff -u -p -r1.6 hppa64.mt --- config/pa/hppa64.mt 13 Dec 2004 04:06:16 -0000 1.6 +++ config/pa/hppa64.mt 24 Feb 2006 23:57:32 -0000 @@ -1,3 +1,3 @@ # Target: HP PA-RISC 2.0 running HPUX 11.00 in wide mode TDEPFILES= hppa-tdep.o hppa-hpux-tdep.o solib-som.o solib-pa64.o somread.o hpread.o solib.o -DEPRECATED_TM_FILE= tm-hppa64.h +DEPRECATED_TM_FILE= tm-hppa.h --------------060007080606040006000300--