corelow and threads question

Aleksandar Ristovski aristovski@qnx.com
Wed Jun 10 20:38:00 GMT 2009


Thanks for replying.

Ok, then I think what you wanted to commit works for me (I 
am talking about: 
http://sourceware.org/ml/gdb-patches/2009-06/msg00112.html).

As for extra thread info, I guess if we have 
"core_pid_to_str" to be a thing of architecture, then extra 
thread info from core fits there too.


But I am still not happy about having to expand gdbarch 
whenever I have something specific to my architecture for a 
particular stratum - maybe it does belong there but the 
target stack mechanism seems attractive for using in 
"fine-tuning" existing targets ("strata").  This will really 
lead us to having target_ops functions per each predefined 
strata in gdbarch (i.e. customization for core, for process, 
for thread...)


I was playing (in my head) with idea of defining new 
"gdbarch_stratum" that would be used on top of other 
strata... for example, having one gdbarch_stratum per 
defined stratum (i.e. gdbarch_stratum+file_stratum - to 
allow gdbarch customize file_stratum, gdbarch_stratum + 
core_stratum for customizing core stuff, etc...); we would 
have to "spread" stratums in "strata" enum and insert 
gdbarch_ versions above correspoinding strata... that way I 
could really customize each of the strata for my 
architecture only by overriding corresponding _ops functions 
without having to add new function to gdbarch interface and 
regenerating gdbarch files.

Something like this (just an illustration):

enum strata
   {
     dumm_stratum = 0,
     gdbarch_stratum = 1,
     file_stratum = 2,
     core_stratum = 4,
     process_stratum = 6,
     thread_stratum = 8,
     record_stratum = 10
   };


Then I would be able to "inject" my:

...
   nto_core_ops.to_stratum = gdbarch_stratum + core_stratum;

/* But NO add_target(&nto_core_ops); */
...

Then, somewhere in core_open:


/* insert gdbarch specific core stratum just above 
core_stratum */
if (gdbarch_has_stratum (gdbarch_stratum + core_stratum))
     push_target (gdbarch_stratum (gdbarch_stratum + 
core_stratum));



Thanks,


-- 
Aleksandar Ristovski
QNX Software Systems



More information about the Gdb mailing list