PageRenderTime 100ms CodeModel.GetById 10ms RepoModel.GetById 1ms app.codeStats 0ms

/libsrc/dobj/dplist.c

https://gitlab.com/oytunistrator/QuIP
C | 596 lines | 388 code | 82 blank | 126 comment | 94 complexity | 79189ac34b851f794dc28fac5292da23 MD5 | raw file
  1. #include "quip_config.h"
  2. /* information display functions */
  3. #include <stdio.h>
  4. #ifdef HAVE_STRING_H
  5. #include <string.h>
  6. #endif
  7. #include "quip_prot.h"
  8. #include "data_obj.h"
  9. #include "dobj_prot.h"
  10. // BUG prec_for_code should use table lookup instead of list search
  11. // missing precision 53?
  12. Precision *prec_for_code(prec_t prec)
  13. {
  14. // find the precision struct using the code
  15. List *lp;
  16. Node *np;
  17. Precision *prec_p;
  18. lp = prec_list(SGL_DEFAULT_QSP_ARG);
  19. //#ifdef CAUTIOUS
  20. // if( lp == NO_LIST ) {
  21. // NERROR1("CAUTIOUS: prec_for_code: Empty list of precisions!?");
  22. // IOS_RETURN_VAL(NULL)
  23. // }
  24. //#endif /* CAUTIOUS */
  25. assert( lp != NO_LIST );
  26. np = QLIST_HEAD(lp);
  27. while( np != NO_NODE ){
  28. prec_p = (Precision *) NODE_DATA(np);
  29. if( prec_p->prec_code == prec )
  30. return( prec_p );
  31. np=NODE_NEXT(np);
  32. }
  33. // shouldn't happen!
  34. //#ifdef CAUTIOUS
  35. // sprintf(DEFAULT_ERROR_STRING,"CAUTIOUS: prec_for_code: missing precision %"PREC_FMT_D" (0x%x)!?",prec,prec);
  36. // NERROR1(DEFAULT_ERROR_STRING);
  37. //#endif /* CAUTIOUS */
  38. assert( AERROR("Missing precision code in list of precisions!?") );
  39. return NO_PRECISION;
  40. }
  41. void describe_shape(QSP_ARG_DECL Shape_Info *shpp)
  42. {
  43. #ifdef CAUTIOUS
  44. if( SHP_PREC_PTR(shpp) == NULL ){
  45. WARN("CAUTIOUS: describe_shape: null shape prec ptr!?");
  46. return;
  47. }
  48. #endif // CAUTIOUS
  49. if( SHP_PREC(shpp) == PREC_VOID ){
  50. prt_msg("void (no shape)");
  51. return;
  52. }
  53. #ifdef CAUTIOUS
  54. if( SHP_TYPE_DIMS(shpp) == NULL ){
  55. WARN("CAUTIOUS: describe_shape: null type dims!?");
  56. return;
  57. }
  58. if( SHP_MACH_DIMS(shpp) == NULL ){
  59. WARN("CAUTIOUS: describe_shape: null mach dims!?");
  60. return;
  61. }
  62. #endif // CAUTIOUS
  63. if( HYPER_SEQ_SHAPE(shpp) )
  64. sprintf(MSG_STR,"hyperseq, %3u sequences ",
  65. SHP_SEQS(shpp));
  66. else if( SEQUENCE_SHAPE(shpp) )
  67. sprintf(MSG_STR,"sequence, %3u %dx%d frames ",
  68. SHP_FRAMES(shpp),SHP_ROWS(shpp),SHP_COLS(shpp));
  69. else if( IMAGE_SHAPE(shpp) ){
  70. /* used to have a special case for bitmaps here, but
  71. * apparently no longer needed...
  72. */
  73. sprintf(MSG_STR,"image, %4u rows %4u columns ",
  74. SHP_ROWS(shpp),SHP_COLS(shpp));
  75. } else if( ROWVEC_SHAPE(shpp) )
  76. sprintf(MSG_STR,"row vector, %4u elements ",SHP_COLS(shpp));
  77. else if( COLVEC_SHAPE(shpp) )
  78. sprintf(MSG_STR,"column vector, %4u elements ",SHP_ROWS(shpp));
  79. else if( PIXEL_SHAPE(shpp) )
  80. sprintf(MSG_STR,"scalar ");
  81. else if( UNKNOWN_SHAPE(shpp) )
  82. sprintf(MSG_STR,"shape unknown at this time ");
  83. else if( VOID_SHAPE(shpp) )
  84. sprintf(MSG_STR,"void shape ");
  85. //#ifdef CAUTIOUS
  86. else {
  87. // sprintf(DEFAULT_ERROR_STRING,"CAUTIOUS: describe_shape: unrecognized object type flag 0x%llx",
  88. // (long long unsigned int) SHP_FLAGS(shpp));
  89. // WARN(DEFAULT_ERROR_STRING);
  90. // sprintf(MSG_STR," ");
  91. assert( AERROR("describe_shape: bad object type flag!?") );
  92. }
  93. //#endif /* CAUTIOUS */
  94. prt_msg_frag(MSG_STR);
  95. if( BITMAP_PRECISION(SHP_PREC(shpp)) ){
  96. //#ifdef CAUTIOUS
  97. // if( (SHP_PREC(shpp) & MACH_PREC_MASK) != BITMAP_MACH_PREC ){
  98. // sprintf(DEFAULT_ERROR_STRING,
  99. // "CAUTIOUS: describe_shape: prec = 0x%"PREC_FMT_X", BIT pseudo precision is set, but machine precision is not %s!?",
  100. // SHP_PREC(shpp),PREC_NAME(PREC_FOR_CODE(BITMAP_MACH_PREC)) );
  101. // NERROR1(DEFAULT_ERROR_STRING);
  102. // IOS_RETURN
  103. // }
  104. //#endif /* CAUTIOUS */
  105. assert( (SHP_PREC(shpp) & MACH_PREC_MASK) == BITMAP_MACH_PREC );
  106. prt_msg(" bit");
  107. return;
  108. } else if( STRING_PRECISION(SHP_PREC(shpp)) || CHAR_PRECISION(SHP_PREC(shpp)) ){
  109. //#ifdef CAUTIOUS
  110. // if( (SHP_PREC(shpp) & MACH_PREC_MASK) != PREC_BY ){
  111. // sprintf(DEFAULT_ERROR_STRING,
  112. // "CAUTIOUS: describe_shape: prec = 0x%"PREC_FMT_X", STRING or CHAR pseudo precision is set, but machine precision is not byte!?",
  113. // SHP_PREC(shpp));
  114. // NERROR1(DEFAULT_ERROR_STRING);
  115. // IOS_RETURN
  116. // }
  117. //#endif /* CAUTIOUS */
  118. assert( (SHP_PREC(shpp) & MACH_PREC_MASK) == PREC_BY );
  119. if( STRING_PRECISION(SHP_PREC(shpp)) )
  120. prt_msg(" string");
  121. else if( CHAR_PRECISION(SHP_PREC(shpp)) )
  122. prt_msg(" char");
  123. return;
  124. }
  125. sprintf(MSG_STR," %s",PREC_NAME( SHP_MACH_PREC_PTR(shpp) ) );
  126. prt_msg_frag(MSG_STR);
  127. if( COMPLEX_PRECISION(SHP_PREC(shpp)) ){
  128. if( (SHP_PREC(shpp) & MACH_PREC_MASK) == PREC_SP )
  129. sprintf(MSG_STR,", complex");
  130. else if( (SHP_PREC(shpp) & MACH_PREC_MASK) == PREC_DP )
  131. sprintf(MSG_STR,", dblcpx");
  132. #ifdef CAUTIOUS
  133. else {
  134. // sprintf(MSG_STR,", unknown_precision_cpx");
  135. // sprintf(ERROR_STRING,
  136. // "CAUTIOUS: describe_shape: unexpected complex machine precision (%s)!?",PREC_NAME(SHP_MACH_PREC_PTR(shpp)));
  137. // WARN(ERROR_STRING);
  138. assert( AERROR("Unexpected complex machine precision!?") );
  139. }
  140. #endif /* CAUTIOUS */
  141. } else if( QUAT_PRECISION(SHP_PREC(shpp)) ){
  142. if( (SHP_PREC(shpp) & MACH_PREC_MASK) == PREC_SP )
  143. sprintf(MSG_STR,", quaternion");
  144. else if( (SHP_PREC(shpp) & MACH_PREC_MASK) == PREC_DP )
  145. sprintf(MSG_STR,", dblquat");
  146. #ifdef CAUTIOUS
  147. else {
  148. // sprintf(MSG_STR,", unknown_precision_quaternion");
  149. // WARN("CAUTIOUS: describe_shape: unexpected quaternion machine precision!?");
  150. assert( AERROR("unexpected quaternion machine precision!?") );
  151. }
  152. #endif /* CAUTIOUS */
  153. } else {
  154. sprintf(MSG_STR,", real");
  155. }
  156. if( SHP_COMPS(shpp) > 1 ){
  157. prt_msg_frag(MSG_STR);
  158. sprintf(MSG_STR,", %d components",SHP_COMPS(shpp));
  159. }
  160. if( INTERLACED_SHAPE(shpp) ){
  161. prt_msg_frag(MSG_STR);
  162. sprintf(MSG_STR,", interlaced");
  163. }
  164. prt_msg(MSG_STR);
  165. }
  166. void dump_shape(QSP_ARG_DECL Shape_Info *shpp)
  167. {
  168. int i;
  169. sprintf(MSG_STR,"shpp = 0x%lx",(int_for_addr)shpp);
  170. prt_msg(MSG_STR);
  171. describe_shape(QSP_ARG shpp);
  172. sprintf(MSG_STR,"prec = 0x%"PREC_FMT_X,SHP_PREC(shpp));
  173. prt_msg(MSG_STR);
  174. for(i=0;i<N_DIMENSIONS;i++){
  175. sprintf(MSG_STR,"dim[%d] = %d (%d), ",i,SHP_TYPE_DIM(shpp,i),SHP_MACH_DIM(shpp,i));
  176. if( i == N_DIMENSIONS-1 )
  177. prt_msg(MSG_STR);
  178. else
  179. prt_msg_frag(MSG_STR);
  180. }
  181. sprintf(MSG_STR,"n_elts = 0x%x (0x%x)",SHP_N_TYPE_ELTS(shpp),SHP_N_MACH_ELTS(shpp));
  182. prt_msg(MSG_STR);
  183. sprintf(MSG_STR,"mindim = 0x%x",SHP_MINDIM(shpp));
  184. prt_msg(MSG_STR);
  185. sprintf(MSG_STR,"maxdim = 0x%x",SHP_MAXDIM(shpp));
  186. prt_msg(MSG_STR);
  187. sprintf(MSG_STR,"flags = 0x%llx",
  188. (long long unsigned int)SHP_FLAGS(shpp));
  189. prt_msg(MSG_STR);
  190. /*
  191. sprintf(MSG_STR,"last_subi = 0x%x",SHP_LAST_SUBI(shpp));
  192. prt_msg(MSG_STR);
  193. */
  194. }
  195. void list_dobj(QSP_ARG_DECL Data_Obj *dp)
  196. {
  197. char string[128];
  198. if( OBJ_AREA(dp) == NO_AREA )
  199. sprintf(string,"(no data area):%s", OBJ_NAME(dp) );
  200. else
  201. sprintf(string,"%s:%s", AREA_NAME( OBJ_AREA(dp) ), OBJ_NAME(dp) );
  202. sprintf(MSG_STR,"%-20s",string);
  203. prt_msg_frag(MSG_STR);
  204. describe_shape(QSP_ARG OBJ_SHAPE(dp) );
  205. /*
  206. if( dp->dt_extra != NULL ){
  207. sprintf(MSG_STR,"Decl node has addr 0x%lx\n",
  208. (int_for_addr)dp->dt_extra);
  209. prt_msg(MSG_STR);
  210. }
  211. */
  212. }
  213. /*
  214. * Print out information about a data object
  215. */
  216. struct _flagtbl {
  217. const char *flagname;
  218. shape_flag_t flagmask;
  219. } flagtbl[N_DP_FLAGS]={
  220. { "sequence", DT_SEQUENCE },
  221. { "image", DT_IMAGE },
  222. { "row vector", DT_ROWVEC },
  223. { "column vector", DT_COLVEC },
  224. { "scalar", DT_SCALAR },
  225. { "hypersequence", DT_HYPER_SEQ },
  226. { "unknown", DT_UNKNOWN_SHAPE },
  227. { "string", DT_STRING },
  228. { "char", DT_CHAR },
  229. { "quaternion", DT_QUAT },
  230. { "complex", DT_COMPLEX },
  231. { "multidimensional", DT_MULTIDIM },
  232. { "bitmap", DT_BIT },
  233. { "not data owner", DT_NO_DATA },
  234. { "zombie", DT_ZOMBIE },
  235. { "contiguous", DT_CONTIG },
  236. { "contiguity checked", DT_CHECKED },
  237. { "evenly spaced", DT_EVENLY },
  238. { "data aligned", DT_ALIGNED },
  239. { "locked", DT_LOCKED },
  240. { "assigned", DT_ASSIGNED },
  241. { "temporary object", DT_TEMP },
  242. { "void type", DT_VOID },
  243. { "exported", DT_EXPORTED },
  244. { "read-only", DT_RDONLY },
  245. { "volatile", DT_VOLATILE },
  246. { "interlaced", DT_INTERLACED },
  247. { "obj_list", DT_OBJ_LIST },
  248. { "static", DT_STATIC },
  249. { "GL buffer", DT_GL_BUF },
  250. { "GL buffer is mapped", DT_BUF_MAPPED },
  251. { "shape checked", DT_SHAPE_CHECKED },
  252. { "partially assigned", DT_PARTIALLY_ASSIGNED },
  253. { "contiguous bitmap data", DT_CONTIG_BITMAP_DATA },
  254. };
  255. static void list_dp_flags(QSP_ARG_DECL Data_Obj *dp)
  256. {
  257. int i;
  258. shape_flag_t flags;
  259. sprintf(MSG_STR,"\tflags (0x%x):",(unsigned) OBJ_FLAGS(dp));
  260. prt_msg(MSG_STR);
  261. /* We keep a copy of flags, and clear each bit as we display its
  262. * description... then if there are any bits left at the end, we know
  263. * something has been left out of the table.
  264. */
  265. flags = OBJ_FLAGS(dp);
  266. for(i=0;i<N_DP_FLAGS;i++){
  267. //#ifdef CAUTIOUS
  268. // if( flagtbl[i].flagmask == 0 ){
  269. // sprintf(DEFAULT_ERROR_STRING,"CAUTIOUS: list_dp_flags: flagtbl[%d].flagmask = 0!?",i);
  270. // WARN(DEFAULT_ERROR_STRING);
  271. // sprintf(DEFAULT_ERROR_STRING,"make sure flagtbl has %d initialization entries in dplist.c",N_DP_FLAGS);
  272. // NERROR1(DEFAULT_ERROR_STRING);
  273. // IOS_RETURN
  274. // }
  275. //#endif /* CAUTIOUS */
  276. assert( flagtbl[i].flagmask != 0 );
  277. if( flags & flagtbl[i].flagmask ){
  278. sprintf(MSG_STR,"\t\t%s (0x%llx)",flagtbl[i].flagname,
  279. (long long unsigned int)flagtbl[i].flagmask);
  280. prt_msg(MSG_STR);
  281. flags &= ~flagtbl[i].flagmask;
  282. }
  283. }
  284. fflush(stdout);
  285. //#ifdef CAUTIOUS
  286. // if( flags ){ /* any bits still set */
  287. // sprintf(DEFAULT_ERROR_STRING,"CAUTIOUS: list_dp_flags: unhandled flag bit(s) 0x%llx!?",(long long unsigned int)flags);
  288. // WARN(DEFAULT_ERROR_STRING);
  289. // }
  290. //#endif /* CAUTIOUS */
  291. assert( flags == 0 );
  292. }
  293. /*static*/ void show_dimensions(QSP_ARG_DECL Data_Obj *dp, Dimension_Set *dsp, Increment_Set *isp)
  294. {
  295. int i;
  296. char dn[32];
  297. /* this makes the singularity check somewhat superfluous,
  298. * but we'll leave it in for now...
  299. */
  300. #ifdef QUIP_DEBUG
  301. if( debug & debug_data ){
  302. for(i=N_DIMENSIONS-1;i>OBJ_MAXDIM(dp);i--){
  303. strcpy(dn,dimension_name[i]);
  304. if( DIMENSION(dsp,i) > 1 ) strcat(dn,"s");
  305. sprintf(MSG_STR,"\t%4u %12s inc=%d", DIMENSION(dsp,i),
  306. dn, INCREMENT(isp,i));
  307. prt_msg(MSG_STR);
  308. }
  309. }
  310. #endif /* QUIP_DEBUG */
  311. /* show only the dimensions which are between mindim and maxdim */
  312. for(i=OBJ_MAXDIM(dp);i>=OBJ_MINDIM(dp);i--){
  313. strcpy(dn,dimension_name[i]);
  314. if( DIMENSION(dsp,i) > 1 ) strcat(dn,"s");
  315. sprintf(MSG_STR,"\t%4u %12s inc=%d", DIMENSION(dsp,i),
  316. dn, INCREMENT(isp,i));
  317. prt_msg(MSG_STR);
  318. }
  319. #ifdef QUIP_DEBUG
  320. if( debug & debug_data ){
  321. for(i=OBJ_MINDIM(dp)-1;i>=0;i--){
  322. strcpy(dn,dimension_name[i]);
  323. if( DIMENSION(dsp,i) > 1 ) strcat(dn,"s");
  324. sprintf(MSG_STR,"\t%4u %12s inc=%d", DIMENSION(dsp,i),
  325. dn, INCREMENT(isp,i));
  326. prt_msg(MSG_STR);
  327. }
  328. }
  329. #endif /* QUIP_DEBUG */
  330. }
  331. static void list_sizes(QSP_ARG_DECL Data_Obj *dp)
  332. {
  333. sprintf(MSG_STR,"\tmindim = %d, maxdim = %d",
  334. OBJ_MINDIM(dp),OBJ_MAXDIM(dp));
  335. prt_msg(MSG_STR);
  336. sprintf(MSG_STR,"\trange_mindim = %d, range_maxdim = %d",
  337. OBJ_RANGE_MINDIM(dp),OBJ_RANGE_MAXDIM(dp));
  338. prt_msg(MSG_STR);
  339. show_dimensions(QSP_ARG dp,OBJ_TYPE_DIMS(dp),OBJ_TYPE_INCS(dp));
  340. if( debug & debug_data ){
  341. prt_msg("machine type dimensions:");
  342. show_dimensions(QSP_ARG dp,OBJ_MACH_DIMS(dp),OBJ_MACH_INCS(dp));
  343. }
  344. }
  345. static void list_relatives(QSP_ARG_DECL Data_Obj *dp)
  346. {
  347. if( OBJ_PARENT(dp) != NO_OBJ ){
  348. sprintf(MSG_STR,"\tparent data object: %s",
  349. OBJ_NAME(OBJ_PARENT( dp) ));
  350. prt_msg(MSG_STR);
  351. sprintf(MSG_STR,"\tdata offset: 0x%x", OBJ_OFFSET(dp));
  352. prt_msg(MSG_STR);
  353. }
  354. if( OBJ_CHILDREN(dp) != NO_LIST &&
  355. QLIST_HEAD( OBJ_CHILDREN(dp) ) != NO_NODE ){
  356. Node *np;
  357. Data_Obj *dp2;
  358. sprintf(MSG_STR,"\tsubobjects:");
  359. prt_msg(MSG_STR);
  360. np = QLIST_HEAD( OBJ_CHILDREN(dp) );
  361. while( np != NO_NODE ){
  362. dp2=(Data_Obj *) NODE_DATA(np);
  363. sprintf(MSG_STR,"\t\t%s",OBJ_NAME(dp2));
  364. prt_msg(MSG_STR);
  365. np=NODE_NEXT(np);
  366. }
  367. }
  368. }
  369. static void list_device(QSP_ARG_DECL Data_Obj *dp)
  370. {
  371. sprintf(MSG_STR,"\tdevice: %s",PFDEV_NAME(OBJ_PFDEV(dp)));
  372. prt_msg(MSG_STR);
  373. }
  374. // Show the context of a data object.
  375. // A "context" is a namespace, these can be stacked...
  376. // This was introduced to support function-base scope
  377. // in the expression language.
  378. //
  379. // Contexts can be pushed and popped, and the context for
  380. // a subroutine is popped when we call another subroutine
  381. // from the first. If an object from the context of the first
  382. // subroutine is passed by reference to the second, then its
  383. // context will not be active, and so this will fail.
  384. // This was originally written to be a CAUTIOUS error,
  385. // but in fact this seems like the correct behavior.
  386. // The alternative would be for the objects to keep a pointer
  387. // to their context (BETTER SOLUTION, BUG, FIXME), but
  388. // for now it's not worth the trouble.
  389. static void list_context(QSP_ARG_DECL Data_Obj *dp)
  390. {
  391. Item_Context *icp;
  392. Node *np;
  393. Item *ip;
  394. const char *cname="not found";
  395. /* objects don't keep a ptr to their context,
  396. * so we search all the contexts until we find it.
  397. *
  398. * But subscripted objects won't show up,
  399. * so if the object has a parent, list the context
  400. * of the parent instead.
  401. */
  402. if( OBJ_PARENT(dp) != NO_OBJ ){
  403. list_context(QSP_ARG OBJ_PARENT( dp) );
  404. return;
  405. }
  406. /* BUG this is the list of the current context stack,
  407. * not ALL the contexts!?
  408. */
  409. //np=QLIST_HEAD( CONTEXT_LIST(dobj_itp) );
  410. np=QLIST_HEAD( DOBJ_CONTEXT_LIST );
  411. //#ifdef CAUTIOUS
  412. // if( np == NO_NODE ){
  413. // NERROR1("CAUTIOUS: list_context: no data object context");
  414. // IOS_RETURN
  415. // }
  416. //#endif /* CAUTIOUS */
  417. assert( np != NO_NODE );
  418. while(np!=NO_NODE){
  419. icp=(Item_Context *)NODE_DATA(np);
  420. /* can we search this context only? */
  421. /*
  422. sprintf(ERROR_STRING,
  423. "Searching context %s for object %s",CONTEXT_NAME(icp),OBJ_NAME(dp));
  424. advise(ERROR_STRING);
  425. */
  426. //ip=fetch_name(OBJ_NAME(dp),icp->ic_nsp);
  427. //ip=FETCH_NAME_FROM_CONTEXT( OBJ_NAME(dp), icp );
  428. ip=FETCH_OBJ_FROM_CONTEXT( dp, icp );
  429. if( ((Data_Obj *)ip) == dp ){ /* found it! */
  430. cname=CONTEXT_NAME(icp);
  431. goto show_context;
  432. }
  433. np=NODE_NEXT(np);
  434. }
  435. // fall-throuhg if not found, use default string
  436. show_context:
  437. sprintf(MSG_STR,"\titem context: %s",cname);
  438. prt_msg(MSG_STR);
  439. return;
  440. }
  441. static void list_data(QSP_ARG_DECL Data_Obj *dp)
  442. {
  443. dimension_t n;
  444. if( IS_BITMAP(dp) )
  445. n = BITMAP_WORD_COUNT(dp);
  446. else
  447. n = OBJ_N_MACH_ELTS(dp);
  448. sprintf(MSG_STR,"\t%d %s element%s",n,OBJ_MACH_PREC_NAME(dp),n==1?"":"s");
  449. prt_msg(MSG_STR);
  450. sprintf(MSG_STR,"\tdata at 0x%lx",(int_for_addr)OBJ_DATA_PTR(dp));
  451. prt_msg(MSG_STR);
  452. if( IS_BITMAP(dp) ){
  453. sprintf(MSG_STR,"\t\tbit0 = %d",OBJ_BIT0(dp));
  454. prt_msg(MSG_STR);
  455. }
  456. }
  457. #ifdef QUIP_DEBUG
  458. static void list_increments(QSP_ARG_DECL Data_Obj *dp)
  459. {
  460. int i;
  461. for(i=0;i<N_DIMENSIONS;i++){
  462. sprintf(MSG_STR,"\tincr[%d] = %d (%d)",i,OBJ_TYPE_INC(dp,i),OBJ_MACH_INC(dp,i));
  463. prt_msg(MSG_STR);
  464. }
  465. }
  466. #endif /* QUIP_DEBUG */
  467. void longlist(QSP_ARG_DECL Data_Obj *dp)
  468. {
  469. list_dobj(QSP_ARG dp);
  470. list_device(QSP_ARG dp);
  471. list_context(QSP_ARG dp);
  472. list_sizes(QSP_ARG dp);
  473. list_data(QSP_ARG dp);
  474. list_relatives(QSP_ARG dp);
  475. list_dp_flags(QSP_ARG dp);
  476. #ifdef QUIP_DEBUG
  477. if( debug & debug_data ){
  478. list_increments(QSP_ARG dp);
  479. dump_shape(QSP_ARG OBJ_SHAPE(dp) );
  480. }
  481. #endif /* QUIP_DEBUG */
  482. }
  483. void info_area(QSP_ARG_DECL Data_Area *ap)
  484. {
  485. List *lp;
  486. Node *np;
  487. Data_Obj *dp;
  488. lp=dobj_list(SINGLE_QSP_ARG);
  489. if( lp==NO_LIST ) return;
  490. np=QLIST_HEAD( lp );
  491. while( np != NO_NODE ){
  492. dp = (Data_Obj *)NODE_DATA(np);
  493. if( OBJ_AREA(dp) == ap )
  494. list_dobj(QSP_ARG dp );
  495. np=NODE_NEXT(np);
  496. }
  497. }
  498. void info_all_dps(SINGLE_QSP_ARG_DECL)
  499. {
  500. List *lp;
  501. Node *np;
  502. lp=data_area_list(SINGLE_QSP_ARG);
  503. if( lp==NO_LIST ) return;
  504. np=QLIST_HEAD( lp );
  505. while( np != NO_NODE ){
  506. info_area( QSP_ARG (Data_Area *) NODE_DATA(np) );
  507. np=NODE_NEXT(np);
  508. }
  509. }
  510. void show_space_used(QSP_ARG_DECL Data_Obj *dp)
  511. {
  512. sprintf(MSG_STR,"%s:\t\t0x%lx",OBJ_NAME(dp),(int_for_addr)OBJ_DATA_PTR(dp));
  513. prt_msg(MSG_STR);
  514. }