[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gdb-cvs
Subject:    [binutils-gdb] Remove unnecessary call to get_thread_db_info
From:       Simon Marchi <simark () sourceware ! org>
Date:       2017-12-30 2:57:40
Message-ID: 20171230025740.20107.qmail () sourceware ! org
[Download RAW message or body]

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=502a625ab01da27e851333b598c893d6f2c20bd0

commit 502a625ab01da27e851333b598c893d6f2c20bd0
Author: Simon Marchi <simon.marchi@ericsson.com>
Date:   Fri Dec 29 21:56:58 2017 -0500

    Remove unnecessary call to get_thread_db_info
    
    In thread_db_detach, we call get_thread_db_info to first check if there
    exists a thread_db_info entry for the pid to detach.  If there is, then
    we call delete_thread_db_info.  It's unnecessary to call
    get_thread_db_info in the first place, since delete_thread_db_info
    handles the case where no thread_db_info entry exist for the given pid.
    
    gdb/ChangeLog:
    
    	* linux-thread-db.c (thread_db_detach): Remove call to
    	delete_thread_db_info.

Diff:
---
 gdb/ChangeLog         | 5 +++++
 gdb/linux-thread-db.c | 6 +-----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8555b55..bba278e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2017-12-29  Simon Marchi  <simon.marchi@ericsson.com>
+
+	* linux-thread-db.c (thread_db_detach): Remove call to
+	delete_thread_db_info.
+
 2017-12-28  Simon Marchi  <simon.marchi@polymtl.ca>
 
 	* target.h (enum target_object) <TARGET_OBJECT_HPUX_UREGS,
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index 27f9ce8..7fe6e2d 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -1093,12 +1093,8 @@ static void
 thread_db_detach (struct target_ops *ops, const char *args, int from_tty)
 {
   struct target_ops *target_beneath = find_target_beneath (ops);
-  struct thread_db_info *info;
-
-  info = get_thread_db_info (ptid_get_pid (inferior_ptid));
 
-  if (info)
-    delete_thread_db_info (ptid_get_pid (inferior_ptid));
+  delete_thread_db_info (ptid_get_pid (inferior_ptid));
 
   target_beneath->to_detach (target_beneath, args, from_tty);
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic