public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM] archer-sergio-catch-syscall: Modifications regarding comments received on the ml.
@ 2008-11-14 19:02 sergio
0 siblings, 0 replies; only message in thread
From: sergio @ 2008-11-14 19:02 UTC (permalink / raw)
To: archer-commits
The branch, archer-sergio-catch-syscall has been updated
via ccaa0ba4b4077936dfa4a4597ae3f989e55110e7 (commit)
from 589b9ef4c57807e3a2f5038f841b55b600bd9036 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email.
- Log -----------------------------------------------------------------
commit ccaa0ba4b4077936dfa4a4597ae3f989e55110e7
Author: Sergio Durigan Junior <sergiodj@linux.vnet.ibm.com>
Date: Fri Nov 14 11:02:36 2008 -0800
Modifications regarding comments received on the ml.
-----------------------------------------------------------------------
Summary of changes:
gdb/breakpoint.c | 36 +++++++++++++++++++++--------
gdb/completer.c | 9 -------
gdb/completer.h | 2 -
gdb/ppc-linux-tdep.c | 5 +++-
gdb/testsuite/gdb.base/catch-syscall.exp | 2 +-
gdb/xml-syscall.c | 2 +-
6 files changed, 32 insertions(+), 24 deletions(-)
First 500 lines of diff:
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index c185559..69d06b1 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -3187,7 +3187,8 @@ bpstat_what (bpstat bs)
/* We caught a shared library event. */
catch_shlib_event,
- /* We are in a entry breakpoint. */
+ /* We are in a entry breakpoint. It means we have stopped
+ at the inferior's entrypoint (AT_ENTRY). */
entry_breakpoint,
/* This is just used to count how many enums there are. */
@@ -5070,7 +5071,7 @@ print_one_catch_syscall (struct breakpoint *b, CORE_ADDR *last_addr)
ui_out_field_int (uiout, "what", b->syscall_number);
}
else
- ui_out_field_string (uiout, "what", "<unknown syscall>");
+ ui_out_field_string (uiout, "what", "<any syscall>");
ui_out_text (uiout, "\" ");
}
@@ -5085,7 +5086,7 @@ print_mention_catch_syscall (struct breakpoint *b)
struct syscall_filter *iter;
printf_filtered (_("Catchpoint %d (syscalls"), b->number);
for (iter = b->syscalls_to_be_caught; iter; iter = iter->next)
- printf_filtered (" %s",
+ printf_filtered (" '%s'",
gdbarch_syscall_name_from_number (current_gdbarch,
iter->syscall));
printf_filtered (")");
@@ -7288,8 +7289,8 @@ catch_syscall_split_args (char *arg)
if (gdbarch_syscall_name_from_number (current_gdbarch,
syscall_number) == NULL)
- error (_("The number '%d' does not represent a valid syscall."),
- syscall_number);
+ warning (_("The number '%d' does not represent a known syscall."),
+ syscall_number);
}
else
{
@@ -7299,7 +7300,7 @@ catch_syscall_split_args (char *arg)
gdbarch_syscall_number_from_name (current_gdbarch, cur_name);
if (syscall_number == UNKNOWN_SYSCALL)
- error (_("Invalid syscall name '%s'."), cur_name);
+ warning (_("Unknown syscall name '%s'."), cur_name);
}
/* Ok, it's valid. */
@@ -7330,6 +7331,12 @@ this architeture yet."));
ep_skip_leading_whitespace (&arg);
+ /* We need to do this first "dummy" translation in order
+ to get the syscall XML file loaded or, most important,
+ to display a warning to the user if there's no XML file
+ for his/her architecture. */
+ gdbarch_syscall_name_from_number (current_gdbarch, 0);
+
/* The allowed syntax is:
catch syscall
catch syscall <name | number> [<name | number> ... <name | number>]
@@ -7866,7 +7873,7 @@ delete_command (char *arg, int from_tty)
b->type != bp_shlib_event &&
b->type != bp_thread_event &&
b->type != bp_overlay_event &&
- b->type != bp_entry_breakpoint &&
+ b->type != bp_entry_breakpoint &&
b->number >= 0)
{
breaks_to_delete = 1;
@@ -7884,7 +7891,7 @@ delete_command (char *arg, int from_tty)
b->type != bp_shlib_event &&
b->type != bp_thread_event &&
b->type != bp_overlay_event &&
- b->type != bp_entry_breakpoint &&
+ b->type != bp_entry_breakpoint &&
b->number >= 0)
delete_breakpoint (b);
}
@@ -8800,6 +8807,15 @@ catching_syscall_number (int syscall_number)
return 0;
}
+/* Complete syscall names. Used by "catch syscall". */
+static char **
+catch_syscall_completer (char *text, char *word)
+{
+ const char **list =
+ gdbarch_get_syscall_names (current_gdbarch);
+ return (list == NULL) ? NULL : complete_on_enum (list, text, word);
+}
+
\f
/* This help string is used for the break, hbreak, tbreak and thbreak commands.
It is defined as a macro to prevent duplication.
@@ -9149,8 +9165,8 @@ With an argument, catch only exceptions with the given name."),
CATCH_PERMANENT,
CATCH_TEMPORARY);
add_catch_command ("syscall", _("\
-Catch calls to syscalls.\n\
-With an argument, catch only calls of that syscall."),
+Catch system calls.\n\
+With an argument, catch only that syscall."),
catch_syscall_command_1,
catch_syscall_completer,
CATCH_PERMANENT,
diff --git a/gdb/completer.c b/gdb/completer.c
index e88c33d..122974a 100644
--- a/gdb/completer.c
+++ b/gdb/completer.c
@@ -713,15 +713,6 @@ command_completer (char *text, char *word)
return complete_line_internal (word, text, strlen (text), 1);
}
-/* Complete syscall names. Used by "catch syscall". */
-char **
-catch_syscall_completer (char *text, char *word)
-{
- const char **list =
- gdbarch_get_syscall_names (current_gdbarch);
- return (list == NULL) ? NULL : complete_on_enum (list, text, word);
-}
-
/* Generate completions one by one for the completer. Each time we are
called return another potential completion to the caller.
line_completion just completes on commands or passes the buck to the
diff --git a/gdb/completer.h b/gdb/completer.h
index 2e10136..318594e 100644
--- a/gdb/completer.h
+++ b/gdb/completer.h
@@ -31,8 +31,6 @@ extern char **location_completer (char *, char *);
extern char **command_completer (char *, char *);
-extern char **catch_syscall_completer (char *text, char *word);
-
extern char *get_gdb_completer_quote_characters (void);
/* Exported to linespec.c */
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index 5ac4767..928d2a9 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -1012,6 +1012,7 @@ ppc_linux_get_syscall_number (struct gdbarch *gdbarch,
{
struct regcache *regcache = get_thread_regcache (ptid);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ struct cleanup *cleanbuf;
/* The content of a register */
gdb_byte *buf;
/* The result */
@@ -1022,13 +1023,15 @@ ppc_linux_get_syscall_number (struct gdbarch *gdbarch,
buf = (gdb_byte *) xmalloc (tdep->wordsize * sizeof (gdb_byte));
+ cleanbuf = make_cleanup (xfree, buf);
+
/* Getting the system call number from the register.
When dealing with PowerPC architecture, this information
is stored at 0th register. */
regcache_cooked_read (regcache, tdep->ppc_gp0_regnum, buf);
ret = extract_signed_integer (buf, tdep->wordsize);
- xfree (buf);
+ do_cleanups (cleanbuf);
return ret;
}
diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp
index 3e44c1c..1296cba 100644
--- a/gdb/testsuite/gdb.base/catch-syscall.exp
+++ b/gdb/testsuite/gdb.base/catch-syscall.exp
@@ -108,7 +108,7 @@ proc insert_catch_syscall_with_arg { syscall_name } {
# Trying to set the syscall
set thistest "catch syscall with arguments ($syscall_name)"
- gdb_test "catch syscall $syscall_name" "Catchpoint .*(syscall .$syscall_name.).*" $thistest
+ gdb_test "catch syscall $syscall_name" "Catchpoint .*(syscalls .$syscall_name.).*" $thistest
}
diff --git a/gdb/xml-syscall.c b/gdb/xml-syscall.c
index 4ddb751..498f58a 100644
--- a/gdb/xml-syscall.c
+++ b/gdb/xml-syscall.c
@@ -413,7 +413,7 @@ xml_list_of_syscalls (const struct syscalls_info *sysinfo)
for (i = 0;
VEC_iterate (syscall_desc_p, sysinfo->syscalls, i, sysdesc);
i++)
- names[i] = xstrdup (sysdesc->name);
+ names[i] = sysdesc->name;
names[i] = NULL;
hooks/post-receive
--
Repository for Project Archer.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-11-14 19:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-14 19:02 [SCM] archer-sergio-catch-syscall: Modifications regarding comments received on the ml sergio
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).