This is the mail archive of the gdb-prs@sources.redhat.com 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]

gdb/747: PPC/sim: Need initialization pass for populating of tree with defaults


>Number:         747
>Category:       gdb
>Synopsis:       PPC/sim: Need initialization pass for populating of tree with defaults
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 27 14:08:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     ac131313@redhat.com
>Release:        unknown-1.0
>Organization:
>Environment:

>Description:
I make this commit needed by the FreeBSD/powerpc porting effort.

2002-03-24  David O'Brien  <obrien@FreeBSD.org>
* ppc/hw_disk.c: Export a disk device property.

Index: hw_disk.c
===================================================================
RCS file: /cvs/src/src/sim/ppc/hw_disk.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- hw_disk.c    1999/04/16 01:35:09    1.1
+++ hw_disk.c    2002/03/25 04:39:20    1.2
@@ -232,6 +232,9 @@
             space, address, 0/*size*/, access_read_write_exec,
             me);
 
+  /* Tell the world we are a disk.  */
+  device_add_string_property(me, "device_type", "disk");
+
   /* get the name of the file specifying the disk image */
   disk->name_index = 0;
   disk->nr_names = device_find_string_array_property(me, "file",

I'm going to need to dig up my 1275 manual to check this one out.

David,

A disk drive has a "device_type" of "block" not "disk".  See 1276 section 3.7 (Standard device types) and 3.7.2 ("block" devices).  Could you please fix this, trunk and branch (given it has already been checked into the branch :-( ).

At present none of other hw_*.c files are doing like the above.  Instead they use a device tree (see attached) so your two line patch introduces a very fundamental change in the simulator's behavour.  However, yes, the current need to specify all the properties in a file is a pain and the code to start doing this is long overdue.

Looking at the actual change, ..._init_address() appears to get the job done.  However, if you trace the code, the second and further init calls try to re-add the property to the tree (see how permenant_object is used) - fortunatly these are ignored.  Can you please create a bug-report documenting this problem.

enjoy,
Andrew 
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]