aboutsummaryrefslogtreecommitdiff
path: root/src/client/solaris/handler/solaris_lwp.cc
diff options
context:
space:
mode:
authormmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e>2007-09-26 18:28:05 +0000
committermmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e>2007-09-26 18:28:05 +0000
commitea2bba970675e01f9964f82d3f44960c1aad05dc (patch)
treed3d6744bf2ef136f9a89748c96ab4e5c465eb7ff /src/client/solaris/handler/solaris_lwp.cc
parentFix crash reason switching to allow proper behavior for Linux. Spotted by (diff)
downloadbreakpad-ea2bba970675e01f9964f82d3f44960c1aad05dc.tar.xz
Add SPARC/Solaris support to client handler and processor (#201, 200).
Patch by Michael shang <satisfy123>. r=me, r=Alfred Peng. http://groups.google.com/group/google-breakpad-discuss/browse_thread/thread/2fba07577f1fa35e git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@215 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/solaris/handler/solaris_lwp.cc')
-rw-r--r--src/client/solaris/handler/solaris_lwp.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/client/solaris/handler/solaris_lwp.cc b/src/client/solaris/handler/solaris_lwp.cc
index 763e1977..9ce7b4fd 100644
--- a/src/client/solaris/handler/solaris_lwp.cc
+++ b/src/client/solaris/handler/solaris_lwp.cc
@@ -217,7 +217,7 @@ int SolarisLwp::Lwp_iter_all(int pid,
lwpsinfo_t *Lpsp;
long nstat;
long ninfo;
- int rv;
+ int rv = 0;
/*
* The /proc/pid/lstatus file has the array of lwpstatus_t's and the
@@ -240,8 +240,9 @@ int SolarisLwp::Lwp_iter_all(int pid,
sp = NULL;
}
if (callback_param &&
- !(rv = (callback_param->call_back)(sp, callback_param->context)))
+ !(callback_param->call_back)(sp, callback_param->context))
break;
+ ++rv;
Lpsp = (lwpsinfo_t *)((uintptr_t)Lpsp + Lphp->pr_entsize);
}
@@ -279,7 +280,8 @@ int SolarisLwp::ListModules(
return -1;
/*
- * Determine number of mappings.
+ * Determine number of mappings, this value must be
+ * larger than the actual module count
*/
size = status.st_size;
if ((num = (int)(size / sizeof (prmap_t))) > MAP_MAX) {
@@ -287,9 +289,6 @@ int SolarisLwp::ListModules(
return -1;
}
- if (!callback_param)
- return num; // return the Module count
-
if (read(fd, (void *)maps, size) < 0) {
print_message2(2, "failed to read %d\n", fd);
return -1;
@@ -297,7 +296,8 @@ int SolarisLwp::ListModules(
prmap_t *_maps;
int _num;
-
+ int module_count = 0;
+
/*
* Scan each mapping - note it is assummed that the mappings are
* presented in order. We fill holes between mappings. On intel
@@ -313,15 +313,17 @@ int SolarisLwp::ListModules(
memset(&module, 0, sizeof (module));
module.start_addr = _maps->pr_vaddr;
module.size = _maps->pr_size;
- if (name && (strcmp(name, "a.out") != 0))
+ if ((strlen(name) > 0) && (strcmp(name, "a.out") != 0)) {
strncpy(module.name, name, sizeof (module.name) - 1);
+ ++module_count;
+ }
if (callback_param &&
(!callback_param->call_back(module, callback_param->context))) {
break;
}
}
- return num;
+ return module_count;
}
} // namespace google_breakpad