Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153637595
D36565.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D36565.diff
View Options
diff --git a/sys/amd64/amd64/db_trace.c b/sys/amd64/amd64/db_trace.c
--- a/sys/amd64/amd64/db_trace.c
+++ b/sys/amd64/amd64/db_trace.c
@@ -34,7 +34,6 @@
#include <sys/reg.h>
#include <sys/smp.h>
#include <sys/stack.h>
-#include <sys/sysent.h>
#include <machine/cpu.h>
#include <machine/md_var.h>
@@ -139,28 +138,6 @@
db_printf("\n");
}
-static void
-decode_syscall(int number, struct thread *td)
-{
- struct proc *p;
- c_db_sym_t sym;
- db_expr_t diff;
- sy_call_t *f;
- const char *symname;
-
- db_printf(" (%d", number);
- p = (td != NULL) ? td->td_proc : NULL;
- if (p != NULL && 0 <= number && number < p->p_sysent->sv_size) {
- f = p->p_sysent->sv_table[number].sy_call;
- sym = db_search_symbol((db_addr_t)f, DB_STGY_ANY, &diff);
- if (sym != DB_SYM_NULL && diff == 0) {
- db_symbol_values(sym, &symname, NULL);
- db_printf(", %s, %s", p->p_sysent->sv_name, symname);
- }
- }
- db_printf(")");
-}
-
/*
* Figure out the next frame up in the call stack.
*/
@@ -242,7 +219,7 @@
break;
case SYSCALL:
db_printf("--- syscall");
- decode_syscall(tf->tf_rax, td);
+ db_decode_syscall(tf->tf_rax, td);
break;
case INTERRUPT:
db_printf("--- interrupt");
diff --git a/sys/ddb/db_sym.h b/sys/ddb/db_sym.h
--- a/sys/ddb/db_sym.h
+++ b/sys/ddb/db_sym.h
@@ -105,4 +105,6 @@
void X_db_symbol_values(db_symtab_t *symtab, c_db_sym_t sym,
const char **namep, db_expr_t *valuep);
+void db_decode_syscall(int number, struct thread *td);
+
#endif /* !_DDB_DB_SYM_H_ */
diff --git a/sys/ddb/db_sym.c b/sys/ddb/db_sym.c
--- a/sys/ddb/db_sym.c
+++ b/sys/ddb/db_sym.c
@@ -38,7 +38,7 @@
#include <sys/param.h>
#include <sys/pcpu.h>
#include <sys/smp.h>
-#include <sys/systm.h>
+#include <sys/sysent.h>
#include <net/vnet.h>
@@ -481,3 +481,25 @@
{
return (X_db_sym_numargs(db_last_symtab, sym, nargp, argnames));
}
+
+void
+db_decode_syscall(int number, struct thread *td)
+{
+ struct proc *p;
+ c_db_sym_t sym;
+ db_expr_t diff;
+ sy_call_t *f;
+ const char *symname;
+
+ db_printf(" (%d", number);
+ p = (td != NULL) ? td->td_proc : NULL;
+ if (p != NULL && 0 <= number && number < p->p_sysent->sv_size) {
+ f = p->p_sysent->sv_table[number].sy_call;
+ sym = db_search_symbol((db_addr_t)f, DB_STGY_ANY, &diff);
+ if (sym != DB_SYM_NULL && diff == 0) {
+ db_symbol_values(sym, &symname, NULL);
+ db_printf(", %s, %s", p->p_sysent->sv_name, symname);
+ }
+ }
+ db_printf(")");
+}
diff --git a/sys/i386/i386/db_trace.c b/sys/i386/i386/db_trace.c
--- a/sys/i386/i386/db_trace.c
+++ b/sys/i386/i386/db_trace.c
@@ -32,7 +32,6 @@
#include <sys/kdb.h>
#include <sys/proc.h>
#include <sys/reg.h>
-#include <sys/sysent.h>
#include <machine/cpu.h>
#include <machine/frame.h>
@@ -196,7 +195,6 @@
static int db_numargs(struct i386_frame *);
static void db_print_stack_entry(const char *, int, char **, int *, db_addr_t,
void *);
-static void decode_syscall(int, struct thread *);
/*
* Figure out how many arguments were passed into the frame at "fp".
@@ -262,28 +260,6 @@
db_printf("\n");
}
-static void
-decode_syscall(int number, struct thread *td)
-{
- struct proc *p;
- c_db_sym_t sym;
- db_expr_t diff;
- sy_call_t *f;
- const char *symname;
-
- db_printf(" (%d", number);
- p = (td != NULL) ? td->td_proc : NULL;
- if (p != NULL && 0 <= number && number < p->p_sysent->sv_size) {
- f = p->p_sysent->sv_table[number].sy_call;
- sym = db_search_symbol((db_addr_t)f, DB_STGY_ANY, &diff);
- if (sym != DB_SYM_NULL && diff == 0) {
- db_symbol_values(sym, &symname, NULL);
- db_printf(", %s, %s", p->p_sysent->sv_name, symname);
- }
- }
- db_printf(")");
-}
-
/*
* Figure out the next frame up in the call stack.
*/
@@ -396,7 +372,7 @@
break;
case SYSCALL:
db_printf("--- syscall");
- decode_syscall(tf->tf_eax, td);
+ db_decode_syscall(tf->tf_eax, td);
break;
case INTERRUPT:
db_printf("--- interrupt");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 23, 1:26 PM (17 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32027666
Default Alt Text
D36565.diff (3 KB)
Attached To
Mode
D36565: riscv: decode syscall in ddb backtrace
Attached
Detach File
Event Timeline
Log In to Comment