diff options
author | Andreas Schwab <schwab@linux-m68k.org> | 2014-01-07 21:28:53 +0100 |
---|---|---|
committer | Andreas Schwab <schwab@linux-m68k.org> | 2014-01-07 22:58:31 +0100 |
commit | 1b67eb02738593359e929cf296a14f0be5637096 (patch) | |
tree | 2f65b76de5883e5f2ced36aa9bdff36ca5d3127b | |
parent | 5e3f4fab9ab17362d758871ad9371042918c9374 (diff) | |
download | gdb-1b67eb02738593359e929cf296a14f0be5637096.zip gdb-1b67eb02738593359e929cf296a14f0be5637096.tar.gz gdb-1b67eb02738593359e929cf296a14f0be5637096.tar.bz2 |
Use correct default for target functions that return pointer
* target.c (return_null): Define.
(update_current_target): Use it instead of return_zero for
functions that return a pointer.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/target.c | 16 |
2 files changed, 18 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b976827..e3fe615 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2014-01-07 Andreas Schwab <schwab@linux-m68k.org> + + * target.c (return_null): Define. + (update_current_target): Use it instead of return_zero for + functions that return a pointer. + 2014-01-07 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com> * source.c (add_path): Fix check for duplicated paths in the previously diff --git a/gdb/target.c b/gdb/target.c index 65c7a7a..42a8741 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -64,6 +64,8 @@ static int return_one (void); static int return_minus_one (void); +static void *return_null (void); + void target_ignore (void); static void target_command (char *, int); @@ -806,10 +808,10 @@ update_current_target (void) return_zero); de_fault (to_extra_thread_info, (char *(*) (struct thread_info *)) - return_zero); + return_null); de_fault (to_thread_name, (char *(*) (struct thread_info *)) - return_zero); + return_null); de_fault (to_stop, (void (*) (ptid_t)) target_ignore); @@ -819,7 +821,7 @@ update_current_target (void) tcomplain); de_fault (to_pid_to_exec_file, (char *(*) (int)) - return_zero); + return_null); de_fault (to_async, (void (*) (void (*) (enum inferior_event_type, void*), void*)) tcomplain); @@ -918,7 +920,7 @@ update_current_target (void) tcomplain); de_fault (to_traceframe_info, (struct traceframe_info * (*) (void)) - return_zero); + return_null); de_fault (to_supports_evaluation_of_breakpoint_conditions, (int (*) (void)) return_zero); @@ -3634,6 +3636,12 @@ return_minus_one (void) return -1; } +static void * +return_null (void) +{ + return 0; +} + /* * Find the next target down the stack from the specified target. */ |