Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using 'pstruct' under OSS NonStop

140 views
Skip to first unread message

mrpc.j...@gmail.com

unread,
May 22, 2013, 9:24:18 PM5/22/13
to
Hi All,

Anybody had any experience (and success) using the 'pstruct' program to dump 'C' structures under OSS?

Thanks.

Robert Hutchings

unread,
May 22, 2013, 10:48:52 PM5/22/13
to
Are you referring to "p struct" in Native Inspect, like

eInspect 4,219): p structure3
$1 = {
c = 0x70000c00 "From call2",
d = 2
}

?

mrpc.j...@gmail.com

unread,
May 22, 2013, 11:42:33 PM5/22/13
to
Hi, thanks for the reply.
The 'pstruct' program/executable is a unix/open source type process that can parse a 'C' file/header and 'dump' the 'struct' definitions. It uses C89 etc. But, as far as I can see the HP OSS C89 doesn't appear to support the options required.

Regards.

Robert Hutchings

unread,
May 23, 2013, 12:00:45 AM5/23/13
to
OK. I looked for pstruct and c2ph in the OSS Shell and Utilities manual and could not find either one. If you can download the source code you might be able to compile it on the OSS...

Regards.

mrpc.j...@gmail.com

unread,
May 23, 2013, 12:12:08 AM5/23/13
to
On Thursday, 23 May 2013 11:24:18 UTC+10, mrpc.j...@gmail.com wrote:
Thanks Robert, for some reason it is provided on our NonStop machine and I wanted to use it! But the C89 compiler requires the '-S' option which the OSS C89 does not support.

I'll keep looking :)

Regards.

Joachim Schmitz

unread,
May 23, 2013, 2:52:55 AM5/23/13
to
In gcc -S stops compilation before calling the assembler, indeed c89 doesn't
have an option for this. But maybe the environment variable AS1 could be
used to trick c89 to spit out the assembler code? At least on TNS/R
target...

AS1=/bin/cat c89 -c foo.c -Wtarget=tns/r >some_out_file

Bye, Jojo

Robert Hutchings

unread,
May 23, 2013, 8:37:42 AM5/23/13
to
Hi Jojo,

Is ITUGLIB still available (and/or FLOSS)?

Robert Hutchings

unread,
May 23, 2013, 9:33:05 AM5/23/13
to

Joachim Schmitz

unread,
May 23, 2013, 3:26:29 PM5/23/13
to
Robert Hutchings wrote:
> Hi Jojo,
>
> Is ITUGLIB still available (and/or FLOSS)?

It sure is, http://ituglib.connect-community.org

Bye, Jojo

mrpc.j...@gmail.com

unread,
May 27, 2013, 11:22:39 PM5/27/13
to
On Thursday, 23 May 2013 11:24:18 UTC+10, mrpc.j...@gmail.com wrote:
Hi all,

FYI I have discovered a partial method of performing what I need using 'debug' (gdb).
Using the ptype -v <struct or typedef> option will display the structure definition. For example:

Basically if you have a type (e.g. DEFS_T), compiled in an object:

4> ptype -v DEFS_T
type = struct __T152236944 { /* off 0 bits, len 1280 bits */
enum DTYPE st_type_e;
/* off 0 bits, len 32 bits */
enum DTYPE type_e;
/* off 32 bits, len 32 bits */
int offset_i;
/* off 64 bits, len 32 bits */
char option_ca[20];
/* off 96 bits, len 160 bits */
int var_len_i;
/* off 256 bits, len 32 bits */
char var_name_ca[30];
/* off 288 bits, len 240 bits */
char init_type_c;
/* off 528 bits, len 8 bits */
enum ITYPE init_var_type_e;
/* off 544 bits, len 32 bits */
char *init_text_cp;
/* off 576 bits, len 32 bits */
short num_init_vals_s;
/* off 608 bits, len 16 bits */
---Type <return> to continue, or q <return> to quit---
long long init_num_ll;
/* off 640 bits, len 64 bits */
char comment_ca[70];
/* off 704 bits, len 560 bits */
}

The only (small?) issue with this is if there are embedded or sub-structs; these have to be displayed separately :(

Cheers.

Robert Hutchings

unread,
May 28, 2013, 8:33:28 AM5/28/13
to
Looks like an interesting tool. Were you able to compile and configure this on the NonStop server?

mrpc.j...@gmail.com

unread,
May 29, 2013, 11:24:34 PM5/29/13
to
On Thursday, 23 May 2013 11:24:18 UTC+10, mrpc.j...@gmail.com wrote:
Hi, this was performed using the 'standard' debug process (based on GDB).
You can also dump the complete symbol table for a struct or typedef using (from debug) "maint print type <item>. Lot's of information; and this can be parsed reasonably easily. This method also dumps the sub-structs as well; very useful.
0 new messages