This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
+static int +compare_processes (const void *process1, const void *process2)
Most of the new functions need introductory comments.
+ static struct buffer buffer;
Wow, another growable buffer type. I didn't know about this one. Let's see.. VEC, dynstr, obstack, buffer... can we have a 5th? :)
+ char procentry[sizeof ("/proc/4294967295")];
One occasionally hears talk of 64 bit PIDs.
+static void +time_from_int (char *time, int maxlen, int seconds)
Why int and not just time_t? ...
[...]+ items_read = sscanf (buf, + "%d %d %o %d %d %d %d %u %u %u %u %d %d %d", + &key,&shmid,&perms,&size, + &cpid,&lpid, + &nattch, + &uid,&gid,&cuid,&cgid, + &atime,&dtime,&ctime);[...]+ char atime_str[32], dtime_str[32], ctime_str[32];+ time_from_int (atime_str, sizeof (atime_str), atime); + time_from_int (dtime_str, sizeof (dtime_str), dtime); + time_from_int (ctime_str, sizeof (ctime_str), ctime);
I think it is probably better to use long at least.
>>> +#if 0 >>> + struct stat statbuf; >>> + stat (dp2->d_name,&statbuf); >>> +#endif > > No new #if 0 code. >
gdb/ * common/linux-osdata.c (PID_T, TIME_T): Add local versions of pid_t and time_t to avoid problems with the size of the native versions. (MAX_PID_T_STRLEN): New. (linux_common_core_of_thread): Add comment. Change to use PID_T and MAX_PID_T_STRLEN. (command_from_pid): Add comment. Change to use PID_T. (commandline_from_pid): Change to use PID_T. (user_from_pid): Add comment. (get_process_owner): Add comment. Change to use PID_T and MAX_PID_T_STRLEN. (get_number_of_cpu_cores): Add comment. (get_cores_used_by_process): Add comment. Change to use PID_T and MAX_PID_T_STRLEN. (linux_xfer_osdata_processes): Change to use PID_T and MAX_PID_T_STRLEN. (compare_processes): Auxiliary function for linux_xfer_osdata_processgroups. (linux_xfer_osdata_processgroups): New function to look up process groups. (linux_xfer_osdata_threads): Change to use PID_T. (linux_xfer_osdata_fds): New function to look up file descriptors. (format_socket_state, print_sockets): Auxiliary functions for linux_xfer_osdata_isockets. (union socket_addr): New union used to avoid strict-aliasing problems. (linux_xfer_osdata_isockets): New function to look up internet sockets. (time_from_time_t, group_from_gid): New convenience functions for converting between data types. (linux_xfer_osdata_shm): New function to look up shared memory for IPC. (linux_xfer_osdata_sem): New function to look up semaphores for IPC. (linux_xfer_osdata_msg): New function to look up message queues for IPC. (linux_xfer_osdata_modules): New function to look up loaded kernel modules. (osdata_table): Add new entries. * common/buffer.c (buffer_xml_printf): Add support for long and long long format specifiers.
Attachment:
os-awareness_2.patch
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |