From patchwork Thu Nov 13 12:54:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 3707 Received: (qmail 12145 invoked by alias); 13 Nov 2014 12:55:55 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 12105 invoked by uid 89); 13 Nov 2014 12:55:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, KAM_STOCKGEN, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-pd0-f180.google.com Received: from mail-pd0-f180.google.com (HELO mail-pd0-f180.google.com) (209.85.192.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 13 Nov 2014 12:55:53 +0000 Received: by mail-pd0-f180.google.com with SMTP id ft15so14498018pdb.11 for ; Thu, 13 Nov 2014 04:55:51 -0800 (PST) X-Received: by 10.68.93.132 with SMTP id cu4mr2597417pbb.36.1415883351297; Thu, 13 Nov 2014 04:55:51 -0800 (PST) Received: from sspiff.org (173-13-178-53-sfba.hfc.comcastbusiness.net. [173.13.178.53]) by mx.google.com with ESMTPSA id mz4sm24841555pbc.28.2014.11.13.04.55.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Nov 2014 04:55:50 -0800 (PST) Message-ID: <5464aa56.24d3440a.5849.ffffa32f@mx.google.com> Received: by sspiff.org (sSMTP sendmail emulation); Thu, 13 Nov 2014 04:54:58 -0800 Date: Thu, 13 Nov 2014 04:54:58 -0800 From: Doug Evans To: gdb-patches@sourceware.org Subject: [PATCH 04/21] struct symtab split part 2: amd64-tdep.c arm-tdep.c i386-tdep.c spu-tdep.c X-IsSubscribed: yes This patch contains the changes to amd64-tdep.c, arm-tdep.c, i386-tdep.c, spu-tdep.c. Full ChangeLog: https://sourceware.org/ml/gdb-patches/2014-11/msg00233.html 2014-11-12 Doug Evans * amd64-tdep.c (amd64_skip_xmm_prologue): Fetch producer from compunit. * i386-tdep.c (i386_skip_prologue): Fetch producer from compunit. diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index ed41f88..e69da01 100644 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -2301,7 +2301,8 @@ amd64_skip_xmm_prologue (CORE_ADDR pc, CORE_ADDR start_pc) start_pc_sal = find_pc_sect_line (start_pc, NULL, 0); if (start_pc_sal.symtab == NULL - || producer_is_gcc_ge_4 (start_pc_sal.symtab->producer) < 6 + || producer_is_gcc_ge_4 (COMPUNIT_PRODUCER + (SYMTAB_COMPUNIT (start_pc_sal.symtab))) < 6 || start_pc_sal.pc != start_pc || pc >= start_pc_sal.end) return pc; @@ -2364,14 +2365,15 @@ amd64_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc) { CORE_ADDR post_prologue_pc = skip_prologue_using_sal (gdbarch, func_addr); - struct symtab *s = find_pc_symtab (func_addr); + struct compunit_symtab *cust = find_pc_compunit_symtab (func_addr); /* Clang always emits a line note before the prologue and another one after. We trust clang to emit usable line notes. */ if (post_prologue_pc - && (s != NULL - && s->producer != NULL - && strncmp (s->producer, "clang ", sizeof ("clang ") - 1) == 0)) + && (cust != NULL + && COMPUNIT_PRODUCER (cust) != NULL + && strncmp (COMPUNIT_PRODUCER (cust), "clang ", + sizeof ("clang ") - 1) == 0)) return max (start_pc, post_prologue_pc); } @@ -2713,10 +2715,10 @@ static int amd64_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc) { gdb_byte insn; - struct symtab *symtab; + struct compunit_symtab *cust; - symtab = find_pc_symtab (pc); - if (symtab && symtab->epilogue_unwind_valid) + cust = find_pc_compunit_symtab (pc); + if (cust != NULL && COMPUNIT_EPILOGUE_UNWIND_VALID (cust)) return 0; if (target_read_memory (pc, &insn, 1)) diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 9e632a7..1002870 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -1398,7 +1398,7 @@ arm_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) { CORE_ADDR post_prologue_pc = skip_prologue_using_sal (gdbarch, func_addr); - struct symtab *s = find_pc_symtab (func_addr); + struct compunit_symtab *cust = find_pc_compunit_symtab (func_addr); if (post_prologue_pc) post_prologue_pc @@ -1412,10 +1412,12 @@ arm_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) will have producer information for most binaries; if it is missing (e.g. for -gstabs), assuming the GNU tools. */ if (post_prologue_pc - && (s == NULL - || s->producer == NULL - || strncmp (s->producer, "GNU ", sizeof ("GNU ") - 1) == 0 - || strncmp (s->producer, "clang ", sizeof ("clang ") - 1) == 0)) + && (cust == NULL + || COMPUNIT_PRODUCER (cust) == NULL + || strncmp (COMPUNIT_PRODUCER (cust), "GNU ", + sizeof ("GNU ") - 1) == 0 + || strncmp (COMPUNIT_PRODUCER (cust), "clang ", + sizeof ("clang ") - 1) == 0)) return post_prologue_pc; if (post_prologue_pc != 0) diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 8387c72..c80e844 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -1817,14 +1817,15 @@ i386_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc) { CORE_ADDR post_prologue_pc = skip_prologue_using_sal (gdbarch, func_addr); - struct symtab *s = find_pc_symtab (func_addr); + struct compunit_symtab *cust = find_pc_compunit_symtab (func_addr); /* Clang always emits a line note before the prologue and another one after. We trust clang to emit usable line notes. */ if (post_prologue_pc - && (s != NULL - && s->producer != NULL - && strncmp (s->producer, "clang ", sizeof ("clang ") - 1) == 0)) + && (cust != NULL + && COMPUNIT_PRODUCER (cust) != NULL + && strncmp (COMPUNIT_PRODUCER (cust), "clang ", + sizeof ("clang ") - 1) == 0)) return max (start_pc, post_prologue_pc); } @@ -2183,10 +2184,10 @@ static int i386_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc) { gdb_byte insn; - struct symtab *symtab; + struct compunit_symtab *cust; - symtab = find_pc_symtab (pc); - if (symtab && symtab->epilogue_unwind_valid) + cust = find_pc_compunit_symtab (pc); + if (cust != NULL && COMPUNIT_EPILOGUE_UNWIND_VALID (cust)) return 0; if (target_read_memory (pc, &insn, 1)) diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c index 897cd72..fe8f1d9 100644 --- a/gdb/spu-tdep.c +++ b/gdb/spu-tdep.c @@ -1953,7 +1953,7 @@ static void spu_catch_start (struct objfile *objfile) { struct bound_minimal_symbol minsym; - struct symtab *symtab; + struct compunit_symtab *cust; CORE_ADDR pc; char buf[32]; @@ -1978,11 +1978,12 @@ spu_catch_start (struct objfile *objfile) /* If we have debugging information, try to use it -- this will allow us to properly skip the prologue. */ pc = BMSYMBOL_VALUE_ADDRESS (minsym); - symtab = find_pc_sect_symtab (pc, MSYMBOL_OBJ_SECTION (minsym.objfile, - minsym.minsym)); - if (symtab != NULL) + cust + = find_pc_sect_compunit_symtab (pc, MSYMBOL_OBJ_SECTION (minsym.objfile, + minsym.minsym)); + if (cust != NULL) { - const struct blockvector *bv = SYMTAB_BLOCKVECTOR (symtab); + const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (cust); struct block *block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); struct symbol *sym; struct symtab_and_line sal;