author | April Chin <april.chin@oracle.com> |
Wed, 19 Apr 2017 14:37:55 -0700 | |
changeset 7939 | a0c0b8aac8d4 |
parent 6420 | components/gdb/patches/gdb.procfs.c.patch@65948e9e205b |
permissions | -rw-r--r-- |
7939
a0c0b8aac8d4
25137614 gdb is not able to debug PIE executables on sparc
April Chin <april.chin@oracle.com>
parents:
6420
diff
changeset
|
1 |
# |
a0c0b8aac8d4
25137614 gdb is not able to debug PIE executables on sparc
April Chin <april.chin@oracle.com>
parents:
6420
diff
changeset
|
2 |
# Fix the size of the pathname for /proc files. |
a0c0b8aac8d4
25137614 gdb is not able to debug PIE executables on sparc
April Chin <april.chin@oracle.com>
parents:
6420
diff
changeset
|
3 |
# In Solaris, PID_MAX is 999999 (6 digit pid). |
a0c0b8aac8d4
25137614 gdb is not able to debug PIE executables on sparc
April Chin <april.chin@oracle.com>
parents:
6420
diff
changeset
|
4 |
# In Solaris, lwpid_t is an unsigned int, so theoretically the lwp id |
a0c0b8aac8d4
25137614 gdb is not able to debug PIE executables on sparc
April Chin <april.chin@oracle.com>
parents:
6420
diff
changeset
|
5 |
# could be 10 digits. |
a0c0b8aac8d4
25137614 gdb is not able to debug PIE executables on sparc
April Chin <april.chin@oracle.com>
parents:
6420
diff
changeset
|
6 |
# Patch will be submitted upstream. |
a0c0b8aac8d4
25137614 gdb is not able to debug PIE executables on sparc
April Chin <april.chin@oracle.com>
parents:
6420
diff
changeset
|
7 |
# |
6420
65948e9e205b
22928258 update gdb to 7.11
April Chin <april.chin@oracle.com>
parents:
1511
diff
changeset
|
8 |
|
7939
a0c0b8aac8d4
25137614 gdb is not able to debug PIE executables on sparc
April Chin <april.chin@oracle.com>
parents:
6420
diff
changeset
|
9 |
--- gdb-7.12.1-orig/gdb/procfs.c 2017-01-21 05:48:42.000000000 -0800 |
a0c0b8aac8d4
25137614 gdb is not able to debug PIE executables on sparc
April Chin <april.chin@oracle.com>
parents:
6420
diff
changeset
|
10 |
+++ gdb-7.12.1/gdb/procfs.c 2017-04-19 10:28:43.395097240 -0700 |
a0c0b8aac8d4
25137614 gdb is not able to debug PIE executables on sparc
April Chin <april.chin@oracle.com>
parents:
6420
diff
changeset
|
11 |
@@ -341,7 +341,7 @@ typedef siginfo_t gdb_siginfo_t; |
1511
4d3b0b480760
17086418 upgrade gdb to 7.6
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
12 |
# define AS_PROC_NAME_FMT "/proc/%d/as" |
4d3b0b480760
17086418 upgrade gdb to 7.6
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
13 |
# define MAP_PROC_NAME_FMT "/proc/%d/map" |
4d3b0b480760
17086418 upgrade gdb to 7.6
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
14 |
# define STATUS_PROC_NAME_FMT "/proc/%d/status" |
4d3b0b480760
17086418 upgrade gdb to 7.6
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
15 |
-# define MAX_PROC_NAME_SIZE sizeof("/proc/99999/lwp/8096/lstatus") |
7939
a0c0b8aac8d4
25137614 gdb is not able to debug PIE executables on sparc
April Chin <april.chin@oracle.com>
parents:
6420
diff
changeset
|
16 |
+# define MAX_PROC_NAME_SIZE sizeof("/proc/0123456789/lwp/0123456789/lwpstatus") |
1511
4d3b0b480760
17086418 upgrade gdb to 7.6
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
17 |
# endif |
4d3b0b480760
17086418 upgrade gdb to 7.6
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
18 |
/* the name of the proc status struct depends on the implementation */ |
4d3b0b480760
17086418 upgrade gdb to 7.6
Stefan Teleman <stefan.teleman@oracle.com>
parents:
diff
changeset
|
19 |
typedef pstatus_t gdb_prstatus_t; |
7939
a0c0b8aac8d4
25137614 gdb is not able to debug PIE executables on sparc
April Chin <april.chin@oracle.com>
parents:
6420
diff
changeset
|
20 |
@@ -712,7 +712,7 @@ create_procinfo (int pid, int tid) |
a0c0b8aac8d4
25137614 gdb is not able to debug PIE executables on sparc
April Chin <april.chin@oracle.com>
parents:
6420
diff
changeset
|
21 |
else |
a0c0b8aac8d4
25137614 gdb is not able to debug PIE executables on sparc
April Chin <april.chin@oracle.com>
parents:
6420
diff
changeset
|
22 |
{ |
a0c0b8aac8d4
25137614 gdb is not able to debug PIE executables on sparc
April Chin <april.chin@oracle.com>
parents:
6420
diff
changeset
|
23 |
#ifdef NEW_PROC_API |
a0c0b8aac8d4
25137614 gdb is not able to debug PIE executables on sparc
April Chin <april.chin@oracle.com>
parents:
6420
diff
changeset
|
24 |
- sprintf (pi->pathname, "/proc/%05d/lwp/%d", pid, tid); |
a0c0b8aac8d4
25137614 gdb is not able to debug PIE executables on sparc
April Chin <april.chin@oracle.com>
parents:
6420
diff
changeset
|
25 |
+ sprintf (pi->pathname, "/proc/%d/lwp/%d", pid, tid); |
a0c0b8aac8d4
25137614 gdb is not able to debug PIE executables on sparc
April Chin <april.chin@oracle.com>
parents:
6420
diff
changeset
|
26 |
#else |
a0c0b8aac8d4
25137614 gdb is not able to debug PIE executables on sparc
April Chin <april.chin@oracle.com>
parents:
6420
diff
changeset
|
27 |
sprintf (pi->pathname, MAIN_PROC_NAME_FMT, pid); |
a0c0b8aac8d4
25137614 gdb is not able to debug PIE executables on sparc
April Chin <april.chin@oracle.com>
parents:
6420
diff
changeset
|
28 |
#endif |