Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(666)

Unified Diff: gdb/common/signals.c

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/common/queue.h ('k') | gdb/common/vec.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/common/signals.c
diff --git a/gdb/common/signals.c b/gdb/common/signals.c
index 3ef98402c10c759742ea90ed13c1ceacd55aedc5..299519505a1f6cec862025aa4227ed2aa7ac47bc 100644
--- a/gdb/common/signals.c
+++ b/gdb/common/signals.c
@@ -1,5 +1,5 @@
/* Target signal translation functions for GDB.
- Copyright (C) 1990-2003, 2006-2012 Free Software Foundation, Inc.
+ Copyright (C) 1990-2013 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file is part of GDB.
@@ -21,7 +21,7 @@
#include "server.h"
#else
#include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
#endif
#ifdef HAVE_SIGNAL_H
@@ -29,6 +29,7 @@
#endif
#include "gdb_signals.h"
+#include "gdb_assert.h"
struct gdbarch;
@@ -50,15 +51,23 @@ struct gdbarch;
gdb_signal. */
static const struct {
+ const char *symbol;
const char *name;
const char *string;
} signals [] =
{
-#define SET(symbol, constant, name, string) { name, string },
+#define SET(symbol, constant, name, string) { #symbol, name, string },
#include "gdb/signals.def"
#undef SET
};
+const char *
+gdb_signal_to_symbol_string (enum gdb_signal sig)
+{
+ gdb_assert ((int) sig >= GDB_SIGNAL_FIRST && (int) sig <= GDB_SIGNAL_LAST);
+
+ return signals[sig].symbol;
+}
/* Return the string for a signal. */
const char *
@@ -306,27 +315,27 @@ gdb_signal_from_host (int hostsig)
/* Mach exceptions. Assumes that the values for EXC_ are positive! */
#if defined (EXC_BAD_ACCESS) && defined (_NSIG)
if (hostsig == _NSIG + EXC_BAD_ACCESS)
- return TARGET_EXC_BAD_ACCESS;
+ return GDB_EXC_BAD_ACCESS;
#endif
#if defined (EXC_BAD_INSTRUCTION) && defined (_NSIG)
if (hostsig == _NSIG + EXC_BAD_INSTRUCTION)
- return TARGET_EXC_BAD_INSTRUCTION;
+ return GDB_EXC_BAD_INSTRUCTION;
#endif
#if defined (EXC_ARITHMETIC) && defined (_NSIG)
if (hostsig == _NSIG + EXC_ARITHMETIC)
- return TARGET_EXC_ARITHMETIC;
+ return GDB_EXC_ARITHMETIC;
#endif
#if defined (EXC_EMULATION) && defined (_NSIG)
if (hostsig == _NSIG + EXC_EMULATION)
- return TARGET_EXC_EMULATION;
+ return GDB_EXC_EMULATION;
#endif
#if defined (EXC_SOFTWARE) && defined (_NSIG)
if (hostsig == _NSIG + EXC_SOFTWARE)
- return TARGET_EXC_SOFTWARE;
+ return GDB_EXC_SOFTWARE;
#endif
#if defined (EXC_BREAKPOINT) && defined (_NSIG)
if (hostsig == _NSIG + EXC_BREAKPOINT)
- return TARGET_EXC_BREAKPOINT;
+ return GDB_EXC_BREAKPOINT;
#endif
#if defined (SIGINFO)
@@ -562,27 +571,27 @@ do_gdb_signal_to_host (enum gdb_signal oursig,
/* Mach exceptions. Assumes that the values for EXC_ are positive! */
#if defined (EXC_BAD_ACCESS) && defined (_NSIG)
- case TARGET_EXC_BAD_ACCESS:
+ case GDB_EXC_BAD_ACCESS:
return _NSIG + EXC_BAD_ACCESS;
#endif
#if defined (EXC_BAD_INSTRUCTION) && defined (_NSIG)
- case TARGET_EXC_BAD_INSTRUCTION:
+ case GDB_EXC_BAD_INSTRUCTION:
return _NSIG + EXC_BAD_INSTRUCTION;
#endif
#if defined (EXC_ARITHMETIC) && defined (_NSIG)
- case TARGET_EXC_ARITHMETIC:
+ case GDB_EXC_ARITHMETIC:
return _NSIG + EXC_ARITHMETIC;
#endif
#if defined (EXC_EMULATION) && defined (_NSIG)
- case TARGET_EXC_EMULATION:
+ case GDB_EXC_EMULATION:
return _NSIG + EXC_EMULATION;
#endif
#if defined (EXC_SOFTWARE) && defined (_NSIG)
- case TARGET_EXC_SOFTWARE:
+ case GDB_EXC_SOFTWARE:
return _NSIG + EXC_SOFTWARE;
#endif
#if defined (EXC_BREAKPOINT) && defined (_NSIG)
- case TARGET_EXC_BREAKPOINT:
+ case GDB_EXC_BREAKPOINT:
return _NSIG + EXC_BREAKPOINT;
#endif
« no previous file with comments | « gdb/common/queue.h ('k') | gdb/common/vec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698