• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

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

修訂3101915abf7ce1188e58c811e8c8096fae441e3c (tree)
時間2015-10-17 03:52:29
作者Paul Koning <paul_koning@dell...>
CommiterPaul Koning

Log Message

convert exec target to to_xclose

This converts the exec target to use to_xclose, to make it suitable
for multi-target.

2014-07-29 Tom Tromey <tromey@redhat.com>

* exec.c (exec_xclose_1): Rename from exec_close_1. Free "self".
(add_target_sections): Push a new target instance.
(section_table_read_available_memory): Don't refer to "exec_ops".
(set_section_command): Likewise.
(init_exec_ops): Set to_xclose, not to_close.

Change Summary

差異

--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -105,11 +105,11 @@ exec_close (void)
105105 }
106106 }
107107
108-/* This is the target_close implementation. Clears all target
108+/* This is the target_xclose implementation. Clears all target
109109 sections and closes all executable bfds from all program spaces. */
110110
111111 static void
112-exec_close_1 (struct target_ops *self)
112+exec_xclose_1 (struct target_ops *self)
113113 {
114114 struct program_space *ss;
115115 struct cleanup *old_chain;
@@ -123,6 +123,7 @@ exec_close_1 (struct target_ops *self)
123123 }
124124
125125 do_cleanups (old_chain);
126+ xfree (self);
126127 }
127128
128129 void
@@ -512,7 +513,7 @@ add_target_sections (void *owner,
512513 /* If these are the first file sections we can provide memory
513514 from, push the file_stratum target. */
514515 if (!target_is_pushed (&exec_ops))
515- push_target (&exec_ops);
516+ push_target (TARGET_NEW (struct target_ops, &exec_ops));
516517 }
517518 }
518519
@@ -706,7 +707,7 @@ section_table_read_available_memory (gdb_byte *readbuf, ULONGEST offset,
706707 mem_range_s *r;
707708 int i;
708709
709- table = target_get_section_table (&exec_ops);
710+ table = current_target_sections;
710711 available_memory = section_table_available_memory (available_memory,
711712 offset, len,
712713 table->sections,
@@ -962,7 +963,7 @@ set_section_command (char *args, int from_tty)
962963 p->addr += offset;
963964 p->endaddr += offset;
964965 if (from_tty)
965- exec_files_info (&exec_ops);
966+ exec_files_info (NULL);
966967 return;
967968 }
968969 }
@@ -1031,7 +1032,7 @@ init_exec_ops (void)
10311032 exec_ops.to_doc = "Use an executable file as a target.\n\
10321033 Specify the filename of the executable file.";
10331034 exec_ops.to_open = exec_open;
1034- exec_ops.to_close = exec_close_1;
1035+ exec_ops.to_xclose = exec_xclose_1;
10351036 exec_ops.to_xfer_partial = exec_xfer_partial;
10361037 exec_ops.to_get_section_table = exec_get_section_table;
10371038 exec_ops.to_files_info = exec_files_info;