Skip to content

Commit 27087a3

Browse files
author
Joel Brobecker
committed
Breakpoint in shared library does not work on mips-irix.
* procfs.c: #include "observer.h". (procfs_inferior_created): New function, moving here the code which unsets the syssgi syscall-exit notifications. (procfs_create_inferior): Remove the code which unsets the syssgi syscall-exit notifications. It is too early to do this here. (_initialize_procfs): Attach the procfs_inferior_created observer.
1 parent f08877b commit 27087a3

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

gdb/ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2010-01-09 Joel Brobecker <[email protected]>
2+
3+
Breakpoint in shared library does not work on mips-irix.
4+
* procfs.c: #include "observer.h".
5+
(procfs_inferior_created): New function, moving here the code
6+
which unsets the syssgi syscall-exit notifications.
7+
(procfs_create_inferior): Remove the code which unsets the syssgi
8+
syscall-exit notifications. It is too early to do this here.
9+
(_initialize_procfs): Attach the procfs_inferior_created observer.
10+
111
2010-01-09 Joel Brobecker <[email protected]>
212

313
Wrong return convention for arrays (mips-irix).

gdb/procfs.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#include "inflow.h"
5252
#include "auxv.h"
5353
#include "procfs.h"
54+
#include "observer.h"
5455

5556
/*
5657
* PROCFS.C
@@ -5146,13 +5147,27 @@ procfs_create_inferior (struct target_ops *ops, char *exec_file,
51465147
NULL, NULL, shell_file);
51475148

51485149
procfs_init_inferior (ops, pid);
5150+
}
5151+
5152+
/* An observer for the "inferior_created" event. */
51495153

5154+
static void
5155+
procfs_inferior_created (struct target_ops *ops, int from_tty)
5156+
{
51505157
#ifdef SYS_syssgi
51515158
/* Make sure to cancel the syssgi() syscall-exit notifications.
51525159
They should normally have been removed by now, but they may still
51535160
be activated if the inferior doesn't use shared libraries, or if
51545161
we didn't locate __dbx_link, or if we never stopped in __dbx_link.
5155-
See procfs_init_inferior() for more details. */
5162+
See procfs_init_inferior() for more details.
5163+
5164+
Since these notifications are only ever enabled when we spawned
5165+
the inferior ourselves, there is nothing to do when the inferior
5166+
was created by attaching to an already running process, or when
5167+
debugging a core file. */
5168+
if (current_inferior ()->attach_flag || !target_can_run (&current_target))
5169+
return;
5170+
51565171
proc_trace_syscalls_1 (find_procinfo_or_die (PIDGET (inferior_ptid), 0),
51575172
SYS_syssgi, PR_SYSEXIT, FLAG_RESET, 0);
51585173
#endif
@@ -6000,6 +6015,8 @@ proc_untrace_sysexit_cmd (char *args, int from_tty)
60006015
void
60016016
_initialize_procfs (void)
60026017
{
6018+
observer_attach_inferior_created (procfs_inferior_created);
6019+
60036020
add_info ("proc", info_proc_cmd, _("\
60046021
Show /proc process information about any running process.\n\
60056022
Specify process id, or use the program being debugged by default.\n\

0 commit comments

Comments
 (0)