diff options
author | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2018-09-19 11:21:32 +0200 |
---|---|---|
committer | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2018-09-19 11:21:32 +0200 |
commit | 13db92d3f48cbd6784f50bbd0ce10220e0d48ee4 (patch) | |
tree | bdd96f1c633067b8819f547583708839a6d13387 /gdb/procfs.c | |
parent | 7e00df65a4e3e281604acab2450812a5fb275743 (diff) | |
download | gdb-13db92d3f48cbd6784f50bbd0ce10220e0d48ee4.zip gdb-13db92d3f48cbd6784f50bbd0ce10220e0d48ee4.tar.gz gdb-13db92d3f48cbd6784f50bbd0ce10220e0d48ee4.tar.bz2 |
Fix /proc pathname sizes on Solaris
I'm slowly working my way through the gdb patches from the
solaris-userland repo
https://github.com/oracle/solaris-userland/tree/master/components/gdb/patches
This one (001-fix-proc-name-size.patch) should be obvious given the
patches' comment:
# In Solaris, PID_MAX is 999999 (6 digit pid).
# In Solaris, lwpid_t is an unsigned int, so theoretically the lwp id
# could be 10 digits.
Tested on i386-pc-solaris2.11.
2018-09-19 Stefan Teleman <stefan.teleman@oracle.com>
April Chin <april.chin@oracle.com>
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* procfs.c (MAX_PROC_NAME_SIZE): Allow for 6-digit PID_MAX and
uint_t lwpid_t.
(create_procinfo): Print pids in /proc without leading zeros.
Diffstat (limited to 'gdb/procfs.c')
-rw-r--r-- | gdb/procfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/procfs.c b/gdb/procfs.c index 66a3197..e66c469 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -231,7 +231,7 @@ enum { READ_WATCHFLAG = WA_READ, #define AS_PROC_NAME_FMT "/proc/%d/as" #define MAP_PROC_NAME_FMT "/proc/%d/map" #define STATUS_PROC_NAME_FMT "/proc/%d/status" -#define MAX_PROC_NAME_SIZE sizeof("/proc/99999/lwp/8096/lstatus") +#define MAX_PROC_NAME_SIZE sizeof("/proc/999999/lwp/0123456789/lwpstatus") typedef struct procinfo { struct procinfo *next; @@ -480,7 +480,7 @@ create_procinfo (int pid, int tid) } else { - sprintf (pi->pathname, "/proc/%05d/lwp/%d", pid, tid); + sprintf (pi->pathname, "/proc/%d/lwp/%d", pid, tid); pi->next = parent->thread_list; parent->thread_list = pi; } |