public inbox for gdb-prs@sourceware.org help / color / mirror / Atom feed
From: "guosheng_gao at realsil dot com.cn" <sourceware-bugzilla@sourceware.org> To: gdb-prs@sourceware.org Subject: [Bug gdb/16157] New: the function get_pc_function_start (CORE_ADDR pc) maybe inaccurate Date: Tue, 12 Nov 2013 06:12:00 -0000 [thread overview] Message-ID: <bug-16157-4717@http.sourceware.org/bugzilla/> (raw) http://sourceware.org/bugzilla/show_bug.cgi?id=16157 Bug ID: 16157 Summary: the function get_pc_function_start (CORE_ADDR pc) maybe inaccurate Product: gdb Version: unknown Status: NEW Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: guosheng_gao at realsil dot com.cn get_pc_function_start(CORE_ADDR pc) try to get the function start for a special pc, but the function lookup_minimal_symbol_by_pc(CORE_ADDR pc) may return a minimal_symbol, which is not a function(e.g. a label in assembler code). So the fstart is not a function start address, too. This may cause a problem: in following code, GDB can not stop when try to next over Line 1.(lop2 and lop3 are mistaken for a function, so GDB thinks that it step into a new function, set a breakpoint at the address stored in register $ra, and run to it) Is this correct? ========================== #.globl hardware_hazard_hook .text .globl _start .ent _start _start: .set noreorder addiu v0, 1 addiu v0, 1 lop3: addiu v0, 1 addiu v0, 1 lop2: addiu v0, 1// Line 1 addiu v0, 1 lop1: addiu v0, 1 addiu v0, 1 addiu v0, 1 addiu v0, 1 nop ... ------------------------------- gdb/minsyms.c CORE_ADDR get_pc_function_start (CORE_ADDR pc) { struct block *bl; struct minimal_symbol *msymbol; bl = block_for_pc (pc); if (bl) { struct symbol *symbol = block_linkage_function (bl); if (symbol) { bl = SYMBOL_BLOCK_VALUE (symbol); return BLOCK_START (bl); } } msymbol = lookup_minimal_symbol_by_pc (pc); if (msymbol) { CORE_ADDR fstart = SYMBOL_VALUE_ADDRESS (msymbol); if (find_pc_section (fstart)) return fstart; } return 0; } -- You are receiving this mail because: You are on the CC list for the bug.
next reply other threads:[~2013-11-12 6:12 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-11-12 6:12 guosheng_gao at realsil dot com.cn [this message] 2013-11-12 11:46 ` [Bug gdb/16157] " palves at redhat dot com 2013-11-12 13:01 ` guosheng_gao at realsil dot com.cn 2013-11-12 13:18 ` guosheng_gao at realsil dot com.cn 2013-11-12 14:29 ` palves at redhat dot com 2013-11-13 2:49 ` guosheng_gao at realsil dot com.cn 2013-11-13 3:10 ` guosheng_gao at realsil dot com.cn 2013-11-13 10:06 ` palves at redhat dot com 2013-11-14 9:57 ` guosheng_gao at realsil dot com.cn
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-16157-4717@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=gdb-prs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).