From: Ramana Radhakrishnan <ramana.radhakrishnan@codito.com>
To: gdb-patches@sources.redhat.com
Subject: Fix for PR 1971 .
Date: Tue, 03 Jan 2006 18:41:00 -0000 [thread overview]
Message-ID: <1136312069.8808.24.camel@localhost.localdomain> (raw)
[-- Attachment #1: Type: text/plain, Size: 791 bytes --]
Hi ,
Attached is a fix for PR 1971. This inserts a breakpoint at the return
address for a function that does not have a previous frame which is what
you have in the case of main. This would however not stop after the
return from main because the semantics of the next command would not
stop the execution in any place where there is no debug information.
Tested on native x86 with today's head as well as 6.4 branch with no
extra regressions .
Ok to commit with an additional testcase ?
cheers
Ramana
2006-01-03 Ramana Radhakrishnan <ramana.radhakrishnan@codito.com>
PR 1971
* infrun.c (handle_inferior_event): Handle case where previous
frame can be NULL. Use insert_step_resume_breakpoint_at_sal instead.
--
Ramana Radhakrishnan
GNU Tools
codito ergo sum (www.codito.com)
[-- Attachment #2: patch-pr1971 --]
[-- Type: text/x-patch, Size: 1187 bytes --]
Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.208
diff -u -a -u -r1.208 infrun.c
--- infrun.c 17 Dec 2005 22:34:01 -0000 1.208
+++ infrun.c 3 Jan 2006 17:48:16 -0000
@@ -2390,8 +2390,22 @@
/* We're doing a "next", set a breakpoint at callee's return
address (the address at which the caller will
resume). */
- insert_step_resume_breakpoint_at_frame (get_prev_frame (get_current_frame ()));
- keep_going (ecs);
+ /* We're doing a "next", set a breakpoint at callee's return
+ address (the address at which the caller will
+ resume). */
+ if (get_prev_frame ( get_current_frame ()))
+ {
+ insert_step_resume_breakpoint_at_frame (get_prev_frame (get_current_frame ()));
+ }
+ else
+ {
+ struct symtab_and_line sr_sal;
+ init_sal (&sr_sal); /* initialize to zeros */
+ sr_sal.pc = ADDR_BITS_REMOVE (gdbarch_unwind_pc (current_gdbarch,get_current_frame()));
+ sr_sal.section = find_pc_overlay (sr_sal.pc);
+ insert_step_resume_breakpoint_at_sal (sr_sal, null_frame_id);
+ }
+ keep_going (ecs);
return;
}
next reply other threads:[~2006-01-03 18:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-03 18:41 Ramana Radhakrishnan [this message]
2006-01-03 23:34 ` Jim Blandy
2006-01-03 23:43 ` Jim Blandy
2006-01-04 5:07 ` Ramana Radhakrishnan
2006-01-04 5:55 ` Jim Blandy
2006-01-04 6:52 ` Ramana Radhakrishnan
2006-01-04 7:57 ` Jim Blandy
2006-01-04 8:27 ` Ramana Radhakrishnan
2006-01-04 13:56 ` Daniel Jacobowitz
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=1136312069.8808.24.camel@localhost.localdomain \
--to=ramana.radhakrishnan@codito.com \
--cc=gdb-patches@sources.redhat.com \
/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: link
Be 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