projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove cmd_cfunc_ftype
[deliverable/binutils-gdb.git]
/
gdb
/
windows-nat.c
diff --git
a/gdb/windows-nat.c
b/gdb/windows-nat.c
index 1ef38fb32b4bd8cb9d9907ba1c7d728658a9f446..dc6dbddf3b58a471779a47e45e79cfb3ed7af9ee 100644
(file)
--- a/
gdb/windows-nat.c
+++ b/
gdb/windows-nat.c
@@
-42,6
+42,7
@@
#include <sys/cygwin.h>
#include <cygwin/version.h>
#endif
#include <sys/cygwin.h>
#include <cygwin/version.h>
#endif
+#include <algorithm>
#include "buildsym.h"
#include "filenames.h"
#include "buildsym.h"
#include "filenames.h"
@@
-465,7
+466,7
@@
do_windows_fetch_inferior_registers (struct regcache *regcache,
windows_thread_info *th, int r)
{
char *context_offset = ((char *) &th->context) + mappings[r];
windows_thread_info *th, int r)
{
char *context_offset = ((char *) &th->context) + mappings[r];
- struct gdbarch *gdbarch =
get_regcache_arch (regcache
);
+ struct gdbarch *gdbarch =
regcache->arch (
);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
long l;
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
long l;
@@
-552,7
+553,7
@@
do_windows_store_inferior_registers (const struct regcache *regcache,
((char *) &th->context) + mappings[r]);
else
{
((char *) &th->context) + mappings[r]);
else
{
- for (r = 0; r < gdbarch_num_regs (
get_regcache_arch (regcache
)); r++)
+ for (r = 0; r < gdbarch_num_regs (
regcache->arch (
)); r++)
do_windows_store_inferior_registers (regcache, th, r);
}
}
do_windows_store_inferior_registers (regcache, th, r);
}
}
@@
-755,8
+756,8
@@
get_image_name (HANDLE h, void *address, int unicode)
do_initial_windows_stuff and windows_add_all_dlls for more info
on how we handle DLL loading during that phase). */
do_initial_windows_stuff and windows_add_all_dlls for more info
on how we handle DLL loading during that phase). */
-static
int
-handle_load_dll (
void *dummy
)
+static
void
+handle_load_dll ()
{
LOAD_DLL_DEBUG_INFO *event = ¤t_event.u.LoadDll;
char *dll_name;
{
LOAD_DLL_DEBUG_INFO *event = ¤t_event.u.LoadDll;
char *dll_name;
@@
-769,7
+770,7
@@
handle_load_dll (void *dummy)
dll_name = get_image_name (current_process_handle,
event->lpImageName, event->fUnicode);
if (!dll_name)
dll_name = get_image_name (current_process_handle,
event->lpImageName, event->fUnicode);
if (!dll_name)
- return
1
;
+ return;
solib_end->next = windows_make_so (dll_name, event->lpBaseOfDll);
solib_end = solib_end->next;
solib_end->next = windows_make_so (dll_name, event->lpBaseOfDll);
solib_end = solib_end->next;
@@
-778,8
+779,6
@@
handle_load_dll (void *dummy)
DEBUG_EVENTS (("gdb: Loading dll \"%s\" at %s.\n", solib_end->so_name,
host_address_to_string (li->load_addr)));
DEBUG_EVENTS (("gdb: Loading dll \"%s\" at %s.\n", solib_end->so_name,
host_address_to_string (li->load_addr)));
-
- return 1;
}
static void
}
static void
@@
-799,8
+798,8
@@
windows_free_so (struct so_list *so)
do_initial_windows_stuff and windows_add_all_dlls for more info
on how we handle DLL loading during that phase). */
do_initial_windows_stuff and windows_add_all_dlls for more info
on how we handle DLL loading during that phase). */
-static
int
-handle_unload_dll (
void *dummy
)
+static
void
+handle_unload_dll ()
{
LPVOID lpBaseOfDll = current_event.u.UnloadDll.lpBaseOfDll;
struct so_list *so;
{
LPVOID lpBaseOfDll = current_event.u.UnloadDll.lpBaseOfDll;
struct so_list *so;
@@
-819,7
+818,7
@@
handle_unload_dll (void *dummy)
DEBUG_EVENTS (("gdb: Unloading dll \"%s\".\n", sodel->so_name));
windows_free_so (sodel);
DEBUG_EVENTS (("gdb: Unloading dll \"%s\".\n", sodel->so_name));
windows_free_so (sodel);
- return
1
;
+ return;
}
}
}
}
@@
-832,8
+831,23
@@
handle_unload_dll (void *dummy)
32bit and 64bit worlds). */
complaint (&symfile_complaints, _("dll starting at %s not found."),
host_address_to_string (lpBaseOfDll));
32bit and 64bit worlds). */
complaint (&symfile_complaints, _("dll starting at %s not found."),
host_address_to_string (lpBaseOfDll));
+}
- return 0;
+/* Call FUNC wrapped in a TRY/CATCH that swallows all GDB
+ exceptions. */
+
+static void
+catch_errors (void (*func) ())
+{
+ TRY
+ {
+ func ();
+ }
+ CATCH (ex, RETURN_MASK_ALL)
+ {
+ exception_print (gdb_stderr, ex);
+ }
+ END_CATCH
}
/* Clear list of loaded DLLs. */
}
/* Clear list of loaded DLLs. */
@@
-845,7
+859,7
@@
windows_clear_solib (void)
}
static void
}
static void
-signal_event_command (char *args, int from_tty)
+signal_event_command (c
onst c
har *args, int from_tty)
{
uintptr_t event_id = 0;
char *endargs = NULL;
{
uintptr_t event_id = 0;
char *endargs = NULL;
@@
-1006,7
+1020,7
@@
display_selector (HANDLE thread, DWORD sel)
}
static void
}
static void
-display_selectors (char * args, int from_tty)
+display_selectors (c
onst c
har * args, int from_tty)
{
if (!current_thread)
{
{
if (!current_thread)
{
@@
-1362,7
+1376,7
@@
windows_resume (struct target_ops *ops,
{
/* Single step by setting t bit. */
struct regcache *regcache = get_current_regcache ();
{
/* Single step by setting t bit. */
struct regcache *regcache = get_current_regcache ();
- struct gdbarch *gdbarch =
get_regcache_arch (regcache
);
+ struct gdbarch *gdbarch =
regcache->arch (
);
windows_fetch_inferior_registers (ops, regcache,
gdbarch_ps_regnum (gdbarch));
th->context.EFlags |= FLAG_TRACE_BIT;
windows_fetch_inferior_registers (ops, regcache,
gdbarch_ps_regnum (gdbarch));
th->context.EFlags |= FLAG_TRACE_BIT;
@@
-1541,7
+1555,7
@@
get_windows_debug_event (struct target_ops *ops,
CloseHandle (current_event.u.LoadDll.hFile);
if (saw_create != 1 || ! windows_initialization_done)
break;
CloseHandle (current_event.u.LoadDll.hFile);
if (saw_create != 1 || ! windows_initialization_done)
break;
- catch_errors (handle_load_dll
, NULL, (char *) "", RETURN_MASK_ALL
);
+ catch_errors (handle_load_dll);
ourstatus->kind = TARGET_WAITKIND_LOADED;
ourstatus->value.integer = 0;
thread_id = main_thread_id;
ourstatus->kind = TARGET_WAITKIND_LOADED;
ourstatus->value.integer = 0;
thread_id = main_thread_id;
@@
-1554,7
+1568,7
@@
get_windows_debug_event (struct target_ops *ops,
"UNLOAD_DLL_DEBUG_EVENT"));
if (saw_create != 1 || ! windows_initialization_done)
break;
"UNLOAD_DLL_DEBUG_EVENT"));
if (saw_create != 1 || ! windows_initialization_done)
break;
- catch_errors (handle_unload_dll
, NULL, (char *) "", RETURN_MASK_ALL
);
+ catch_errors (handle_unload_dll);
ourstatus->kind = TARGET_WAITKIND_LOADED;
ourstatus->value.integer = 0;
thread_id = main_thread_id;
ourstatus->kind = TARGET_WAITKIND_LOADED;
ourstatus->value.integer = 0;
thread_id = main_thread_id;
This page took
0.025816 seconds
and
4
git commands to generate.