J. Johnston | 29 Mar 2003 01:18
Picon
Favicon

RFA: gdb linux nptl patch 1

The following is the first of a set of proposed patches for gdb to support
the new nptl threading model for linux.

In the old linuxthreads model, the lwp was equal to the pid.  In the new
nptl model, the lwp is unique for each thread and the pid value is common
among sibling threads.  A side-effect of this difference is that with linuxthreads,
you could see individual threads externally on the ps list.  With the new
nptl kernel, you will not be able to see child thread lwps on the list.

Another key difference is how a tid is represented.  In the linuxthreads model,
a tid was an index into a table and was restricted to 16-bits.  In the new nptl
model, there is no such restriction on the number of threads and the tid is in
fact an address (i.e. not 16 bits).  In the current linux-proc.c logic, when
performing a gcore command, pr_status note information is created by taking the pid and
concatenating this to the tid to form a 32-bit construct.  Obviously, in the new
nptl model this won't work as the tid itself is either 32-bits or 64-bits.
It should also be mentioned that this logic does not match what the kernel
spits out in a corefile.  For linuxthreads, the kernel is just putting the
lwp = pid in the pr_status notes.

Logic that works for either model and matches what the kernel is doing is to
use the lwp and only the lwp in the pr_status notes.  This creates a slight
problem because linux-proc.c uses the thread_info list to run through all the
threads.  Unfortunately, the thread_info list contains ptid_t structs that
contain the pid and the tid, but no lwp.  In the old linuxthreads model, this
isn't a problem because the pid is in fact equal to the lwp.  In the nptl
model, we can't simply convert a pid/tid combination into its associated lwp
because this logic is hidden in libthread_db.  At present, the libthread_db
library is only loaded by the thread-db layer.  While there are routines to
convert a tid to lwp and vice-versa, these routines are not externally exposed
(Continue reading)

Andrew Cagney | 29 Mar 2003 01:28
Picon
Favicon

Re: [RFA] Remove calls to inside_entry_file

> Hi,
> 
> according to my RFC on the gdb mailing list
> 
>   http://sources.redhat.com/ml/gdb/2003-03/msg00358.html
> 
> I'm now proposing to remove calls to inside_entry_func entirely from
> the generic code.  Additionally I've removed the call from
> i386_frame_chain with no regressions on Linux and 7 new PASSes instead
> of FAILs on Cygwin.

> Index: blockframe.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/blockframe.c,v

For "blockframe.c", please leave it as is.  I'm already in enough 
trouble for breaking old targets so I'd prefer to leave that part 
untouched.  It would only affect out-of-date targets anyway.  The 
up-to-date targets don't rely on that function.

> Index: frame.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/frame.c,v
> retrieving revision 1.89
> diff -u -p -r1.89 frame.c
> --- frame.c	26 Mar 2003 00:00:07 -0000	1.89
> +++ frame.c	27 Mar 2003 11:25:20 -0000
>  <at>  <at>  -1419,26 +1419,6  <at>  <at>  get_prev_frame (struct frame_info *this_
>      return this_frame->prev;
>    this_frame->prev_p = 1;
(Continue reading)

Bob Rossi | 29 Mar 2003 01:41
Picon

Adding -file-list-exec-source-file command to GDB/MI

This change essentially adds the command -file-list-exec-source-file to
the mi commands.

* mi-cmd-file.c:    Added file to implement mi file commands.
* mi-cmds.c:        Added -file-list-exec-source-file command.
* mi-cmds.h:        Added -file-list-exec-source-file to proto list.
* doc/gdb.texinfo:  Document -file-list-exec-source-file.
* mi-file.exp:      Added testcase to test -file-list-exec-source-file.

Thanks,
Bob Rossi

Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.351
diff -c -r1.351 Makefile.in
*** Makefile.in	26 Mar 2003 03:39:42 -0000	1.351
--- Makefile.in	29 Mar 2003 00:24:56 -0000
***************
*** 168,181 ****
  SUBDIR_MI_OBS = \
  	mi-out.o mi-console.o \
  	mi-cmds.o mi-cmd-env.o mi-cmd-var.o mi-cmd-break.o mi-cmd-stack.o \
! 	mi-cmd-disas.o \
  	mi-interp.o \
  	mi-main.o mi-parse.o mi-getopt.o
  SUBDIR_MI_SRCS = \
  	mi/mi-out.c mi/mi-console.c \
  	mi/mi-cmds.c mi/mi-cmd-env.c \
(Continue reading)

Andrew Cagney | 29 Mar 2003 02:41
Picon
Favicon

[commit] d10v cleanups

Hello,

This cleans up the d10v a little:

- moves an extern to "remote.h"
- zaps some legacy calls
- eliminates an ``if (... = ...)''

Apart from some still remaining read_register() and write_register() 
calls, the d10v is pretty clean.

Andrew
2003-03-28  Andrew Cagney  <cagney <at> redhat.com>

	* Makefile.in (d10v-tdep.o): Update dependencies.
	* remote.h (target_resume_hook, target_wait_loop_hook): Declare.
	* d10v-tdep.c: Include "remote.h".
	(target_resume_hook): Delete extern declaration.
	(target_wait_loop_hook): Ditto.
	(tdisassemble_command): Eliminate assignment in "if" conditional.
	(d10v_ts2_register_sim_regno): Eliminate call to
	legacy_register_sim_regno.
	(d10v_ts3_register_sim_regno): Ditto.

Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.351
(Continue reading)

Andrew Cagney | 29 Mar 2003 02:42
Picon
Favicon

[ob] thread re-indent

Jeff,

Don't forget to separatly post any gdb_indent.sh changes (even though 
they are obvious).

enjoy,
Andrew

2003-03-28  Jeff Johnston  <jjohnstn <at> redhat.com>

         * thread.c: Reindented.
         * lin-lwp.c: Ditto.
         * linux-proc.c: Ditto.

Richard Earnshaw | 29 Mar 2003 18:11
Favicon

PATCH ARM arm_push_arguemntes->arm_push_dummy_call

This patch implements the new arm_push_dummy_call function and thus 
removes the deprecated arm_push_arguments and arm_store_struct_return 
functions.

R.

2003-03-29  Richard Earnshaw  <rearnsha <at> arm.com>

	* arm-tdep.c (arm_push_arguments): Delete.
	(struct stack_item): New type.
	(push_stack_item, pop_stack_item, arm_push_dummy_call): New functions.
	(arm_store_struct_return): Delete.
	(arm_gdbarch_init): Register arm_push_dummy_call.  Don't register
	arm_push_arguments or arm_store_struct_return.

Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.117
diff -p -r1.117 arm-tdep.c
*** arm-tdep.c	26 Mar 2003 22:39:52 -0000	1.117
--- arm-tdep.c	29 Mar 2003 17:05:16 -0000
*************** arm_fix_call_dummy (char *dummy, CORE_AD
*** 1334,1470 ****
    write_register (4, fun);
  }

- /* Note: ScottB
(Continue reading)

Andrew Cagney | 29 Mar 2003 19:51
Picon
Favicon

[patch rfc] Switch ns32k to CALL_DUMMY_BREAKPOINT_OFFSET

Hello,

This switches the ns32k target to the CALL_DUMMY_BREAKPOINT_OFFSET 
mechanism.   When using that mechanism, GDB explicitly sets a momentary 
breakpoint at the inferior function call's return address.

The ns32k is the only target that doesn't use that mechanism so doing 
this switch lets GDB expunge a macro.

If course I've no ns32k so this is just an educated guess :-)

Jason, got a machine to test this on?  Or should this be assumed to work?

Andrew
2003-03-29  Andrew Cagney  <cagney <at> redhat.com>

	* ns32k-tdep.c (ns32k_gdbarch_init): Set the call dummy breakpoint
	offset.

Index: ns32k-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ns32k-tdep.c,v
retrieving revision 1.39
diff -u -r1.39 ns32k-tdep.c
--- ns32k-tdep.c	25 Mar 2003 20:38:46 -0000	1.39
+++ ns32k-tdep.c	29 Mar 2003 18:45:04 -0000
 <at>  <at>  -600,7 +600,8  <at>  <at> 
   set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof_ns32k_call_dummy_words);
(Continue reading)

Andrew Cagney | 29 Mar 2003 21:05
Picon
Favicon

[patch rfc] Delete CALL_DUMMY_P

Hello,

All architectures (I think there was once one) that didn't support 
inferior function calls have been either obsoleted or deleted.  Hence 
CALL_DUMMY_P is always one, and gdb always supports inferior function 
calls.  This deletes the architecture method that indicated the lack of 
inferior function call support.

As fallout, it also combines hand_function_call() and 
call_function_by_hand() into a single call_function_by_hand().

I'll commit in a day or so,

Andrew
Index: doc/ChangeLog
2003-03-29  Andrew Cagney  <cagney <at> redhat.com>

	* gdbint.texinfo (Target Architecture Definition): Delete
	references to CALL_DUMMY_P.

2003-03-29  Andrew Cagney  <cagney <at> redhat.com>

	* gdbarch.sh (CALL_DUMMY_P): Delete.
	* gdbarch.h, gdbarch.c: Re-generate.
	* inferior.h (CALL_DUMMY_P): Delete macro.
	* xstormy16-tdep.c (xstormy16_gdbarch_init): Update.
	* vax-tdep.c (vax_gdbarch_init): Update.
	* v850-tdep.c (v850_gdbarch_init): Update.
(Continue reading)

Jason Thorpe | 29 Mar 2003 21:27

Re: [patch rfc] Switch ns32k to CALL_DUMMY_BREAKPOINT_OFFSET


On Saturday, March 29, 2003, at 10:51  AM, Andrew Cagney wrote:

> Jason, got a machine to test this on?  Or should this be assumed to 
> work?

I'd say go ahead and assume it's okay.  I'm still in the process of 
putting together a PC532 (I finally got a SCSI->Ethernet adapter last 
week so I can hook it up to the network :-)

         -- Jason R. Thorpe <thorpej <at> wasabisystems.com>

Andrew Cagney | 29 Mar 2003 23:06
Picon
Favicon

[patch rfc] Provide default dummy values for ...

Hello,

This patch changes the architecture vector so that:

	CALL_DUMMY_BREAKPOINT_OFFSET
	CALL_DUMMY_START_OFFSET
	CALL_DUMMY_LENGTH

all default to zero.  It then deletes all cases where the gdbarch-init 
code was simply setting the value to zero.

Note that these values are only really used when the call dummy is being 
put on the stack.

This might take a bit of time for people to digest (I've tested it on 
d10v, ppc and i386) so I'll give it two or more days before committing.

Andrew
2003-03-29  Andrew Cagney  <cagney <at> redhat.com>

	* gdbarch.sh (CALL_DUMMY_BREAKPOINT_OFFSET): Make optional,
	default to zero.
	(CALL_DUMMY_START_OFFSET, CALL_DUMMY_LENGTH): Ditto.
	* gdbarch.c: Re-generate.
	* inferior.h (CALL_DUMMY_START_OFFSET): Delete macro.
	(CALL_DUMMY_LENGTH): Delete macro.
	* alpha-tdep.c (alpha_gdbarch_init): Do not set above when zero.
	* arm-tdep.c (arm_gdbarch_init): Ditto.
(Continue reading)


Gmane