• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revisión8b94f1180ecc3d49e94bb497fa0e8f41b0b8a5fd (tree)
Tiempo2006-04-03 06:52:40
AutorDaniel Jacobowitz <drow@fals...>
CommiterDaniel Jacobowitz

Log Message

Add a Debian patch that prevents some bogus "No selected frame" errors.
This needs to go to mainline separately.

Cambiar Resumen

Diferencia incremental

--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -932,7 +932,7 @@ insert_bp_location (struct bp_location *bpt,
932932 /* FIXME drow/2003-09-09: It would be nice if evaluate_expression
933933 took a frame parameter, so that we didn't have to change the
934934 selected frame. */
935- saved_frame_id = get_frame_id (deprecated_selected_frame);
935+ saved_frame_id = get_frame_id (get_selected_frame (NULL));
936936
937937 /* Determine if the watchpoint is within scope. */
938938 if (bpt->owner->exp_valid_block == NULL)
@@ -5939,7 +5939,7 @@ until_break_command (char *arg, int from_tty, int anywhere)
59395939 {
59405940 struct symtabs_and_lines sals;
59415941 struct symtab_and_line sal;
5942- struct frame_info *prev_frame = get_prev_frame (deprecated_selected_frame);
5942+ struct frame_info *prev_frame = get_prev_frame (get_selected_frame (NULL));
59435943 struct breakpoint *breakpoint;
59445944 struct cleanup *old_chain;
59455945 struct continuation_arg *arg1;
@@ -5976,7 +5976,7 @@ until_break_command (char *arg, int from_tty, int anywhere)
59765976 /* Otherwise, specify the current frame, because we want to stop only
59775977 at the very same frame. */
59785978 breakpoint = set_momentary_breakpoint (sal,
5979- get_frame_id (deprecated_selected_frame),
5979+ get_frame_id (get_selected_frame (NULL)),
59805980 bp_until);
59815981
59825982 if (!target_can_async_p ())
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -862,10 +862,7 @@ disassemble_command (char *arg, int from_tty)
862862 name = NULL;
863863 if (!arg)
864864 {
865- if (!deprecated_selected_frame)
866- error (_("No frame selected."));
867-
868- pc = get_frame_pc (deprecated_selected_frame);
865+ pc = get_frame_pc (get_selected_frame (_("No frame selected.")));
869866 if (find_pc_partial_function (pc, &name, &low, &high) == 0)
870867 error (_("No function contains program counter for selected frame."));
871868 #if defined(TUI)
--- a/gdb/f-valprint.c
+++ b/gdb/f-valprint.c
@@ -71,7 +71,7 @@ f77_get_dynamic_lowerbound (struct type *type, int *lower_bound)
7171 switch (TYPE_ARRAY_LOWER_BOUND_TYPE (type))
7272 {
7373 case BOUND_BY_VALUE_ON_STACK:
74- current_frame_addr = get_frame_base (deprecated_selected_frame);
74+ current_frame_addr = get_frame_base (get_selected_frame (NULL));
7575 if (current_frame_addr > 0)
7676 {
7777 *lower_bound =
@@ -95,7 +95,7 @@ f77_get_dynamic_lowerbound (struct type *type, int *lower_bound)
9595 break;
9696
9797 case BOUND_BY_REF_ON_STACK:
98- current_frame_addr = get_frame_base (deprecated_selected_frame);
98+ current_frame_addr = get_frame_base (get_selected_frame (NULL));
9999 if (current_frame_addr > 0)
100100 {
101101 ptr_to_lower_bound =
@@ -129,7 +129,7 @@ f77_get_dynamic_upperbound (struct type *type, int *upper_bound)
129129 switch (TYPE_ARRAY_UPPER_BOUND_TYPE (type))
130130 {
131131 case BOUND_BY_VALUE_ON_STACK:
132- current_frame_addr = get_frame_base (deprecated_selected_frame);
132+ current_frame_addr = get_frame_base (get_selected_frame (NULL));
133133 if (current_frame_addr > 0)
134134 {
135135 *upper_bound =
@@ -158,7 +158,7 @@ f77_get_dynamic_upperbound (struct type *type, int *upper_bound)
158158 break;
159159
160160 case BOUND_BY_REF_ON_STACK:
161- current_frame_addr = get_frame_base (deprecated_selected_frame);
161+ current_frame_addr = get_frame_base (get_selected_frame (NULL));
162162 if (current_frame_addr > 0)
163163 {
164164 ptr_to_upper_bound =
@@ -643,10 +643,7 @@ info_common_command (char *comname, int from_tty)
643643 first make sure that it is visible and if so, let
644644 us display its contents */
645645
646- fi = deprecated_selected_frame;
647-
648- if (fi == NULL)
649- error (_("No frame selected"));
646+ fi = get_selected_frame (_("No frame selected"));
650647
651648 /* The following is generally ripped off from stack.c's routine
652649 print_frame_info() */
@@ -735,10 +732,7 @@ there_is_a_visible_common_named (char *comname)
735732 if (comname == NULL)
736733 error (_("Cannot deal with NULL common name!"));
737734
738- fi = deprecated_selected_frame;
739-
740- if (fi == NULL)
741- error (_("No frame selected"));
735+ fi = get_selected_frame (_("No frame selected"));
742736
743737 /* The following is generally ripped off from stack.c's routine
744738 print_frame_info() */
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -1308,10 +1308,8 @@ finish_command (char *arg, int from_tty)
13081308 error (_("The \"finish\" command does not take any arguments."));
13091309 if (!target_has_execution)
13101310 error (_("The program is not running."));
1311- if (deprecated_selected_frame == NULL)
1312- error (_("No selected frame."));
13131311
1314- frame = get_prev_frame (deprecated_selected_frame);
1312+ frame = get_prev_frame (get_selected_frame (_("No selected frame.")));
13151313 if (frame == 0)
13161314 error (_("\"finish\" not meaningful in the outermost frame."));
13171315
@@ -1329,7 +1327,7 @@ finish_command (char *arg, int from_tty)
13291327
13301328 /* Find the function we will return from. */
13311329
1332- function = find_pc_function (get_frame_pc (deprecated_selected_frame));
1330+ function = find_pc_function (get_frame_pc (get_selected_frame (NULL)));
13331331
13341332 /* Print info on the selected frame, including level number but not
13351333 source. */
@@ -1695,13 +1693,12 @@ registers_info (char *addr_exp, int fpregs)
16951693
16961694 if (!target_has_registers)
16971695 error (_("The program has no registers now."));
1698- if (deprecated_selected_frame == NULL)
1699- error (_("No selected frame."));
17001696
17011697 if (!addr_exp)
17021698 {
17031699 gdbarch_print_registers_info (current_gdbarch, gdb_stdout,
1704- deprecated_selected_frame, -1, fpregs);
1700+ get_selected_frame (_("No selected frame.")),
1701+ -1, fpregs);
17051702 return;
17061703 }
17071704
@@ -1734,12 +1731,12 @@ registers_info (char *addr_exp, int fpregs)
17341731
17351732 /* A register name? */
17361733 {
1737- int regnum = frame_map_name_to_regnum (deprecated_selected_frame,
1734+ int regnum = frame_map_name_to_regnum (get_selected_frame (_("No selected frame.")),
17381735 start, end - start);
17391736 if (regnum >= 0)
17401737 {
17411738 gdbarch_print_registers_info (current_gdbarch, gdb_stdout,
1742- deprecated_selected_frame, regnum, fpregs);
1739+ get_selected_frame (NULL), regnum, fpregs);
17431740 continue;
17441741 }
17451742 }
@@ -1753,7 +1750,7 @@ registers_info (char *addr_exp, int fpregs)
17531750 && regnum < NUM_REGS + NUM_PSEUDO_REGS)
17541751 {
17551752 gdbarch_print_registers_info (current_gdbarch, gdb_stdout,
1756- deprecated_selected_frame, regnum, fpregs);
1753+ get_selected_frame (NULL), regnum, fpregs);
17571754 continue;
17581755 }
17591756 }
@@ -1779,7 +1776,7 @@ registers_info (char *addr_exp, int fpregs)
17791776 if (gdbarch_register_reggroup_p (current_gdbarch, regnum,
17801777 group))
17811778 gdbarch_print_registers_info (current_gdbarch,
1782- gdb_stdout, deprecated_selected_frame,
1779+ gdb_stdout, get_selected_frame (NULL),
17831780 regnum, fpregs);
17841781 }
17851782 continue;
@@ -1809,8 +1806,6 @@ print_vector_info (struct gdbarch *gdbarch, struct ui_file *file,
18091806 {
18101807 if (!target_has_registers)
18111808 error (_("The program has no registers now."));
1812- if (deprecated_selected_frame == NULL)
1813- error (_("No selected frame."));
18141809
18151810 if (gdbarch_print_vector_info_p (gdbarch))
18161811 gdbarch_print_vector_info (gdbarch, file, frame, args);
@@ -1835,7 +1830,7 @@ print_vector_info (struct gdbarch *gdbarch, struct ui_file *file,
18351830 static void
18361831 vector_info (char *args, int from_tty)
18371832 {
1838- print_vector_info (current_gdbarch, gdb_stdout, deprecated_selected_frame, args);
1833+ print_vector_info (current_gdbarch, gdb_stdout, get_selected_frame (NULL), args);
18391834 }
18401835
18411836
@@ -2023,8 +2018,6 @@ print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
20232018 {
20242019 if (!target_has_registers)
20252020 error (_("The program has no registers now."));
2026- if (deprecated_selected_frame == NULL)
2027- error (_("No selected frame."));
20282021
20292022 if (gdbarch_print_float_info_p (gdbarch))
20302023 gdbarch_print_float_info (gdbarch, file, frame, args);
@@ -2051,7 +2044,7 @@ static void
20512044 float_info (char *args, int from_tty)
20522045 {
20532046 print_float_info (current_gdbarch, gdb_stdout,
2054- deprecated_selected_frame, args);
2047+ get_selected_frame (NULL), args);
20552048 }
20562049
20572050 static void
--- a/gdb/inflow.c
+++ b/gdb/inflow.c
@@ -588,7 +588,7 @@ kill_command (char *arg, int from_tty)
588588 if (target_has_stack)
589589 {
590590 printf_filtered (_("In %s,\n"), target_longname);
591- if (deprecated_selected_frame == NULL)
591+ if (deprecated_safe_get_selected_frame () == NULL)
592592 fputs_filtered ("No selected stack frame.\n", gdb_stdout);
593593 else
594594 print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC);
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -3590,7 +3590,7 @@ save_inferior_status (int restore_stack_info)
35903590
35913591 inf_status->registers = regcache_dup (current_regcache);
35923592
3593- inf_status->selected_frame_id = get_frame_id (deprecated_selected_frame);
3593+ inf_status->selected_frame_id = get_frame_id (get_selected_frame (NULL));
35943594 return inf_status;
35953595 }
35963596
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -1909,7 +1909,7 @@ func_command (char *arg, int from_tty)
19091909
19101910 if (!found)
19111911 printf_filtered (_("'%s' not within current stack frame.\n"), arg);
1912- else if (frame != deprecated_selected_frame)
1912+ else if (frame != get_selected_frame (NULL))
19131913 select_and_print_frame (frame);
19141914 }
19151915
@@ -1918,7 +1918,7 @@ func_command (char *arg, int from_tty)
19181918 enum language
19191919 get_frame_language (void)
19201920 {
1921- struct frame_info *frame = deprecated_selected_frame;
1921+ struct frame_info *frame = deprecated_safe_get_selected_frame ();
19221922
19231923 if (frame)
19241924 {
--- a/gdb/testsuite/gdb.base/default.exp
+++ b/gdb/testsuite/gdb.base/default.exp
@@ -167,7 +167,7 @@ gdb_test "disable breakpoints" "" "disable breakpoints"
167167 #test disable display
168168 gdb_test "disable display" "" "disable display"
169169 #test disassemble
170-gdb_test "disassemble" "No frame selected." "disassemble"
170+gdb_test "disassemble" "No (frame selected|registers)." "disassemble"
171171 #test display
172172 gdb_test "display" "" "display"
173173 #test do
@@ -229,9 +229,9 @@ gdb_expect {
229229 }
230230
231231 #test frame "f" abbreviation
232-gdb_test "f" "No stack." "frame \"f\" abbreviation"
232+gdb_test "f" "No (stack|registers)." "frame \"f\" abbreviation"
233233 #test frame
234-gdb_test "frame" "No stack." "frame"
234+gdb_test "frame" "No (stack|registers)." "frame"
235235 #test fg
236236 gdb_test "fg" "The program is not being run." "fg"
237237 # FIXME: fg kills the udi connection
@@ -294,9 +294,9 @@ gdb_test "ignore" "Argument required .a breakpoint number.*" "ignore"
294294 #test info address
295295 gdb_test "info address" "Argument required." "info address"
296296 #test info all-registers
297-gdb_test "info all-registers" "The program has no registers now." "info all-registers"
297+gdb_test "info all-registers" "(The program has no registers now|No registers)." "info all-registers"
298298 #test info args
299-gdb_test "info args" "No frame selected." "info args"
299+gdb_test "info args" "No (frame selected|registers)." "info args"
300300 #test info bogus-gdb-command
301301 gdb_test "info bogus-gdb-command" "Undefined info command: \"bogus-gdb-command\". Try \"help info\".*" "info bogus-gdb-command"
302302 #test info breakpoints
@@ -320,11 +320,11 @@ gdb_test "info frame" "No stack.|No selected frame." "info frame"
320320 #test info files
321321 gdb_test "info files" "" "info files"
322322 #test info float
323-gdb_test "info float" "The program has no registers now." "info float"
323+gdb_test "info float" "(The program has no registers now|No registers)." "info float"
324324 #test info functions
325325 gdb_test "info functions" "All defined functions:" "info functions"
326326 #test info locals
327-gdb_test "info locals" "No frame selected." "info locals"
327+gdb_test "info locals" "(No frame selected|No registers)." "info locals"
328328 #test info program
329329 gdb_test "info program" "The program being debugged is not being run." "info program"
330330 #test info registers
@@ -352,7 +352,7 @@ gdb_test "info types" "All defined types:" "info types"
352352 #test info variables
353353 gdb_test "info variables" "All defined variables:" "info variables"
354354 #test info vector
355-gdb_test "info vector" "The program has no registers now." "info vector"
355+gdb_test "info vector" "(The program has no registers now|No registers)." "info vector"
356356 #test info warranty
357357 gdb_test "info warranty" "NO WARRANTY(\[^\r\n\]*\[\r\n\])+ *11. *BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY(\[^\r\n\]*\[\r\n\])+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN(\[^\r\n\]*\[\r\n\])+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES(\[^\r\n\]*\[\r\n\])+PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED(\[^\r\n\]*\[\r\n\])+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF(\[^\r\n\]*\[\r\n\])+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS(\[^\r\n\]*\[\r\n\])+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE(\[^\r\n\]*\[\r\n\])+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,(\[^\r\n\]*\[\r\n\])+REPAIR OR CORRECTION.(\[^\r\n\]*\[\r\n\])+ *12. *IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING(\[^\r\n\]*\[\r\n\])+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR(\[^\r\n\]*\[\r\n\])+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,(\[^\r\n\]*\[\r\n\])+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING(\[^\r\n\]*\[\r\n\])+OUT OF THE USE OR INABILITY TO USE THE PROGRAM .INCLUDING BUT NOT LIMITED(\[^\r\n\]*\[\r\n\])+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY(\[^\r\n\]*\[\r\n\])+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER(\[^\r\n\]*\[\r\n\])+PROGRAMS., EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE(\[^\r\n\]*\[\r\n\])+POSSIBILITY OF SUCH DAMAGES.*" "info warranty"
358358 #test info watchpoints
--- a/gdb/tui/tui-disasm.c
+++ b/gdb/tui/tui-disasm.c
@@ -386,7 +386,7 @@ tui_vertical_disassem_scroll (enum tui_scroll_direction scroll_direction,
386386
387387 content = (tui_win_content) TUI_DISASM_WIN->generic.content;
388388 if (cursal.symtab == (struct symtab *) NULL)
389- s = find_pc_symtab (get_frame_pc (deprecated_selected_frame));
389+ s = find_pc_symtab (get_frame_pc (get_selected_frame (NULL)));
390390 else
391391 s = cursal.symtab;
392392
--- a/gdb/tui/tui-source.c
+++ b/gdb/tui/tui-source.c
@@ -330,7 +330,7 @@ tui_vertical_source_scroll (enum tui_scroll_direction scroll_direction,
330330 struct symtab_and_line cursal = get_current_source_symtab_and_line ();
331331
332332 if (cursal.symtab == (struct symtab *) NULL)
333- s = find_pc_symtab (get_frame_pc (deprecated_selected_frame));
333+ s = find_pc_symtab (get_frame_pc (get_selected_frame (NULL)));
334334 else
335335 s = cursal.symtab;
336336
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -314,7 +314,7 @@ tui_horizontal_source_scroll (struct tui_win_info * win_info,
314314 struct symtab_and_line cursal = get_current_source_symtab_and_line ();
315315
316316 if (cursal.symtab == (struct symtab *) NULL)
317- s = find_pc_symtab (get_frame_pc (deprecated_selected_frame));
317+ s = find_pc_symtab (get_frame_pc (get_selected_frame (NULL)));
318318 else
319319 s = cursal.symtab;
320320
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -544,7 +544,7 @@ value_assign (struct value *toval, struct value *fromval)
544544 /* Since modifying a register can trash the frame chain, and modifying memory
545545 can trash the frame cache, we save the old frame and then restore the new
546546 frame afterwards. */
547- old_frame = get_frame_id (deprecated_selected_frame);
547+ old_frame = get_frame_id (deprecated_safe_get_selected_frame ());
548548
549549 switch (VALUE_LVAL (toval))
550550 {
@@ -2605,16 +2605,18 @@ value_of_local (const char *name, int complain)
26052605 struct symbol *func, *sym;
26062606 struct block *b;
26072607 struct value * ret;
2608+ struct frame_info *frame;
26082609
2609- if (deprecated_selected_frame == 0)
2610+ if (complain)
2611+ frame = get_selected_frame (_("no frame selected"));
2612+ else
26102613 {
2611- if (complain)
2612- error (_("no frame selected"));
2613- else
2614+ frame = deprecated_safe_get_selected_frame ();
2615+ if (frame == 0)
26142616 return 0;
26152617 }
26162618
2617- func = get_frame_function (deprecated_selected_frame);
2619+ func = get_frame_function (frame);
26182620 if (!func)
26192621 {
26202622 if (complain)
@@ -2643,7 +2645,7 @@ value_of_local (const char *name, int complain)
26432645 return NULL;
26442646 }
26452647
2646- ret = read_var_value (sym, deprecated_selected_frame);
2648+ ret = read_var_value (sym, frame);
26472649 if (ret == 0 && complain)
26482650 error (_("`%s' argument unreadable"), name);
26492651 return ret;
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -498,7 +498,7 @@ varobj_create (char *objname,
498498 if (fi != NULL)
499499 {
500500 var->root->frame = get_frame_id (fi);
501- old_fi = deprecated_selected_frame;
501+ old_fi = get_selected_frame (NULL);
502502 select_frame (fi);
503503 }
504504